All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: sifive: Fix OF_BOARD boot failure
@ 2022-01-05  1:07 Bin Meng
  2022-01-05  7:14 ` Ilias Apalodimas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bin Meng @ 2022-01-05  1:07 UTC (permalink / raw)
  To: Ilias Apalodimas, Simon Glass, Leo Yu-Chi Liang, Rick Chen,
	Tom Rini, U-Boot Mailing List

When using QEMU to have a quick test of booting U-Boot S-mode payload
directly without the needs of preparing the SPI flash or SD card images
for SiFive Unleashed board, as per the instructions [1], it currently
does not boot any more.

This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer
points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE,
hence we need to add the OF_BOARD logic in board_fdt_blob_setup().

[1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot

Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 board/sifive/unleashed/unleashed.c | 2 +-
 board/sifive/unmatched/unmatched.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c
index 3c3e0e1d0d..f8aad862c6 100644
--- a/board/sifive/unleashed/unleashed.c
+++ b/board/sifive/unleashed/unleashed.c
@@ -117,7 +117,7 @@ int misc_init_r(void)
 void *board_fdt_blob_setup(int *err)
 {
 	*err = 0;
-	if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
+	if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
 		if (gd->arch.firmware_fdt_addr)
 			return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
 	}
diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c
index 4895909f8d..6295deeae2 100644
--- a/board/sifive/unmatched/unmatched.c
+++ b/board/sifive/unmatched/unmatched.c
@@ -14,7 +14,7 @@
 void *board_fdt_blob_setup(int *err)
 {
 	*err = 0;
-	if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
+	if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
 		if (gd->arch.firmware_fdt_addr)
 			return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: sifive: Fix OF_BOARD boot failure
  2022-01-05  1:07 [PATCH] riscv: sifive: Fix OF_BOARD boot failure Bin Meng
@ 2022-01-05  7:14 ` Ilias Apalodimas
  2022-01-05 14:03 ` Simon Glass
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ilias Apalodimas @ 2022-01-05  7:14 UTC (permalink / raw)
  To: Bin Meng
  Cc: Simon Glass, Leo Yu-Chi Liang, Rick Chen, Tom Rini, U-Boot Mailing List

Hi Bin,

On Wed, 5 Jan 2022 at 03:08, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> When using QEMU to have a quick test of booting U-Boot S-mode payload
> directly without the needs of preparing the SPI flash or SD card images
> for SiFive Unleashed board, as per the instructions [1], it currently
> does not boot any more.
>
> This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer
> points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE,
> hence we need to add the OF_BOARD logic in board_fdt_blob_setup().

Looking at the patch history I found these It seems that I had
something similar on [1] but forgot to add it under the Kconfig after
all.

[1] https://lore.kernel.org/u-boot/YVQ9MbtzJpp9+Gv9@apalos.home/

I'd prefer if someone with a RISC-V board checked this as well but FWIW

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
>
> [1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot
>
> Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
> Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE")
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  board/sifive/unleashed/unleashed.c | 2 +-
>  board/sifive/unmatched/unmatched.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c
> index 3c3e0e1d0d..f8aad862c6 100644
> --- a/board/sifive/unleashed/unleashed.c
> +++ b/board/sifive/unleashed/unleashed.c
> @@ -117,7 +117,7 @@ int misc_init_r(void)
>  void *board_fdt_blob_setup(int *err)
>  {
>         *err = 0;
> -       if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
> +       if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
>                 if (gd->arch.firmware_fdt_addr)
>                         return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
>         }
> diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c
> index 4895909f8d..6295deeae2 100644
> --- a/board/sifive/unmatched/unmatched.c
> +++ b/board/sifive/unmatched/unmatched.c
> @@ -14,7 +14,7 @@
>  void *board_fdt_blob_setup(int *err)
>  {
>         *err = 0;
> -       if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
> +       if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
>                 if (gd->arch.firmware_fdt_addr)
>                         return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
>         }
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: sifive: Fix OF_BOARD boot failure
  2022-01-05  1:07 [PATCH] riscv: sifive: Fix OF_BOARD boot failure Bin Meng
  2022-01-05  7:14 ` Ilias Apalodimas
