[U-Boot] [PATCH 2/9] MIPS: fix ROM exception vectors

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Mon Sep 26 19:45:32 CEST 2016


2016-09-26 9:58 GMT+02:00 Matthew Fortune <Matthew.Fortune at imgtec.com>:
> Daniel Schwierzeck <daniel.schwierzeck at gmail.com> writes:
>> When booting from ROM, early exceptions can't be handled
>> properly. Instead of busy-looping give the developer the
>> possibilty to examine the situation. Thus issue a SDBBP
>> instruction to transfer control to hardware debugger if one
>> is attached.
>
> You could make the SDBBP into a UHI operation that can be read by
> a debugger as an unhandled exception rather than an unexpected
> breakpoint (assuming said debugger knows about UHI). The fragment
> I use in lightweight boot code is:
>
>     move  k0, t9                        # Preserve t9
>     move  k1, a0                        # Preserve a0
>     li    $25, 15                       # UHI exception operation
>     li    $4, 0                         # Use hard register context
>     sdbbp 1                             # Invoke UHI operation
>
> You lose k0/k1 in this which may be undesirable but it might
> be a reasonable trade off. This shouldn't go in the debug vector
> of course!
>

sounds interesting. I'll have a look into that. Can I test this with
OpenOCD and GDB?


-- 
- Daniel


More information about the U-Boot mailing list