diff mbox series

[v7,15/17] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin

Message ID 20240227163019.2876942-16-dario.binacchi@amarulasolutions.com
State Superseded, archived
Headers show
Series Add support for AM62x-SK HS-FS devices | expand

Commit Message

Dario Binacchi Feb. 27, 2024, 4:30 p.m. UTC
Recent versions of U-Boot are capable of building tiboot3.bin using
Binman. In this case, let's copy it to the binaries directory.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v6:
- Replace `find' command with `cp' one.

Changes in v5:
- Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with
  tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin

Added in v4

 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andreas Dannenberg Feb. 29, 2024, 2:22 a.m. UTC | #1
Hi Dario,

On Tue, Feb 27, 2024 at 05:30:17PM +0100, Dario Binacchi wrote:
> Recent versions of U-Boot are capable of building tiboot3.bin using
> Binman. In this case, let's copy it to the binaries directory.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Changes in v6:
> - Replace `find' command with `cp' one.
> 
> Changes in v5:
> - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with
>   tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin
> 
> Added in v4
> 
>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> index fdb058f3b72a..cbdb653278f8 100644
> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
>  endef
>  
> +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE))
> +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC))
> +
>  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
>  	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> +	cp $(@D)/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin $(BINARIES_DIR)/tiboot3.bin

Have you tried doing a clean build of ti_am64x_sk_defconfig? When I do
that the change above breaks the build...

<snip>
>>> ti-k3-r5-loader 2022.10 Installing to images directory
cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/spl/u-boot-spl.bin /home/a0797059/git/buildroot/output/images/r5-u-boot-spl
.bin
cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin /home/a0797059/git/buildroot/output/images/tiboot3.b
in
cp: cannot stat '/home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin': No such file or directory
make[1]: *** [package/pkg-generic.mk:364: /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/.stamp_images_installed] Error 1
make: *** [Makefile:82: _all] Error 2
<snip>

Looks like the tiboot3.bin file is already there, and nothing needs to
be copied or renamed. Not sure what is best way to manage this
dependency as this is the behavior of the older U-Boot. I'd probably
just migrate the am64x_sk support to binman too also using the
same/newer U-Boot you are already using for AM62x, making everything
equivalent of the am62x_sk support you are focused on with this series.

--
Andreas Dannenberg
Texas Instruments Inc





>  endef
>  
>  $(eval $(kconfig-package))
> -- 
> 2.43.0
>
Dario Binacchi Feb. 29, 2024, 11:37 a.m. UTC | #2
Hi Andreas,

On Thu, Feb 29, 2024 at 3:22 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
>
> Hi Dario,
>
> On Tue, Feb 27, 2024 at 05:30:17PM +0100, Dario Binacchi wrote:
> > Recent versions of U-Boot are capable of building tiboot3.bin using
> > Binman. In this case, let's copy it to the binaries directory.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >
> > ---
> >
> > Changes in v6:
> > - Replace `find' command with `cp' one.
> >
> > Changes in v5:
> > - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with
> >   tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin
> >
> > Added in v4
> >
> >  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > index fdb058f3b72a..cbdb653278f8 100644
> > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS
> >       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> >  endef
> >
> > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE))
> > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC))
> > +
> >  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> >       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> > +     cp $(@D)/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin $(BINARIES_DIR)/tiboot3.bin
>
> Have you tried doing a clean build of ti_am64x_sk_defconfig? When I do
> that the change above breaks the build...
>
> <snip>
> >>> ti-k3-r5-loader 2022.10 Installing to images directory
> cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/spl/u-boot-spl.bin /home/a0797059/git/buildroot/output/images/r5-u-boot-spl
> .bin
> cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin /home/a0797059/git/buildroot/output/images/tiboot3.b
> in
> cp: cannot stat '/home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin': No such file or directory
> make[1]: *** [package/pkg-generic.mk:364: /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/.stamp_images_installed] Error 1
> make: *** [Makefile:82: _all] Error 2
> <snip>
>
> Looks like the tiboot3.bin file is already there, and nothing needs to
> be copied or renamed. Not sure what is best way to manage this
> dependency as this is the behavior of the older U-Boot. I'd probably
> just migrate the am64x_sk support to binman too also using the
> same/newer U-Boot you are already using for AM62x, making everything
> equivalent of the am62x_sk support you are focused on with this series.

I am modifying the configuration ti_am64x_sk_defconfig so that,
similarly to what was done for ti_am62x_sk_defconfig,
it uses a U-Boot 2024.01 that makes use of binman:

https://patchwork.ozlabs.org/project/buildroot/patch/20240224205654.1546744-17-dario.binacchi@amarulasolutions.com/

Thanks and regards,
Dario

>
> --
> Andreas Dannenberg
> Texas Instruments Inc
>
>
>
>
>
> >  endef
> >
> >  $(eval $(kconfig-package))
> > --
> > 2.43.0
> >
Andreas Dannenberg March 1, 2024, 12:06 a.m. UTC | #3
Hi Dario,

