From 10fbdaab3f51359c5377495b1ab0698bb8e64df9 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 2 Apr 2014 17:50:19 -0500 Subject: mips: lantiq: copy built-in DTB out of init section The existing code is buggy because built-in DTBs are in init memory. Fix this by using the unflatten_and_copy_device_tree function. This removes all accesses to FDT header data by the arch code. Signed-off-by: Rob Herring Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Tested-by: Grant Likely --- arch/mips/lantiq/prom.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'arch/mips/lantiq') diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c index 19686c5..cdea687 100644 --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c @@ -76,18 +76,7 @@ void __init plat_mem_setup(void) void __init device_tree_init(void) { - unsigned long base, size; - - if (!initial_boot_params) - return; - - base = virt_to_phys((void *)initial_boot_params); - size = be32_to_cpu(initial_boot_params->totalsize); - - /* Before we do anything, lets reserve the dt blob */ - reserve_bootmem(base, size, BOOTMEM_DEFAULT); - - unflatten_device_tree(); + unflatten_and_copy_device_tree(); } void __init prom_init(void) -- cgit v1.1 From 0cdde839265d5f258b36b871b083324f62c1fbb9 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 31 Mar 2014 15:13:07 -0500 Subject: mips: convert fdt pointers to opaque pointers The architecture code does not need to access the internals of the FDT blob directly, so make the pointers to it void * and use char arrays for section variables. Signed-off-by: Rob Herring Cc: Ralf Baechle Tested-by: Grant Likely --- arch/mips/lantiq/prom.c | 2 +- arch/mips/lantiq/prom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/mips/lantiq') diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c index cdea687..7447d32 100644 --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c @@ -71,7 +71,7 @@ void __init plat_mem_setup(void) * Load the builtin devicetree. This causes the chosen node to be * parsed resulting in our memory appearing */ - __dt_setup_arch(&__dtb_start); + __dt_setup_arch(__dtb_start); } void __init device_tree_init(void) diff --git a/arch/mips/lantiq/prom.h b/arch/mips/lantiq/prom.h index 8e07b5f..69a4c58 100644 --- a/arch/mips/lantiq/prom.h +++ b/arch/mips/lantiq/prom.h @@ -26,6 +26,6 @@ struct ltq_soc_info { extern void ltq_soc_detect(struct ltq_soc_info *i); extern void ltq_soc_init(void); -extern struct boot_param_header __dtb_start; +extern char __dtb_start[]; #endif -- cgit v1.1 From ccf3356e6b3d2802ea452c0091314605a9e7b7a0 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Thu, 3 Apr 2014 13:38:32 -0500 Subject: of/fdt: consolidate built-in dtb section variables Unify the various architectures __dtb_start and __dtb_end definitions moving them into of_fdt.h. Signed-off-by: Rob Herring Acked-by: Vineet Gupta Acked-by: James Hogan Tested-by: Michal Simek Cc: Ralf Baechle Cc: Jonas Bonn Cc: Chris Zankel Cc: Max Filippov Cc: linux-metag@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux@lists.openrisc.net Cc: linux-xtensa@linux-xtensa.org Tested-by: Grant Likely Tested-by: Stephen Chivers --- arch/mips/lantiq/prom.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/mips/lantiq') diff --git a/arch/mips/lantiq/prom.h b/arch/mips/lantiq/prom.h index 69a4c58..bfd2d58 100644 --- a/arch/mips/lantiq/prom.h +++ b/arch/mips/lantiq/prom.h @@ -26,6 +26,4 @@ struct ltq_soc_info { extern void ltq_soc_detect(struct ltq_soc_info *i); extern void ltq_soc_init(void); -extern char __dtb_start[]; - #endif -- cgit v1.1