linux-mips
[Top] [All Lists]

[PATCH 06/15] MIPS: Netlogic: Move fdt init to plat_mem_setup

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 06/15] MIPS: Netlogic: Move fdt init to plat_mem_setup
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Wed, 31 Oct 2012 18:31:32 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <cover.1351688140.git.jchandra@broadcom.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <cover.1351688140.git.jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
At this point early printk is available, so debugging device tree
issues is easier.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 arch/mips/netlogic/xlp/setup.c |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index d899709..b886a50 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -68,10 +68,23 @@ static void nlm_linux_exit(void)
 
 void __init plat_mem_setup(void)
 {
+       void *fdtp;
+
        panic_timeout   = 5;
        _machine_restart = (void (*)(char *))nlm_linux_exit;
        _machine_halt   = nlm_linux_exit;
        pm_power_off    = nlm_linux_exit;
+
+       /*
+        * If no FDT pointer is passed in, use the built-in FDT.
+        * device_tree_init() does not handle CKSEG0 pointers in
+        * 64-bit, so convert pointer.
+        */
+       fdtp = (void *)(long)fw_arg0;
+       if (!fdtp)
+               fdtp = __dtb_start;
+       fdtp = phys_to_virt(__pa(fdtp));
+       early_init_devtree(fdtp);
 }
 
 const char *get_system_type(void)
@@ -96,23 +109,11 @@ void xlp_mmu_init(void)
 
 void __init prom_init(void)
 {
-       void *fdtp;
-
        xlp_mmu_init();
        nlm_hal_init();
 
-       /*
-        * If no FDT pointer is passed in, use the built-in FDT.
-        * device_tree_init() does not handle CKSEG0 pointers in
-        * 64-bit, so convert pointer.
-        */
-       fdtp = (void *)(long)fw_arg0;
-       if (!fdtp)
-               fdtp = __dtb_start;
-       fdtp = phys_to_virt(__pa(fdtp));
-       early_init_devtree(fdtp);
-
        nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));
+
 #ifdef CONFIG_SMP
        nlm_wakeup_secondary_cpus(0xffffffff);
 
-- 
1.7.9.5



<Prev in Thread] Current Thread [Next in Thread>