@ 2022-01-05 14:03 ` Simon Glass
  2022-01-06  5:19 ` Bin Meng
  2022-01-07 17:03 ` Tom Rini
  3 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2022-01-05 14:03 UTC (permalink / raw)
  To: Bin Meng
  Cc: Ilias Apalodimas, Leo Yu-Chi Liang, Rick Chen, Tom Rini,
	U-Boot Mailing List

On Tue, 4 Jan 2022 at 18:08, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> When using QEMU to have a quick test of booting U-Boot S-mode payload
> directly without the needs of preparing the SPI flash or SD card images
> for SiFive Unleashed board, as per the instructions [1], it currently
> does not boot any more.
>
> This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer
> points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE,
> hence we need to add the OF_BOARD logic in board_fdt_blob_setup().
>
> [1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot
>
> Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
> Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE")
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  board/sifive/unleashed/unleashed.c | 2 +-
>  board/sifive/unmatched/unmatched.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: sifive: Fix OF_BOARD boot failure
  2022-01-05  1:07 [PATCH] riscv: sifive: Fix OF_BOARD boot failure Bin Meng
  2022-01-05  7:14 ` Ilias Apalodimas
  2022-01-05 14:03 ` Simon Glass
@ 2022-01-06  5:19 ` Bin Meng
  2022-01-07 17:03 ` Tom Rini
  3 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2022-01-06  5:19 UTC (permalink / raw)
  To: Ilias Apalodimas, Simon Glass, Leo Yu-Chi Liang, Rick Chen,
	Tom Rini, U-Boot Mailing List

Hi Tom,

On Wed, Jan 5, 2022 at 9:08 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> When using QEMU to have a quick test of booting U-Boot S-mode payload
> directly without the needs of preparing the SPI flash or SD card images
> for SiFive Unleashed board, as per the instructions [1], it currently
> does not boot any more.
>
> This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer
> points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE,
> hence we need to add the OF_BOARD logic in board_fdt_blob_setup().
>
> [1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot
>
> Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
> Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE")
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  board/sifive/unleashed/unleashed.c | 2 +-
>  board/sifive/unmatched/unmatched.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>

Would you pick up this patch directly for v2022.01?

Regards,
Bin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: sifive: Fix OF_BOARD boot failure
  2022-01-05  1:07 [PATCH] riscv: sifive: Fix OF_BOARD boot failure Bin Meng
                   ` (2 preceding siblings ...)
  2022-01-06  5:19 ` Bin Meng
@ 2022-01-07 17:03 ` Tom Rini
  3 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2022-01-07 17:03 UTC (permalink / raw)
  To: Bin Meng
  Cc: Ilias Apalodimas, Simon Glass, Leo Yu-Chi Liang, Rick Chen,
	U-Boot Mailing List

[-- Attachment #1: Type: text/plain, Size: 969 bytes --]

On Wed, Jan 05, 2022 at 09:07:57AM +0800, Bin Meng wrote:

> When using QEMU to have a quick test of booting U-Boot S-mode payload
> directly without the needs of preparing the SPI flash or SD card images
> for SiFive Unleashed board, as per the instructions [1], it currently
> does not boot any more.
> 
> This was caused by the OF_PRIOR_STAGE removal, as gd->fdt_blob no longer
> points to a valid DTB. OF_BOARD is supposed to replace OF_PRIOR_STAGE,
> hence we need to add the OF_BOARD logic in board_fdt_blob_setup().
> 
> [1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot
> 
> Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards")
> Fixes: d6f8ab30a2af ("treewide: Remove OF_PRIOR_STAGE")
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-07 17:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05  1:07 [PATCH] riscv: sifive: Fix OF_BOARD boot failure Bin Meng
2022-01-05  7:14 ` Ilias Apalodimas
2022-01-05 14:03 ` Simon Glass
2022-01-06  5:19 ` Bin Meng
2022-01-07 17:03 ` Tom Rini

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.