summaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic/common/reset.S
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2014-05-09 16:35:14 +0530
committerRalf Baechle <ralf@linux-mips.org>2014-05-30 16:47:56 +0200
commita3deecfaa36662ca2e2104be3c305236cf03efcc (patch)
tree64c90d95f734fc75ded54103e9c94ab23e35bc71 /arch/mips/netlogic/common/reset.S
parent2e240ddd09d41645e928a19a3ff3290a0f546834 (diff)
downloadblackbird-op-linux-a3deecfaa36662ca2e2104be3c305236cf03efcc.tar.gz
blackbird-op-linux-a3deecfaa36662ca2e2104be3c305236cf03efcc.zip
MIPS: Netlogic: Reduce size of reset code
Update thread wakeup function to use scratch registers for saving SP and RA. Move the register restore code needed for thread 0 to the calling function. This reduces the size of code copied to the reset vector. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6910/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/netlogic/common/reset.S')
-rw-r--r--arch/mips/netlogic/common/reset.S15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/mips/netlogic/common/reset.S b/arch/mips/netlogic/common/reset.S
index b231fe1e7a09..fda772a8595b 100644
--- a/arch/mips/netlogic/common/reset.S
+++ b/arch/mips/netlogic/common/reset.S
@@ -197,6 +197,9 @@ FEXPORT(nlm_reset_entry)
EXPORT(nlm_boot_siblings)
/* core L1D flush before enable threads */
xlp_flush_l1_dcache
+ /* save ra and sp, will be used later (only for boot cpu) */
+ dmtc0 ra, $22, 6
+ dmtc0 sp, $22, 7
/* Enable hw threads by writing to MAP_THREADMODE of the core */
li t0, CKSEG1ADDR(RESET_DATA_PHYS)
lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */
@@ -238,14 +241,12 @@ EXPORT(nlm_boot_siblings)
nop
/*
- * For the boot CPU, we have to restore registers and
- * return
+ * For the boot CPU, we have to restore ra and sp and return, rest
+ * of the registers will be restored by the caller
*/
-4: dmfc0 t0, $4, 2 /* restore SP from UserLocal */
- li t1, 0xfadebeef
- dmtc0 t1, $4, 2 /* restore SP from UserLocal */
- PTR_SUBU sp, t0, PT_SIZE
- RESTORE_ALL
+4:
+ dmfc0 ra, $22, 6
+ dmfc0 sp, $22, 7
jr ra
nop
EXPORT(nlm_reset_entry_end)
OpenPOWER on IntegriCloud