diff mbox series

am625x_evm_a53: Tweak boot command to set fdt

Message ID 20240326142634.2043539-1-martyn.welch@collabora.com
State Accepted
Commit 17a820920b7a72940b09b359e2972f36442badf3
Delegated to: Tom Rini
Headers show
Series am625x_evm_a53: Tweak boot command to set fdt | expand

Commit Message

Martyn Welch March 26, 2024, 2:26 p.m. UTC
With the current config for tha SK-AM62, fdtfile isn't set in the U-Boot
environment. When using bootflow to boot from a block device, where the
extlinux.conf file specifies `fdtdir`, a fallback device tree is being
constructed from the `soc` (`k3`) and `board` (`am62x`) environment
variables, resulting in u-Boot trying to retrieve
`/dtbs/6.8.1+/k3-am62x.dtb`. This file doesn't exist.

The environment variables `default_device_tree` and
`default_device_tree_arch` are set in the config, the `findfdt` script
can be called to construct `fdtfile` from the environment variables set
by these config options, however this script currently isn't being run.

Calling this script results in the correct device tree being retrieved:

   Retrieving file: /dtbs/6.8.1+/ti/k3-am625-sk.dtb

Many boards are calling this script as part of their boot command. The
am62x currently isn't. Rectify this so that booting works correctly.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
---
 configs/am62x_evm_a53_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christopher Obbard March 26, 2024, 2:35 p.m. UTC | #1
Hi Martyn.

On Tue, 2024-03-26 at 14:26 +0000, Martyn Welch wrote:
> With the current config for tha SK-AM62, fdtfile isn't set in the U-Boot
> environment. When using bootflow to boot from a block device, where the
> extlinux.conf file specifies `fdtdir`, a fallback device tree is being
> constructed from the `soc` (`k3`) and `board` (`am62x`) environment
> variables, resulting in u-Boot trying to retrieve
> `/dtbs/6.8.1+/k3-am62x.dtb`. This file doesn't exist.
> 
> The environment variables `default_device_tree` and
> `default_device_tree_arch` are set in the config, the `findfdt` script
> can be called to construct `fdtfile` from the environment variables set
> by these config options, however this script currently isn't being run.
> 
> Calling this script results in the correct device tree being retrieved:
> 
>    Retrieving file: /dtbs/6.8.1+/ti/k3-am625-sk.dtb
> 
> Many boards are calling this script as part of their boot command. The
> am62x currently isn't. Rectify this so that booting works correctly.
> 
> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>

Would this also be appropriate to add to the defconfig for other AM62x boards
(e.g beagleplay) ?

Anyway, for this device:

Reviewed-by: Christopher Obbard <chris.obbard@collabora.com>

> ---
>  configs/am62x_evm_a53_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/am62x_evm_a53_defconfig
> b/configs/am62x_evm_a53_defconfig
> index 78287ec18a..e373e44a93 100644
> --- a/configs/am62x_evm_a53_defconfig
> +++ b/configs/am62x_evm_a53_defconfig
> @@ -30,7 +30,7 @@ CONFIG_SPL_LOAD_FIT=y
>  CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
>  CONFIG_BOOTSTD_FULL=y
>  CONFIG_SYS_BOOTM_LEN=0x800000
> -CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
> +CONFIG_BOOTCOMMAND="run findfdt; run envboot; bootflow scan -lb"
>  CONFIG_BOARD_LATE_INIT=y
>  CONFIG_SPL_MAX_SIZE=0x58000
>  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y

Thanks!

Chris
Martyn Welch March 26, 2024, 3:13 p.m. UTC | #2
On Tue, 2024-03-26 at 14:35 +0000, Christopher Obbard wrote:
> Hi Martyn.
> 
> On Tue, 2024-03-26 at 14:26 +0000, Martyn Welch wrote:
> > With the current config for tha SK-AM62, fdtfile isn't set in the
> > U-Boot
> > environment. When using bootflow to boot from a block device, where
> > the
> > extlinux.conf file specifies `fdtdir`, a fallback device tree is
> > being
> > constructed from the `soc` (`k3`) and `board` (`am62x`) environment
> > variables, resulting in u-Boot trying to retrieve
> > `/dtbs/6.8.1+/k3-am62x.dtb`. This file doesn't exist.
> > 
> > The environment variables `default_device_tree` and
> > `default_device_tree_arch` are set in the config, the `findfdt`
> > script
> > can be called to construct `fdtfile` from the environment variables
> > set
> > by these config options, however this script currently isn't being
> > run.
> > 
> > Calling this script results in the correct device tree being
> > retrieved:
> > 
> >    Retrieving file: /dtbs/6.8.1+/ti/k3-am625-sk.dtb
> > 
> > Many boards are calling this script as part of their boot command.
> > The
> > am62x currently isn't. Rectify this so that booting works
> > correctly.
> > 
> > Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
> 
> Would this also be appropriate to add to the defconfig for other
> AM62x boards
> (e.g beagleplay) ?
> 

