From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Schwierzeck Date: Mon, 26 Sep 2016 19:41:22 +0200 Subject: [U-Boot] [PATCH 8/9] MIPS: add handling for generic and EJTAG exceptions In-Reply-To: <9930506.s6XfmmmqN3@np-p-burton> References: <20160925180532.19800-1-daniel.schwierzeck@gmail.com> <20160925180532.19800-9-daniel.schwierzeck@gmail.com> <9930506.s6XfmmmqN3@np-p-burton> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 2016-09-26 12:29 GMT+02:00 Paul Burton : > > > 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 > > Tested-by: Paul Burton > thanks for testing and reviewing -- - Daniel