Thread (41 messages) 41 messages, 6 authors, 2013-11-08

[PATCH v2 07/29] xtensa: use unflatten_and_copy_device_tree

flat view
STALE4724d REVIEWED: 4 (3M)

From: Rob Herring <hidden>
Date: 2013-10-07 16:34:52
Also in: lkml
Subsystem: tensilica xtensa port (xtensa), the rest · Maintainers: Chris Zankel, Max Filippov, Linus Torvalds

Revision v2 of 2 in this series; 2 review trailers (1 from subsystem maintainers).

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current
From: Rob Herring <redacted>

Use the common unflatten_and_copy_device_tree to copy the built-in FDT
out of init section.

Signed-off-by: Rob Herring <redacted>
Cc: Chris Zankel <chris@zankel.net>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-xtensa@linux-xtensa.org
Acked-by: Grant Likely <redacted>
---
 arch/xtensa/kernel/setup.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
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 <linux/screen_info.h>
 #include <linux/bootmem.h>
 #include <linux/kernel.h>
-
-#ifdef CONFIG_OF
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
-#endif
 
 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
 # include <linux/console.h>
@@ -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);
 
-- 
1.8.1.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help