With the upcoming introduction of a new device tree property format for memory (ibm,dynamic-memory-v2), we should separate LMB data from the device tree format used to represent them. Doing this allows any consumer of LMB information, currently the mm/numa and pseries/hotplug-memory code, to access it directly without having to worry about device tree format and how to parse it.
This patch set attempts to solve this by creating an array of LMB information at boot time which holds all relevant data presented in the device tree for each LMB; base address, drc index, associativity array index, and flags. The first two patches are small updates to two routines to have them look up the memory device node instead of having it passed to them. This is needed since the new code will not need to look at the device tree when getting LMB information. The third patch introduces the new LMB data array in lmb.h and the set of routines needed to initialize and access the array. The data is intialized from parse_numa_properties() and the routines in numa.c are updated to use the new LMB array. A few notes: This code has only been boot-tested. I would like to get some feedback on this approach before venturing too far down this design path. I considered intializing the lmb array in prom.c to avoid having to write a new routine there to parse the -v2 property. My concern is allocating the array for this information that early in boot, the number of LMBs can get very large on systems with 16, 32 TB. The code for memory DLPAR (pseries/hotplug-memory.c) still needs to be updated to use the new LMB array. Any thoughts, feedback, comments (good and bad) would be appreciated. Thanks, -Nathan --- Nathan Fontenot (3): powerpc/numa: Get device node whenn retreiving associativity arrays powerpc/numa: Get device node whenn retreiving usm memory powerpc/mm: Separate LMB information from device tree format arch/powerpc/include/asm/lmb.h | 44 ++++++++ arch/powerpc/mm/Makefile | 2 arch/powerpc/mm/lmb.c | 146 ++++++++++++++++++++++++++++ arch/powerpc/mm/numa.c | 211 ++++++++++------------------------------ 4 files changed, 244 insertions(+), 159 deletions(-) create mode 100644 arch/powerpc/include/asm/lmb.h create mode 100644 arch/powerpc/mm/lmb.c