All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Fortune <Matthew.Fortune@imgtec.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/9] MIPS: fix ROM exception vectors
Date: Mon, 26 Sep 2016 19:03:27 +0000	[thread overview]
Message-ID: <6D39441BF12EF246A7ABCE6654B023537E512B52@HHMAIL01.hh.imgtec.org> (raw)
In-Reply-To: <CACUy__VB-jvcO_f9S2RDF5XNjP4hFU5=TiNS1X=i5zxsdkAYvA@mail.gmail.com>

Daniel Schwierzeck <daniel.schwierzeck@gmail.com> writes:
> 2016-09-26 9:58 GMT+02:00 Matthew Fortune <Matthew.Fortune@imgtec.com>:
> > Daniel Schwierzeck <daniel.schwierzeck@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?

I'm sorry to say progress with getting UHI into OpenOCD is rather slow.
The main effort for OpenOCD has been part of the MIPSfpga project which
I am not directly involved with. To my knowledge they have the basic
'write' call implemented but are not handling all the operations and
the implementation is out of tree. I'll try and check on this and let
you know.

I had an idea of using a special UHI operation to indicate a boot failure
with a simple enumerated 'reason' code so you could get a quick hint at
what blew up in low level boot code without the source. I.e. any errors
that can be detected without ending up raising an exception. I put two
quickly thought up errors into the UHI spec as an example but I only
have some simplistic boot code to play with. If you think U-boot could
have a range of errors to report like this (and want to use it) then we
can add to the list.

Matthew

  reply	other threads:[~2016-09-26 19:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 18:05 [U-Boot] [PATCH 0/9] MIPS: improve start.S and add exception support Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 1/9] MIPS: make inclusion of ROM exception vectors configurable Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 2/9] MIPS: fix ROM exception vectors Daniel Schwierzeck
2016-09-26  7:58   ` Matthew Fortune
2016-09-26 17:45     ` Daniel Schwierzeck
2016-09-26 19:03       ` Matthew Fortune [this message]
2016-09-25 18:05 ` [U-Boot] [PATCH 3/9] MIPS: fix iand optimize setup of CP0 registers Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 4/9] MIPS: factor out code for initial stack and global data Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 5/9] MIPS: add possibility to setup initial stack and global data in SRAM Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 6/9] MIPS: add asm-offsets for struct pt_regs Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 7/9] MIPS: reserve space for exception vectors Daniel Schwierzeck
2016-09-25 18:05 ` [U-Boot] [PATCH 8/9] MIPS: add handling for generic and EJTAG exceptions Daniel Schwierzeck
2016-09-26 10:29   ` Paul Burton
2016-09-26 17:41     ` Daniel Schwierzeck
2016-09-26 18:15       ` Paul Burton
2016-09-25 18:05 ` [U-Boot] [PATCH 9/9] common/board_f: enable initr_trap for MIPS Daniel Schwierzeck
2016-09-27  0:34   ` Simon Glass
2016-09-26  7:52 ` [U-Boot] [PATCH 0/9] MIPS: improve start.S and add exception support Matthew Fortune

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6D39441BF12EF246A7ABCE6654B023537E512B52@HHMAIL01.hh.imgtec.org \
    --to=matthew.fortune@imgtec.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.