openrisc: use unflatten_and_copy_device_tree
authorRob Herring <rob.herring@calxeda.com>
Mon, 26 Aug 2013 16:23:50 +0000 (11:23 -0500)
committerRob Herring <rob.herring@calxeda.com>
Wed, 9 Oct 2013 16:38:04 +0000 (11:38 -0500)
Use the common unflatten_and_copy_device_tree to copy the built-in FDT
out of init section. This moves the copy later in the boot, but there
do not appear to be any references to strings in the FDT before the copy.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: linux@lists.openrisc.net
arch/openrisc/kernel/prom.c
arch/openrisc/kernel/setup.c

index bf3fd05703c32bfe0823844272c34ad08232dd3c..3b94972e52b2069bb8761f18350a1f2a99176677 100644 (file)
@@ -55,8 +55,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 
 void __init early_init_devtree(void *params)
 {
-       void *alloc;
-
        /* Setup flat device-tree pointer */
        initial_boot_params = params;
 
@@ -72,17 +70,6 @@ void __init early_init_devtree(void *params)
        of_scan_flat_dt(early_init_dt_scan_memory, NULL);
 
        memblock_allow_resize();
-
-       /* We must copy the flattend device tree from init memory to regular
-        * memory because the device tree references the strings in it
-        * directly.
-        */
-
-       alloc = __va(memblock_alloc(initial_boot_params->totalsize, PAGE_SIZE));
-
-       memcpy(alloc, initial_boot_params, initial_boot_params->totalsize);
-
-       initial_boot_params = alloc;
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
index 719c5c8895c4bbc3ddde6fc2b148136516eacf04..09a769b695720909a52b409f9a49fe40b99f4fa0 100644 (file)
@@ -283,7 +283,7 @@ void __init setup_arch(char **cmdline_p)
 {
        unsigned long max_low_pfn;
 
-       unflatten_device_tree();
+       unflatten_and_copy_device_tree();
 
        setup_cpuinfo();
 
This page took 0.037331 seconds and 5 git commands to generate.