diff options
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/mem.c | 30 | ||||
-rw-r--r-- | arch/powerpc/mm/numa.c | 24 |
2 files changed, 47 insertions, 7 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 16da595ff402..2dd6bdd31fe1 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/suspend.h> | 34 | #include <linux/suspend.h> |
35 | #include <linux/memblock.h> | 35 | #include <linux/memblock.h> |
36 | #include <linux/hugetlb.h> | 36 | #include <linux/hugetlb.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | #include <asm/pgalloc.h> | 39 | #include <asm/pgalloc.h> |
39 | #include <asm/prom.h> | 40 | #include <asm/prom.h> |
@@ -555,3 +556,32 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |||
555 | book3e_hugetlb_preload(vma->vm_mm, address, *ptep); | 556 | book3e_hugetlb_preload(vma->vm_mm, address, *ptep); |
556 | #endif | 557 | #endif |
557 | } | 558 | } |
559 | |||
560 | /* | ||
561 | * System memory should not be in /proc/iomem but various tools expect it | ||
562 | * (eg kdump). | ||
563 | */ | ||
564 | static int add_system_ram_resources(void) | ||
565 | { | ||
566 | struct memblock_region *reg; | ||
567 | |||
568 | for_each_memblock(memory, reg) { | ||
569 | struct resource *res; | ||
570 | unsigned long base = reg->base; | ||
571 | unsigned long size = reg->size; | ||
572 | |||
573 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); | ||
574 | WARN_ON(!res); | ||
575 | |||
576 | if (res) { | ||
577 | res->name = "System RAM"; | ||
578 | res->start = base; | ||
579 | res->end = base + size - 1; | ||
580 | res->flags = IORESOURCE_MEM; | ||
581 | WARN_ON(request_resource(&iomem_resource, res) < 0); | ||
582 | } | ||
583 | } | ||
584 | |||
585 | return 0; | ||
586 | } | ||
587 | subsys_initcall(add_system_ram_resources); | ||
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index c7dd4dec4df8..b22a83a91cb8 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -315,7 +315,10 @@ static int __init find_min_common_depth(void) | |||
315 | struct device_node *root; | 315 | struct device_node *root; |
316 | const char *vec5; | 316 | const char *vec5; |
317 | 317 | ||
318 | root = of_find_node_by_path("/rtas"); | 318 | if (firmware_has_feature(FW_FEATURE_OPAL)) |
319 | root = of_find_node_by_path("/ibm,opal"); | ||
320 | else | ||
321 | root = of_find_node_by_path("/rtas"); | ||
319 | if (!root) | 322 | if (!root) |
320 | root = of_find_node_by_path("/"); | 323 | root = of_find_node_by_path("/"); |
321 | 324 | ||
@@ -344,12 +347,19 @@ static int __init find_min_common_depth(void) | |||
344 | 347 | ||
345 | #define VEC5_AFFINITY_BYTE 5 | 348 | #define VEC5_AFFINITY_BYTE 5 |
346 | #define VEC5_AFFINITY 0x80 | 349 | #define VEC5_AFFINITY 0x80 |
347 | chosen = of_find_node_by_path("/chosen"); | 350 | |
348 | if (chosen) { | 351 | if (firmware_has_feature(FW_FEATURE_OPAL)) |
349 | vec5 = of_get_property(chosen, "ibm,architecture-vec-5", NULL); | 352 | form1_affinity = 1; |
350 | if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & VEC5_AFFINITY)) { | 353 | else { |
351 | dbg("Using form 1 affinity\n"); | 354 | chosen = of_find_node_by_path("/chosen"); |
352 | form1_affinity = 1; | 355 | if (chosen) { |
356 | vec5 = of_get_property(chosen, | ||
357 | "ibm,architecture-vec-5", NULL); | ||
358 | if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & | ||
359 | VEC5_AFFINITY)) { | ||
360 | dbg("Using form 1 affinity\n"); | ||
361 | form1_affinity = 1; | ||
362 | } | ||
353 | } | 363 | } |
354 | } | 364 | } |
355 | 365 | ||