diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h | 4 | ||||
-rw-r--r-- | arch/mips/netlogic/common/smpboot.S | 47 |
2 files changed, 45 insertions, 6 deletions
diff --git a/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h b/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h index bf7d41deb9be..7b63a6b722a0 100644 --- a/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h +++ b/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h | |||
@@ -47,7 +47,9 @@ | |||
47 | #define CPU_BLOCKID_MAP 10 | 47 | #define CPU_BLOCKID_MAP 10 |
48 | 48 | ||
49 | #define LSU_DEFEATURE 0x304 | 49 | #define LSU_DEFEATURE 0x304 |
50 | #define LSU_CERRLOG_REGID 0x09 | 50 | #define LSU_DEBUG_ADDR 0x305 |
51 | #define LSU_DEBUG_DATA0 0x306 | ||
52 | #define LSU_CERRLOG_REGID 0x309 | ||
51 | #define SCHED_DEFEATURE 0x700 | 53 | #define SCHED_DEFEATURE 0x700 |
52 | 54 | ||
53 | /* Offsets of interest from the 'MAP' Block */ | 55 | /* Offsets of interest from the 'MAP' Block */ |
diff --git a/arch/mips/netlogic/common/smpboot.S b/arch/mips/netlogic/common/smpboot.S index c4872a714cfe..d6431b7b49fc 100644 --- a/arch/mips/netlogic/common/smpboot.S +++ b/arch/mips/netlogic/common/smpboot.S | |||
@@ -80,6 +80,38 @@ | |||
80 | * This is the code that will be copied to the reset entry point for | 80 | * This is the code that will be copied to the reset entry point for |
81 | * XLR and XLP. The XLP cores start here when they are woken up. This | 81 | * XLR and XLP. The XLP cores start here when they are woken up. This |
82 | * is also the NMI entry point. | 82 | * is also the NMI entry point. |
83 | */ | ||
84 | .macro xlp_flush_l1_dcache | ||
85 | li t0, LSU_DEBUG_DATA0 | ||
86 | li t1, LSU_DEBUG_ADDR | ||
87 | li t2, 0 /* index */ | ||
88 | li t3, 0x1000 /* loop count */ | ||
89 | 1: | ||
90 | sll v0, t2, 5 | ||
91 | mtcr zero, t0 | ||
92 | ori v1, v0, 0x3 /* way0 | write_enable | write_active */ | ||
93 | mtcr v1, t1 | ||
94 | 2: | ||
95 | mfcr v1, t1 | ||
96 | andi v1, 0x1 /* wait for write_active == 0 */ | ||
97 | bnez v1, 2b | ||
98 | nop | ||
99 | mtcr zero, t0 | ||
100 | ori v1, v0, 0x7 /* way1 | write_enable | write_active */ | ||
101 | mtcr v1, t1 | ||
102 | 3: | ||
103 | mfcr v1, t1 | ||
104 | andi v1, 0x1 /* wait for write_active == 0 */ | ||
105 | bnez v1, 3b | ||
106 | nop | ||
107 | addi t2, 1 | ||
108 | bne t3, t2, 1b | ||
109 | nop | ||
110 | .endm | ||
111 | |||
112 | /* | ||
113 | * The cores can come start when they are woken up. This is also the NMI | ||
114 | * entry, so check that first. | ||
83 | * | 115 | * |
84 | * The data corresponding to reset/NMI is stored at RESET_DATA_PHYS | 116 | * The data corresponding to reset/NMI is stored at RESET_DATA_PHYS |
85 | * location, this will have the thread mask (used when core is woken up) | 117 | * location, this will have the thread mask (used when core is woken up) |
@@ -138,6 +170,8 @@ FEXPORT(nlm_reset_entry) | |||
138 | * a core. | 170 | * a core. |
139 | */ | 171 | */ |
140 | EXPORT(nlm_boot_siblings) | 172 | EXPORT(nlm_boot_siblings) |
173 | /* core L1D flush before enable threads */ | ||
174 | xlp_flush_l1_dcache | ||
141 | /* Enable hw threads by writing to MAP_THREADMODE of the core */ | 175 | /* Enable hw threads by writing to MAP_THREADMODE of the core */ |
142 | li t0, CKSEG1ADDR(RESET_DATA_PHYS) | 176 | li t0, CKSEG1ADDR(RESET_DATA_PHYS) |
143 | lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */ | 177 | lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */ |
@@ -164,16 +198,13 @@ EXPORT(nlm_boot_siblings) | |||
164 | li t0, MMU_SETUP | 198 | li t0, MMU_SETUP |
165 | li t1, 0 | 199 | li t1, 0 |
166 | mtcr t1, t0 | 200 | mtcr t1, t0 |
167 | ehb | 201 | _ehb |
168 | 202 | ||
169 | 2: beqz v0, 4f /* boot cpu (cpuid == 0)? */ | 203 | 2: beqz v0, 4f /* boot cpu (cpuid == 0)? */ |
170 | nop | 204 | nop |
171 | 205 | ||
172 | /* setup status reg */ | 206 | /* setup status reg */ |
173 | mfc0 t1, CP0_STATUS | 207 | move t1, zero |
174 | li t0, ST0_BEV | ||
175 | or t1, t0 | ||
176 | xor t1, t0 | ||
177 | #ifdef CONFIG_64BIT | 208 | #ifdef CONFIG_64BIT |
178 | ori t1, ST0_KX | 209 | ori t1, ST0_KX |
179 | #endif | 210 | #endif |
@@ -220,6 +251,12 @@ FEXPORT(xlp_boot_core0_siblings) /* "Master" cpu starts from here */ | |||
220 | 251 | ||
221 | __CPUINIT | 252 | __CPUINIT |
222 | NESTED(nlm_boot_secondary_cpus, 16, sp) | 253 | NESTED(nlm_boot_secondary_cpus, 16, sp) |
254 | /* Initialize CP0 Status */ | ||
255 | move t1, zero | ||
256 | #ifdef CONFIG_64BIT | ||
257 | ori t1, ST0_KX | ||
258 | #endif | ||
259 | mtc0 t1, CP0_STATUS | ||
223 | PTR_LA t1, nlm_next_sp | 260 | PTR_LA t1, nlm_next_sp |
224 | PTR_L sp, 0(t1) | 261 | PTR_L sp, 0(t1) |
225 | PTR_LA t1, nlm_next_gp | 262 | PTR_LA t1, nlm_next_gp |