[PATCH V3 0/9] powerpc: Support for ibm,dynamic-memory-v2
Nathan Fontenot
nfont at linux.vnet.ibm.com
Sat Dec 2 03:46:25 AEDT 2017
This patch set provides a series of updates to de-couple the LMB
information provided in the device tree property from the device
tree property format. This eases the ability to support a new
format for the dynamic memory property, ibm,dynamic-memory-v2.
This series of patches consolidates the routines for parsing the
LMB device tree properties into a new file, powerpc/mm/drmem.c,
and provides the ability to retrieve LMB information without having
to know the backing device tree format.
To do this, a set of routines are introduced that will walk the
device tree property and make a call back for each LMB represented
in the device tree. These are to be used by init routines during
boot, currently in prom.c and numa.c.
A late_initcall is used to allocate and initialize a LMB array to
provide a common data structure of per-LMB data. This array provides
a data structure to retrieve LMB information without knowing the
backing tree format. This is used in numa.c and pseries/hotplug-memory.c.
This is a big design change from the first two version of the patch set
that attempted to allocate the LMB array with bootmem very early.
Testing showed that this allocation can fail which pushed the change
to the current design.
To support memory hotplug needing to update the device tree, a
common routine is introduced to create a new copy of the device
tree property in the proper format.
The first three patches update the of_get_assoc_arrays(),
of_get_usable_memory(), and of_drconf_to_nid_single() routines
to do device tree lookups for information they need instead of having
the nodes/properties passed in. These are updates needed for later
changes.
The fourth patch adds the walk_drmem_lmbs_early() routine to provide
parsing of the flattened device tree and make a per-LMB call back,
used in prom.c
The fifth patch provides a walk_drmem_lmbs() routine to parse the
device tree and provide a per-LMB call back, used in numa.c. This
also allocates and initializes the LMB array, and updates numa.c
to use the array.
The sixth patch updates pseries hotplug code new LMB array data
instead of parsing the device tree directly and introduces the
common routine to create a new device tree property.
The seventh patch moves the of_drconf_cell struct to drmem.h where it
fits better than prom.h
The eighth patch introduces support for the ibm,dynamic-memory-v2
property format by updating the new drmem.c code to be able to parse
and create this new device tree format.
The last patch in the series updates the architecture vector to indicate
support for ibm,dynamic-memory-v2.
-Nathan
---
Nathan Fontenot (9):
powerpc/numa: Look up device node in of_get_assoc_arrays()
powerpc/numa: Look up device node in of_get_usable_memory()
powerpc/numa: Look up associativity array in of_drconf_to_nid_single
powerpc/mm: Separate ibm,dynamic-memory data from DT format
powerpc/numa: Update numa code use walk_drmem_lmbs
powerpc/pseries: Update memory hotplug code to use drmem LMB array
powerpc: Move of_drconf_cell struct to asm/drmem.h
powerpc/drmem: Add support for ibm,dynamic-memory-v2 property
powerpc: Enable support of ibm,dynamic-memory-v2
arch/powerpc/include/asm/drmem.h | 100 ++++
arch/powerpc/include/asm/firmware.h | 3
arch/powerpc/include/asm/prom.h | 17 -
arch/powerpc/kernel/prom.c | 114 ++---
arch/powerpc/kernel/prom_init.c | 1
arch/powerpc/mm/Makefile | 2
arch/powerpc/mm/drmem.c | 438 +++++++++++++++++++
arch/powerpc/mm/numa.c | 252 +++--------
arch/powerpc/platforms/pseries/firmware.c | 1
arch/powerpc/platforms/pseries/hotplug-memory.c | 522 +++++++++--------------
10 files changed, 864 insertions(+), 586 deletions(-)
create mode 100644 arch/powerpc/include/asm/drmem.h
create mode 100644 arch/powerpc/mm/drmem.c
More information about the Linuxppc-dev
mailing list