[U-Boot] [PATCH 8/9] MIPS: add handling for generic and EJTAG exceptions
Daniel Schwierzeck
daniel.schwierzeck at gmail.com
Mon Sep 26 19:41:22 CEST 2016
2016-09-26 12:29 GMT+02:00 Paul Burton <paul.burton at imgtec.com>:
>
>
> Something I've had in the U-Boot source we use on Boston, Malta & SEAD-3
> boards internally for a while is the ability to longjmp back to the shell
> after an exception. It seems to work pretty well & generally means
> exceptions are non-fatal. I'll submit that once this goes in.
But this only works for commands issues at the U-Boot prompt? If the
init code crashes,
then you have no valid code to jump to.
>
>> +
>
>> + .macro RESTORE_TEMP
>
>> + LONG_L $24, PT_LO(sp)
>
>> + mtlo $24
>
>> + LONG_L $24, PT_HI(sp)
>
>> + mthi $24
>
>
>
> The hi & lo bits here & in the save code above need to be wrapped in "#if
> __mips_isa_rev < 6", since the hi & lo registers were removed in MIPSr6.
>
ok, I'll do a resync with Linux's arch/mips/include/asm/stackframe.h.
>
>> +void trap_init(ulong reloc_addr)
>
>> +{
>
>> + unsigned long ebase = gd->irq_sp;
>
>> +
>
>> + set_handler(0x180, &except_vec3_generic, 0x80);
>
>> + set_handler(0x280, &except_vec_ejtag_debug, 0x80);
>
>> +
>
>> + write_c0_ebase(ebase);
>
>> + clear_c0_status(ST0_BEV);
>
>
>
> I think strictly speaking we should probably have an ehb instruction at the
> end of trap_init so that we know the new ebase takes effect straight away.
Sounds plausible. Shall I import arch/mips/include/asm/hazards.h from Linux?
>
>
>
> With the R6 change mentioned above this works fine on a 64r6el (I6400)
> Boston board, so feel free to add:
>
>
>
> Reviewed-by: Paul Burton <paul.burton at imgtec.com>
>
> Tested-by: Paul Burton <paul.burton at imgtec.com>
>
thanks for testing and reviewing
--
- Daniel
More information about the U-Boot
mailing list