OSDN Git Service

powerpc/mm: Separate ibm, dynamic-memory data from DT format
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Fri, 1 Dec 2017 16:47:08 +0000 (10:47 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 16 Jan 2018 12:26:27 +0000 (23:26 +1100)
commit6c6ea53725b357fa3deac96d8d2d4ee785b67c6b
tree3faa655dd0e98972bcde1ae1146610167b328732
parentb88fc309d6ad0abee74053b4a8f78a1a4ed5e5db
powerpc/mm: Separate ibm, dynamic-memory data from DT format

We currently have code to parse the dynamic reconfiguration LMB
information from the ibm,dynamic-meory device tree property in
multiple locations; numa.c, prom.c, and pseries/hotplug-memory.c.
In anticipation of adding support for a version 2 of the
ibm,dynamic-memory property this patch aims to separate the device
tree information from the device tree format.

Doing this requires a two step process to avoid a possibly very large
bootmem allocation early in boot. During initial boot, new routines
are provided to walk the device tree property and make a call-back
for each LMB.

The second step (introduced in later patches) will allocate an
array of LMB information that can be used directly without needing
to know the DT format.

This approach provides the benefit of consolidating the device tree
property parsing to a single location and (eventually) providing
a common data structure for retrieving LMB information.

This patch introduces a routine to walk the ibm,dynamic-memory
property in the flattened device tree and updates the prom.c code
to use this to initialize memory.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/drmem.h [new file with mode: 0644]
arch/powerpc/kernel/prom.c
arch/powerpc/mm/Makefile
arch/powerpc/mm/drmem.c [new file with mode: 0644]