Commit e83fc6be612ae6642f330e4aff93f32593c25a04

Authored by Jayachandran C
Committed by John Crispin
1 parent 5b47a4db1e

MIPS: Netlogic: Move fdt init to plat_mem_setup

At this point early printk is available, so debugging device tree
issues is easier.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/4460
Signed-off-by: John Crispin <blogic@openwrt.org>

Showing 1 changed file with 14 additions and 13 deletions Side-by-side Diff

arch/mips/netlogic/xlp/setup.c
... ... @@ -68,10 +68,23 @@
68 68  
69 69 void __init plat_mem_setup(void)
70 70 {
  71 + void *fdtp;
  72 +
71 73 panic_timeout = 5;
72 74 _machine_restart = (void (*)(char *))nlm_linux_exit;
73 75 _machine_halt = nlm_linux_exit;
74 76 pm_power_off = nlm_linux_exit;
  77 +
  78 + /*
  79 + * If no FDT pointer is passed in, use the built-in FDT.
  80 + * device_tree_init() does not handle CKSEG0 pointers in
  81 + * 64-bit, so convert pointer.
  82 + */
  83 + fdtp = (void *)(long)fw_arg0;
  84 + if (!fdtp)
  85 + fdtp = __dtb_start;
  86 + fdtp = phys_to_virt(__pa(fdtp));
  87 + early_init_devtree(fdtp);
75 88 }
76 89  
77 90 const char *get_system_type(void)
78 91  
79 92  
... ... @@ -96,23 +109,11 @@
96 109  
97 110 void __init prom_init(void)
98 111 {
99   - void *fdtp;
100   -
101 112 xlp_mmu_init();
102 113 nlm_hal_init();
103 114  
104   - /*
105   - * If no FDT pointer is passed in, use the built-in FDT.
106   - * device_tree_init() does not handle CKSEG0 pointers in
107   - * 64-bit, so convert pointer.
108   - */
109   - fdtp = (void *)(long)fw_arg0;
110   - if (!fdtp)
111   - fdtp = __dtb_start;
112   - fdtp = phys_to_virt(__pa(fdtp));
113   - early_init_devtree(fdtp);
114   -
115 115 nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));
  116 +
116 117 #ifdef CONFIG_SMP
117 118 nlm_wakeup_secondary_cpus(0xffffffff);
118 119