From: E Shattow <e@freeshell.de>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>,
Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>
Cc: Simon Glass <sjg@chromium.org>, Yao Zi <ziyao@disroot.org>,
Emil Renner Berthing <emil.renner.berthing@canonical.com>,
u-boot@lists.denx.de
Subject: Re: [PATCH 1/1] riscv: consider CONFIG_RISCV_ISA_ZAAMO in SPL too
Date: Thu, 16 Oct 2025 13:44:31 -0700 [thread overview]
Message-ID: <43872d3c-475d-484d-9709-4ad810bcaaaa@freeshell.de> (raw)
In-Reply-To: <20251016165851.45311-1-heinrich.schuchardt@canonical.com>
Hi Heinrich, thank you for your attention to this.
On 10/16/25 09:58, Heinrich Schuchardt wrote:
> Commit a681cfecb434 ("riscv: Add a Zalrsc-only alternative for
> synchronization in start.S") changed the hart synchronization in start.S.
> It uses CONFIG_IS_ENABLED(RISCV_ISA_ZAAMO) to determine which method to
> use. If the macro evaluates to true the old behavior is maintained.
>
> The macro evaluates to false for SPL builds which was unintended. Use
> IS_ENABLED(CONFIG_RISCV_ISA_ZAAMO) instead.
>
> This fixes a boot failure on StarFive JH7110 based boards.
>
> Fixes: a681cfecb434 ("riscv: Add a Zalrsc-only alternative for synchronization in start.S")
> Reported-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> arch/riscv/cpu/start.S | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
> index 6324ff585d4..87b3ff0f93f 100644
> --- a/arch/riscv/cpu/start.S
> +++ b/arch/riscv/cpu/start.S
> @@ -151,7 +151,7 @@ call_harts_early_init:
> */
> la t0, hart_lottery
> li t1, 1
> -#if CONFIG_IS_ENABLED(RISCV_ISA_ZAAMO)
> +#if IS_ENABLED(CONFIG_RISCV_ISA_ZAAMO)
> amoswap.w s2, t1, 0(t0)
> bnez s2, wait_for_gd_init
> #else
> @@ -184,7 +184,7 @@ call_harts_early_init:
> #if !CONFIG_IS_ENABLED(XIP)
> #ifdef CONFIG_AVAILABLE_HARTS
> la t0, available_harts_lock
> -#if CONFIG_IS_ENABLED(RISCV_ISA_ZAAMO)
> +#if IS_ENABLED(CONFIG_RISCV_ISA_ZAAMO)
> amoswap.w.rl zero, zero, 0(t0)
> #else
> fence rw, w
> @@ -203,7 +203,7 @@ wait_for_gd_init:
> la t0, available_harts_lock
> li t1, 1
> 1:
> -#if CONFIG_IS_ENABLED(RISCV_ISA_ZAAMO)
> +#if IS_ENABLED(CONFIG_RISCV_ISA_ZAAMO)
> amoswap.w.aq t1, t1, 0(t0)
> #else
> lr.w.aq t1, 0(t0)
> @@ -219,7 +219,7 @@ wait_for_gd_init:
> or t2, t2, t1
> SREG t2, GD_AVAILABLE_HARTS(gp)
>
> -#if CONFIG_IS_ENABLED(RISCV_ISA_ZAAMO)
> +#if IS_ENABLED(CONFIG_RISCV_ISA_ZAAMO)
> amoswap.w.rl zero, zero, 0(t0)
> #else
> fence rw, w
I confirm this restores Pine64 Star64 (JH-7110) SPL boot in origin/next
Are we reverting the bad commit or papering over it with a fix?
Ref. "Revert "riscv: Add a Zalrsc-only alternative for synchronization
in start.S":
https://lore.kernel.org/u-boot/aOylBeAxyoKuPJYa@pie/
In any event, for this patch,
Tested-by: E Shattow <e@freeshell.de>
prev parent reply other threads:[~2025-10-16 20:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 16:58 [PATCH 1/1] riscv: consider CONFIG_RISCV_ISA_ZAAMO in SPL too Heinrich Schuchardt
2025-10-16 17:04 ` Heinrich Schuchardt
2025-10-17 1:33 ` Yao Zi
2025-10-17 7:12 ` Heinrich Schuchardt
2025-10-20 3:41 ` Hal Feng
2025-10-20 9:13 ` Yao Zi
2025-10-20 9:34 ` Heinrich Schuchardt
2025-10-16 20:44 ` E Shattow [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=43872d3c-475d-484d-9709-4ad810bcaaaa@freeshell.de \
--to=e@freeshell.de \
--cc=emil.renner.berthing@canonical.com \
--cc=heinrich.schuchardt@canonical.com \
--cc=rick@andestech.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=ycliang@andestech.com \
--cc=ziyao@disroot.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.