diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2015-07-01 04:13:33 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-07-09 05:17:01 -0400 |
commit | b677bc03d757c7d749527cccdd2afcf34ebeeb07 (patch) | |
tree | 110a81f09e2e2c20e63631e1d01e91d577722a0c | |
parent | 717f14255a52ad445d6f0eca7d0f22f59d6ba1f8 (diff) |
MIPS: cps-vec: Use macros for various arithmetics and memory operations
Replace lw/sw and various arithmetic instructions with macros so the
code can work on 64-bit kernels as well.
Cc: <stable@vger.kernel.org> # 3.16+
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/10591/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/cps-vec.S | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S index 2f95568e0da5..1b6ca634e646 100644 --- a/arch/mips/kernel/cps-vec.S +++ b/arch/mips/kernel/cps-vec.S | |||
@@ -108,9 +108,9 @@ not_nmi: | |||
108 | mul t1, t1, t2 | 108 | mul t1, t1, t2 |
109 | 109 | ||
110 | li a0, CKSEG0 | 110 | li a0, CKSEG0 |
111 | add a1, a0, t1 | 111 | PTR_ADD a1, a0, t1 |
112 | 1: cache Index_Store_Tag_I, 0(a0) | 112 | 1: cache Index_Store_Tag_I, 0(a0) |
113 | add a0, a0, t0 | 113 | PTR_ADD a0, a0, t0 |
114 | bne a0, a1, 1b | 114 | bne a0, a1, 1b |
115 | nop | 115 | nop |
116 | icache_done: | 116 | icache_done: |
@@ -135,11 +135,11 @@ icache_done: | |||
135 | mul t1, t1, t2 | 135 | mul t1, t1, t2 |
136 | 136 | ||
137 | li a0, CKSEG0 | 137 | li a0, CKSEG0 |
138 | addu a1, a0, t1 | 138 | PTR_ADDU a1, a0, t1 |
139 | subu a1, a1, t0 | 139 | PTR_SUBU a1, a1, t0 |
140 | 1: cache Index_Store_Tag_D, 0(a0) | 140 | 1: cache Index_Store_Tag_D, 0(a0) |
141 | bne a0, a1, 1b | 141 | bne a0, a1, 1b |
142 | add a0, a0, t0 | 142 | PTR_ADD a0, a0, t0 |
143 | dcache_done: | 143 | dcache_done: |
144 | 144 | ||
145 | /* Set Kseg0 CCA to that in s0 */ | 145 | /* Set Kseg0 CCA to that in s0 */ |
@@ -152,7 +152,7 @@ dcache_done: | |||
152 | 152 | ||
153 | /* Enter the coherent domain */ | 153 | /* Enter the coherent domain */ |
154 | li t0, 0xff | 154 | li t0, 0xff |
155 | sw t0, GCR_CL_COHERENCE_OFS(v1) | 155 | PTR_S t0, GCR_CL_COHERENCE_OFS(v1) |
156 | ehb | 156 | ehb |
157 | 157 | ||
158 | /* Jump to kseg0 */ | 158 | /* Jump to kseg0 */ |
@@ -178,9 +178,9 @@ dcache_done: | |||
178 | nop | 178 | nop |
179 | 179 | ||
180 | /* Off we go! */ | 180 | /* Off we go! */ |
181 | lw t1, VPEBOOTCFG_PC(v0) | 181 | PTR_L t1, VPEBOOTCFG_PC(v0) |
182 | lw gp, VPEBOOTCFG_GP(v0) | 182 | PTR_L gp, VPEBOOTCFG_GP(v0) |
183 | lw sp, VPEBOOTCFG_SP(v0) | 183 | PTR_L sp, VPEBOOTCFG_SP(v0) |
184 | jr t1 | 184 | jr t1 |
185 | nop | 185 | nop |
186 | END(mips_cps_core_entry) | 186 | END(mips_cps_core_entry) |
@@ -299,15 +299,15 @@ LEAF(mips_cps_core_init) | |||
299 | LEAF(mips_cps_boot_vpes) | 299 | LEAF(mips_cps_boot_vpes) |
300 | /* Retrieve CM base address */ | 300 | /* Retrieve CM base address */ |
301 | PTR_LA t0, mips_cm_base | 301 | PTR_LA t0, mips_cm_base |
302 | lw t0, 0(t0) | 302 | PTR_L t0, 0(t0) |
303 | 303 | ||
304 | /* Calculate a pointer to this cores struct core_boot_config */ | 304 | /* Calculate a pointer to this cores struct core_boot_config */ |
305 | lw t0, GCR_CL_ID_OFS(t0) | 305 | PTR_L t0, GCR_CL_ID_OFS(t0) |
306 | li t1, COREBOOTCFG_SIZE | 306 | li t1, COREBOOTCFG_SIZE |
307 | mul t0, t0, t1 | 307 | mul t0, t0, t1 |
308 | PTR_LA t1, mips_cps_core_bootcfg | 308 | PTR_LA t1, mips_cps_core_bootcfg |
309 | lw t1, 0(t1) | 309 | PTR_L t1, 0(t1) |
310 | addu t0, t0, t1 | 310 | PTR_ADDU t0, t0, t1 |
311 | 311 | ||
312 | /* Calculate this VPEs ID. If the core doesn't support MT use 0 */ | 312 | /* Calculate this VPEs ID. If the core doesn't support MT use 0 */ |
313 | has_mt ta2, 1f | 313 | has_mt ta2, 1f |
@@ -334,8 +334,8 @@ LEAF(mips_cps_boot_vpes) | |||
334 | 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */ | 334 | 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */ |
335 | li t1, VPEBOOTCFG_SIZE | 335 | li t1, VPEBOOTCFG_SIZE |
336 | mul v0, t9, t1 | 336 | mul v0, t9, t1 |
337 | lw ta3, COREBOOTCFG_VPECONFIG(t0) | 337 | PTR_L ta3, COREBOOTCFG_VPECONFIG(t0) |
338 | addu v0, v0, ta3 | 338 | PTR_ADDU v0, v0, ta3 |
339 | 339 | ||
340 | #ifdef CONFIG_MIPS_MT | 340 | #ifdef CONFIG_MIPS_MT |
341 | 341 | ||
@@ -360,7 +360,7 @@ LEAF(mips_cps_boot_vpes) | |||
360 | ehb | 360 | ehb |
361 | 361 | ||
362 | /* Loop through each VPE */ | 362 | /* Loop through each VPE */ |
363 | lw ta2, COREBOOTCFG_VPEMASK(t0) | 363 | PTR_L ta2, COREBOOTCFG_VPEMASK(t0) |
364 | move t8, ta2 | 364 | move t8, ta2 |
365 | li ta1, 0 | 365 | li ta1, 0 |
366 | 366 | ||