On Thu, Feb 29, 2024 at 12:37:57PM +0100, Dario Binacchi wrote:
> Hi Andreas,
> 
> On Thu, Feb 29, 2024 at 3:22 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
> >
> > Hi Dario,
> >
> > On Tue, Feb 27, 2024 at 05:30:17PM +0100, Dario Binacchi wrote:
> > > Recent versions of U-Boot are capable of building tiboot3.bin using
> > > Binman. In this case, let's copy it to the binaries directory.
> > >
> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > >
> > > ---
> > >
> > > Changes in v6:
> > > - Replace `find' command with `cp' one.
> > >
> > > Changes in v5:
> > > - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with
> > >   tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin
> > >
> > > Added in v4
> > >
> > >  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > > index fdb058f3b72a..cbdb653278f8 100644
> > > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > > @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS
> > >       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> > >  endef
> > >
> > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE))
> > > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC))
> > > +
> > >  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> > >       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> > > +     cp $(@D)/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin $(BINARIES_DIR)/tiboot3.bin
> >
> > Have you tried doing a clean build of ti_am64x_sk_defconfig? When I do
> > that the change above breaks the build...
> >
> > <snip>
> > >>> ti-k3-r5-loader 2022.10 Installing to images directory
> > cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/spl/u-boot-spl.bin /home/a0797059/git/buildroot/output/images/r5-u-boot-spl
> > .bin
> > cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin /home/a0797059/git/buildroot/output/images/tiboot3.b
> > in
> > cp: cannot stat '/home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin': No such file or directory
> > make[1]: *** [package/pkg-generic.mk:364: /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/.stamp_images_installed] Error 1
> > make: *** [Makefile:82: _all] Error 2
> > <snip>
> >
> > Looks like the tiboot3.bin file is already there, and nothing needs to
> > be copied or renamed. Not sure what is best way to manage this
> > dependency as this is the behavior of the older U-Boot. I'd probably
> > just migrate the am64x_sk support to binman too also using the
> > same/newer U-Boot you are already using for AM62x, making everything
> > equivalent of the am62x_sk support you are focused on with this series.
> 
> I am modifying the configuration ti_am64x_sk_defconfig so that,
> similarly to what was done for ti_am62x_sk_defconfig,
> it uses a U-Boot 2024.01 that makes use of binman:
> 
> https://patchwork.ozlabs.org/project/buildroot/patch/20240224205654.1546744-17-dario.binacchi@amarulasolutions.com/

