aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic/xlp/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/netlogic/xlp/setup.c')
-rw-r--r--arch/mips/netlogic/xlp/setup.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 3dec9f28b65b..d8997098defd 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -35,6 +35,7 @@
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/serial_8250.h> 36#include <linux/serial_8250.h>
37#include <linux/pm.h> 37#include <linux/pm.h>
38#include <linux/bootmem.h>
38 39
39#include <asm/reboot.h> 40#include <asm/reboot.h>
40#include <asm/time.h> 41#include <asm/time.h>
@@ -56,6 +57,7 @@ unsigned long nlm_common_ebase = 0x0;
56/* default to uniprocessor */ 57/* default to uniprocessor */
57uint32_t nlm_coremask = 1, nlm_cpumask = 1; 58uint32_t nlm_coremask = 1, nlm_cpumask = 1;
58int nlm_threads_per_core = 1; 59int nlm_threads_per_core = 1;
60extern u32 __dtb_start[];
59 61
60static void nlm_linux_exit(void) 62static void nlm_linux_exit(void)
61{ 63{
@@ -96,9 +98,18 @@ void __init prom_init(void)
96{ 98{
97 void *fdtp; 99 void *fdtp;
98 100
99 fdtp = (void *)(long)fw_arg0;
100 xlp_mmu_init(); 101 xlp_mmu_init();
101 nlm_hal_init(); 102 nlm_hal_init();
103
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));
102 early_init_devtree(fdtp); 113 early_init_devtree(fdtp);
103 114
104 nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1)); 115 nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));
@@ -112,6 +123,25 @@ void __init prom_init(void)
112#endif 123#endif
113} 124}
114 125
126void __init device_tree_init(void)
127{
128 unsigned long base, size;
129
130 if (!initial_boot_params)
131 return;
132
133 base = virt_to_phys((void *)initial_boot_params);
134 size = be32_to_cpu(initial_boot_params->totalsize);
135
136 /* Before we do anything, lets reserve the dt blob */
137 reserve_bootmem(base, size, BOOTMEM_DEFAULT);
138
139 unflatten_device_tree();
140
141 /* free the space reserved for the dt blob */
142 free_bootmem(base, size);
143}
144
115static struct of_device_id __initdata xlp_ids[] = { 145static struct of_device_id __initdata xlp_ids[] = {
116 { .compatible = "simple-bus", }, 146 { .compatible = "simple-bus", },
117 {}, 147 {},