aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 3455ad33de4c..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
521static void __init 521static void __init request_standard_resources(struct machine_desc *mdesc)
522request_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);
@@ -650,15 +646,17 @@ static int __init parse_tag_revision(const struct tag *tag)
650 646
651__tagtable(ATAG_REVISION, parse_tag_revision); 647__tagtable(ATAG_REVISION, parse_tag_revision);
652 648
653#ifndef CONFIG_CMDLINE_FORCE
654static int __init parse_tag_cmdline(const struct tag *tag) 649static int __init parse_tag_cmdline(const struct tag *tag)
655{ 650{
651#ifndef CONFIG_CMDLINE_FORCE
656 strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); 652 strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
653#else
654 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
655#endif /* CONFIG_CMDLINE_FORCE */
657 return 0; 656 return 0;
658} 657}
659 658
660__tagtable(ATAG_CMDLINE, parse_tag_cmdline); 659__tagtable(ATAG_CMDLINE, parse_tag_cmdline);
661#endif /* CONFIG_CMDLINE_FORCE */
662 660
663/* 661/*
664 * Scan the tag table for this tag, and call its parse function. 662 * Scan the tag table for this tag, and call its parse function.
@@ -857,7 +855,7 @@ void __init setup_arch(char **cmdline_p)
857 arm_memblock_init(&meminfo, mdesc); 855 arm_memblock_init(&meminfo, mdesc);
858 856
859 paging_init(mdesc); 857 paging_init(mdesc);
860 request_standard_resources(&meminfo, mdesc); 858 request_standard_resources(mdesc);
861 859
862#ifdef CONFIG_SMP 860#ifdef CONFIG_SMP
863 if (is_smp()) 861 if (is_smp())