From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] ARM: interrupt_init before relocation, write fails
Date: Thu, 7 Nov 2013 10:15:02 +0100 [thread overview]
Message-ID: <20131107101502.25db21ac@lilith> (raw)
In-Reply-To: <CAExZSpT5tir=7den1dfvSbGTLm9OZatq_a=YiKij43ifT0iYdQ@mail.gmail.com>
Hi Joe,
On Wed, 6 Nov 2013 09:18:53 -0700, Joe Kulikauskas
<jkulikauskas@cardinalpeak.com> wrote:
> Hi,
>
> Rob, yes that's correct.
>
> To Albert's question: the disassembled instruction I had showed
> LDR R3,ff0a0fc0 is load of r3 with address of the variable holding
> the stack address; "this write" is the str which I've now copied in below.
> IRQ_STACK_START_IN = gd->irq_sp + 8;
> ff0a0fb0: e5992044 ldr r2, [r9, #68] ; 0x44
> ff0a0fb4: e2822008 add r2, r2, #8
> ff0a0fb8: e5832000 str r2, [r3]
>
> For my target, IIRC the write to flash caused problem in the flash
> controller hardware, breaking further instruction fetches. On other
> platforms the write to flash may fail silently. But the issue is that
> interrupt_init() moving into board_init_f (i.e. before relocation)
> generally just doesn't work right.
>
> Joe
Thanks Rob and Joe for the clarification.
Indeed interrupt_init() cannot execute before relocation as it sets
globals.
Further, interrupt_init() uses globals to communicate with start.S.
This should be changed. I understand that is because the interrupt
handlers actually set the interrupt stack when they are invoked -- and
that is unnecessary; stacks should be set up as soon as their addresses
are known.
I'll revert the patch as soon as I finish getting the current PRs in.
I have a start.S rewrite effort underway whcuh I should post soon.
I'll add to it a change to the way stacks are initialized.
Amicalement,
--
Albert.
prev parent reply other threads:[~2013-11-07 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-23 17:41 [U-Boot] ARM: interrupt_init before relocation, write fails Joe Kulikauskas
2013-10-24 21:37 ` Andrew Ruder
2013-11-05 16:22 ` Rob Herring
2013-11-05 19:17 ` Albert ARIBAUD
2013-11-05 19:46 ` Rob Herring
2013-11-06 16:18 ` Joe Kulikauskas
2013-11-07 9:15 ` Albert ARIBAUD [this message]
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=20131107101502.25db21ac@lilith \
--to=albert.u.boot@aribaud.net \
--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