diff for duplicates of <20110202062111.GC16543@angua.secretlab.ca> diff --git a/a/1.txt b/N1/1.txt index f07862d..af47f2c 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -94,14 +94,14 @@ g. > > > > Still debugging it. > > > > > > > > > -----Original Message----- -> > > > > From: glikely at secretlab.ca [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely +> > > > > From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely > > > > > Sent: Monday, January 31, 2011 2:58 PM > > > > > To: John Linn > > > > > Subject: Re: FW: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree > > > > > > > > > > On Mon, Jan 31, 2011 at 2:42 PM, John Linn <John.Linn@xilinx.com> wrote: > > > > > >> -----Original Message----- -> > > > > >> From: glikely at secretlab.ca [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely +> > > > > >> From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely > > > > > >> Sent: Monday, January 31, 2011 2:11 PM > > > > > >> To: John Linn > > > > > >> Subject: Re: FW: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree @@ -115,7 +115,7 @@ g. > > > > > >> > Are these all in your tree? > > > > > >> > > > > > >> If you're based on devicetree/arm, then you should be able to just -> > > > > >> merge it again to get the changes. ?I haven't rebased that branch. ?In +> > > > > >> merge it again to get the changes. I haven't rebased that branch. In > > > > > >> fact, the top commit on devicetree/arm will show you the exact diff > > > > > >> between this series and the previous version. > > > > > > @@ -144,13 +144,13 @@ g. > > > > > >> > > > > > >> > > > > > > >> >> -----Original Message----- -> > > > > >> >> From: Grant Likely [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely +> > > > > >> >> From: Grant Likely [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely > > > > > >> >> Sent: Monday, January 31, 2011 2:04 PM -> > > > > >> >> To: nicolas.pitre at linaro.org; Russell King; Catalin Marinas; devicetree- -> > > > > discuss at lists.ozlabs.org; -> > > > > >> >> linux-kernel at vger.kernel.org; buytenh at wantstofly.org; Olof Johansson; John Linn; linux- +> > > > > >> >> To: nicolas.pitre@linaro.org; Russell King; Catalin Marinas; devicetree- +> > > > > discuss@lists.ozlabs.org; +> > > > > >> >> linux-kernel@vger.kernel.org; buytenh@wantstofly.org; Olof Johansson; John Linn; linux- > > arm- -> > > > > >> >> kernel at lists.infradead.org +> > > > > >> >> kernel@lists.infradead.org > > > > > >> >> Subject: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree > > > > > >> >> > > > > > >> >> If a dtb is passed to the kernel then the kernel needs to iterate @@ -161,45 +161,45 @@ g. > > > > > >> >> This patch creates a new function, setup_machine_fdt() which is > > > > > >> >> analogous to the setup_machine_atags() created in the previous patch. > > > > > >> >> It does all the early setup needed to use a device tree machine -> > > > > >> >> description. ?It also creates arm_unflatten_device_tree() which copies +> > > > > >> >> description. It also creates arm_unflatten_device_tree() which copies > > > > > >> >> the dtb into an allocated buffer and unflattens it into the live-tree > > > > > >> >> representation. > > > > > >> >> > > > > > >> >> v2: Changed to save the dtb by copying into an allocated buffer. -> > > > > >> >> ? ? - Since the dtb will very likely be passed in the first 16k of ram -> > > > > >> >> ? ? ? where the interrupt vectors live, memblock_reserve() is -> > > > > >> >> ? ? ? insufficient to protect the dtb data. +> > > > > >> >> - Since the dtb will very likely be passed in the first 16k of ram +> > > > > >> >> where the interrupt vectors live, memblock_reserve() is +> > > > > >> >> insufficient to protect the dtb data. > > > > > >> >> [based on work originally written by Jeremy Kerr <jeremy.kerr@canonical.com>] > > > > > >> >> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> > > > > > >> >> --- -> > > > > >> >> ?arch/arm/include/asm/mach/arch.h | ? ?2 + -> > > > > >> >> ?arch/arm/include/asm/prom.h ? ? ?| ? 11 +++++ -> > > > > >> >> ?arch/arm/include/asm/setup.h ? ? | ? ?1 -> > > > > >> >> ?arch/arm/kernel/devtree.c ? ? ? ?| ? 87 ++++++++++++++++++++++++++++++++++++++ -> > > > > >> >> ?arch/arm/kernel/setup.c ? ? ? ? ?| ? 10 +++- -> > > > > >> >> ?arch/arm/mm/init.c ? ? ? ? ? ? ? | ? ?8 +++ -> > > > > >> >> ?6 files changed, 117 insertions(+), 2 deletions(-) +> > > > > >> >> arch/arm/include/asm/mach/arch.h | 2 + +> > > > > >> >> arch/arm/include/asm/prom.h | 11 +++++ +> > > > > >> >> arch/arm/include/asm/setup.h | 1 +> > > > > >> >> arch/arm/kernel/devtree.c | 87 ++++++++++++++++++++++++++++++++++++++ +> > > > > >> >> arch/arm/kernel/setup.c | 10 +++- +> > > > > >> >> arch/arm/mm/init.c | 8 +++ +> > > > > >> >> 6 files changed, 117 insertions(+), 2 deletions(-) > > > > > >> >> > > > > > >> >> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h > > > > > >> >> index 3a0893a..2ed24e7 100644 > > > > > >> >> --- a/arch/arm/include/asm/mach/arch.h > > > > > >> >> +++ b/arch/arm/include/asm/mach/arch.h > > > > > >> >> @@ -22,6 +22,8 @@ struct machine_desc { -> > > > > >> >> ? ? ? unsigned int ? ? ? ? ? ?nr; ? ? ? ? ? ? /* architecture number ?*/ -> > > > > >> >> ? ? ? const char ? ? ? ? ? ? ?*name; ? ? ? ? ?/* architecture name ? ?*/ -> > > > > >> >> ? ? ? unsigned long ? ? ? ? ? boot_params; ? ?/* tagged list ? ? ? ? ?*/ -> > > > > >> >> + ? ? const char ? ? ? ? ? ? ?**dt_compat; ? ?/* array of device tree -> > > > > >> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* 'compatible' strings */ +> > > > > >> >> unsigned int nr; /* architecture number */ +> > > > > >> >> const char *name; /* architecture name */ +> > > > > >> >> unsigned long boot_params; /* tagged list */ +> > > > > >> >> + const char **dt_compat; /* array of device tree +> > > > > >> >> + * 'compatible' strings */ > > > > > >> >> -> > > > > >> >> ? ? ? unsigned int ? ? ? ? ? ?nr_irqs; ? ? ? ?/* number of IRQs */ +> > > > > >> >> unsigned int nr_irqs; /* number of IRQs */ > > > > > >> >> > > > > > >> >> diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h > > > > > >> >> index 8f1037f..6ba62a8 100644 > > > > > >> >> --- a/arch/arm/include/asm/prom.h > > > > > >> >> +++ b/arch/arm/include/asm/prom.h > > > > > >> >> @@ -21,5 +21,16 @@ static inline void irq_dispose_mapping(unsigned int virq) -> > > > > >> >> ? ? ? return; -> > > > > >> >> ?} +> > > > > >> >> return; +> > > > > >> >> } > > > > > >> >> > > > > > >> >> +extern void arm_unflatten_device_tree(void); > > > > > >> >> +extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); @@ -209,22 +209,22 @@ g. > > > > > >> >> +static void arm_unflatten_device_tree(void) { } > > > > > >> >> +static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys) > > > > > >> >> +{ -> > > > > >> >> + ? ? return NULL; +> > > > > >> >> + return NULL; > > > > > >> >> +} > > > > > >> >> + -> > > > > >> >> ?#endif /* CONFIG_OF */ -> > > > > >> >> ?#endif /* ASMARM_PROM_H */ +> > > > > >> >> #endif /* CONFIG_OF */ +> > > > > >> >> #endif /* ASMARM_PROM_H */ > > > > > >> >> diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h > > > > > >> >> index 06c4d0e..1cec82a 100644 > > > > > >> >> --- a/arch/arm/include/asm/setup.h > > > > > >> >> +++ b/arch/arm/include/asm/setup.h > > > > > >> >> @@ -222,6 +222,7 @@ extern struct meminfo meminfo; -> > > > > >> >> ?#define bank_phys_size(bank) (bank)->size +> > > > > >> >> #define bank_phys_size(bank) (bank)->size > > > > > >> >> -> > > > > >> >> ?extern int arm_add_memory(unsigned long start, unsigned long size); +> > > > > >> >> extern int arm_add_memory(unsigned long start, unsigned long size); > > > > > >> >> +extern char cmd_line[COMMAND_LINE_SIZE]; > > > > > >> >> -> > > > > >> >> ?#endif ?/* ?__KERNEL__ ?*/ +> > > > > >> >> #endif /* __KERNEL__ */ > > > > > >> >> > > > > > >> >> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c > > > > > >> >> index ac48da2..07b75bb 100644 @@ -232,16 +232,16 @@ g. > > > > > >> >> +++ b/arch/arm/kernel/devtree.c > > > > > >> >> @@ -21,6 +21,7 @@ > > > > > >> >> -> > > > > >> >> ?#include <asm/setup.h> -> > > > > >> >> ?#include <asm/page.h> +> > > > > >> >> #include <asm/setup.h> +> > > > > >> >> #include <asm/page.h> > > > > > >> >> +#include <asm/mach/arch.h> > > > > > >> >> -> > > > > >> >> ?void __init early_init_dt_add_memory_arch(u64 base, u64 size) -> > > > > >> >> ?{ +> > > > > >> >> void __init early_init_dt_add_memory_arch(u64 base, u64 size) +> > > > > >> >> { > > > > > >> >> @@ -45,3 +46,89 @@ unsigned int irq_create_of_mapping(struct device_node *controller, -> > > > > >> >> ? ? ? return intspec[0]; -> > > > > >> >> ?} -> > > > > >> >> ?EXPORT_SYMBOL_GPL(irq_create_of_mapping); +> > > > > >> >> return intspec[0]; +> > > > > >> >> } +> > > > > >> >> EXPORT_SYMBOL_GPL(irq_create_of_mapping); > > > > > >> >> + > > > > > >> >> +extern struct machine_desc __arch_info_begin, __arch_info_end; > > > > > >> >> + @@ -254,25 +254,25 @@ g. > > > > > >> >> + */ > > > > > >> >> +void __init arm_unflatten_device_tree(void) > > > > > >> >> +{ -> > > > > >> >> + ? ? struct boot_param_header *devtree; -> > > > > >> >> + ? ? u32 dtb_size; +> > > > > >> >> + struct boot_param_header *devtree; +> > > > > >> >> + u32 dtb_size; > > > > > >> >> + -> > > > > >> >> + ? ? if (!initial_boot_params) -> > > > > >> >> + ? ? ? ? ? ? return; +> > > > > >> >> + if (!initial_boot_params) +> > > > > >> >> + return; > > > > > >> >> + -> > > > > >> >> + ? ? /* Save the dtb to an allocated buffer */ -> > > > > >> >> + ? ? dtb_size = be32_to_cpu(initial_boot_params->totalsize); -> > > > > >> >> + ? ? devtree = early_init_dt_alloc_memory_arch(dtb_size, SZ_4K); -> > > > > >> >> + ? ? if (!devtree) { -> > > > > >> >> + ? ? ? ? ? ? printk("Unable to allocate memory for device tree\n"); -> > > > > >> >> + ? ? ? ? ? ? while(1); -> > > > > >> >> + ? ? } -> > > > > >> >> + ? ? pr_info("relocating device tree from 0x%p to 0x%p, length 0x%x\n", -> > > > > >> >> + ? ? ? ? ? ? initial_boot_params, devtree, dtb_size); -> > > > > >> >> + ? ? memmove(devtree, initial_boot_params, dtb_size); -> > > > > >> >> + ? ? initial_boot_params = devtree; +> > > > > >> >> + /* Save the dtb to an allocated buffer */ +> > > > > >> >> + dtb_size = be32_to_cpu(initial_boot_params->totalsize); +> > > > > >> >> + devtree = early_init_dt_alloc_memory_arch(dtb_size, SZ_4K); +> > > > > >> >> + if (!devtree) { +> > > > > >> >> + printk("Unable to allocate memory for device tree\n"); +> > > > > >> >> + while(1); +> > > > > >> >> + } +> > > > > >> >> + pr_info("relocating device tree from 0x%p to 0x%p, length 0x%x\n", +> > > > > >> >> + initial_boot_params, devtree, dtb_size); +> > > > > >> >> + memmove(devtree, initial_boot_params, dtb_size); +> > > > > >> >> + initial_boot_params = devtree; > > > > > >> >> + -> > > > > >> >> + ? ? unflatten_device_tree(); +> > > > > >> >> + unflatten_device_tree(); > > > > > >> >> +} > > > > > >> >> + > > > > > >> >> +/** @@ -284,118 +284,118 @@ g. > > > > > >> >> + */ > > > > > >> >> +struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) > > > > > >> >> +{ -> > > > > >> >> + ? ? struct boot_param_header *devtree = phys_to_virt(dt_phys); -> > > > > >> >> + ? ? struct machine_desc *mdesc, *mdesc_best = NULL; -> > > > > >> >> + ? ? unsigned int score, mdesc_score = ~1; -> > > > > >> >> + ? ? unsigned long dt_root; -> > > > > >> >> + ? ? const char *model; +> > > > > >> >> + struct boot_param_header *devtree = phys_to_virt(dt_phys); +> > > > > >> >> + struct machine_desc *mdesc, *mdesc_best = NULL; +> > > > > >> >> + unsigned int score, mdesc_score = ~1; +> > > > > >> >> + unsigned long dt_root; +> > > > > >> >> + const char *model; > > > > > >> >> + -> > > > > >> >> + ? ? /* check device tree validity */ -> > > > > >> >> + ? ? if (!dt_phys || be32_to_cpu(devtree->magic) != OF_DT_HEADER) -> > > > > >> >> + ? ? ? ? ? ? return NULL; +> > > > > >> >> + /* check device tree validity */ +> > > > > >> >> + if (!dt_phys || be32_to_cpu(devtree->magic) != OF_DT_HEADER) +> > > > > >> >> + return NULL; > > > > > >> >> + -> > > > > >> >> + ? ? /* Search the mdescs for the 'best' compatible value match */ -> > > > > >> >> + ? ? initial_boot_params = devtree; +> > > > > >> >> + /* Search the mdescs for the 'best' compatible value match */ +> > > > > >> >> + initial_boot_params = devtree; > > > > > >> >> + -> > > > > >> >> + ? ? dt_root = of_get_flat_dt_root(); -> > > > > >> >> + ? ? for (mdesc = &__arch_info_begin; mdesc < &__arch_info_end; mdesc++) { -> > > > > >> >> + ? ? ? ? ? ? score = of_flat_dt_match(dt_root, mdesc->dt_compat); -> > > > > >> >> + ? ? ? ? ? ? if (score > 0 && score < mdesc_score) { -> > > > > >> >> + ? ? ? ? ? ? ? ? ? ? mdesc_best = mdesc; -> > > > > >> >> + ? ? ? ? ? ? ? ? ? ? mdesc_score = score; -> > > > > >> >> + ? ? ? ? ? ? } -> > > > > >> >> + ? ? } -> > > > > >> >> + ? ? if (!mdesc_best) { -> > > > > >> >> + ? ? ? ? ? ? printk("Machine not supported, unable to continue.\n"); -> > > > > >> >> + ? ? ? ? ? ? while (1); -> > > > > >> >> + ? ? } +> > > > > >> >> + dt_root = of_get_flat_dt_root(); +> > > > > >> >> + for (mdesc = &__arch_info_begin; mdesc < &__arch_info_end; mdesc++) { +> > > > > >> >> + score = of_flat_dt_match(dt_root, mdesc->dt_compat); +> > > > > >> >> + if (score > 0 && score < mdesc_score) { +> > > > > >> >> + mdesc_best = mdesc; +> > > > > >> >> + mdesc_score = score; +> > > > > >> >> + } +> > > > > >> >> + } +> > > > > >> >> + if (!mdesc_best) { +> > > > > >> >> + printk("Machine not supported, unable to continue.\n"); +> > > > > >> >> + while (1); +> > > > > >> >> + } > > > > > >> >> + -> > > > > >> >> + ? ? model = of_get_flat_dt_prop(dt_root, "model", NULL); -> > > > > >> >> + ? ? if (!model) -> > > > > >> >> + ? ? ? ? ? ? model = of_get_flat_dt_prop(dt_root, "compatible", NULL); -> > > > > >> >> + ? ? if (!model) -> > > > > >> >> + ? ? ? ? ? ? model = "<unknown>"; -> > > > > >> >> + ? ? pr_info("Machine: %s, model: %s\n", mdesc_best->name, model); +> > > > > >> >> + model = of_get_flat_dt_prop(dt_root, "model", NULL); +> > > > > >> >> + if (!model) +> > > > > >> >> + model = of_get_flat_dt_prop(dt_root, "compatible", NULL); +> > > > > >> >> + if (!model) +> > > > > >> >> + model = "<unknown>"; +> > > > > >> >> + pr_info("Machine: %s, model: %s\n", mdesc_best->name, model); > > > > > >> >> + -> > > > > >> >> + ? ? /* Retrieve various information from the /chosen node */ -> > > > > >> >> + ? ? of_scan_flat_dt(early_init_dt_scan_chosen, NULL); -> > > > > >> >> + ? ? /* Initialize {size,address}-cells info */ -> > > > > >> >> + ? ? of_scan_flat_dt(early_init_dt_scan_root, NULL); -> > > > > >> >> + ? ? /* Setup memory, calling early_init_dt_add_memory_arch */ -> > > > > >> >> + ? ? of_scan_flat_dt(early_init_dt_scan_memory, NULL); -> > > > > >> >> + ? ? /* Save command line for /proc/cmdline ?*/ -> > > > > >> >> + ? ? strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); +> > > > > >> >> + /* Retrieve various information from the /chosen node */ +> > > > > >> >> + of_scan_flat_dt(early_init_dt_scan_chosen, NULL); +> > > > > >> >> + /* Initialize {size,address}-cells info */ +> > > > > >> >> + of_scan_flat_dt(early_init_dt_scan_root, NULL); +> > > > > >> >> + /* Setup memory, calling early_init_dt_add_memory_arch */ +> > > > > >> >> + of_scan_flat_dt(early_init_dt_scan_memory, NULL); +> > > > > >> >> + /* Save command line for /proc/cmdline */ +> > > > > >> >> + strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); > > > > > >> >> + -> > > > > >> >> + ? ? return mdesc_best; +> > > > > >> >> + return mdesc_best; > > > > > >> >> +} > > > > > >> >> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > > > > > >> >> index cbc1836..68e0204 100644 > > > > > >> >> --- a/arch/arm/kernel/setup.c > > > > > >> >> +++ b/arch/arm/kernel/setup.c > > > > > >> >> @@ -20,6 +20,7 @@ -> > > > > >> >> ?#include <linux/screen_info.h> -> > > > > >> >> ?#include <linux/init.h> -> > > > > >> >> ?#include <linux/kexec.h> +> > > > > >> >> #include <linux/screen_info.h> +> > > > > >> >> #include <linux/init.h> +> > > > > >> >> #include <linux/kexec.h> > > > > > >> >> +#include <linux/of_fdt.h> -> > > > > >> >> ?#include <linux/crash_dump.h> -> > > > > >> >> ?#include <linux/root_dev.h> -> > > > > >> >> ?#include <linux/cpu.h> +> > > > > >> >> #include <linux/crash_dump.h> +> > > > > >> >> #include <linux/root_dev.h> +> > > > > >> >> #include <linux/cpu.h> > > > > > >> >> @@ -42,6 +43,7 @@ -> > > > > >> >> ?#include <asm/cachetype.h> -> > > > > >> >> ?#include <asm/tlbflush.h> +> > > > > >> >> #include <asm/cachetype.h> +> > > > > >> >> #include <asm/tlbflush.h> > > > > > >> >> > > > > > >> >> +#include <asm/prom.h> -> > > > > >> >> ?#include <asm/mach/arch.h> -> > > > > >> >> ?#include <asm/mach/irq.h> -> > > > > >> >> ?#include <asm/mach/time.h> +> > > > > >> >> #include <asm/mach/arch.h> +> > > > > >> >> #include <asm/mach/irq.h> +> > > > > >> >> #include <asm/mach/time.h> > > > > > >> >> @@ -125,7 +127,7 @@ EXPORT_SYMBOL(elf_platform); > > > > > >> >> -> > > > > >> >> ?static const char *cpu_name; -> > > > > >> >> ?static const char *machine_name; +> > > > > >> >> static const char *cpu_name; +> > > > > >> >> static const char *machine_name; > > > > > >> >> -static char __initdata cmd_line[COMMAND_LINE_SIZE]; > > > > > >> >> +char cmd_line[COMMAND_LINE_SIZE]; -> > > > > >> >> ?struct machine_desc *machine_desc __initdata; +> > > > > >> >> struct machine_desc *machine_desc __initdata; > > > > > >> >> -> > > > > >> >> ?static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; +> > > > > >> >> static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; > > > > > >> >> @@ -838,7 +840,9 @@ void __init setup_arch(char **cmdline_p) -> > > > > >> >> ? ? ? unwind_init(); +> > > > > >> >> unwind_init(); > > > > > >> >> -> > > > > >> >> ? ? ? setup_processor(); -> > > > > >> >> - ? ? mdesc = setup_machine_tags(machine_arch_type); -> > > > > >> >> + ? ? mdesc = setup_machine_fdt(__atags_pointer); -> > > > > >> >> + ? ? if (!mdesc) -> > > > > >> >> + ? ? ? ? ? ? mdesc = setup_machine_tags(machine_arch_type); -> > > > > >> >> ? ? ? machine_desc = mdesc; -> > > > > >> >> ? ? ? machine_name = mdesc->name; +> > > > > >> >> setup_processor(); +> > > > > >> >> - mdesc = setup_machine_tags(machine_arch_type); +> > > > > >> >> + mdesc = setup_machine_fdt(__atags_pointer); +> > > > > >> >> + if (!mdesc) +> > > > > >> >> + mdesc = setup_machine_tags(machine_arch_type); +> > > > > >> >> machine_desc = mdesc; +> > > > > >> >> machine_name = mdesc->name; > > > > > >> >> > > > > > >> >> @@ -859,6 +863,8 @@ void __init setup_arch(char **cmdline_p) -> > > > > >> >> ? ? ? paging_init(mdesc); -> > > > > >> >> ? ? ? request_standard_resources(mdesc); +> > > > > >> >> paging_init(mdesc); +> > > > > >> >> request_standard_resources(mdesc); > > > > > >> >> -> > > > > >> >> + ? ? arm_unflatten_device_tree(); +> > > > > >> >> + arm_unflatten_device_tree(); > > > > > >> >> + -> > > > > >> >> ?#ifdef CONFIG_SMP -> > > > > >> >> ? ? ? if (is_smp()) -> > > > > >> >> ? ? ? ? ? ? ? smp_init_cpus(); +> > > > > >> >> #ifdef CONFIG_SMP +> > > > > >> >> if (is_smp()) +> > > > > >> >> smp_init_cpus(); > > > > > >> >> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > > > > > >> >> index 5164069..62ff2e8 100644 > > > > > >> >> --- a/arch/arm/mm/init.c > > > > > >> >> +++ b/arch/arm/mm/init.c > > > > > >> >> @@ -71,6 +71,14 @@ static int __init parse_tag_initrd2(const struct tag *tag) > > > > > >> >> -> > > > > >> >> ?__tagtable(ATAG_INITRD2, parse_tag_initrd2); +> > > > > >> >> __tagtable(ATAG_INITRD2, parse_tag_initrd2); > > > > > >> >> > > > > > >> >> +#ifdef CONFIG_OF_FLATTREE > > > > > >> >> +void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end) > > > > > >> >> +{ -> > > > > >> >> + ? ? phys_initrd_start = start; -> > > > > >> >> + ? ? phys_initrd_size = end - start + 1; +> > > > > >> >> + phys_initrd_start = start; +> > > > > >> >> + phys_initrd_size = end - start + 1; > > > > > >> >> +} > > > > > >> >> +#endif /* CONFIG_OF_FLATTREE */ > > > > > >> >> + -> > > > > >> >> ?/* -> > > > > >> >> ? * This keeps memory configuration data used by a couple memory -> > > > > >> >> ? * initialization functions, as well as show_mem() for the skipping +> > > > > >> >> /* +> > > > > >> >> * This keeps memory configuration data used by a couple memory +> > > > > >> >> * initialization functions, as well as show_mem() for the skipping > > > > > >> >> > > > > > >> > > > > > > >> > diff --git a/a/content_digest b/N1/content_digest index 4f5abfc..52df89a 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -3,11 +3,20 @@ "ref\07f92c231-05d4-4b3c-a8e2-8cf241d0c17b@VA3EHSMHS028.ehs.local\0" "ref\0AANLkTi=O6zOO+nx3gdVoDB2Q6rD+gRMyrvO04XdgxXtW@mail.gmail.com\0" "ref\0c55eb92d-bca0-4047-bbf9-7d532e37154d@VA3EHSMHS029.ehs.local\0" - "From\0grant.likely@secretlab.ca (Grant Likely)\0" - "Subject\0FW: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree\0" + "From\0Grant Likely <grant.likely@secretlab.ca>\0" + "Subject\0Re: FW: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree\0" "Date\0Tue, 1 Feb 2011 23:21:11 -0700\0" - "To\0linux-arm-kernel@lists.infradead.org\0" + "To\0John Linn <John.Linn@xilinx.com>\0" + "Cc\0nicolas.pitre@linaro.org" + Russell King <linux@arm.linux.org.uk> + Catalin Marinas <catalin.marinas@arm.com> + devicetree-discuss@lists.ozlabs.org + linux-kernel@vger.kernel.org + buytenh@wantstofly.org + Olof Johansson <olof@lixom.net> + " linux-arm-kernel@lists.infradead.org\0" "\00:1\0" + "d\0evicetree-discuss@lists.ozlabs.org,evicetree-discuss@lists.ozlabs.org,\0" "b\0" "[restored cc: list]\n" "\n" @@ -105,14 +114,14 @@ "> > > > Still debugging it.\n" "> > > >\n" "> > > > > -----Original Message-----\n" - "> > > > > From: glikely at secretlab.ca [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely\n" + "> > > > > From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely\n" "> > > > > Sent: Monday, January 31, 2011 2:58 PM\n" "> > > > > To: John Linn\n" "> > > > > Subject: Re: FW: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree\n" "> > > > >\n" "> > > > > On Mon, Jan 31, 2011 at 2:42 PM, John Linn <John.Linn@xilinx.com> wrote:\n" "> > > > > >> -----Original Message-----\n" - "> > > > > >> From: glikely at secretlab.ca [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely\n" + "> > > > > >> From: glikely@secretlab.ca [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely\n" "> > > > > >> Sent: Monday, January 31, 2011 2:11 PM\n" "> > > > > >> To: John Linn\n" "> > > > > >> Subject: Re: FW: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree\n" @@ -126,7 +135,7 @@ "> > > > > >> > Are these all in your tree?\n" "> > > > > >>\n" "> > > > > >> If you're based on devicetree/arm, then you should be able to just\n" - "> > > > > >> merge it again to get the changes. ?I haven't rebased that branch. ?In\n" + "> > > > > >> merge it again to get the changes. \302\240I haven't rebased that branch. \302\240In\n" "> > > > > >> fact, the top commit on devicetree/arm will show you the exact diff\n" "> > > > > >> between this series and the previous version.\n" "> > > > > >\n" @@ -155,13 +164,13 @@ "> > > > > >>\n" "> > > > > >> >\n" "> > > > > >> >> -----Original Message-----\n" - "> > > > > >> >> From: Grant Likely [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely\n" + "> > > > > >> >> From: Grant Likely [mailto:glikely@secretlab.ca] On Behalf Of Grant Likely\n" "> > > > > >> >> Sent: Monday, January 31, 2011 2:04 PM\n" - "> > > > > >> >> To: nicolas.pitre at linaro.org; Russell King; Catalin Marinas; devicetree-\n" - "> > > > > discuss at lists.ozlabs.org;\n" - "> > > > > >> >> linux-kernel at vger.kernel.org; buytenh at wantstofly.org; Olof Johansson; John Linn; linux-\n" + "> > > > > >> >> To: nicolas.pitre@linaro.org; Russell King; Catalin Marinas; devicetree-\n" + "> > > > > discuss@lists.ozlabs.org;\n" + "> > > > > >> >> linux-kernel@vger.kernel.org; buytenh@wantstofly.org; Olof Johansson; John Linn; linux-\n" "> > arm-\n" - "> > > > > >> >> kernel at lists.infradead.org\n" + "> > > > > >> >> kernel@lists.infradead.org\n" "> > > > > >> >> Subject: [PATCH v2 4/6] arm/dt: probe for platforms via the device tree\n" "> > > > > >> >>\n" "> > > > > >> >> If a dtb is passed to the kernel then the kernel needs to iterate\n" @@ -172,45 +181,45 @@ "> > > > > >> >> This patch creates a new function, setup_machine_fdt() which is\n" "> > > > > >> >> analogous to the setup_machine_atags() created in the previous patch.\n" "> > > > > >> >> It does all the early setup needed to use a device tree machine\n" - "> > > > > >> >> description. ?It also creates arm_unflatten_device_tree() which copies\n" + "> > > > > >> >> description. \302\240It also creates arm_unflatten_device_tree() which copies\n" "> > > > > >> >> the dtb into an allocated buffer and unflattens it into the live-tree\n" "> > > > > >> >> representation.\n" "> > > > > >> >>\n" "> > > > > >> >> v2: Changed to save the dtb by copying into an allocated buffer.\n" - "> > > > > >> >> ? ? - Since the dtb will very likely be passed in the first 16k of ram\n" - "> > > > > >> >> ? ? ? where the interrupt vectors live, memblock_reserve() is\n" - "> > > > > >> >> ? ? ? insufficient to protect the dtb data.\n" + "> > > > > >> >> \302\240 \302\240 - Since the dtb will very likely be passed in the first 16k of ram\n" + "> > > > > >> >> \302\240 \302\240 \302\240 where the interrupt vectors live, memblock_reserve() is\n" + "> > > > > >> >> \302\240 \302\240 \302\240 insufficient to protect the dtb data.\n" "> > > > > >> >> [based on work originally written by Jeremy Kerr <jeremy.kerr@canonical.com>]\n" "> > > > > >> >> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>\n" "> > > > > >> >> ---\n" - "> > > > > >> >> ?arch/arm/include/asm/mach/arch.h | ? ?2 +\n" - "> > > > > >> >> ?arch/arm/include/asm/prom.h ? ? ?| ? 11 +++++\n" - "> > > > > >> >> ?arch/arm/include/asm/setup.h ? ? | ? ?1\n" - "> > > > > >> >> ?arch/arm/kernel/devtree.c ? ? ? ?| ? 87 ++++++++++++++++++++++++++++++++++++++\n" - "> > > > > >> >> ?arch/arm/kernel/setup.c ? ? ? ? ?| ? 10 +++-\n" - "> > > > > >> >> ?arch/arm/mm/init.c ? ? ? ? ? ? ? | ? ?8 +++\n" - "> > > > > >> >> ?6 files changed, 117 insertions(+), 2 deletions(-)\n" + "> > > > > >> >> \302\240arch/arm/include/asm/mach/arch.h | \302\240 \302\2402 +\n" + "> > > > > >> >> \302\240arch/arm/include/asm/prom.h \302\240 \302\240 \302\240| \302\240 11 +++++\n" + "> > > > > >> >> \302\240arch/arm/include/asm/setup.h \302\240 \302\240 | \302\240 \302\2401\n" + "> > > > > >> >> \302\240arch/arm/kernel/devtree.c \302\240 \302\240 \302\240 \302\240| \302\240 87 ++++++++++++++++++++++++++++++++++++++\n" + "> > > > > >> >> \302\240arch/arm/kernel/setup.c \302\240 \302\240 \302\240 \302\240 \302\240| \302\240 10 +++-\n" + "> > > > > >> >> \302\240arch/arm/mm/init.c \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 | \302\240 \302\2408 +++\n" + "> > > > > >> >> \302\2406 files changed, 117 insertions(+), 2 deletions(-)\n" "> > > > > >> >>\n" "> > > > > >> >> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h\n" "> > > > > >> >> index 3a0893a..2ed24e7 100644\n" "> > > > > >> >> --- a/arch/arm/include/asm/mach/arch.h\n" "> > > > > >> >> +++ b/arch/arm/include/asm/mach/arch.h\n" "> > > > > >> >> @@ -22,6 +22,8 @@ struct machine_desc {\n" - "> > > > > >> >> ? ? ? unsigned int ? ? ? ? ? ?nr; ? ? ? ? ? ? /* architecture number ?*/\n" - "> > > > > >> >> ? ? ? const char ? ? ? ? ? ? ?*name; ? ? ? ? ?/* architecture name ? ?*/\n" - "> > > > > >> >> ? ? ? unsigned long ? ? ? ? ? boot_params; ? ?/* tagged list ? ? ? ? ?*/\n" - "> > > > > >> >> + ? ? const char ? ? ? ? ? ? ?**dt_compat; ? ?/* array of device tree\n" - "> > > > > >> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* 'compatible' strings */\n" + "> > > > > >> >> \302\240 \302\240 \302\240 unsigned int \302\240 \302\240 \302\240 \302\240 \302\240 \302\240nr; \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 /* architecture number \302\240*/\n" + "> > > > > >> >> \302\240 \302\240 \302\240 const char \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240*name; \302\240 \302\240 \302\240 \302\240 \302\240/* architecture name \302\240 \302\240*/\n" + "> > > > > >> >> \302\240 \302\240 \302\240 unsigned long \302\240 \302\240 \302\240 \302\240 \302\240 boot_params; \302\240 \302\240/* tagged list \302\240 \302\240 \302\240 \302\240 \302\240*/\n" + "> > > > > >> >> + \302\240 \302\240 const char \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240**dt_compat; \302\240 \302\240/* array of device tree\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240* 'compatible' strings */\n" "> > > > > >> >>\n" - "> > > > > >> >> ? ? ? unsigned int ? ? ? ? ? ?nr_irqs; ? ? ? ?/* number of IRQs */\n" + "> > > > > >> >> \302\240 \302\240 \302\240 unsigned int \302\240 \302\240 \302\240 \302\240 \302\240 \302\240nr_irqs; \302\240 \302\240 \302\240 \302\240/* number of IRQs */\n" "> > > > > >> >>\n" "> > > > > >> >> diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h\n" "> > > > > >> >> index 8f1037f..6ba62a8 100644\n" "> > > > > >> >> --- a/arch/arm/include/asm/prom.h\n" "> > > > > >> >> +++ b/arch/arm/include/asm/prom.h\n" "> > > > > >> >> @@ -21,5 +21,16 @@ static inline void irq_dispose_mapping(unsigned int virq)\n" - "> > > > > >> >> ? ? ? return;\n" - "> > > > > >> >> ?}\n" + "> > > > > >> >> \302\240 \302\240 \302\240 return;\n" + "> > > > > >> >> \302\240}\n" "> > > > > >> >>\n" "> > > > > >> >> +extern void arm_unflatten_device_tree(void);\n" "> > > > > >> >> +extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);\n" @@ -220,22 +229,22 @@ "> > > > > >> >> +static void arm_unflatten_device_tree(void) { }\n" "> > > > > >> >> +static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys)\n" "> > > > > >> >> +{\n" - "> > > > > >> >> + ? ? return NULL;\n" + "> > > > > >> >> + \302\240 \302\240 return NULL;\n" "> > > > > >> >> +}\n" "> > > > > >> >> +\n" - "> > > > > >> >> ?#endif /* CONFIG_OF */\n" - "> > > > > >> >> ?#endif /* ASMARM_PROM_H */\n" + "> > > > > >> >> \302\240#endif /* CONFIG_OF */\n" + "> > > > > >> >> \302\240#endif /* ASMARM_PROM_H */\n" "> > > > > >> >> diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h\n" "> > > > > >> >> index 06c4d0e..1cec82a 100644\n" "> > > > > >> >> --- a/arch/arm/include/asm/setup.h\n" "> > > > > >> >> +++ b/arch/arm/include/asm/setup.h\n" "> > > > > >> >> @@ -222,6 +222,7 @@ extern struct meminfo meminfo;\n" - "> > > > > >> >> ?#define bank_phys_size(bank) (bank)->size\n" + "> > > > > >> >> \302\240#define bank_phys_size(bank) (bank)->size\n" "> > > > > >> >>\n" - "> > > > > >> >> ?extern int arm_add_memory(unsigned long start, unsigned long size);\n" + "> > > > > >> >> \302\240extern int arm_add_memory(unsigned long start, unsigned long size);\n" "> > > > > >> >> +extern char cmd_line[COMMAND_LINE_SIZE];\n" "> > > > > >> >>\n" - "> > > > > >> >> ?#endif ?/* ?__KERNEL__ ?*/\n" + "> > > > > >> >> \302\240#endif \302\240/* \302\240__KERNEL__ \302\240*/\n" "> > > > > >> >>\n" "> > > > > >> >> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c\n" "> > > > > >> >> index ac48da2..07b75bb 100644\n" @@ -243,16 +252,16 @@ "> > > > > >> >> +++ b/arch/arm/kernel/devtree.c\n" "> > > > > >> >> @@ -21,6 +21,7 @@\n" "> > > > > >> >>\n" - "> > > > > >> >> ?#include <asm/setup.h>\n" - "> > > > > >> >> ?#include <asm/page.h>\n" + "> > > > > >> >> \302\240#include <asm/setup.h>\n" + "> > > > > >> >> \302\240#include <asm/page.h>\n" "> > > > > >> >> +#include <asm/mach/arch.h>\n" "> > > > > >> >>\n" - "> > > > > >> >> ?void __init early_init_dt_add_memory_arch(u64 base, u64 size)\n" - "> > > > > >> >> ?{\n" + "> > > > > >> >> \302\240void __init early_init_dt_add_memory_arch(u64 base, u64 size)\n" + "> > > > > >> >> \302\240{\n" "> > > > > >> >> @@ -45,3 +46,89 @@ unsigned int irq_create_of_mapping(struct device_node *controller,\n" - "> > > > > >> >> ? ? ? return intspec[0];\n" - "> > > > > >> >> ?}\n" - "> > > > > >> >> ?EXPORT_SYMBOL_GPL(irq_create_of_mapping);\n" + "> > > > > >> >> \302\240 \302\240 \302\240 return intspec[0];\n" + "> > > > > >> >> \302\240}\n" + "> > > > > >> >> \302\240EXPORT_SYMBOL_GPL(irq_create_of_mapping);\n" "> > > > > >> >> +\n" "> > > > > >> >> +extern struct machine_desc __arch_info_begin, __arch_info_end;\n" "> > > > > >> >> +\n" @@ -265,25 +274,25 @@ "> > > > > >> >> + */\n" "> > > > > >> >> +void __init arm_unflatten_device_tree(void)\n" "> > > > > >> >> +{\n" - "> > > > > >> >> + ? ? struct boot_param_header *devtree;\n" - "> > > > > >> >> + ? ? u32 dtb_size;\n" + "> > > > > >> >> + \302\240 \302\240 struct boot_param_header *devtree;\n" + "> > > > > >> >> + \302\240 \302\240 u32 dtb_size;\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? if (!initial_boot_params)\n" - "> > > > > >> >> + ? ? ? ? ? ? return;\n" + "> > > > > >> >> + \302\240 \302\240 if (!initial_boot_params)\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 return;\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? /* Save the dtb to an allocated buffer */\n" - "> > > > > >> >> + ? ? dtb_size = be32_to_cpu(initial_boot_params->totalsize);\n" - "> > > > > >> >> + ? ? devtree = early_init_dt_alloc_memory_arch(dtb_size, SZ_4K);\n" - "> > > > > >> >> + ? ? if (!devtree) {\n" - "> > > > > >> >> + ? ? ? ? ? ? printk(\"Unable to allocate memory for device tree\\n\");\n" - "> > > > > >> >> + ? ? ? ? ? ? while(1);\n" - "> > > > > >> >> + ? ? }\n" - "> > > > > >> >> + ? ? pr_info(\"relocating device tree from 0x%p to 0x%p, length 0x%x\\n\",\n" - "> > > > > >> >> + ? ? ? ? ? ? initial_boot_params, devtree, dtb_size);\n" - "> > > > > >> >> + ? ? memmove(devtree, initial_boot_params, dtb_size);\n" - "> > > > > >> >> + ? ? initial_boot_params = devtree;\n" + "> > > > > >> >> + \302\240 \302\240 /* Save the dtb to an allocated buffer */\n" + "> > > > > >> >> + \302\240 \302\240 dtb_size = be32_to_cpu(initial_boot_params->totalsize);\n" + "> > > > > >> >> + \302\240 \302\240 devtree = early_init_dt_alloc_memory_arch(dtb_size, SZ_4K);\n" + "> > > > > >> >> + \302\240 \302\240 if (!devtree) {\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 printk(\"Unable to allocate memory for device tree\\n\");\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 while(1);\n" + "> > > > > >> >> + \302\240 \302\240 }\n" + "> > > > > >> >> + \302\240 \302\240 pr_info(\"relocating device tree from 0x%p to 0x%p, length 0x%x\\n\",\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 initial_boot_params, devtree, dtb_size);\n" + "> > > > > >> >> + \302\240 \302\240 memmove(devtree, initial_boot_params, dtb_size);\n" + "> > > > > >> >> + \302\240 \302\240 initial_boot_params = devtree;\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? unflatten_device_tree();\n" + "> > > > > >> >> + \302\240 \302\240 unflatten_device_tree();\n" "> > > > > >> >> +}\n" "> > > > > >> >> +\n" "> > > > > >> >> +/**\n" @@ -295,118 +304,118 @@ "> > > > > >> >> + */\n" "> > > > > >> >> +struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)\n" "> > > > > >> >> +{\n" - "> > > > > >> >> + ? ? struct boot_param_header *devtree = phys_to_virt(dt_phys);\n" - "> > > > > >> >> + ? ? struct machine_desc *mdesc, *mdesc_best = NULL;\n" - "> > > > > >> >> + ? ? unsigned int score, mdesc_score = ~1;\n" - "> > > > > >> >> + ? ? unsigned long dt_root;\n" - "> > > > > >> >> + ? ? const char *model;\n" + "> > > > > >> >> + \302\240 \302\240 struct boot_param_header *devtree = phys_to_virt(dt_phys);\n" + "> > > > > >> >> + \302\240 \302\240 struct machine_desc *mdesc, *mdesc_best = NULL;\n" + "> > > > > >> >> + \302\240 \302\240 unsigned int score, mdesc_score = ~1;\n" + "> > > > > >> >> + \302\240 \302\240 unsigned long dt_root;\n" + "> > > > > >> >> + \302\240 \302\240 const char *model;\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? /* check device tree validity */\n" - "> > > > > >> >> + ? ? if (!dt_phys || be32_to_cpu(devtree->magic) != OF_DT_HEADER)\n" - "> > > > > >> >> + ? ? ? ? ? ? return NULL;\n" + "> > > > > >> >> + \302\240 \302\240 /* check device tree validity */\n" + "> > > > > >> >> + \302\240 \302\240 if (!dt_phys || be32_to_cpu(devtree->magic) != OF_DT_HEADER)\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 return NULL;\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? /* Search the mdescs for the 'best' compatible value match */\n" - "> > > > > >> >> + ? ? initial_boot_params = devtree;\n" + "> > > > > >> >> + \302\240 \302\240 /* Search the mdescs for the 'best' compatible value match */\n" + "> > > > > >> >> + \302\240 \302\240 initial_boot_params = devtree;\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? dt_root = of_get_flat_dt_root();\n" - "> > > > > >> >> + ? ? for (mdesc = &__arch_info_begin; mdesc < &__arch_info_end; mdesc++) {\n" - "> > > > > >> >> + ? ? ? ? ? ? score = of_flat_dt_match(dt_root, mdesc->dt_compat);\n" - "> > > > > >> >> + ? ? ? ? ? ? if (score > 0 && score < mdesc_score) {\n" - "> > > > > >> >> + ? ? ? ? ? ? ? ? ? ? mdesc_best = mdesc;\n" - "> > > > > >> >> + ? ? ? ? ? ? ? ? ? ? mdesc_score = score;\n" - "> > > > > >> >> + ? ? ? ? ? ? }\n" - "> > > > > >> >> + ? ? }\n" - "> > > > > >> >> + ? ? if (!mdesc_best) {\n" - "> > > > > >> >> + ? ? ? ? ? ? printk(\"Machine not supported, unable to continue.\\n\");\n" - "> > > > > >> >> + ? ? ? ? ? ? while (1);\n" - "> > > > > >> >> + ? ? }\n" + "> > > > > >> >> + \302\240 \302\240 dt_root = of_get_flat_dt_root();\n" + "> > > > > >> >> + \302\240 \302\240 for (mdesc = &__arch_info_begin; mdesc < &__arch_info_end; mdesc++) {\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 score = of_flat_dt_match(dt_root, mdesc->dt_compat);\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (score > 0 && score < mdesc_score) {\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 mdesc_best = mdesc;\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 mdesc_score = score;\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 }\n" + "> > > > > >> >> + \302\240 \302\240 }\n" + "> > > > > >> >> + \302\240 \302\240 if (!mdesc_best) {\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 printk(\"Machine not supported, unable to continue.\\n\");\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 while (1);\n" + "> > > > > >> >> + \302\240 \302\240 }\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? model = of_get_flat_dt_prop(dt_root, \"model\", NULL);\n" - "> > > > > >> >> + ? ? if (!model)\n" - "> > > > > >> >> + ? ? ? ? ? ? model = of_get_flat_dt_prop(dt_root, \"compatible\", NULL);\n" - "> > > > > >> >> + ? ? if (!model)\n" - "> > > > > >> >> + ? ? ? ? ? ? model = \"<unknown>\";\n" - "> > > > > >> >> + ? ? pr_info(\"Machine: %s, model: %s\\n\", mdesc_best->name, model);\n" + "> > > > > >> >> + \302\240 \302\240 model = of_get_flat_dt_prop(dt_root, \"model\", NULL);\n" + "> > > > > >> >> + \302\240 \302\240 if (!model)\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 model = of_get_flat_dt_prop(dt_root, \"compatible\", NULL);\n" + "> > > > > >> >> + \302\240 \302\240 if (!model)\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 model = \"<unknown>\";\n" + "> > > > > >> >> + \302\240 \302\240 pr_info(\"Machine: %s, model: %s\\n\", mdesc_best->name, model);\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? /* Retrieve various information from the /chosen node */\n" - "> > > > > >> >> + ? ? of_scan_flat_dt(early_init_dt_scan_chosen, NULL);\n" - "> > > > > >> >> + ? ? /* Initialize {size,address}-cells info */\n" - "> > > > > >> >> + ? ? of_scan_flat_dt(early_init_dt_scan_root, NULL);\n" - "> > > > > >> >> + ? ? /* Setup memory, calling early_init_dt_add_memory_arch */\n" - "> > > > > >> >> + ? ? of_scan_flat_dt(early_init_dt_scan_memory, NULL);\n" - "> > > > > >> >> + ? ? /* Save command line for /proc/cmdline ?*/\n" - "> > > > > >> >> + ? ? strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);\n" + "> > > > > >> >> + \302\240 \302\240 /* Retrieve various information from the /chosen node */\n" + "> > > > > >> >> + \302\240 \302\240 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);\n" + "> > > > > >> >> + \302\240 \302\240 /* Initialize {size,address}-cells info */\n" + "> > > > > >> >> + \302\240 \302\240 of_scan_flat_dt(early_init_dt_scan_root, NULL);\n" + "> > > > > >> >> + \302\240 \302\240 /* Setup memory, calling early_init_dt_add_memory_arch */\n" + "> > > > > >> >> + \302\240 \302\240 of_scan_flat_dt(early_init_dt_scan_memory, NULL);\n" + "> > > > > >> >> + \302\240 \302\240 /* Save command line for /proc/cmdline \302\240*/\n" + "> > > > > >> >> + \302\240 \302\240 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);\n" "> > > > > >> >> +\n" - "> > > > > >> >> + ? ? return mdesc_best;\n" + "> > > > > >> >> + \302\240 \302\240 return mdesc_best;\n" "> > > > > >> >> +}\n" "> > > > > >> >> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c\n" "> > > > > >> >> index cbc1836..68e0204 100644\n" "> > > > > >> >> --- a/arch/arm/kernel/setup.c\n" "> > > > > >> >> +++ b/arch/arm/kernel/setup.c\n" "> > > > > >> >> @@ -20,6 +20,7 @@\n" - "> > > > > >> >> ?#include <linux/screen_info.h>\n" - "> > > > > >> >> ?#include <linux/init.h>\n" - "> > > > > >> >> ?#include <linux/kexec.h>\n" + "> > > > > >> >> \302\240#include <linux/screen_info.h>\n" + "> > > > > >> >> \302\240#include <linux/init.h>\n" + "> > > > > >> >> \302\240#include <linux/kexec.h>\n" "> > > > > >> >> +#include <linux/of_fdt.h>\n" - "> > > > > >> >> ?#include <linux/crash_dump.h>\n" - "> > > > > >> >> ?#include <linux/root_dev.h>\n" - "> > > > > >> >> ?#include <linux/cpu.h>\n" + "> > > > > >> >> \302\240#include <linux/crash_dump.h>\n" + "> > > > > >> >> \302\240#include <linux/root_dev.h>\n" + "> > > > > >> >> \302\240#include <linux/cpu.h>\n" "> > > > > >> >> @@ -42,6 +43,7 @@\n" - "> > > > > >> >> ?#include <asm/cachetype.h>\n" - "> > > > > >> >> ?#include <asm/tlbflush.h>\n" + "> > > > > >> >> \302\240#include <asm/cachetype.h>\n" + "> > > > > >> >> \302\240#include <asm/tlbflush.h>\n" "> > > > > >> >>\n" "> > > > > >> >> +#include <asm/prom.h>\n" - "> > > > > >> >> ?#include <asm/mach/arch.h>\n" - "> > > > > >> >> ?#include <asm/mach/irq.h>\n" - "> > > > > >> >> ?#include <asm/mach/time.h>\n" + "> > > > > >> >> \302\240#include <asm/mach/arch.h>\n" + "> > > > > >> >> \302\240#include <asm/mach/irq.h>\n" + "> > > > > >> >> \302\240#include <asm/mach/time.h>\n" "> > > > > >> >> @@ -125,7 +127,7 @@ EXPORT_SYMBOL(elf_platform);\n" "> > > > > >> >>\n" - "> > > > > >> >> ?static const char *cpu_name;\n" - "> > > > > >> >> ?static const char *machine_name;\n" + "> > > > > >> >> \302\240static const char *cpu_name;\n" + "> > > > > >> >> \302\240static const char *machine_name;\n" "> > > > > >> >> -static char __initdata cmd_line[COMMAND_LINE_SIZE];\n" "> > > > > >> >> +char cmd_line[COMMAND_LINE_SIZE];\n" - "> > > > > >> >> ?struct machine_desc *machine_desc __initdata;\n" + "> > > > > >> >> \302\240struct machine_desc *machine_desc __initdata;\n" "> > > > > >> >>\n" - "> > > > > >> >> ?static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;\n" + "> > > > > >> >> \302\240static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;\n" "> > > > > >> >> @@ -838,7 +840,9 @@ void __init setup_arch(char **cmdline_p)\n" - "> > > > > >> >> ? ? ? unwind_init();\n" + "> > > > > >> >> \302\240 \302\240 \302\240 unwind_init();\n" "> > > > > >> >>\n" - "> > > > > >> >> ? ? ? setup_processor();\n" - "> > > > > >> >> - ? ? mdesc = setup_machine_tags(machine_arch_type);\n" - "> > > > > >> >> + ? ? mdesc = setup_machine_fdt(__atags_pointer);\n" - "> > > > > >> >> + ? ? if (!mdesc)\n" - "> > > > > >> >> + ? ? ? ? ? ? mdesc = setup_machine_tags(machine_arch_type);\n" - "> > > > > >> >> ? ? ? machine_desc = mdesc;\n" - "> > > > > >> >> ? ? ? machine_name = mdesc->name;\n" + "> > > > > >> >> \302\240 \302\240 \302\240 setup_processor();\n" + "> > > > > >> >> - \302\240 \302\240 mdesc = setup_machine_tags(machine_arch_type);\n" + "> > > > > >> >> + \302\240 \302\240 mdesc = setup_machine_fdt(__atags_pointer);\n" + "> > > > > >> >> + \302\240 \302\240 if (!mdesc)\n" + "> > > > > >> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 mdesc = setup_machine_tags(machine_arch_type);\n" + "> > > > > >> >> \302\240 \302\240 \302\240 machine_desc = mdesc;\n" + "> > > > > >> >> \302\240 \302\240 \302\240 machine_name = mdesc->name;\n" "> > > > > >> >>\n" "> > > > > >> >> @@ -859,6 +863,8 @@ void __init setup_arch(char **cmdline_p)\n" - "> > > > > >> >> ? ? ? paging_init(mdesc);\n" - "> > > > > >> >> ? ? ? request_standard_resources(mdesc);\n" + "> > > > > >> >> \302\240 \302\240 \302\240 paging_init(mdesc);\n" + "> > > > > >> >> \302\240 \302\240 \302\240 request_standard_resources(mdesc);\n" "> > > > > >> >>\n" - "> > > > > >> >> + ? ? arm_unflatten_device_tree();\n" + "> > > > > >> >> + \302\240 \302\240 arm_unflatten_device_tree();\n" "> > > > > >> >> +\n" - "> > > > > >> >> ?#ifdef CONFIG_SMP\n" - "> > > > > >> >> ? ? ? if (is_smp())\n" - "> > > > > >> >> ? ? ? ? ? ? ? smp_init_cpus();\n" + "> > > > > >> >> \302\240#ifdef CONFIG_SMP\n" + "> > > > > >> >> \302\240 \302\240 \302\240 if (is_smp())\n" + "> > > > > >> >> \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 smp_init_cpus();\n" "> > > > > >> >> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c\n" "> > > > > >> >> index 5164069..62ff2e8 100644\n" "> > > > > >> >> --- a/arch/arm/mm/init.c\n" "> > > > > >> >> +++ b/arch/arm/mm/init.c\n" "> > > > > >> >> @@ -71,6 +71,14 @@ static int __init parse_tag_initrd2(const struct tag *tag)\n" "> > > > > >> >>\n" - "> > > > > >> >> ?__tagtable(ATAG_INITRD2, parse_tag_initrd2);\n" + "> > > > > >> >> \302\240__tagtable(ATAG_INITRD2, parse_tag_initrd2);\n" "> > > > > >> >>\n" "> > > > > >> >> +#ifdef CONFIG_OF_FLATTREE\n" "> > > > > >> >> +void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end)\n" "> > > > > >> >> +{\n" - "> > > > > >> >> + ? ? phys_initrd_start = start;\n" - "> > > > > >> >> + ? ? phys_initrd_size = end - start + 1;\n" + "> > > > > >> >> + \302\240 \302\240 phys_initrd_start = start;\n" + "> > > > > >> >> + \302\240 \302\240 phys_initrd_size = end - start + 1;\n" "> > > > > >> >> +}\n" "> > > > > >> >> +#endif /* CONFIG_OF_FLATTREE */\n" "> > > > > >> >> +\n" - "> > > > > >> >> ?/*\n" - "> > > > > >> >> ? * This keeps memory configuration data used by a couple memory\n" - "> > > > > >> >> ? * initialization functions, as well as show_mem() for the skipping\n" + "> > > > > >> >> \302\240/*\n" + "> > > > > >> >> \302\240 * This keeps memory configuration data used by a couple memory\n" + "> > > > > >> >> \302\240 * initialization functions, as well as show_mem() for the skipping\n" "> > > > > >> >>\n" "> > > > > >> >\n" "> > > > > >> >\n" @@ -443,4 +452,4 @@ "> \n" > -3b648424a3ed17c270478a9fd7dc34d17d533ffdf6405912520e0677993ca704 +75e09deecf5ba5e5b6abd58de208b54668987ebe96629a38625723ffb0edf7f5
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.