Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'devicetree/arm-next' of git://git.secretlab.ca/git/linux-2.6 into devel-stable

+375 -60
+29 -4
Documentation/arm/Booting
··· 65 65 The boot loader must ultimately be able to provide a MACH_TYPE_xxx 66 66 value to the kernel. (see linux/arch/arm/tools/mach-types). 67 67 68 - 69 - 4. Setup the kernel tagged list 70 - ------------------------------- 68 + 4. Setup boot data 69 + ------------------ 71 70 72 71 Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED 73 72 New boot loaders: MANDATORY 73 + 74 + The boot loader must provide either a tagged list or a dtb image for 75 + passing configuration data to the kernel. The physical address of the 76 + boot data is passed to the kernel in register r2. 77 + 78 + 4a. Setup the kernel tagged list 79 + -------------------------------- 74 80 75 81 The boot loader must create and initialise the kernel tagged list. 76 82 A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE. ··· 107 101 the kernel decompressor nor initrd 'bootp' program will overwrite 108 102 it. The recommended placement is in the first 16KiB of RAM. 109 103 104 + 4b. Setup the device tree 105 + ------------------------- 106 + 107 + The boot loader must load a device tree image (dtb) into system ram 108 + at a 64bit aligned address and initialize it with the boot data. The 109 + dtb format is documented in Documentation/devicetree/booting-without-of.txt. 110 + The kernel will look for the dtb magic value of 0xd00dfeed at the dtb 111 + physical address to determine if a dtb has been passed instead of a 112 + tagged list. 113 + 114 + The boot loader must pass at a minimum the size and location of the 115 + system memory, and the root filesystem location. The dtb must be 116 + placed in a region of memory where the kernel decompressor will not 117 + overwrite it. The recommended placement is in the first 16KiB of RAM 118 + with the caveat that it may not be located at physical address 0 since 119 + the kernel interprets a value of 0 in r2 to mean neither a tagged list 120 + nor a dtb were passed. 121 + 110 122 5. Calling the kernel image 111 123 --------------------------- 112 124 ··· 149 125 - CPU register settings 150 126 r0 = 0, 151 127 r1 = machine type number discovered in (3) above. 152 - r2 = physical address of tagged list in system RAM. 128 + r2 = physical address of tagged list in system RAM, or 129 + physical address of device tree block (dtb) in system RAM 153 130 154 131 - CPU mode 155 132 All forms of interrupts must be disabled (IRQs and FIQs)
+44 -4
Documentation/devicetree/booting-without-of.txt
··· 12 12 ================= 13 13 14 14 I - Introduction 15 - 1) Entry point for arch/powerpc 16 - 2) Entry point for arch/x86 15 + 1) Entry point for arch/arm 16 + 2) Entry point for arch/powerpc 17 + 3) Entry point for arch/x86 17 18 18 19 II - The DT block format 19 20 1) Header ··· 149 148 it with special cases. 150 149 151 150 152 - 1) Entry point for arch/powerpc 151 + 1) Entry point for arch/arm 152 + --------------------------- 153 + 154 + There is one single entry point to the kernel, at the start 155 + of the kernel image. That entry point supports two calling 156 + conventions. A summary of the interface is described here. A full 157 + description of the boot requirements is documented in 158 + Documentation/arm/Booting 159 + 160 + a) ATAGS interface. Minimal information is passed from firmware 161 + to the kernel with a tagged list of predefined parameters. 162 + 163 + r0 : 0 164 + 165 + r1 : Machine type number 166 + 167 + r2 : Physical address of tagged list in system RAM 168 + 169 + b) Entry with a flattened device-tree block. Firmware loads the 170 + physical address of the flattened device tree block (dtb) into r2, 171 + r1 is not used, but it is considered good practise to use a valid 172 + machine number as described in Documentation/arm/Booting. 173 + 174 + r0 : 0 175 + 176 + r1 : Valid machine type number. When using a device tree, 177 + a single machine type number will often be assigned to 178 + represent a class or family of SoCs. 179 + 180 + r2 : physical pointer to the device-tree block 181 + (defined in chapter II) in RAM. Device tree can be located 182 + anywhere in system RAM, but it should be aligned on a 64 bit 183 + boundary. 184 + 185 + The kernel will differentiate between ATAGS and device tree booting by 186 + reading the memory pointed to by r2 and looking for either the flattened 187 + device tree block magic value (0xd00dfeed) or the ATAG_CORE value at 188 + offset 0x4 from r2 (0x54410001). 189 + 190 + 2) Entry point for arch/powerpc 153 191 ------------------------------- 154 192 155 193 There is one single entry point to the kernel, at the start ··· 266 226 cannot support both configurations with Book E and configurations 267 227 with classic Powerpc architectures. 268 228 269 - 2) Entry point for arch/x86 229 + 3) Entry point for arch/x86 270 230 ------------------------------- 271 231 272 232 There is one single 32bit entry point to the kernel at code32_start,
+7
arch/arm/Kconfig
··· 1683 1683 1684 1684 menu "Boot options" 1685 1685 1686 + config USE_OF 1687 + bool "Flattened Device Tree support" 1688 + select OF 1689 + select OF_EARLY_FLATTREE 1690 + help 1691 + Include support for flattened device tree machine descriptions. 1692 + 1686 1693 # Compressed boot loader in ROM. Yes, we really want to ask about 1687 1694 # TEXT and BSS so we preserve their values in the config files. 1688 1695 config ZBOOT_ROM_TEXT
+9
arch/arm/include/asm/mach/arch.h
··· 18 18 unsigned int nr; /* architecture number */ 19 19 const char *name; /* architecture name */ 20 20 unsigned long boot_params; /* tagged list */ 21 + const char **dt_compat; /* array of device tree 22 + * 'compatible' strings */ 21 23 22 24 unsigned int nr_irqs; /* number of IRQs */ 23 25 ··· 48 46 * Current machine - only accessible during boot. 49 47 */ 50 48 extern struct machine_desc *machine_desc; 49 + 50 + /* 51 + * Machine type table - also only accessible during boot 52 + */ 53 + extern struct machine_desc __arch_info_begin[], __arch_info_end[]; 54 + #define for_each_machine_desc(p) \ 55 + for (p = __arch_info_begin; p < __arch_info_end; p++) 51 56 52 57 /* 53 58 * Set of macros to define architecture features. This is built into
+37
arch/arm/include/asm/prom.h
··· 1 + /* 2 + * arch/arm/include/asm/prom.h 3 + * 4 + * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + * 10 + */ 11 + #ifndef __ASMARM_PROM_H 12 + #define __ASMARM_PROM_H 13 + 14 + #ifdef CONFIG_OF 15 + 16 + #include <asm/setup.h> 17 + #include <asm/irq.h> 18 + 19 + static inline void irq_dispose_mapping(unsigned int virq) 20 + { 21 + return; 22 + } 23 + 24 + extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); 25 + extern void arm_dt_memblock_reserve(void); 26 + 27 + #else /* CONFIG_OF */ 28 + 29 + static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys) 30 + { 31 + return NULL; 32 + } 33 + 34 + static inline void arm_dt_memblock_reserve(void) { } 35 + 36 + #endif /* CONFIG_OF */ 37 + #endif /* ASMARM_PROM_H */
+4
arch/arm/include/asm/setup.h
··· 217 217 #define bank_phys_end(bank) ((bank)->start + (bank)->size) 218 218 #define bank_phys_size(bank) (bank)->size 219 219 220 + extern int arm_add_memory(phys_addr_t start, unsigned long size); 221 + extern void early_print(const char *str, ...); 222 + extern void dump_machine_table(void); 223 + 220 224 #endif /* __KERNEL__ */ 221 225 222 226 #endif
+1
arch/arm/kernel/Makefile
··· 44 44 obj-$(CONFIG_KGDB) += kgdb.o 45 45 obj-$(CONFIG_ARM_UNWIND) += unwind.o 46 46 obj-$(CONFIG_HAVE_TCM) += tcm.o 47 + obj-$(CONFIG_OF) += devtree.o 47 48 obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 48 49 obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o 49 50 CFLAGS_swp_emulate.o := -Wa,-march=armv7-a
+145
arch/arm/kernel/devtree.c
··· 1 + /* 2 + * linux/arch/arm/kernel/devtree.c 3 + * 4 + * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/init.h> 12 + #include <linux/module.h> 13 + #include <linux/errno.h> 14 + #include <linux/types.h> 15 + #include <linux/bootmem.h> 16 + #include <linux/memblock.h> 17 + #include <linux/of.h> 18 + #include <linux/of_fdt.h> 19 + #include <linux/of_irq.h> 20 + #include <linux/of_platform.h> 21 + 22 + #include <asm/setup.h> 23 + #include <asm/page.h> 24 + #include <asm/mach/arch.h> 25 + #include <asm/mach-types.h> 26 + 27 + void __init early_init_dt_add_memory_arch(u64 base, u64 size) 28 + { 29 + arm_add_memory(base, size); 30 + } 31 + 32 + void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 33 + { 34 + return alloc_bootmem_align(size, align); 35 + } 36 + 37 + void __init arm_dt_memblock_reserve(void) 38 + { 39 + u64 *reserve_map, base, size; 40 + 41 + if (!initial_boot_params) 42 + return; 43 + 44 + /* Reserve the dtb region */ 45 + memblock_reserve(virt_to_phys(initial_boot_params), 46 + be32_to_cpu(initial_boot_params->totalsize)); 47 + 48 + /* 49 + * Process the reserve map. This will probably overlap the initrd 50 + * and dtb locations which are already reserved, but overlaping 51 + * doesn't hurt anything 52 + */ 53 + reserve_map = ((void*)initial_boot_params) + 54 + be32_to_cpu(initial_boot_params->off_mem_rsvmap); 55 + while (1) { 56 + base = be64_to_cpup(reserve_map++); 57 + size = be64_to_cpup(reserve_map++); 58 + if (!size) 59 + break; 60 + memblock_reserve(base, size); 61 + } 62 + } 63 + 64 + /** 65 + * setup_machine_fdt - Machine setup when an dtb was passed to the kernel 66 + * @dt_phys: physical address of dt blob 67 + * 68 + * If a dtb was passed to the kernel in r2, then use it to choose the 69 + * correct machine_desc and to setup the system. 70 + */ 71 + struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) 72 + { 73 + struct boot_param_header *devtree; 74 + struct machine_desc *mdesc, *mdesc_best = NULL; 75 + unsigned int score, mdesc_score = ~1; 76 + unsigned long dt_root; 77 + const char *model; 78 + 79 + devtree = phys_to_virt(dt_phys); 80 + 81 + /* check device tree validity */ 82 + if (be32_to_cpu(devtree->magic) != OF_DT_HEADER) 83 + return NULL; 84 + 85 + /* Search the mdescs for the 'best' compatible value match */ 86 + initial_boot_params = devtree; 87 + dt_root = of_get_flat_dt_root(); 88 + for_each_machine_desc(mdesc) { 89 + score = of_flat_dt_match(dt_root, mdesc->dt_compat); 90 + if (score > 0 && score < mdesc_score) { 91 + mdesc_best = mdesc; 92 + mdesc_score = score; 93 + } 94 + } 95 + if (!mdesc_best) { 96 + const char *prop; 97 + long size; 98 + 99 + early_print("\nError: unrecognized/unsupported " 100 + "device tree compatible list:\n[ "); 101 + 102 + prop = of_get_flat_dt_prop(dt_root, "compatible", &size); 103 + while (size > 0) { 104 + early_print("'%s' ", prop); 105 + size -= strlen(prop) + 1; 106 + prop += strlen(prop) + 1; 107 + } 108 + early_print("]\n\n"); 109 + 110 + dump_machine_table(); /* does not return */ 111 + } 112 + 113 + model = of_get_flat_dt_prop(dt_root, "model", NULL); 114 + if (!model) 115 + model = of_get_flat_dt_prop(dt_root, "compatible", NULL); 116 + if (!model) 117 + model = "<unknown>"; 118 + pr_info("Machine: %s, model: %s\n", mdesc_best->name, model); 119 + 120 + /* Retrieve various information from the /chosen node */ 121 + of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); 122 + /* Initialize {size,address}-cells info */ 123 + of_scan_flat_dt(early_init_dt_scan_root, NULL); 124 + /* Setup memory, calling early_init_dt_add_memory_arch */ 125 + of_scan_flat_dt(early_init_dt_scan_memory, NULL); 126 + 127 + /* Change machine number to match the mdesc we're using */ 128 + __machine_arch_type = mdesc_best->nr; 129 + 130 + return mdesc_best; 131 + } 132 + 133 + /** 134 + * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq# 135 + * 136 + * Currently the mapping mechanism is trivial; simple flat hwirq numbers are 137 + * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not 138 + * supported. 139 + */ 140 + unsigned int irq_create_of_mapping(struct device_node *controller, 141 + const u32 *intspec, unsigned int intsize) 142 + { 143 + return intspec[0]; 144 + } 145 + EXPORT_SYMBOL_GPL(irq_create_of_mapping);
+18 -6
arch/arm/kernel/head-common.S
··· 15 15 #define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2) 16 16 #define ATAG_CORE_SIZE_EMPTY ((2*4) >> 2) 17 17 18 + #ifdef CONFIG_CPU_BIG_ENDIAN 19 + #define OF_DT_MAGIC 0xd00dfeed 20 + #else 21 + #define OF_DT_MAGIC 0xedfe0dd0 /* 0xd00dfeed in big-endian */ 22 + #endif 23 + 18 24 /* 19 25 * Exception handling. Something went wrong and we can't proceed. We 20 26 * ought to tell the user, but since we don't have any guarantee that ··· 34 28 35 29 /* Determine validity of the r2 atags pointer. The heuristic requires 36 30 * that the pointer be aligned, in the first 16k of physical RAM and 37 - * that the ATAG_CORE marker is first and present. Future revisions 31 + * that the ATAG_CORE marker is first and present. If CONFIG_OF_FLATTREE 32 + * is selected, then it will also accept a dtb pointer. Future revisions 38 33 * of this function may be more lenient with the physical address and 39 34 * may also be able to move the ATAGS block if necessary. 40 35 * 41 36 * Returns: 42 - * r2 either valid atags pointer, or zero 37 + * r2 either valid atags pointer, valid dtb pointer, or zero 43 38 * r5, r6 corrupted 44 39 */ 45 40 __vet_atags: 46 41 tst r2, #0x3 @ aligned? 47 42 bne 1f 48 43 49 - ldr r5, [r2, #0] @ is first tag ATAG_CORE? 50 - cmp r5, #ATAG_CORE_SIZE 44 + ldr r5, [r2, #0] 45 + #ifdef CONFIG_OF_FLATTREE 46 + ldr r6, =OF_DT_MAGIC @ is it a DTB? 47 + cmp r5, r6 48 + beq 2f 49 + #endif 50 + cmp r5, #ATAG_CORE_SIZE @ is first tag ATAG_CORE? 51 51 cmpne r5, #ATAG_CORE_SIZE_EMPTY 52 52 bne 1f 53 53 ldr r5, [r2, #4] ··· 61 49 cmp r5, r6 62 50 bne 1f 63 51 64 - mov pc, lr @ atag pointer is ok 52 + 2: mov pc, lr @ atag/dtb pointer is ok 65 53 66 54 1: mov r2, #0 67 55 mov pc, lr ··· 73 61 * 74 62 * r0 = cp#15 control register 75 63 * r1 = machine ID 76 - * r2 = atags pointer 64 + * r2 = atags/dtb pointer 77 65 * r9 = processor ID 78 66 */ 79 67 __INIT
+4 -4
arch/arm/kernel/head.S
··· 59 59 * 60 60 * This is normally called from the decompressor code. The requirements 61 61 * are: MMU = off, D-cache = off, I-cache = dont care, r0 = 0, 62 - * r1 = machine nr, r2 = atags pointer. 62 + * r1 = machine nr, r2 = atags or dtb pointer. 63 63 * 64 64 * This code is mostly position independent, so if you link the kernel at 65 65 * 0xc0008000, you call this at __pa(0xc0008000). ··· 91 91 #endif 92 92 93 93 /* 94 - * r1 = machine no, r2 = atags, 94 + * r1 = machine no, r2 = atags or dtb, 95 95 * r8 = phys_offset, r9 = cpuid, r10 = procinfo 96 96 */ 97 97 bl __vet_atags ··· 339 339 * 340 340 * r0 = cp#15 control register 341 341 * r1 = machine ID 342 - * r2 = atags pointer 342 + * r2 = atags or dtb pointer 343 343 * r4 = page table pointer 344 344 * r9 = processor ID 345 345 * r13 = *virtual* address to jump to upon completion ··· 376 376 * 377 377 * r0 = cp#15 control register 378 378 * r1 = machine ID 379 - * r2 = atags pointer 379 + * r2 = atags or dtb pointer 380 380 * r9 = processor ID 381 381 * r13 = *virtual* address to jump to upon completion 382 382 *
+58 -32
arch/arm/kernel/setup.c
··· 20 20 #include <linux/screen_info.h> 21 21 #include <linux/init.h> 22 22 #include <linux/kexec.h> 23 + #include <linux/of_fdt.h> 23 24 #include <linux/crash_dump.h> 24 25 #include <linux/root_dev.h> 25 26 #include <linux/cpu.h> ··· 43 42 #include <asm/cachetype.h> 44 43 #include <asm/tlbflush.h> 45 44 45 + #include <asm/prom.h> 46 46 #include <asm/mach/arch.h> 47 47 #include <asm/mach/irq.h> 48 48 #include <asm/mach/time.h> ··· 311 309 */ 312 310 extern struct proc_info_list *lookup_processor_type(unsigned int); 313 311 314 - static void __init early_print(const char *str, ...) 312 + void __init early_print(const char *str, ...) 315 313 { 316 314 extern void printascii(const char *); 317 315 char buf[256]; ··· 441 439 : "r14"); 442 440 } 443 441 444 - static struct machine_desc * __init setup_machine(unsigned int nr) 442 + void __init dump_machine_table(void) 445 443 { 446 - extern struct machine_desc __arch_info_begin[], __arch_info_end[]; 447 444 struct machine_desc *p; 448 445 449 - /* 450 - * locate machine in the list of supported machines. 451 - */ 452 - for (p = __arch_info_begin; p < __arch_info_end; p++) 453 - if (nr == p->nr) { 454 - printk("Machine: %s\n", p->name); 455 - return p; 456 - } 457 - 458 - early_print("\n" 459 - "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n" 460 - "Available machine support:\n\nID (hex)\tNAME\n", nr); 461 - 462 - for (p = __arch_info_begin; p < __arch_info_end; p++) 446 + early_print("Available machine support:\n\nID (hex)\tNAME\n"); 447 + for_each_machine_desc(p) 463 448 early_print("%08x\t%s\n", p->nr, p->name); 464 449 465 450 early_print("\nPlease check your kernel config and/or bootloader.\n"); ··· 455 466 /* can't use cpu_relax() here as it may require MMU setup */; 456 467 } 457 468 458 - static int __init arm_add_memory(phys_addr_t start, unsigned long size) 469 + int __init arm_add_memory(phys_addr_t start, unsigned long size) 459 470 { 460 471 struct membank *bank = &meminfo.bank[meminfo.nr_banks]; 461 472 ··· 790 801 tag->hdr.tag = ATAG_NONE; 791 802 } 792 803 793 - void __init setup_arch(char **cmdline_p) 804 + static struct machine_desc * __init setup_machine_tags(unsigned int nr) 794 805 { 795 806 struct tag *tags = (struct tag *)&init_tags; 796 - struct machine_desc *mdesc; 807 + struct machine_desc *mdesc = NULL, *p; 797 808 char *from = default_command_line; 798 809 799 810 init_tags.mem.start = PHYS_OFFSET; 800 811 801 - unwind_init(); 812 + /* 813 + * locate machine in the list of supported machines. 814 + */ 815 + for_each_machine_desc(p) 816 + if (nr == p->nr) { 817 + printk("Machine: %s\n", p->name); 818 + mdesc = p; 819 + break; 820 + } 802 821 803 - setup_processor(); 804 - mdesc = setup_machine(machine_arch_type); 805 - machine_desc = mdesc; 806 - machine_name = mdesc->name; 807 - 808 - if (mdesc->soft_reboot) 809 - reboot_setup("s"); 822 + if (!mdesc) { 823 + early_print("\nError: unrecognized/unsupported machine ID" 824 + " (r1 = 0x%08x).\n\n", nr); 825 + dump_machine_table(); /* does not return */ 826 + } 810 827 811 828 if (__atags_pointer) 812 829 tags = phys_to_virt(__atags_pointer); ··· 844 849 if (tags->hdr.tag != ATAG_CORE) 845 850 convert_to_tag_list(tags); 846 851 #endif 847 - if (tags->hdr.tag != ATAG_CORE) 852 + 853 + if (tags->hdr.tag != ATAG_CORE) { 854 + #if defined(CONFIG_OF) 855 + /* 856 + * If CONFIG_OF is set, then assume this is a reasonably 857 + * modern system that should pass boot parameters 858 + */ 859 + early_print("Warning: Neither atags nor dtb found\n"); 860 + #endif 848 861 tags = (struct tag *)&init_tags; 862 + } 849 863 850 864 if (mdesc->fixup) 851 865 mdesc->fixup(mdesc, tags, &from, &meminfo); ··· 866 862 parse_tags(tags); 867 863 } 868 864 865 + /* parse_early_param needs a boot_command_line */ 866 + strlcpy(boot_command_line, from, COMMAND_LINE_SIZE); 867 + 868 + return mdesc; 869 + } 870 + 871 + 872 + void __init setup_arch(char **cmdline_p) 873 + { 874 + struct machine_desc *mdesc; 875 + 876 + unwind_init(); 877 + 878 + setup_processor(); 879 + mdesc = setup_machine_fdt(__atags_pointer); 880 + if (!mdesc) 881 + mdesc = setup_machine_tags(machine_arch_type); 882 + machine_desc = mdesc; 883 + machine_name = mdesc->name; 884 + 885 + if (mdesc->soft_reboot) 886 + reboot_setup("s"); 887 + 869 888 init_mm.start_code = (unsigned long) _text; 870 889 init_mm.end_code = (unsigned long) _etext; 871 890 init_mm.end_data = (unsigned long) _edata; 872 891 init_mm.brk = (unsigned long) _end; 873 - 874 - /* parse_early_param needs a boot_command_line */ 875 - strlcpy(boot_command_line, from, COMMAND_LINE_SIZE); 876 892 877 893 /* populate cmd_line too for later use, preserving boot_command_line */ 878 894 strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE); ··· 904 880 905 881 paging_init(mdesc); 906 882 request_standard_resources(mdesc); 883 + 884 + unflatten_device_tree(); 907 885 908 886 #ifdef CONFIG_SMP 909 887 if (is_smp())
+11
arch/arm/mm/init.c
··· 15 15 #include <linux/mman.h> 16 16 #include <linux/nodemask.h> 17 17 #include <linux/initrd.h> 18 + #include <linux/of_fdt.h> 18 19 #include <linux/highmem.h> 19 20 #include <linux/gfp.h> 20 21 #include <linux/memblock.h> 21 22 #include <linux/sort.h> 22 23 23 24 #include <asm/mach-types.h> 25 + #include <asm/prom.h> 24 26 #include <asm/sections.h> 25 27 #include <asm/setup.h> 26 28 #include <asm/sizes.h> ··· 72 70 } 73 71 74 72 __tagtable(ATAG_INITRD2, parse_tag_initrd2); 73 + 74 + #ifdef CONFIG_OF_FLATTREE 75 + void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end) 76 + { 77 + phys_initrd_start = start; 78 + phys_initrd_size = end - start; 79 + } 80 + #endif /* CONFIG_OF_FLATTREE */ 75 81 76 82 /* 77 83 * This keeps memory configuration data used by a couple memory ··· 344 334 #endif 345 335 346 336 arm_mm_memblock_reserve(); 337 + arm_dt_memblock_reserve(); 347 338 348 339 /* reserve any platform specific memblock areas */ 349 340 if (mdesc->reserve)
+1 -1
arch/microblaze/kernel/prom.c
··· 130 130 * device-tree, including the platform type, initrd location and 131 131 * size, TCE reserve, and more ... 132 132 */ 133 - of_scan_flat_dt(early_init_dt_scan_chosen, NULL); 133 + of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line); 134 134 135 135 /* Scan memory nodes and rebuild MEMBLOCKs */ 136 136 memblock_init();
-3
arch/mips/include/asm/prom.h
··· 14 14 #ifdef CONFIG_OF 15 15 #include <asm/bootinfo.h> 16 16 17 - /* which is compatible with the flattened device tree (FDT) */ 18 - #define cmd_line arcs_cmdline 19 - 20 17 extern int early_init_dt_scan_memory_arch(unsigned long node, 21 18 const char *uname, int depth, void *data); 22 19
+2 -1
arch/mips/kernel/prom.c
··· 83 83 * device-tree, including the platform type, initrd location and 84 84 * size, and more ... 85 85 */ 86 - of_scan_flat_dt(early_init_dt_scan_chosen, NULL); 86 + of_scan_flat_dt(early_init_dt_scan_chosen, arcs_cmdline); 87 + 87 88 88 89 /* Scan memory nodes */ 89 90 of_scan_flat_dt(early_init_dt_scan_root, NULL);
+1 -1
arch/powerpc/kernel/prom.c
··· 694 694 * device-tree, including the platform type, initrd location and 695 695 * size, TCE reserve, and more ... 696 696 */ 697 - of_scan_flat_dt(early_init_dt_scan_chosen_ppc, NULL); 697 + of_scan_flat_dt(early_init_dt_scan_chosen_ppc, cmd_line); 698 698 699 699 /* Scan memory nodes and rebuild MEMBLOCKs */ 700 700 memblock_init();
+4 -4
drivers/of/fdt.c
··· 670 670 671 671 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); 672 672 673 - if (depth != 1 || 673 + if (depth != 1 || !data || 674 674 (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) 675 675 return 0; 676 676 ··· 679 679 /* Retrieve command line */ 680 680 p = of_get_flat_dt_prop(node, "bootargs", &l); 681 681 if (p != NULL && l > 0) 682 - strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE)); 682 + strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); 683 683 684 684 #ifdef CONFIG_CMDLINE 685 685 #ifndef CONFIG_CMDLINE_FORCE 686 686 if (p == NULL || l == 0 || (l == 1 && (*p) == 0)) 687 687 #endif 688 - strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 688 + strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 689 689 #endif /* CONFIG_CMDLINE */ 690 690 691 - pr_debug("Command line is: %s\n", cmd_line); 691 + pr_debug("Command line is: %s\n", (char*)data); 692 692 693 693 /* break now */ 694 694 return 1;