All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] rockchip: spl: make boot0 hook TPL safe
Date: Wed, 12 Jul 2017 12:36:01 +0200	[thread overview]
Message-ID: <E1dVEzx-0000qt-Rj@mail.theobroma-systems.com> (raw)
In-Reply-To: <1499799885-35391-1-git-send-email-philipp.tomsich@theobroma-systems.com>

> When building for a TPL/SPL setup (e.g. on the RK3368), we need the
> TPL stage to have the extra space for for the 'Rockchip SPL name'
> (i.e. 'RK33' word).  Yet, the SPL will start execution at its first
> word (i.e. the first word in the SPL binary needs to be a valid
> instruction).  To make things a bit more involved, CONFIG_SPL_BUILD
> is defined both for the SPL and the TPL stage.
> 
> To avoid having to explicitly test for the first stage (TPL, if and
> only if TPL and SPL are built, SPL otherwise), this commit modifies
> the sequence to repeat the 'b reset' (instead of reserving 4 bytes
> of undefined space) at the start of the boot0 hook: if overwritten
> (and execution starts at the second word), the first instruction is
> still a 'b reset'... if not overwritten, we start on a 'b reset' as
> well.
> 
> This solution wouldn't even require the check whether we are in the
> SPL/TPL build (i.e. CONFIG_SPL_BUILD), but we leave this check in for
> documentation purposes.
> 
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/arm/include/asm/arch-rockchip/boot0.h | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!

      parent reply	other threads:[~2017-07-12 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 19:04 [U-Boot] [PATCH] rockchip: spl: make boot0 hook TPL safe Philipp Tomsich
2017-07-12  0:32 ` Simon Glass
2017-07-12 10:36 ` Philipp Tomsich [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=E1dVEzx-0000qt-Rj@mail.theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.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.