Ah ok I see your earlier post on this now. Nothing wrong with trying to
split things (it's not fun trying to maintain ~20 patches in one go) but
we can't break things obviously.

If the concern is around testing, I'll be happy to help wih this, I can
readily access GP and HS-FS variants of SK-AM64 and help testing on
short notice. Will keep a close eye out for anything you may need that I
can pitch in here.

Thanks,

--
Andreas Dannenberg
Texas Instruments Inc


> 
> Thanks and regards,
> Dario
> 
> >
> > --
> > Andreas Dannenberg
> > Texas Instruments Inc
> >
> >
> >
> >
> >
> > >  endef
> > >
> > >  $(eval $(kconfig-package))
> > > --
> > > 2.43.0
> > >
> 
> 
> 
> -- 
> 
> Dario Binacchi
> 
> Senior Embedded Linux Developer
> 
> dario.binacchi@amarulasolutions.com
> 
> __________________________________
> 
> 
> Amarula Solutions SRL
> 
> Via Le Canevare 30, 31100 Treviso, Veneto, IT
> 
> T. +39 042 243 5310
> info@amarulasolutions.com
> 
> www.amarulasolutions.com
Dario Binacchi March 1, 2024, 2:03 p.m. UTC | #4
Hi Andreas and Romain,

On Fri, Mar 1, 2024 at 1:06 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
>
> Hi Dario,
>
> On Thu, Feb 29, 2024 at 12:37:57PM +0100, Dario Binacchi wrote:
> > Hi Andreas,
> >
> > On Thu, Feb 29, 2024 at 3:22 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
> > >
> > > Hi Dario,
> > >
> > > On Tue, Feb 27, 2024 at 05:30:17PM +0100, Dario Binacchi wrote:
> > > > Recent versions of U-Boot are capable of building tiboot3.bin using
> > > > Binman. In this case, let's copy it to the binaries directory.
> > > >
> > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > > >
> > > > ---
> > > >
> > > > Changes in v6:
> > > > - Replace `find' command with `cp' one.
> > > >
> > > > Changes in v5:
> > > > - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with
> > > >   tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin
> > > >
> > > > Added in v4
> > > >
> > > >  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > > > index fdb058f3b72a..cbdb653278f8 100644
> > > > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > > > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > > > @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS
> > > >       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> > > >  endef
> > > >
> > > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE))
> > > > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC))
> > > > +
> > > >  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> > > >       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> > > > +     cp $(@D)/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin $(BINARIES_DIR)/tiboot3.bin
> > >
> > > Have you tried doing a clean build of ti_am64x_sk_defconfig? When I do
> > > that the change above breaks the build...
> > >
> > > <snip>
> > > >>> ti-k3-r5-loader 2022.10 Installing to images directory
> > > cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/spl/u-boot-spl.bin /home/a0797059/git/buildroot/output/images/r5-u-boot-spl
> > > .bin
> > > cp /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin /home/a0797059/git/buildroot/output/images/tiboot3.b
> > > in
> > > cp: cannot stat '/home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/tiboot3-am64x-gp-*.bin': No such file or directory
> > > make[1]: *** [package/pkg-generic.mk:364: /home/a0797059/git/buildroot/output/build/ti-k3-r5-loader-2022.10/.stamp_images_installed] Error 1
> > > make: *** [Makefile:82: _all] Error 2
> > > <snip>
> > >
> > > Looks like the tiboot3.bin file is already there, and nothing needs to
> > > be copied or renamed. Not sure what is best way to manage this
> > > dependency as this is the behavior of the older U-Boot. I'd probably
> > > just migrate the am64x_sk support to binman too also using the
> > > same/newer U-Boot you are already using for AM62x, making everything
> > > equivalent of the am62x_sk support you are focused on with this series.
> >
> > I am modifying the configuration ti_am64x_sk_defconfig so that,
> > similarly to what was done for ti_am62x_sk_defconfig,
> > it uses a U-Boot 2024.01 that makes use of binman:
> >
> > https://patchwork.ozlabs.org/project/buildroot/patch/20240224205654.1546744-17-dario.binacchi@amarulasolutions.com/
>
> Ah ok I see your earlier post on this now. Nothing wrong with trying to
> split things (it's not fun trying to maintain ~20 patches in one go) but
> we can't break things obviously.

I submitted version 8, which fixes the compilation error for HS (*) and
added patches that update the configuration ti_am64x_sk_defconfig and
remove the no longer necessary ti-k3-image-gen package.

(*) [v8,15/23] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
>>> ti-k3-r5-loader 2024.01 Installing to target
>>> ti-k3-r5-loader 2024.01 Installing to images directory
cp /home/dario/projects/passgat/buildroot-ti-am62x-sk/buildroot/output/build/ti-k3-r5-loader-2024.01/spl/u-boot-spl.bin
/home/dario/projects/passgat/buildroot-ti-am62x-sk/buildroot/output/images/r5-u-boot-spl.bin
cp /home/dario/projects/passgat/buildroot-ti-am62x-sk/buildroot/output/build/ti-k3-r5-loader-2024.01/tiboot3-am62x-hs-*.bin
/home/dario/projects/passgat/buildroot-ti-am62x-sk/buildroot/output/images/tiboot3.bin
cp: target '/home/dario/projects/passgat/buildroot-ti-am62x-sk/buildroot/output/images/tiboot3.bin'
is not a directory
make[1]: *** [package/pkg-generic.mk:364:
/home/dario/projects/passgat/buildroot-ti-am62x-sk/buildroot/output/build/ti-k3-r5-loader-2024.01/.stamp_images_installed]
Error 1
make: *** [Makefile:82: _all] Error 2

For HS case, two tiboot3 files were found:
tiboot3-am62x-hs-evm.bin and tiboot3-am62x-hs-fs-evm.bin
so the cp command failed.

Thanks and regards,
Dario

>
> If the concern is around testing, I'll be happy to help wih this, I can
> readily access GP and HS-FS variants of SK-AM64 and help testing on
> short notice. Will keep a close eye out for anything you may need that I
> can pitch in here.
>
> Thanks,
>
> --
> Andreas Dannenberg
> Texas Instruments Inc
>
>
> >
> > Thanks and regards,
> > Dario
> >
> > >
> > > --
> > > Andreas Dannenberg
> > > Texas Instruments Inc
> > >
> > >
> > >
> > >
> > >
> > > >  endef
> > > >
> > > >  $(eval $(kconfig-package))
> > > > --
> > > > 2.43.0
> > > >
> >
> >
> >
> > --
> >
> > Dario Binacchi
> >
> > Senior Embedded Linux Developer
> >
> > dario.binacchi@amarulasolutions.com
> >
> > __________________________________
> >
> >
> > Amarula Solutions SRL
> >
> > Via Le Canevare 30, 31100 Treviso, Veneto, IT
> >
> > T. +39 042 243 5310
> > info@amarulasolutions.com
> >
> > www.amarulasolutions.com



--

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com
diff mbox series

Patch

diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
index fdb058f3b72a..cbdb653278f8 100644
--- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
@@ -70,8 +70,12 @@  define TI_K3_R5_LOADER_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
 endef
 
+TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE))
+TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC))
+
 define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
 	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
+	cp $(@D)/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin $(BINARIES_DIR)/tiboot3.bin
 endef
 
 $(eval $(kconfig-package))