mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-28 22:21:49 +01:00
MIPS: fix ROM exception vectors
When booting from ROM, early exceptions can't be handled properly. Instead of busy-looping give the developer the possibilty to examine the situation. Invoke an UHI exception operation which can be read as unhandled exception by a hardware debugger if one is attached. If the debugger doesn't support UHI, the exception is read as unexpected breakpoint. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
This commit is contained in:
parent
af3971f81a
commit
345490fcd6
@ -52,6 +52,14 @@
|
|||||||
|
|
||||||
.set noreorder
|
.set noreorder
|
||||||
|
|
||||||
|
.macro uhi_mips_exception
|
||||||
|
move k0, t9 # preserve t9 in k0
|
||||||
|
move k1, a0 # preserve a0 in k1
|
||||||
|
li t9, 15 # UHI exception operation
|
||||||
|
li a0, 0 # Use hard register context
|
||||||
|
sdbbp 1 # Invoke UHI operation
|
||||||
|
.endm
|
||||||
|
|
||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
/* U-Boot entry point */
|
/* U-Boot entry point */
|
||||||
b reset
|
b reset
|
||||||
@ -79,30 +87,30 @@ ENTRY(_start)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ROM_EXCEPTION_VECTORS)
|
#if defined(CONFIG_ROM_EXCEPTION_VECTORS)
|
||||||
|
/*
|
||||||
|
* Exception vector entry points. When running from ROM, an exception
|
||||||
|
* cannot be handled. Halt execution and transfer control to debugger,
|
||||||
|
* if one is attached.
|
||||||
|
*/
|
||||||
.org 0x200
|
.org 0x200
|
||||||
/* TLB refill, 32 bit task */
|
/* TLB refill, 32 bit task */
|
||||||
1: b 1b
|
uhi_mips_exception
|
||||||
nop
|
|
||||||
|
|
||||||
.org 0x280
|
.org 0x280
|
||||||
/* XTLB refill, 64 bit task */
|
/* XTLB refill, 64 bit task */
|
||||||
1: b 1b
|
uhi_mips_exception
|
||||||
nop
|
|
||||||
|
|
||||||
.org 0x300
|
.org 0x300
|
||||||
/* Cache error exception */
|
/* Cache error exception */
|
||||||
1: b 1b
|
uhi_mips_exception
|
||||||
nop
|
|
||||||
|
|
||||||
.org 0x380
|
.org 0x380
|
||||||
/* General exception */
|
/* General exception */
|
||||||
1: b 1b
|
uhi_mips_exception
|
||||||
nop
|
|
||||||
|
|
||||||
.org 0x400
|
.org 0x400
|
||||||
/* Catch interrupt exceptions */
|
/* Catch interrupt exceptions */
|
||||||
1: b 1b
|
uhi_mips_exception
|
||||||
nop
|
|
||||||
|
|
||||||
.org 0x480
|
.org 0x480
|
||||||
/* EJTAG debug exception */
|
/* EJTAG debug exception */
|
||||||
@ -222,6 +230,7 @@ reset:
|
|||||||
|
|
||||||
move a0, zero # a0 <-- boot_flags = 0
|
move a0, zero # a0 <-- boot_flags = 0
|
||||||
PTR_LA t9, board_init_f
|
PTR_LA t9, board_init_f
|
||||||
|
|
||||||
jr t9
|
jr t9
|
||||||
move ra, zero
|
move ra, zero
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user