From 3104021c12747df63843fedf3ceb6a54410e2c18 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 26 Aug 2013 11:24:11 -0500 Subject: xtensa: use unflatten_and_copy_device_tree Use the common unflatten_and_copy_device_tree to copy the built-in FDT out of init section. Signed-off-by: Rob Herring Cc: Chris Zankel Acked-by: Max Filippov Cc: linux-xtensa@linux-xtensa.org Acked-by: Grant Likely --- arch/xtensa/kernel/setup.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'arch/xtensa') diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 946fb8d..fc31ec1 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -21,11 +21,8 @@ #include #include #include - -#ifdef CONFIG_OF #include #include -#endif #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) # include @@ -252,17 +249,6 @@ void __init early_init_devtree(void *params) of_scan_flat_dt(early_init_dt_scan_memory, NULL); } -static void __init copy_devtree(void) -{ - void *alloc = early_init_dt_alloc_memory_arch( - be32_to_cpu(initial_boot_params->totalsize), 8); - if (alloc) { - memcpy(alloc, initial_boot_params, - be32_to_cpu(initial_boot_params->totalsize)); - initial_boot_params = alloc; - } -} - static int __init xtensa_device_probe(void) { of_platform_populate(NULL, NULL, NULL, NULL); @@ -525,10 +511,7 @@ void __init setup_arch(char **cmdline_p) bootmem_init(); -#ifdef CONFIG_OF - copy_devtree(); - unflatten_device_tree(); -#endif + unflatten_and_copy_device_tree(); platform_setup(cmdline_p); -- cgit v1.1 From 7745fc1fec6ec9556e4cc36c21b0e02589078902 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 28 Aug 2013 10:05:10 -0500 Subject: xtensa: use early_init_dt_scan Convert xtensa to use new early_init_dt_scan function. Signed-off-by: Rob Herring Acked-by: Max Filippov Cc: Chris Zankel Cc: linux-xtensa@linux-xtensa.org --- arch/xtensa/kernel/setup.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'arch/xtensa') diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index fc31ec1..65974a8 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -219,9 +219,13 @@ static int __init parse_bootparam(const bp_tag_t* tag) } #ifdef CONFIG_OF +bool __initdata dt_memory_scan = false; void __init early_init_dt_add_memory_arch(u64 base, u64 size) { + if (!dt_memory_scan) + return; + size &= PAGE_MASK; add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); } @@ -233,20 +237,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) void __init early_init_devtree(void *params) { - /* Setup flat device-tree pointer */ - initial_boot_params = params; + if (sysmem.nr_banks == 0) + dt_memory_scan = true; - /* Retrieve various informations from the /chosen node of the - * device-tree, including the platform type, initrd location and - * size, TCE reserve, and more ... - */ - if (!command_line[0]) - of_scan_flat_dt(early_init_dt_scan_chosen, command_line); + early_init_dt_scan(params); - /* Scan memory nodes and rebuild MEMBLOCKs */ - of_scan_flat_dt(early_init_dt_scan_root, NULL); - if (sysmem.nr_banks == 0) - of_scan_flat_dt(early_init_dt_scan_memory, NULL); + if (!command_line[0]) + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); } static int __init xtensa_device_probe(void) -- cgit v1.1 From 29eb45a9ab4839a1e9cef2bcf369b918c9c4fcad Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 30 Aug 2013 17:06:53 -0500 Subject: of: remove early_init_dt_setup_initrd_arch All arches do essentially the same thing now for early_init_dt_setup_initrd_arch, so it can now be removed. Signed-off-by: Rob Herring Acked-by: Vineet Gupta Cc: Russell King Cc: Mark Salter Cc: Aurelien Jacquiot Cc: James Hogan Cc: Michal Simek Cc: Ralf Baechle Cc: Jonas Bonn Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Chris Zankel Cc: Max Filippov Acked-by: Grant Likely --- arch/xtensa/kernel/setup.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'arch/xtensa') diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 65974a8..6e2b663 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -61,8 +61,8 @@ extern struct rtc_ops no_rtc_ops; struct rtc_ops *rtc_ops; #ifdef CONFIG_BLK_DEV_INITRD -extern void *initrd_start; -extern void *initrd_end; +extern unsigned long initrd_start; +extern unsigned long initrd_end; int initrd_is_mapped = 0; extern int initrd_below_start_ok; #endif @@ -149,8 +149,8 @@ static int __init parse_tag_initrd(const bp_tag_t* tag) { meminfo_t* mi; mi = (meminfo_t*)(tag->data); - initrd_start = __va(mi->start); - initrd_end = __va(mi->end); + initrd_start = (unsigned long)__va(mi->start); + initrd_end = (unsigned long)__va(mi->end); return 0; } @@ -167,13 +167,6 @@ static int __init parse_tag_fdt(const bp_tag_t *tag) __tagtable(BP_TAG_FDT, parse_tag_fdt); -void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) -{ - initrd_start = (void *)__va(start); - initrd_end = (void *)__va(end); - initrd_below_start_ok = 1; -} - #endif /* CONFIG_OF */ #endif /* CONFIG_BLK_DEV_INITRD */ -- cgit v1.1 From 32df8dca503f82c816f8be85a8d0a394a8b88c2c Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sat, 7 Sep 2013 14:11:58 -0500 Subject: of: remove HAVE_ARCH_DEVTREE_FIXUPS HAVE_ARCH_DEVTREE_FIXUPS appears to always be needed except for sparc, but it is only used for /proc/device-teee and sparc does not enable /proc/device-tree. So this option is redundant. Remove the option and always enable it. This has the side effect of fixing /proc/device-tree on arches such as arm64 which failed to define this option. Signed-off-by: Rob Herring Acked-by: Vineet Gupta Acked-by: Grant Likely Cc: Russell King Cc: James Hogan Cc: Michal Simek Cc: Jonas Bonn Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Chris Zankel Cc: Max Filippov --- arch/xtensa/include/asm/prom.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/xtensa') diff --git a/arch/xtensa/include/asm/prom.h b/arch/xtensa/include/asm/prom.h index f3d7cd2..2a87a58 100644 --- a/arch/xtensa/include/asm/prom.h +++ b/arch/xtensa/include/asm/prom.h @@ -1,6 +1,4 @@ #ifndef _XTENSA_ASM_PROM_H #define _XTENSA_ASM_PROM_H -#define HAVE_ARCH_DEVTREE_FIXUPS - #endif /* _XTENSA_ASM_PROM_H */ -- cgit v1.1 From 5116b1defad7cec648384c2d1bc0b7460d305c93 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sat, 7 Sep 2013 14:33:54 -0500 Subject: of: remove empty arch prom.h headers Now that prom.h is optional, all the empty prom.h headers can be removed. Signed-off-by: Rob Herring Acked-by: Vineet Gupta Acked-by: Catalin Marinas Acked-by: Grant Likely Cc: Will Deacon Cc: Mark Salter Cc: Aurelien Jacquiot Cc: James Hogan Cc: Jonas Bonn Cc: Chris Zankel Cc: Max Filippov --- arch/xtensa/include/asm/prom.h | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 arch/xtensa/include/asm/prom.h (limited to 'arch/xtensa') diff --git a/arch/xtensa/include/asm/prom.h b/arch/xtensa/include/asm/prom.h deleted file mode 100644 index 2a87a58..0000000 --- a/arch/xtensa/include/asm/prom.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _XTENSA_ASM_PROM_H -#define _XTENSA_ASM_PROM_H - -#endif /* _XTENSA_ASM_PROM_H */ -- cgit v1.1