diff options
Diffstat (limited to 'arch/mips/netlogic/xlp/setup.c')
-rw-r--r-- | arch/mips/netlogic/xlp/setup.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c index d8997098defd..4894d62043ac 100644 --- a/arch/mips/netlogic/xlp/setup.c +++ b/arch/mips/netlogic/xlp/setup.c | |||
@@ -52,26 +52,40 @@ | |||
52 | #include <asm/netlogic/xlp-hal/xlp.h> | 52 | #include <asm/netlogic/xlp-hal/xlp.h> |
53 | #include <asm/netlogic/xlp-hal/sys.h> | 53 | #include <asm/netlogic/xlp-hal/sys.h> |
54 | 54 | ||
55 | unsigned long nlm_common_ebase = 0x0; | 55 | uint64_t nlm_io_base; |
56 | 56 | struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; | |
57 | /* default to uniprocessor */ | 57 | cpumask_t nlm_cpumask = CPU_MASK_CPU0; |
58 | uint32_t nlm_coremask = 1, nlm_cpumask = 1; | 58 | unsigned int nlm_threads_per_core; |
59 | int nlm_threads_per_core = 1; | ||
60 | extern u32 __dtb_start[]; | 59 | extern u32 __dtb_start[]; |
61 | 60 | ||
62 | static void nlm_linux_exit(void) | 61 | static void nlm_linux_exit(void) |
63 | { | 62 | { |
64 | nlm_write_sys_reg(nlm_sys_base, SYS_CHIP_RESET, 1); | 63 | uint64_t sysbase = nlm_get_node(0)->sysbase; |
64 | |||
65 | nlm_write_sys_reg(sysbase, SYS_CHIP_RESET, 1); | ||
65 | for ( ; ; ) | 66 | for ( ; ; ) |
66 | cpu_wait(); | 67 | cpu_wait(); |
67 | } | 68 | } |
68 | 69 | ||
69 | void __init plat_mem_setup(void) | 70 | void __init plat_mem_setup(void) |
70 | { | 71 | { |
72 | void *fdtp; | ||
73 | |||
71 | panic_timeout = 5; | 74 | panic_timeout = 5; |
72 | _machine_restart = (void (*)(char *))nlm_linux_exit; | 75 | _machine_restart = (void (*)(char *))nlm_linux_exit; |
73 | _machine_halt = nlm_linux_exit; | 76 | _machine_halt = nlm_linux_exit; |
74 | pm_power_off = nlm_linux_exit; | 77 | pm_power_off = nlm_linux_exit; |
78 | |||
79 | /* | ||
80 | * If no FDT pointer is passed in, use the built-in FDT. | ||
81 | * device_tree_init() does not handle CKSEG0 pointers in | ||
82 | * 64-bit, so convert pointer. | ||
83 | */ | ||
84 | fdtp = (void *)(long)fw_arg0; | ||
85 | if (!fdtp) | ||
86 | fdtp = __dtb_start; | ||
87 | fdtp = phys_to_virt(__pa(fdtp)); | ||
88 | early_init_devtree(fdtp); | ||
75 | } | 89 | } |
76 | 90 | ||
77 | const char *get_system_type(void) | 91 | const char *get_system_type(void) |
@@ -94,27 +108,19 @@ void xlp_mmu_init(void) | |||
94 | (13 + (ffz(PM_DEFAULT_MASK >> 13) / 2))); | 108 | (13 + (ffz(PM_DEFAULT_MASK >> 13) / 2))); |
95 | } | 109 | } |
96 | 110 | ||
97 | void __init prom_init(void) | 111 | void nlm_percpu_init(int hwcpuid) |
98 | { | 112 | { |
99 | void *fdtp; | 113 | } |
100 | 114 | ||
115 | void __init prom_init(void) | ||
116 | { | ||
117 | nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); | ||
101 | xlp_mmu_init(); | 118 | xlp_mmu_init(); |
102 | nlm_hal_init(); | 119 | nlm_node_init(0); |
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)); | ||
113 | early_init_devtree(fdtp); | ||
114 | 120 | ||
115 | nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1)); | ||
116 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
117 | nlm_wakeup_secondary_cpus(0xffffffff); | 122 | cpumask_setall(&nlm_cpumask); |
123 | nlm_wakeup_secondary_cpus(); | ||
118 | 124 | ||
119 | /* update TLB size after waking up threads */ | 125 | /* update TLB size after waking up threads */ |
120 | current_cpu_data.tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1; | 126 | current_cpu_data.tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1; |