aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-12-04 02:39:55 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:52:38 -0500
commitba7594852f4e7121b3f037d59f983637b795f0dd (patch)
tree6949f16d3dff337b4b36ced0b460e4ed9b09365b
parent54c32021eb6feafc32e90104e960b38301521b7b (diff)
[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: Haren Myneni <haren@us.ibm.com> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kernel/prom.c9
-rw-r--r--arch/powerpc/mm/numa.c7
2 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index fddc9c13bff5..7e798d5b03b4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -567,7 +567,10 @@ static int __init interpret_root_props(struct device_node *np,
567 unsigned int *rp; 567 unsigned int *rp;
568 int rpsize = (naddrc + nsizec) * sizeof(unsigned int); 568 int rpsize = (naddrc + nsizec) * sizeof(unsigned int);
569 569
570 rp = (unsigned int *) get_property(np, "reg", &l); 570 rp = (unsigned int *) get_property(np, "linux,usable-memory", &l);
571 if (rp == NULL)
572 rp = (unsigned int *) get_property(np, "reg", &l);
573
571 if (rp != 0 && l >= rpsize) { 574 if (rp != 0 && l >= rpsize) {
572 i = 0; 575 i = 0;
573 adr = (struct address_range *) (*mem_start); 576 adr = (struct address_range *) (*mem_start);
@@ -1275,7 +1278,9 @@ static int __init early_init_dt_scan_memory(unsigned long node,
1275 } else if (strcmp(type, "memory") != 0) 1278 } else if (strcmp(type, "memory") != 0)
1276 return 0; 1279 return 0;
1277 1280
1278 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); 1281 reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
1282 if (reg == NULL)
1283 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
1279 if (reg == NULL) 1284 if (reg == NULL)
1280 return 0; 1285 return 0;
1281 1286
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 40c99deb691b..97e83f1d1bdb 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -423,7 +423,12 @@ static int __init parse_numa_properties(void)
423 unsigned int *memcell_buf; 423 unsigned int *memcell_buf;
424 unsigned int len; 424 unsigned int len;
425 425
426 memcell_buf = (unsigned int *)get_property(memory, "reg", &len); 426 memcell_buf = (unsigned int *)get_property(memory,
427 "linux,usable-memory", &len);
428 if (!memcell_buf || len <= 0)
429 memcell_buf =
430 (unsigned int *)get_property(memory, "reg",
431 &len);
427 if (!memcell_buf || len <= 0) 432 if (!memcell_buf || len <= 0)
428 continue; 433 continue;
429 434