diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/setup.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 7c54e115055b..420b8d6485d6 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -518,25 +518,21 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz) | |||
518 | #endif | 518 | #endif |
519 | } | 519 | } |
520 | 520 | ||
521 | static void __init | 521 | static void __init request_standard_resources(struct machine_desc *mdesc) |
522 | request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc) | ||
523 | { | 522 | { |
523 | struct memblock_region *region; | ||
524 | struct resource *res; | 524 | struct resource *res; |
525 | int i; | ||
526 | 525 | ||
527 | kernel_code.start = virt_to_phys(_text); | 526 | kernel_code.start = virt_to_phys(_text); |
528 | kernel_code.end = virt_to_phys(_etext - 1); | 527 | kernel_code.end = virt_to_phys(_etext - 1); |
529 | kernel_data.start = virt_to_phys(_sdata); | 528 | kernel_data.start = virt_to_phys(_sdata); |
530 | kernel_data.end = virt_to_phys(_end - 1); | 529 | kernel_data.end = virt_to_phys(_end - 1); |
531 | 530 | ||
532 | for (i = 0; i < mi->nr_banks; i++) { | 531 | for_each_memblock(memory, region) { |
533 | if (mi->bank[i].size == 0) | ||
534 | continue; | ||
535 | |||
536 | res = alloc_bootmem_low(sizeof(*res)); | 532 | res = alloc_bootmem_low(sizeof(*res)); |
537 | res->name = "System RAM"; | 533 | res->name = "System RAM"; |
538 | res->start = mi->bank[i].start; | 534 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); |
539 | res->end = mi->bank[i].start + mi->bank[i].size - 1; | 535 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; |
540 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 536 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
541 | 537 | ||
542 | request_resource(&iomem_resource, res); | 538 | request_resource(&iomem_resource, res); |
@@ -859,7 +855,7 @@ void __init setup_arch(char **cmdline_p) | |||
859 | arm_memblock_init(&meminfo, mdesc); | 855 | arm_memblock_init(&meminfo, mdesc); |
860 | 856 | ||
861 | paging_init(mdesc); | 857 | paging_init(mdesc); |
862 | request_standard_resources(&meminfo, mdesc); | 858 | request_standard_resources(mdesc); |
863 | 859 | ||
864 | #ifdef CONFIG_SMP | 860 | #ifdef CONFIG_SMP |
865 | if (is_smp()) | 861 | if (is_smp()) |