Commit ba759485 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[PATCH] powerpc: Add support for "linux,usable-memory" on memory nodes

Milton has proposed that we should support a "linux,usable-memory" property
on memory nodes which describes, in preference to "reg", the regions of memory
Linux should use.

This facility is required for kdump to inform the second kernel which memory
it should use.
Signed-off-by: default avatarHaren Myneni <haren@us.ibm.com>
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 54c32021
...@@ -567,7 +567,10 @@ static int __init interpret_root_props(struct device_node *np, ...@@ -567,7 +567,10 @@ static int __init interpret_root_props(struct device_node *np,
unsigned int *rp; unsigned int *rp;
int rpsize = (naddrc + nsizec) * sizeof(unsigned int); int rpsize = (naddrc + nsizec) * sizeof(unsigned int);
rp = (unsigned int *) get_property(np, "reg", &l); rp = (unsigned int *) get_property(np, "linux,usable-memory", &l);
if (rp == NULL)
rp = (unsigned int *) get_property(np, "reg", &l);
if (rp != 0 && l >= rpsize) { if (rp != 0 && l >= rpsize) {
i = 0; i = 0;
adr = (struct address_range *) (*mem_start); adr = (struct address_range *) (*mem_start);
...@@ -1275,7 +1278,9 @@ static int __init early_init_dt_scan_memory(unsigned long node, ...@@ -1275,7 +1278,9 @@ static int __init early_init_dt_scan_memory(unsigned long node,
} else if (strcmp(type, "memory") != 0) } else if (strcmp(type, "memory") != 0)
return 0; return 0;
reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
if (reg == NULL)
reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
if (reg == NULL) if (reg == NULL)
return 0; return 0;
......
...@@ -423,7 +423,12 @@ static int __init parse_numa_properties(void) ...@@ -423,7 +423,12 @@ static int __init parse_numa_properties(void)
unsigned int *memcell_buf; unsigned int *memcell_buf;
unsigned int len; unsigned int len;
memcell_buf = (unsigned int *)get_property(memory, "reg", &len); memcell_buf = (unsigned int *)get_property(memory,
"linux,usable-memory", &len);
if (!memcell_buf || len <= 0)
memcell_buf =
(unsigned int *)get_property(memory, "reg",
&len);
if (!memcell_buf || len <= 0) if (!memcell_buf || len <= 0)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment