From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Schwierzeck Date: Mon, 26 Sep 2016 19:45:32 +0200 Subject: [U-Boot] [PATCH 2/9] MIPS: fix ROM exception vectors In-Reply-To: <6D39441BF12EF246A7ABCE6654B023537E511886@HHMAIL01.hh.imgtec.org> References: <20160925180532.19800-1-daniel.schwierzeck@gmail.com> <20160925180532.19800-3-daniel.schwierzeck@gmail.com> <6D39441BF12EF246A7ABCE6654B023537E511886@HHMAIL01.hh.imgtec.org> 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 9:58 GMT+02:00 Matthew Fortune : > Daniel Schwierzeck 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