aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJayachandran C <jayachandranc@netlogicmicro.com>2012-07-24 11:28:47 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-07-24 11:28:47 -0400
commit51d1eac0cd633b58be2a1e4e75765dc5bf913e6b (patch)
tree07b89a6618a68337f43138c9742617b9b71dba40 /arch
parentcedc8ef87c3349a6645e285f920715380dd25ddc (diff)
MIPS: Netlogic: SMP wakeup code update
Update for core intialization code. Initialize status register after receiving NMI for CPU wakeup. Add the low level L1D flush code before enabling threads in core. Also convert the ehb to _ehb so that it works under more GCC versions. Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3755/ Patchwork: https://patchwork.linux-mips.org/patch/4095/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h4
-rw-r--r--arch/mips/netlogic/common/smpboot.S47
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 */
891:
90 sll v0, t2, 5
91 mtcr zero, t0
92 ori v1, v0, 0x3 /* way0 | write_enable | write_active */
93 mtcr v1, t1
942:
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
1023:
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 */
140EXPORT(nlm_boot_siblings) 172EXPORT(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
1692: beqz v0, 4f /* boot cpu (cpuid == 0)? */ 2032: 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
222NESTED(nlm_boot_secondary_cpus, 16, sp) 253NESTED(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