From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: v7-M: Fixing XIP when the kernel is in ROM
Date: Mon, 26 Oct 2015 09:05:37 +0100 [thread overview]
Message-ID: <20151026080537.GW4931@pengutronix.de> (raw)
In-Reply-To: <20151026012710.GA17365@laptop>
Hello,
On Sun, Oct 25, 2015 at 10:27:10PM -0300, Ezequiel Garcia wrote:
> I've been trying to make my ARM v7-M LPC43xx board
> boot a XIP kernel from flash. Currently, this seems
I admit I didn't update my efm32 machine for quite some time, but this
can only boot with XIP.
> to be broken in mainline due to this:
>
> arch/arm/mm/proc-v7m.S
> [..]
> @ SVC to run the kernel in this mode
> badr r1, 1f
> ldr r5, [r12, #11 * 4] @ read the SVC vector entry
> str r1, [r12, #11 * 4] @ write the temporary SVC vector entry
> mov r6, lr @ save LR
> mov r7, sp @ save SP
> ldr sp, =__v7m_setup_stack_top @ <<< Breaks XIP!
If you make the tab above 8 spaces the line will align in the git
commit, too.
Hmm, this line is there from the beginning (i.e. 55bdd6941165 ("ARM: Add
base support for ARMv7-M")).
> cpsie i
> svc #0
> 1: cpsid i
> str r5, [r12, #11 * 4] @ restore the original SVC vector entry
> mov lr, r6 @ restore LR
> mov sp, r7 @ restore SP
>
> Here, a temporary stack is prepared before making a
> supervisor call (SVC) to switch to handler mode.
>
> The temporary stack is allocated in the .text.init section
> and so this doesn't work when the kernel is executing from ROM.
If sp isn't used, how does it break you setup? Did you try to put a
watchpoint to the location in question?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2015-10-26 8:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 1:27 v7-M: Fixing XIP when the kernel is in ROM Ezequiel Garcia
2015-10-26 8:05 ` Uwe Kleine-König [this message]
2015-10-26 13:12 ` Ezequiel Garcia
2015-10-27 15:35 ` Ezequiel Garcia
2015-10-27 16:03 ` Maxime Coquelin
2015-10-27 20:25 ` Maxime Coquelin
2015-10-27 20:33 ` Stefan Agner
2015-10-27 21:33 ` Maxime Coquelin
2015-10-27 21:46 ` Ezequiel Garcia
2015-10-27 21:52 ` Maxime Coquelin
2015-10-27 22:08 ` Ezequiel Garcia
2015-10-28 7:43 ` Uwe Kleine-König
2015-11-03 17:52 ` Chris Brandt
2015-11-03 20:09 ` Uwe Kleine-König
2015-11-03 20:30 ` Russell King - ARM Linux
2015-10-27 20:21 ` Uwe Kleine-König
2015-10-27 20:57 ` Ezequiel Garcia
2015-10-27 21:20 ` Uwe Kleine-König
2015-10-27 22:40 ` Russell King - ARM Linux
2015-10-28 7:34 ` Uwe Kleine-König
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=20151026080537.GW4931@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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.