Skip to content

Commit b677bc0

Browse files
Markos Chandrasralfbaechle
authored andcommitted
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>
1 parent 717f142 commit b677bc0

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

arch/mips/kernel/cps-vec.S

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ not_nmi:
108108
mul t1, t1, t2
109109

110110
li a0, CKSEG0
111-
add a1, a0, t1
111+
PTR_ADD a1, a0, t1
112112
1: cache Index_Store_Tag_I, 0(a0)
113-
add a0, a0, t0
113+
PTR_ADD a0, a0, t0
114114
bne a0, a1, 1b
115115
nop
116116
icache_done:
@@ -135,11 +135,11 @@ icache_done:
135135
mul t1, t1, t2
136136

137137
li a0, CKSEG0
138-
addu a1, a0, t1
139-
subu a1, a1, t0
138+
PTR_ADDU a1, a0, t1
139+
PTR_SUBU a1, a1, t0
140140
1: cache Index_Store_Tag_D, 0(a0)
141141
bne a0, a1, 1b
142-
add a0, a0, t0
142+
PTR_ADD a0, a0, t0
143143
dcache_done:
144144

145145
/* Set Kseg0 CCA to that in s0 */
@@ -152,7 +152,7 @@ dcache_done:
152152

153153
/* Enter the coherent domain */
154154
li t0, 0xff
155-
sw t0, GCR_CL_COHERENCE_OFS(v1)
155+
PTR_S t0, GCR_CL_COHERENCE_OFS(v1)
156156
ehb
157157

158158
/* Jump to kseg0 */
@@ -178,9 +178,9 @@ dcache_done:
178178
nop
179179

180180
/* Off we go! */
181-
lw t1, VPEBOOTCFG_PC(v0)
182-
lw gp, VPEBOOTCFG_GP(v0)
183-
lw sp, VPEBOOTCFG_SP(v0)
181+
PTR_L t1, VPEBOOTCFG_PC(v0)
182+
PTR_L gp, VPEBOOTCFG_GP(v0)
183+
PTR_L sp, VPEBOOTCFG_SP(v0)
184184
jr t1
185185
nop
186186
END(mips_cps_core_entry)
@@ -299,15 +299,15 @@ LEAF(mips_cps_core_init)
299299
LEAF(mips_cps_boot_vpes)
300300
/* Retrieve CM base address */
301301
PTR_LA t0, mips_cm_base
302-
lw t0, 0(t0)
302+
PTR_L t0, 0(t0)
303303

304304
/* 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)
306306
li t1, COREBOOTCFG_SIZE
307307
mul t0, t0, t1
308308
PTR_LA t1, mips_cps_core_bootcfg
309-
lw t1, 0(t1)
310-
addu t0, t0, t1
309+
PTR_L t1, 0(t1)
310+
PTR_ADDU t0, t0, t1
311311

312312
/* Calculate this VPEs ID. If the core doesn't support MT use 0 */
313313
has_mt ta2, 1f
@@ -334,8 +334,8 @@ LEAF(mips_cps_boot_vpes)
334334
1: /* Calculate a pointer to this VPEs struct vpe_boot_config */
335335
li t1, VPEBOOTCFG_SIZE
336336
mul v0, t9, t1
337-
lw ta3, COREBOOTCFG_VPECONFIG(t0)
338-
addu v0, v0, ta3
337+
PTR_L ta3, COREBOOTCFG_VPECONFIG(t0)
338+
PTR_ADDU v0, v0, ta3
339339

340340
#ifdef CONFIG_MIPS_MT
341341

@@ -360,7 +360,7 @@ LEAF(mips_cps_boot_vpes)
360360
ehb
361361

362362
/* Loop through each VPE */
363-
lw ta2, COREBOOTCFG_VPEMASK(t0)
363+
PTR_L ta2, COREBOOTCFG_VPEMASK(t0)
364364
move t8, ta2
365365
li ta1, 0
366366

0 commit comments

Comments
 (0)