summaryrefslogtreecommitdiff
path: root/utils/hwstub/stub/asm/mips/system.S
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-17 22:54:13 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-01-24 15:34:19 +0100
commitf3cce72269703e983e4a4e6ec8dc9217b0c2b6fe (patch)
treedc66a06febd287a5f0d146376b69d6a4322d81f1 /utils/hwstub/stub/asm/mips/system.S
parent07bc348c914f04657b284cb1ace92df8ef3a15d9 (diff)
downloadrockbox-f3cce72269703e983e4a4e6ec8dc9217b0c2b6fe.tar.gz
rockbox-f3cce72269703e983e4a4e6ec8dc9217b0c2b6fe.zip
hwstub/jz460b: implement exception recovery
Now that we now that jz4760b implements EBASE, we can use it to rebase exceptions to use a k1seg address, that maps to the physical address of the TCSM0. It requires to enable HAB1 to have this translation. This most the most inefficient way to access tighly coupled memory ever, but it works. Change-Id: I894ca929c9835696102eb2fef44b06e6eaf96d44
Diffstat (limited to 'utils/hwstub/stub/asm/mips/system.S')
-rw-r--r--utils/hwstub/stub/asm/mips/system.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/utils/hwstub/stub/asm/mips/system.S b/utils/hwstub/stub/asm/mips/system.S
index 97b0207ec9..2d89bde096 100644
--- a/utils/hwstub/stub/asm/mips/system.S
+++ b/utils/hwstub/stub/asm/mips/system.S
@@ -49,6 +49,33 @@ set_data_abort_jmp:
49 sw ra, 40(v0) 49 sw ra, 40(v0)
50 jr ra 50 jr ra
51 move v0, zero 51 move v0, zero
52
53/* restore context on read/write error, performs the interrupt return */
54.global restore_data_abort_jmp
55restore_data_abort_jmp:
56la k1, data_abort_jmp_ctx_ptr
57 lw s0, 0(k1)
58 lw s1, 4(k1)
59 lw s2, 8(k1)
60 lw s3, 12(k1)
61 lw s4, 16(k1)
62 lw s5, 20(k1)
63 lw s6, 24(k1)
64 lw s7, 28(k1)
65 lw sp, 32(k1)
66 lw s8, 36(k1)
67 lw k1, 40(k1)
68 mtc0 k1, C0_EPC
69#ifdef CONFIG_JZ4760B
70 /* XBurst has a 3 interlock cycle delay, but we don't know if the interlock
71 * works with eret */
72 nop
73#else
74 ehb
75#endif
76 li v0, 1
77 eret
78 nop
52.set reorder 79.set reorder
53 80
54#ifdef CONFIG_FLUSH_CACHES 81#ifdef CONFIG_FLUSH_CACHES