public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: mxs: Fix vectoring table crafting
Date: Fri, 26 Apr 2013 05:10:55 +0200	[thread overview]
Message-ID: <201304260510.55328.marex@denx.de> (raw)
In-Reply-To: <CAP9ODKr9-=V6rpNA=UV6YNn2hbCOVWmemkWz1z3y2HOK_x_Zyw@mail.gmail.com>

Dear Otavio Salvador,

[...]

> > +/*
> > + * This function will craft a jumptable at 0x0 which will redirect
> > interrupt + * vectoring to proper location of U-Boot in RAM.
> > + *
> > + * The structure of the jumptable will be as follows:
> > + *  ldr pc, [pc, #0x18] ..... for each vector, thus repeated 8 times
> > + *  <destination address> ... for each previous ldr, thus also repeated
> > 8 times + *
> > + * The "ldr pc, [pc, #0x18]" instruction above loads address from memory
> > at + * offset 0x18 from current value of PC register. Note that PC is
> > already + * incremented by 4 when computing the offset, so the effective
> > offset is + * actually 0x20, this the associated <destination address>.
> > Loading the PC + * register with an address performs a jump to that
> > address.
> > + */
> 
> I understood what you're doing but not the motivation for it. What
> problem you're fixing or feature this will allow?

In case the CPU core gets and interrupt (data abort, invalid instruction...), 
the CPU will jump to 0x0. It is imperative for handling code to be present at 
0x0, but since U-Boot on MXS is started from RAM, only remnants of SPL are 
present at 0x0. Any core interrupt will then hit those remnants and cause 
undefined behavior. This patch puts redirection table there which in turn jumps 
to U-Boot vectoring entry points in RAM ... but this is all in the commit 
message already, so dunno if that helps you.

Best regards,
Marek Vasut

  reply	other threads:[~2013-04-26  3:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26  2:37 [U-Boot] [PATCH] arm: mxs: Fix vectoring table crafting Marek Vasut
2013-04-26  3:05 ` Otavio Salvador
2013-04-26  3:10   ` Marek Vasut [this message]
2013-04-26  3:20     ` Otavio Salvador
2013-04-26 12:08       ` Marek Vasut
2013-04-26 20:32 ` Fabio Estevam
2013-06-03 10:50 ` Stefano Babic

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=201304260510.55328.marex@denx.de \
    --to=marex@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox