diff options
author | David Brown <davidb@codeaurora.org> | 2011-03-17 01:13:16 -0400 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2011-03-17 01:13:16 -0400 |
commit | 92c260f755c42337c550d8ac1f8ccd1b32bffb20 (patch) | |
tree | 6d04fefc1adeecabfb2b00c201e0db78fa2b5529 /arch/arm/kernel/setup.c | |
parent | 8e76a80960bf06c245160a484d5a363ca6b520bb (diff) | |
parent | 05e34754518b6a90d5c392790c032575fab12d66 (diff) |
Merge remote branch 'rmk/for-linus' into for-linus
* rmk/for-linus: (1557 commits)
ARM: 6806/1: irq: introduce entry and exit functions for chained handlers
ARM: 6781/1: Thumb-2: Work around buggy Thumb-2 short branch relocations in gas
ARM: 6747/1: P2V: Thumb2 support
ARM: 6798/1: aout-core: zero thread debug registers in a.out core dump
ARM: 6796/1: Footbridge: Fix I/O mappings for NOMMU mode
ARM: 6784/1: errata: no automatic Store Buffer drain on Cortex-A9
ARM: 6772/1: errata: possible fault MMU translations following an ASID switch
ARM: 6776/1: mach-ux500: activate fix for errata 753970
ARM: 6794/1: SPEAr: Append UL to device address macros.
ARM: 6793/1: SPEAr: Remove unused *_SIZE macros from spear*.h files
ARM: 6792/1: SPEAr: Replace SIZE macro's with SZ_4K macros
ARM: 6791/1: SPEAr3xx: Declare device structures after shirq code
ARM: 6790/1: SPEAr: Clock Framework: Rename usbd clock and align apb_clk entry
ARM: 6789/1: SPEAr3xx: Rename sdio to sdhci
ARM: 6788/1: SPEAr: Include mach/hardware.h instead of mach/spear.h
ARM: 6787/1: SPEAr: Reorder #includes in .h & .c files.
ARM: 6681/1: SPEAr: add debugfs support to clk API
ARM: 6703/1: SPEAr: update clk API support
ARM: 6679/1: SPEAr: make clk API functions more generic
ARM: 6737/1: SPEAr: formalized timer support
...
Conflicts:
arch/arm/mach-msm/board-msm7x27.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-msm/board-sapphire.c
arch/arm/mach-msm/include/mach/memory.h
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 72 |
1 files changed, 57 insertions, 15 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 420b8d6485d6..d1da92174277 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -226,8 +226,8 @@ int cpu_architecture(void) | |||
226 | * Register 0 and check for VMSAv7 or PMSAv7 */ | 226 | * Register 0 and check for VMSAv7 or PMSAv7 */ |
227 | asm("mrc p15, 0, %0, c0, c1, 4" | 227 | asm("mrc p15, 0, %0, c0, c1, 4" |
228 | : "=r" (mmfr0)); | 228 | : "=r" (mmfr0)); |
229 | if ((mmfr0 & 0x0000000f) == 0x00000003 || | 229 | if ((mmfr0 & 0x0000000f) >= 0x00000003 || |
230 | (mmfr0 & 0x000000f0) == 0x00000030) | 230 | (mmfr0 & 0x000000f0) >= 0x00000030) |
231 | cpu_arch = CPU_ARCH_ARMv7; | 231 | cpu_arch = CPU_ARCH_ARMv7; |
232 | else if ((mmfr0 & 0x0000000f) == 0x00000002 || | 232 | else if ((mmfr0 & 0x0000000f) == 0x00000002 || |
233 | (mmfr0 & 0x000000f0) == 0x00000020) | 233 | (mmfr0 & 0x000000f0) == 0x00000020) |
@@ -308,7 +308,22 @@ static void __init cacheid_init(void) | |||
308 | * already provide the required functionality. | 308 | * already provide the required functionality. |
309 | */ | 309 | */ |
310 | extern struct proc_info_list *lookup_processor_type(unsigned int); | 310 | extern struct proc_info_list *lookup_processor_type(unsigned int); |
311 | extern struct machine_desc *lookup_machine_type(unsigned int); | 311 | |
312 | static void __init early_print(const char *str, ...) | ||
313 | { | ||
314 | extern void printascii(const char *); | ||
315 | char buf[256]; | ||
316 | va_list ap; | ||
317 | |||
318 | va_start(ap, str); | ||
319 | vsnprintf(buf, sizeof(buf), str, ap); | ||
320 | va_end(ap); | ||
321 | |||
322 | #ifdef CONFIG_DEBUG_LL | ||
323 | printascii(buf); | ||
324 | #endif | ||
325 | printk("%s", buf); | ||
326 | } | ||
312 | 327 | ||
313 | static void __init feat_v6_fixup(void) | 328 | static void __init feat_v6_fixup(void) |
314 | { | 329 | { |
@@ -426,21 +441,29 @@ void cpu_init(void) | |||
426 | 441 | ||
427 | static struct machine_desc * __init setup_machine(unsigned int nr) | 442 | static struct machine_desc * __init setup_machine(unsigned int nr) |
428 | { | 443 | { |
429 | struct machine_desc *list; | 444 | extern struct machine_desc __arch_info_begin[], __arch_info_end[]; |
445 | struct machine_desc *p; | ||
430 | 446 | ||
431 | /* | 447 | /* |
432 | * locate machine in the list of supported machines. | 448 | * locate machine in the list of supported machines. |
433 | */ | 449 | */ |
434 | list = lookup_machine_type(nr); | 450 | for (p = __arch_info_begin; p < __arch_info_end; p++) |
435 | if (!list) { | 451 | if (nr == p->nr) { |
436 | printk("Machine configuration botched (nr %d), unable " | 452 | printk("Machine: %s\n", p->name); |
437 | "to continue.\n", nr); | 453 | return p; |
438 | while (1); | 454 | } |
439 | } | ||
440 | 455 | ||
441 | 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); | ||
442 | 459 | ||
443 | 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 */; | ||
444 | } | 467 | } |
445 | 468 | ||
446 | 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) |
@@ -703,7 +726,7 @@ static struct init_tags { | |||
703 | { tag_size(tag_core), ATAG_CORE }, | 726 | { tag_size(tag_core), ATAG_CORE }, |
704 | { 1, PAGE_SIZE, 0xff }, | 727 | { 1, PAGE_SIZE, 0xff }, |
705 | { tag_size(tag_mem32), ATAG_MEM }, | 728 | { tag_size(tag_mem32), ATAG_MEM }, |
706 | { MEM_SIZE, PHYS_OFFSET }, | 729 | { MEM_SIZE }, |
707 | { 0, ATAG_NONE } | 730 | { 0, ATAG_NONE } |
708 | }; | 731 | }; |
709 | 732 | ||
@@ -802,6 +825,8 @@ void __init setup_arch(char **cmdline_p) | |||
802 | struct machine_desc *mdesc; | 825 | struct machine_desc *mdesc; |
803 | char *from = default_command_line; | 826 | char *from = default_command_line; |
804 | 827 | ||
828 | init_tags.mem.start = PHYS_OFFSET; | ||
829 | |||
805 | unwind_init(); | 830 | unwind_init(); |
806 | 831 | ||
807 | setup_processor(); | 832 | setup_processor(); |
@@ -814,8 +839,25 @@ void __init setup_arch(char **cmdline_p) | |||
814 | 839 | ||
815 | if (__atags_pointer) | 840 | if (__atags_pointer) |
816 | tags = phys_to_virt(__atags_pointer); | 841 | tags = phys_to_virt(__atags_pointer); |
817 | else if (mdesc->boot_params) | 842 | else if (mdesc->boot_params) { |
818 | 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 | } | ||
819 | 861 | ||
820 | #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) | 862 | #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) |
821 | /* | 863 | /* |