aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2013-12-21 06:22:15 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-24 16:39:47 -0500
commitd3b94285025732379df8a46c02416400c70daa85 (patch)
treec6654f3ebdf4696fdfed57191be3ec8274c482b6 /arch/mips/netlogic
parentce59d0f7fec6fa4e7a6c484308e25bad8a6caa39 (diff)
MIPS: Netlogic: Some cleanups for assembly code
No change in logic, the changes are: * cleanup some whitespace and comments * remove confusing argument of SYS_CPU_COHERENT_BASE macro * make the numerical labels in macros consistent Signed-off-by: Jayachandran C <jchandra@broadcom.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6273/
Diffstat (limited to 'arch/mips/netlogic')
-rw-r--r--arch/mips/netlogic/common/reset.S29
-rw-r--r--arch/mips/netlogic/common/smpboot.S3
2 files changed, 17 insertions, 15 deletions
diff --git a/arch/mips/netlogic/common/reset.S b/arch/mips/netlogic/common/reset.S
index adb18288a6c0..06381e11863e 100644
--- a/arch/mips/netlogic/common/reset.S
+++ b/arch/mips/netlogic/common/reset.S
@@ -50,8 +50,8 @@
50#include <asm/netlogic/xlp-hal/cpucontrol.h> 50#include <asm/netlogic/xlp-hal/cpucontrol.h>
51 51
52#define CP0_EBASE $15 52#define CP0_EBASE $15
53#define SYS_CPU_COHERENT_BASE(node) CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \ 53#define SYS_CPU_COHERENT_BASE CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \
54 XLP_IO_SYS_OFFSET(node) + XLP_IO_PCI_HDRSZ + \ 54 XLP_IO_SYS_OFFSET(0) + XLP_IO_PCI_HDRSZ + \
55 SYS_CPU_NONCOHERENT_MODE * 4 55 SYS_CPU_NONCOHERENT_MODE * 4
56 56
57/* Enable XLP features and workarounds in the LSU */ 57/* Enable XLP features and workarounds in the LSU */
@@ -82,26 +82,26 @@
82 li t1, LSU_DEBUG_ADDR 82 li t1, LSU_DEBUG_ADDR
83 li t2, 0 /* index */ 83 li t2, 0 /* index */
84 li t3, 0x1000 /* loop count */ 84 li t3, 0x1000 /* loop count */
851: 8511:
86 sll v0, t2, 5 86 sll v0, t2, 5
87 mtcr zero, t0 87 mtcr zero, t0
88 ori v1, v0, 0x3 /* way0 | write_enable | write_active */ 88 ori v1, v0, 0x3 /* way0 | write_enable | write_active */
89 mtcr v1, t1 89 mtcr v1, t1
902: 9012:
91 mfcr v1, t1 91 mfcr v1, t1
92 andi v1, 0x1 /* wait for write_active == 0 */ 92 andi v1, 0x1 /* wait for write_active == 0 */
93 bnez v1, 2b 93 bnez v1, 12b
94 nop 94 nop
95 mtcr zero, t0 95 mtcr zero, t0
96 ori v1, v0, 0x7 /* way1 | write_enable | write_active */ 96 ori v1, v0, 0x7 /* way1 | write_enable | write_active */
97 mtcr v1, t1 97 mtcr v1, t1
983: 9813:
99 mfcr v1, t1 99 mfcr v1, t1
100 andi v1, 0x1 /* wait for write_active == 0 */ 100 andi v1, 0x1 /* wait for write_active == 0 */
101 bnez v1, 3b 101 bnez v1, 13b
102 nop 102 nop
103 addi t2, 1 103 addi t2, 1
104 bne t3, t2, 1b 104 bne t3, t2, 11b
105 nop 105 nop
106.endm 106.endm
107 107
@@ -149,7 +149,7 @@ FEXPORT(nlm_reset_entry)
149 li t1, 0x1 149 li t1, 0x1
150 sll t0, t1, t0 150 sll t0, t1, t0
151 nor t0, t0, zero /* t0 <- ~(1 << core) */ 151 nor t0, t0, zero /* t0 <- ~(1 << core) */
152 li t2, SYS_CPU_COHERENT_BASE(0) 152 li t2, SYS_CPU_COHERENT_BASE
153 add t2, t2, t3 /* t2 <- SYS offset for node */ 153 add t2, t2, t3 /* t2 <- SYS offset for node */
154 lw t1, 0(t2) 154 lw t1, 0(t2)
155 and t1, t1, t0 155 and t1, t1, t0
@@ -164,8 +164,7 @@ FEXPORT(nlm_reset_entry)
164 /* FALL THROUGH */ 164 /* FALL THROUGH */
165 165
166/* 166/*
167 * Wake up sibling threads from the initial thread in 167 * Wake up sibling threads from the initial thread in a core.
168 * a core.
169 */ 168 */
170EXPORT(nlm_boot_siblings) 169EXPORT(nlm_boot_siblings)
171 /* core L1D flush before enable threads */ 170 /* core L1D flush before enable threads */
@@ -181,8 +180,10 @@ EXPORT(nlm_boot_siblings)
181 /* 180 /*
182 * The new hardware thread starts at the next instruction 181 * The new hardware thread starts at the next instruction
183 * For all the cases other than core 0 thread 0, we will 182 * For all the cases other than core 0 thread 0, we will
184 * jump to the secondary wait function. 183 * jump to the secondary wait function.
185 */ 184
185 * NOTE: All GPR contents are lost after the mtcr above!
186 */
186 mfc0 v0, CP0_EBASE, 1 187 mfc0 v0, CP0_EBASE, 1
187 andi v0, 0x3ff /* v0 <- node/core */ 188 andi v0, 0x3ff /* v0 <- node/core */
188 189
@@ -196,7 +197,7 @@ EXPORT(nlm_boot_siblings)
196#endif 197#endif
197 mtc0 t1, CP0_STATUS 198 mtc0 t1, CP0_STATUS
198 199
199 /* mark CPU ready, careful here, previous mtcr trashed registers */ 200 /* mark CPU ready */
200 li t3, CKSEG1ADDR(RESET_DATA_PHYS) 201 li t3, CKSEG1ADDR(RESET_DATA_PHYS)
201 ADDIU t1, t3, BOOT_CPU_READY 202 ADDIU t1, t3, BOOT_CPU_READY
202 sll v1, v0, 2 203 sll v1, v0, 2
diff --git a/arch/mips/netlogic/common/smpboot.S b/arch/mips/netlogic/common/smpboot.S
index aa6cff0a229b..db3b8947cf46 100644
--- a/arch/mips/netlogic/common/smpboot.S
+++ b/arch/mips/netlogic/common/smpboot.S
@@ -98,7 +98,7 @@ END(nlm_boot_secondary_cpus)
98 * In case of RMIboot bootloader which is used on XLR boards, the CPUs 98 * In case of RMIboot bootloader which is used on XLR boards, the CPUs
99 * be already woken up and waiting in bootloader code. 99 * be already woken up and waiting in bootloader code.
100 * This will get them out of the bootloader code and into linux. Needed 100 * This will get them out of the bootloader code and into linux. Needed
101 * because the bootloader area will be taken and initialized by linux. 101 * because the bootloader area will be taken and initialized by linux.
102 */ 102 */
103NESTED(nlm_rmiboot_preboot, 16, sp) 103NESTED(nlm_rmiboot_preboot, 16, sp)
104 mfc0 t0, $15, 1 /* read ebase */ 104 mfc0 t0, $15, 1 /* read ebase */
@@ -133,6 +133,7 @@ NESTED(nlm_rmiboot_preboot, 16, sp)
133 or t1, t2, v1 /* put in new value */ 133 or t1, t2, v1 /* put in new value */
134 mtcr t1, t0 /* update core control */ 134 mtcr t1, t0 /* update core control */
135 135
136 /* wait for NMI to hit */
1361: wait 1371: wait
137 b 1b 138 b 1b
138 nop 139 nop