Hi Chris,

Probably, but this is the only board I have available to test.

Martyn

> Anyway, for this device:
> 
> Reviewed-by: Christopher Obbard <chris.obbard@collabora.com>
> 
> > ---
> >  configs/am62x_evm_a53_defconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/configs/am62x_evm_a53_defconfig
> > b/configs/am62x_evm_a53_defconfig
> > index 78287ec18a..e373e44a93 100644
> > --- a/configs/am62x_evm_a53_defconfig
> > +++ b/configs/am62x_evm_a53_defconfig
> > @@ -30,7 +30,7 @@ CONFIG_SPL_LOAD_FIT=y
> >  CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
> >  CONFIG_BOOTSTD_FULL=y
> >  CONFIG_SYS_BOOTM_LEN=0x800000
> > -CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
> > +CONFIG_BOOTCOMMAND="run findfdt; run envboot; bootflow scan -lb"
> >  CONFIG_BOARD_LATE_INIT=y
> >  CONFIG_SPL_MAX_SIZE=0x58000
> >  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> 
> Thanks!
> 
> Chris
Andrew Davis March 26, 2024, 9:28 p.m. UTC | #3
On 3/26/24 9:26 AM, Martyn Welch wrote:
> With the current config for tha SK-AM62, fdtfile isn't set in the U-Boot
> environment. When using bootflow to boot from a block device, where the
> extlinux.conf file specifies `fdtdir`, a fallback device tree is being
> constructed from the `soc` (`k3`) and `board` (`am62x`) environment
> variables, resulting in u-Boot trying to retrieve
> `/dtbs/6.8.1+/k3-am62x.dtb`. This file doesn't exist.
> 
> The environment variables `default_device_tree` and
> `default_device_tree_arch` are set in the config, the `findfdt` script
> can be called to construct `fdtfile` from the environment variables set
> by these config options, however this script currently isn't being run.
> 

I think this patch will be unneeded after this series goes in:

https://lore.kernel.org/u-boot/20240109191506.3820908-1-nm@ti.com/

Andrew

> Calling this script results in the correct device tree being retrieved:
> 
>     Retrieving file: /dtbs/6.8.1+/ti/k3-am625-sk.dtb
> 
> Many boards are calling this script as part of their boot command. The
> am62x currently isn't. Rectify this so that booting works correctly.
> 
> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
> ---
>   configs/am62x_evm_a53_defconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
> index 78287ec18a..e373e44a93 100644
> --- a/configs/am62x_evm_a53_defconfig
> +++ b/configs/am62x_evm_a53_defconfig
> @@ -30,7 +30,7 @@ CONFIG_SPL_LOAD_FIT=y
>   CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
>   CONFIG_BOOTSTD_FULL=y
>   CONFIG_SYS_BOOTM_LEN=0x800000
> -CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
> +CONFIG_BOOTCOMMAND="run findfdt; run envboot; bootflow scan -lb"
>   CONFIG_BOARD_LATE_INIT=y
>   CONFIG_SPL_MAX_SIZE=0x58000
>   CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
Tom Rini April 12, 2024, 2:12 a.m. UTC | #4
On Tue, 26 Mar 2024 14:26:33 +0000, Martyn Welch wrote:

> With the current config for tha SK-AM62, fdtfile isn't set in the U-Boot
> environment. When using bootflow to boot from a block device, where the
> extlinux.conf file specifies `fdtdir`, a fallback device tree is being
> constructed from the `soc` (`k3`) and `board` (`am62x`) environment
> variables, resulting in u-Boot trying to retrieve
> `/dtbs/6.8.1+/k3-am62x.dtb`. This file doesn't exist.
> 
> [...]

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 78287ec18a..e373e44a93 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -30,7 +30,7 @@  CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_BOOTSTD_FULL=y
 CONFIG_SYS_BOOTM_LEN=0x800000
-CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
+CONFIG_BOOTCOMMAND="run findfdt; run envboot; bootflow scan -lb"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x58000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y