diff options
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index db2382853450..d1da92174277 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -325,28 +325,6 @@ static void __init early_print(const char *str, ...) | |||
325 | printk("%s", buf); | 325 | printk("%s", buf); |
326 | } | 326 | } |
327 | 327 | ||
328 | static struct machine_desc * __init lookup_machine_type(unsigned int type) | ||
329 | { | ||
330 | extern struct machine_desc __arch_info_begin[], __arch_info_end[]; | ||
331 | struct machine_desc *p; | ||
332 | |||
333 | for (p = __arch_info_begin; p < __arch_info_end; p++) | ||
334 | if (type == p->nr) | ||
335 | return p; | ||
336 | |||
337 | early_print("\n" | ||
338 | "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n" | ||
339 | "Available machine support:\n\nID (hex)\tNAME\n", type); | ||
340 | |||
341 | for (p = __arch_info_begin; p < __arch_info_end; p++) | ||
342 | early_print("%08x\t%s\n", p->nr, p->name); | ||
343 | |||
344 | early_print("\nPlease check your kernel config and/or bootloader.\n"); | ||
345 | |||
346 | while (true) | ||
347 | /* can't use cpu_relax() here as it may require MMU setup */; | ||
348 | } | ||
349 | |||
350 | static void __init feat_v6_fixup(void) | 328 | static void __init feat_v6_fixup(void) |
351 | { | 329 | { |
352 | int id = read_cpuid_id(); | 330 | int id = read_cpuid_id(); |
@@ -463,21 +441,29 @@ void cpu_init(void) | |||
463 | 441 | ||
464 | static struct machine_desc * __init setup_machine(unsigned int nr) | 442 | static struct machine_desc * __init setup_machine(unsigned int nr) |
465 | { | 443 | { |
466 | struct machine_desc *list; | 444 | extern struct machine_desc __arch_info_begin[], __arch_info_end[]; |
445 | struct machine_desc *p; | ||
467 | 446 | ||
468 | /* | 447 | /* |
469 | * locate machine in the list of supported machines. | 448 | * locate machine in the list of supported machines. |
470 | */ | 449 | */ |
471 | list = lookup_machine_type(nr); | 450 | for (p = __arch_info_begin; p < __arch_info_end; p++) |
472 | if (!list) { | 451 | if (nr == p->nr) { |
473 | printk("Machine configuration botched (nr %d), unable " | 452 | printk("Machine: %s\n", p->name); |
474 | "to continue.\n", nr); | 453 | return p; |
475 | while (1); | 454 | } |
476 | } | ||
477 | 455 | ||
478 | printk("Machine: %s\n", list->name); | 456 | early_print("\n" |
457 | "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n" | ||
458 | "Available machine support:\n\nID (hex)\tNAME\n", nr); | ||
479 | 459 | ||
480 | return list; | 460 | for (p = __arch_info_begin; p < __arch_info_end; p++) |
461 | early_print("%08x\t%s\n", p->nr, p->name); | ||
462 | |||
463 | early_print("\nPlease check your kernel config and/or bootloader.\n"); | ||
464 | |||
465 | while (true) | ||
466 | /* can't use cpu_relax() here as it may require MMU setup */; | ||
481 | } | 467 | } |
482 | 468 | ||
483 | static int __init arm_add_memory(unsigned long start, unsigned long size) | 469 | static int __init arm_add_memory(unsigned long start, unsigned long size) |
@@ -740,7 +726,7 @@ static struct init_tags { | |||
740 | { tag_size(tag_core), ATAG_CORE }, | 726 | { tag_size(tag_core), ATAG_CORE }, |
741 | { 1, PAGE_SIZE, 0xff }, | 727 | { 1, PAGE_SIZE, 0xff }, |
742 | { tag_size(tag_mem32), ATAG_MEM }, | 728 | { tag_size(tag_mem32), ATAG_MEM }, |
743 | { MEM_SIZE, PHYS_OFFSET }, | 729 | { MEM_SIZE }, |
744 | { 0, ATAG_NONE } | 730 | { 0, ATAG_NONE } |
745 | }; | 731 | }; |
746 | 732 | ||
@@ -839,6 +825,8 @@ void __init setup_arch(char **cmdline_p) | |||
839 | struct machine_desc *mdesc; | 825 | struct machine_desc *mdesc; |
840 | char *from = default_command_line; | 826 | char *from = default_command_line; |
841 | 827 | ||
828 | init_tags.mem.start = PHYS_OFFSET; | ||
829 | |||
842 | unwind_init(); | 830 | unwind_init(); |
843 | 831 | ||
844 | setup_processor(); | 832 | setup_processor(); |
@@ -851,8 +839,25 @@ void __init setup_arch(char **cmdline_p) | |||
851 | 839 | ||
852 | if (__atags_pointer) | 840 | if (__atags_pointer) |
853 | tags = phys_to_virt(__atags_pointer); | 841 | tags = phys_to_virt(__atags_pointer); |
854 | else if (mdesc->boot_params) | 842 | else if (mdesc->boot_params) { |
855 | tags = phys_to_virt(mdesc->boot_params); | 843 | #ifdef CONFIG_MMU |
844 | /* | ||
845 | * We still are executing with a minimal MMU mapping created | ||
846 | * with the presumption that the machine default for this | ||
847 | * is located in the first MB of RAM. Anything else will | ||
848 | * fault and silently hang the kernel at this point. | ||
849 | */ | ||
850 | if (mdesc->boot_params < PHYS_OFFSET || | ||
851 | mdesc->boot_params >= PHYS_OFFSET + SZ_1M) { | ||
852 | printk(KERN_WARNING | ||
853 | "Default boot params at physical 0x%08lx out of reach\n", | ||
854 | mdesc->boot_params); | ||
855 | } else | ||
856 | #endif | ||
857 | { | ||
858 | tags = phys_to_virt(mdesc->boot_params); | ||
859 | } | ||
860 | } | ||
856 | 861 | ||
857 | #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) | 862 | #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) |
858 | /* | 863 | /* |