From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] arm: Allow lr to be saved by board code
Date: Thu, 5 Feb 2015 15:15:49 +0100 [thread overview]
Message-ID: <20150205151549.4cc1a6aa@lilith> (raw)
In-Reply-To: <CAPnjgZ0n6yO1U+_UbJSiV+go6ynfetuRgD9YXw1kDL9V3Z7QXw@mail.gmail.com>
Hello Simon,
On Wed, 4 Feb 2015 19:51:36 -0700, Simon Glass <sjg@chromium.org> wrote:
> Hi Albert,
>
> On 4 February 2015 at 01:59, Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
> > Hello Simon,
> >
> > On Tue, 3 Feb 2015 21:18:52 -0700, Simon Glass <sjg@chromium.org>
> > wrote:
> >> The link register value can be required on some boards (e.g. FEL mode on
> >> sunxi) so stash it to r4 before jumping to save_boot_params().
> >
> > I'd rather not make this there; I would like save_boot_params to start
> > with as unmodified a core state as possible, because r4 might
> > actually, now or in the future, contain important data.
> >
> > I'd even go as far as saying that save_boot_params should be branched
> > into rather than called, and should branch back to a fixed label right
> > after reset, so that even lr is preserved. For SoCs which do not need
> > to save any boot parameters, a weak version of save_boot_params would
> > just do the branching back.
> >
> > (this should help merging all start.S instances into a singe one,
> > which I still want to achieve one day)
>
> I did consider this but was worried that some save_boot_params()
> functions are written in C (OMAP) so this would not work. But if we
> can require it to be written in assembler, or provide an asm macro to
> return from the C function, then I can do that. What do you think?
I think that save_boot_params runs right at reset and cannot rely on any
C environment at all, and should indeed be written in asm and only deal
with *very urgent* savings; only those registers that would be lost
almost immediately, like r0-r14 and some system registers. Anything
else is less urgent and can be processed later, possibly even in
board_init_f().
That being said, OMAP does not have save_boot_params in C that I can
find; actualy, doing a 'git grep save_boot_param -- *.c' shows only
one occurrence, in arch/arm/cpu/armv7/exynos/spl_boot.c, ar line 312,
and it's an empty function. OMAP has an s_init C implementation,
though.
> Regards,
> Simon
Amicalement,
--
Albert.
next prev parent reply other threads:[~2015-02-05 14:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 4:18 [U-Boot] [PATCH 1/5] arm: Use r2 instead of r0 in start.S Simon Glass
2015-02-04 4:18 ` [U-Boot] [PATCH 2/5] arm: Allow reset init to be controlled Simon Glass
2015-02-04 8:50 ` Albert ARIBAUD
2015-02-05 2:51 ` Simon Glass
2015-02-04 4:18 ` [U-Boot] [PATCH 3/5] arm: Allow lr to be saved by board code Simon Glass
2015-02-04 8:59 ` Albert ARIBAUD
2015-02-05 2:51 ` Simon Glass
2015-02-05 14:15 ` Albert ARIBAUD [this message]
2015-02-05 14:19 ` Simon Glass
2015-02-05 21:40 ` Tom Rini
2015-02-04 4:18 ` [U-Boot] [PATCH 4/5] arm: spl: Provide for a board-specific loader Simon Glass
2015-02-04 4:18 ` [U-Boot] [PATCH 5/5] RFC: sunxi: WIP FEL support Simon Glass
2015-02-04 8:47 ` Hans de Goede
2015-02-04 9:04 ` Albert ARIBAUD
2015-02-05 2:52 ` Simon Glass
2015-02-05 8:40 ` Hans de Goede
2015-02-05 10:21 ` Siarhei Siamashka
2015-02-06 5:45 ` Simon Glass
2015-02-04 8:57 ` [U-Boot] [PATCH 1/5] arm: Use r2 instead of r0 in start.S Albert ARIBAUD
2015-02-05 2:51 ` Simon Glass
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=20150205151549.4cc1a6aa@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 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.