~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/drmem.h

Version: ~ [ linux-4.20-rc2 ] ~ [ linux-4.19.1 ] ~ [ linux-4.18.18 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.80 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.136 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.163 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.125 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.60 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.31.14 ] ~ [ linux-2.6.30.10 ] ~ [ linux-2.6.29.6 ] ~ [ linux-2.6.28.10 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * drmem.h: Power specific logical memory block representation
  3  *
  4  * Copyright 2017 IBM Corporation
  5  *
  6  * This program is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU General Public License
  8  * as published by the Free Software Foundation; either version
  9  * 2 of the License, or (at your option) any later version.
 10  */
 11 
 12 #ifndef _ASM_POWERPC_LMB_H
 13 #define _ASM_POWERPC_LMB_H
 14 
 15 struct drmem_lmb {
 16         u64     base_addr;
 17         u32     drc_index;
 18         u32     aa_index;
 19         u32     flags;
 20 };
 21 
 22 struct drmem_lmb_info {
 23         struct drmem_lmb        *lmbs;
 24         int                     n_lmbs;
 25         u32                     lmb_size;
 26 };
 27 
 28 extern struct drmem_lmb_info *drmem_info;
 29 
 30 #define for_each_drmem_lmb_in_range(lmb, start, end)            \
 31         for ((lmb) = (start); (lmb) <= (end); (lmb)++)
 32 
 33 #define for_each_drmem_lmb(lmb)                                 \
 34         for_each_drmem_lmb_in_range((lmb),                      \
 35                 &drmem_info->lmbs[0],                           \
 36                 &drmem_info->lmbs[drmem_info->n_lmbs - 1])
 37 
 38 /*
 39  * The of_drconf_cell_v1 struct defines the layout of the LMB data
 40  * specified in the ibm,dynamic-memory device tree property.
 41  * The property itself is a 32-bit value specifying the number of
 42  * LMBs followed by an array of of_drconf_cell_v1 entries, one
 43  * per LMB.
 44  */
 45 struct of_drconf_cell_v1 {
 46         __be64  base_addr;
 47         __be32  drc_index;
 48         __be32  reserved;
 49         __be32  aa_index;
 50         __be32  flags;
 51 };
 52 
 53 /*
 54  * Version 2 of the ibm,dynamic-memory property is defined as a
 55  * 32-bit value specifying the number of LMB sets followed by an
 56  * array of of_drconf_cell_v2 entries, one per LMB set.
 57  */
 58 struct of_drconf_cell_v2 {
 59         u32     seq_lmbs;
 60         u64     base_addr;
 61         u32     drc_index;
 62         u32     aa_index;
 63         u32     flags;
 64 } __packed;
 65 
 66 #define DRCONF_MEM_ASSIGNED     0x00000008
 67 #define DRCONF_MEM_AI_INVALID   0x00000040
 68 #define DRCONF_MEM_RESERVED     0x00000080
 69 
 70 static inline u32 drmem_lmb_size(void)
 71 {
 72         return drmem_info->lmb_size;
 73 }
 74 
 75 #define DRMEM_LMB_RESERVED      0x80000000
 76 
 77 static inline void drmem_mark_lmb_reserved(struct drmem_lmb *lmb)
 78 {
 79         lmb->flags |= DRMEM_LMB_RESERVED;
 80 }
 81 
 82 static inline void drmem_remove_lmb_reservation(struct drmem_lmb *lmb)
 83 {
 84         lmb->flags &= ~DRMEM_LMB_RESERVED;
 85 }
 86 
 87 static inline bool drmem_lmb_reserved(struct drmem_lmb *lmb)
 88 {
 89         return lmb->flags & DRMEM_LMB_RESERVED;
 90 }
 91 
 92 u64 drmem_lmb_memory_max(void);
 93 void __init walk_drmem_lmbs(struct device_node *dn,
 94                         void (*func)(struct drmem_lmb *, const __be32 **));
 95 int drmem_update_dt(void);
 96 
 97 #ifdef CONFIG_PPC_PSERIES
 98 void __init walk_drmem_lmbs_early(unsigned long node,
 99                         void (*func)(struct drmem_lmb *, const __be32 **));
100 #endif
101 
102 static inline void invalidate_lmb_associativity_index(struct drmem_lmb *lmb)
103 {
104         lmb->aa_index = 0xffffffff;
105 }
106 
107 #endif /* _ASM_POWERPC_LMB_H */
108 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp