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.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c
index 6d981bb337ec..8c60a2dd9ef6 100644
--- a/arch/mips/netlogic/xlp/setup.c
+++ b/arch/mips/netlogic/xlp/setup.c
@@ -51,12 +51,16 @@ uint64_t nlm_io_base;
51struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; 51struct nlm_soc_info nlm_nodes[NLM_NR_NODES];
52cpumask_t nlm_cpumask = CPU_MASK_CPU0; 52cpumask_t nlm_cpumask = CPU_MASK_CPU0;
53unsigned int nlm_threads_per_core; 53unsigned int nlm_threads_per_core;
54unsigned int xlp_cores_per_node;
54 55
55static void nlm_linux_exit(void) 56static void nlm_linux_exit(void)
56{ 57{
57 uint64_t sysbase = nlm_get_node(0)->sysbase; 58 uint64_t sysbase = nlm_get_node(0)->sysbase;
58 59
59 nlm_write_sys_reg(sysbase, SYS_CHIP_RESET, 1); 60 if (cpu_is_xlp9xx())
61 nlm_write_sys_reg(sysbase, SYS_9XX_CHIP_RESET, 1);
62 else
63 nlm_write_sys_reg(sysbase, SYS_CHIP_RESET, 1);
60 for ( ; ; ) 64 for ( ; ; )
61 cpu_wait(); 65 cpu_wait();
62} 66}
@@ -92,7 +96,14 @@ static void __init xlp_init_mem_from_bars(void)
92 96
93void __init plat_mem_setup(void) 97void __init plat_mem_setup(void)
94{ 98{
95 panic_timeout = 5; 99#ifdef CONFIG_SMP
100 nlm_wakeup_secondary_cpus();
101
102 /* update TLB size after waking up threads */
103 current_cpu_data.tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1;
104
105 register_smp_ops(&nlm_smp_ops);
106#endif
96 _machine_restart = (void (*)(char *))nlm_linux_exit; 107 _machine_restart = (void (*)(char *))nlm_linux_exit;
97 _machine_halt = nlm_linux_exit; 108 _machine_halt = nlm_linux_exit;
98 pm_power_off = nlm_linux_exit; 109 pm_power_off = nlm_linux_exit;
@@ -111,6 +122,7 @@ void __init plat_mem_setup(void)
111const char *get_system_type(void) 122const char *get_system_type(void)
112{ 123{
113 switch (read_c0_prid() & 0xff00) { 124 switch (read_c0_prid() & 0xff00) {
125 case PRID_IMP_NETLOGIC_XLP9XX:
114 case PRID_IMP_NETLOGIC_XLP2XX: 126 case PRID_IMP_NETLOGIC_XLP2XX:
115 return "Broadcom XLPII Series"; 127 return "Broadcom XLPII Series";
116 default: 128 default:
@@ -150,6 +162,10 @@ void __init prom_init(void)
150 void *reset_vec; 162 void *reset_vec;
151 163
152 nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); 164 nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE);
165 if (cpu_is_xlp9xx())
166 xlp_cores_per_node = 32;
167 else
168 xlp_cores_per_node = 8;
153 nlm_init_boot_cpu(); 169 nlm_init_boot_cpu();
154 xlp_mmu_init(); 170 xlp_mmu_init();
155 nlm_node_init(0); 171 nlm_node_init(0);
@@ -163,11 +179,5 @@ void __init prom_init(void)
163 179
164#ifdef CONFIG_SMP 180#ifdef CONFIG_SMP
165 cpumask_setall(&nlm_cpumask); 181 cpumask_setall(&nlm_cpumask);
166 nlm_wakeup_secondary_cpus();
167
168 /* update TLB size after waking up threads */
169 current_cpu_data.tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1;
170
171 register_smp_ops(&nlm_smp_ops);
172#endif 182#endif
173} 183}