Message ID | 20250211093349.2153008-1-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
On Tue, Feb 11, 2025 at 10:33:49AM +0100, Dario Binacchi wrote: > The commit 4bce3270d680 ("Config.in: timeout earlier when connecting to > download servers"), among other things, adds the connection timeout > parameter to the default scp command: > > config BR2_SCP > string "Secure copy (scp) command" > default "scp -o ConnectTimeout=10" > > Since the package/pkg-download.mk file exports this command using the > SCP variable: > > export SCP := $(call qstrip,$(BR2_SCP)) > > and the U-Boot Makefile uses this variable as the path for the system > control processor (SCP) firmware blob: > > cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ > $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \ > --toolpath $(objtree)/tools \ > $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ > build -u -d $(binman_dtb) -O . -m \ > --allow-missing --fake-ext-blobs \ > $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ > -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ > $(foreach f,$(of_list_dirs),-I $(f)) -a of-list=$(of_list) \ > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > -a atf-bl31-path=${BL31} \ > -a tee-os-path=${TEE} \ > -a ti-dm-path=${TI_DM} \ > -a opensbi-path=${OPENSBI} \ > -a default-dt=$(default_dt) \ > -a scp-path=$(SCP) \ > > the following error occurs: > > BINMAN .binman_stamp > usage: binman [-h] [-B BUILD_DIR] [-D] [-H] [--tooldir TOOLDIR] [--toolpath TOOLPATH] [-T THREADS] [--test-section-timeout] [-v VERBOSITY] [-V] > {build,bintool-docs,entry-docs,ls,extract,replace,sign,test,tool} ... > binman: error: unrecognized arguments: -o ConnectTimeout=10 > make[2]: *** [Makefile:1126: .binman_stamp] Error 2 > > The issue was already present, as the scp command was being passed > instead of the path to the SCP firmware, but it is now detected due to > the compilation error. > > Adding the BR2_TARGET_UBOOT_SCP_FIRMWARE option allows passing the > correct parameter to U-Boot, even if it is not set. This also requires > removing the SCP setting from BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS for > configurations that previously set this variable explicitly. > > Fixes: 4bce3270d680 ("Config.in: timeout earlier when connecting to download servers") > Suggested-by: Julien Olivain <ju.o@free.fr> > Co-Developed-by: Julien Olivain <ju.o@free.fr> > Signed-off-by: Julien Olivain <ju.o@free.fr> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > boot/uboot/Config.in | 8 ++++++++ > boot/uboot/uboot.mk | 3 ++- > configs/olimex_a64_olinuxino_defconfig | 2 +- > configs/orangepi_pc2_defconfig | 2 +- > configs/orangepi_zero2w_defconfig | 2 +- > configs/orangepi_zero3_defconfig | 2 +- > configs/orangepi_zero_plus2_defconfig | 2 +- > configs/orangepi_zero_plus_defconfig | 2 +- > configs/pine64_defconfig | 2 +- > support/testing/tests/boot/test_atf.py | 2 +- > 10 files changed, 18 insertions(+), 9 deletions(-) > > diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in > index f17f932c9e95..6087534fee2d 100644 > --- a/boot/uboot/Config.in > +++ b/boot/uboot/Config.in > @@ -744,4 +744,12 @@ config BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS > List of custom make options passed at build time. Can be > used for example to pass a DEVICE_TREE= value. > > +config BR2_TARGET_UBOOT_SCP_FIRMWARE > + string "System Control Processor (SCP) firmware location" > + help > + Location of a SCP firmware binary. > + > + If not empty, holds firmware for an external platform-specific > + coprocessor. > + > endif # BR2_TARGET_UBOOT > diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk > index 2796b0a31010..18997cbdbe26 100644 > --- a/boot/uboot/uboot.mk > +++ b/boot/uboot/uboot.mk > @@ -176,7 +176,8 @@ UBOOT_MAKE_OPTS += \ > ARCH=$(UBOOT_ARCH) \ > HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \ > HOSTLDFLAGS="$(HOST_LDFLAGS)" \ > - $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) > + $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) \ > + SCP=$(BR2_TARGET_UBOOT_SCP_FIRMWARE) > > # Disable FDPIC if enabled by default in toolchain > ifeq ($(BR2_BINFMT_FDPIC),y) > diff --git a/configs/olimex_a64_olinuxino_defconfig b/configs/olimex_a64_olinuxino_defconfig > index ad446ea18c82..b63ea51bc6d3 100644 > --- a/configs/olimex_a64_olinuxino_defconfig > +++ b/configs/olimex_a64_olinuxino_defconfig > @@ -29,7 +29,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_FORMAT_CUSTOM=y > BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_DOSFSTOOLS=y > BR2_PACKAGE_HOST_GENIMAGE=y > BR2_PACKAGE_HOST_MTOOLS=y > diff --git a/configs/orangepi_pc2_defconfig b/configs/orangepi_pc2_defconfig > index 46d04b34c845..d61ffd0f5f24 100644 > --- a/configs/orangepi_pc2_defconfig > +++ b/configs/orangepi_pc2_defconfig > @@ -33,5 +33,5 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_GENIMAGE=y > diff --git a/configs/orangepi_zero2w_defconfig b/configs/orangepi_zero2w_defconfig > index c2030b05c20a..64c06d42315a 100644 > --- a/configs/orangepi_zero2w_defconfig > +++ b/configs/orangepi_zero2w_defconfig > @@ -37,6 +37,6 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_GENIMAGE=y > BR2_PACKAGE_HOST_UBOOT_TOOLS=y > diff --git a/configs/orangepi_zero3_defconfig b/configs/orangepi_zero3_defconfig > index c6aa9c991a6c..78c7d6daff00 100644 > --- a/configs/orangepi_zero3_defconfig > +++ b/configs/orangepi_zero3_defconfig > @@ -38,6 +38,6 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_GENIMAGE=y > BR2_PACKAGE_HOST_UBOOT_TOOLS=y > diff --git a/configs/orangepi_zero_plus2_defconfig b/configs/orangepi_zero_plus2_defconfig > index 2b7ad2064d96..73b18533a28e 100644 > --- a/configs/orangepi_zero_plus2_defconfig > +++ b/configs/orangepi_zero_plus2_defconfig > @@ -45,5 +45,5 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_GENIMAGE=y > diff --git a/configs/orangepi_zero_plus_defconfig b/configs/orangepi_zero_plus_defconfig > index 48c8e993f020..c6eee1d4115b 100644 > --- a/configs/orangepi_zero_plus_defconfig > +++ b/configs/orangepi_zero_plus_defconfig > @@ -34,5 +34,5 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_GENIMAGE=y > diff --git a/configs/pine64_defconfig b/configs/pine64_defconfig > index 8975f3b1a211..f719cd9d2fef 100644 > --- a/configs/pine64_defconfig > +++ b/configs/pine64_defconfig > @@ -29,7 +29,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > BR2_PACKAGE_HOST_DOSFSTOOLS=y > BR2_PACKAGE_HOST_GENIMAGE=y > BR2_PACKAGE_HOST_MTOOLS=y > diff --git a/support/testing/tests/boot/test_atf.py b/support/testing/tests/boot/test_atf.py > index 6142dd36c12a..d00bfa0ff931 100644 > --- a/support/testing/tests/boot/test_atf.py > +++ b/support/testing/tests/boot/test_atf.py > @@ -25,7 +25,7 @@ class TestATFAllwinner(infra.basetest.BRTest): > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > BR2_TARGET_UBOOT_SPL=y > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > - BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > + BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > """ > > def test_run(self): > -- Hello Dario, here: https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/ Julien said that it does not need to be /dev/null, and that it works fine with just an empty string (if the default is the empty string). So, shouldn't you simply be able to remove the: BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" lines from the defconfigs, without any need to add any BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" lines to the defconfigs? Kind regards, Niklas To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On Tue, Feb 11, 2025 at 10:46:27AM +0100, Niklas Cassel wrote: > Hello Dario, > > here: > https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/ > > Julien said that it does not need to be /dev/null, > and that it works fine with just an empty string > (if the default is the empty string). Here is an example of a config option where the default is the empty string: https://github.com/buildroot/buildroot/blob/2024.11/Config.in#L189 Kind regards, Niklas To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hi Niklas, On Tue, Feb 11, 2025 at 10:46 AM Niklas Cassel <Niklas.Cassel@wdc.com> wrote: > > On Tue, Feb 11, 2025 at 10:33:49AM +0100, Dario Binacchi wrote: > > The commit 4bce3270d680 ("Config.in: timeout earlier when connecting to > > download servers"), among other things, adds the connection timeout > > parameter to the default scp command: > > > > config BR2_SCP > > string "Secure copy (scp) command" > > default "scp -o ConnectTimeout=10" > > > > Since the package/pkg-download.mk file exports this command using the > > SCP variable: > > > > export SCP := $(call qstrip,$(BR2_SCP)) > > > > and the U-Boot Makefile uses this variable as the path for the system > > control processor (SCP) firmware blob: > > > > cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ > > $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \ > > --toolpath $(objtree)/tools \ > > $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ > > build -u -d $(binman_dtb) -O . -m \ > > --allow-missing --fake-ext-blobs \ > > $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ > > -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ > > $(foreach f,$(of_list_dirs),-I $(f)) -a of-list=$(of_list) \ > > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > > -a atf-bl31-path=${BL31} \ > > -a tee-os-path=${TEE} \ > > -a ti-dm-path=${TI_DM} \ > > -a opensbi-path=${OPENSBI} \ > > -a default-dt=$(default_dt) \ > > -a scp-path=$(SCP) \ > > > > the following error occurs: > > > > BINMAN .binman_stamp > > usage: binman [-h] [-B BUILD_DIR] [-D] [-H] [--tooldir TOOLDIR] [--toolpath TOOLPATH] [-T THREADS] [--test-section-timeout] [-v VERBOSITY] [-V] > > {build,bintool-docs,entry-docs,ls,extract,replace,sign,test,tool} ... > > binman: error: unrecognized arguments: -o ConnectTimeout=10 > > make[2]: *** [Makefile:1126: .binman_stamp] Error 2 > > > > The issue was already present, as the scp command was being passed > > instead of the path to the SCP firmware, but it is now detected due to > > the compilation error. > > > > Adding the BR2_TARGET_UBOOT_SCP_FIRMWARE option allows passing the > > correct parameter to U-Boot, even if it is not set. This also requires > > removing the SCP setting from BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS for > > configurations that previously set this variable explicitly. > > > > Fixes: 4bce3270d680 ("Config.in: timeout earlier when connecting to download servers") > > Suggested-by: Julien Olivain <ju.o@free.fr> > > Co-Developed-by: Julien Olivain <ju.o@free.fr> > > Signed-off-by: Julien Olivain <ju.o@free.fr> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > boot/uboot/Config.in | 8 ++++++++ > > boot/uboot/uboot.mk | 3 ++- > > configs/olimex_a64_olinuxino_defconfig | 2 +- > > configs/orangepi_pc2_defconfig | 2 +- > > configs/orangepi_zero2w_defconfig | 2 +- > > configs/orangepi_zero3_defconfig | 2 +- > > configs/orangepi_zero_plus2_defconfig | 2 +- > > configs/orangepi_zero_plus_defconfig | 2 +- > > configs/pine64_defconfig | 2 +- > > support/testing/tests/boot/test_atf.py | 2 +- > > 10 files changed, 18 insertions(+), 9 deletions(-) > > > > diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in > > index f17f932c9e95..6087534fee2d 100644 > > --- a/boot/uboot/Config.in > > +++ b/boot/uboot/Config.in > > @@ -744,4 +744,12 @@ config BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS > > List of custom make options passed at build time. Can be > > used for example to pass a DEVICE_TREE= value. > > > > +config BR2_TARGET_UBOOT_SCP_FIRMWARE > > + string "System Control Processor (SCP) firmware location" > > + help > > + Location of a SCP firmware binary. > > + > > + If not empty, holds firmware for an external platform-specific > > + coprocessor. > > + > > endif # BR2_TARGET_UBOOT > > diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk > > index 2796b0a31010..18997cbdbe26 100644 > > --- a/boot/uboot/uboot.mk > > +++ b/boot/uboot/uboot.mk > > @@ -176,7 +176,8 @@ UBOOT_MAKE_OPTS += \ > > ARCH=$(UBOOT_ARCH) \ > > HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \ > > HOSTLDFLAGS="$(HOST_LDFLAGS)" \ > > - $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) > > + $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) \ > > + SCP=$(BR2_TARGET_UBOOT_SCP_FIRMWARE) > > > > # Disable FDPIC if enabled by default in toolchain > > ifeq ($(BR2_BINFMT_FDPIC),y) > > diff --git a/configs/olimex_a64_olinuxino_defconfig b/configs/olimex_a64_olinuxino_defconfig > > index ad446ea18c82..b63ea51bc6d3 100644 > > --- a/configs/olimex_a64_olinuxino_defconfig > > +++ b/configs/olimex_a64_olinuxino_defconfig > > @@ -29,7 +29,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_FORMAT_CUSTOM=y > > BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_DOSFSTOOLS=y > > BR2_PACKAGE_HOST_GENIMAGE=y > > BR2_PACKAGE_HOST_MTOOLS=y > > diff --git a/configs/orangepi_pc2_defconfig b/configs/orangepi_pc2_defconfig > > index 46d04b34c845..d61ffd0f5f24 100644 > > --- a/configs/orangepi_pc2_defconfig > > +++ b/configs/orangepi_pc2_defconfig > > @@ -33,5 +33,5 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_GENIMAGE=y > > diff --git a/configs/orangepi_zero2w_defconfig b/configs/orangepi_zero2w_defconfig > > index c2030b05c20a..64c06d42315a 100644 > > --- a/configs/orangepi_zero2w_defconfig > > +++ b/configs/orangepi_zero2w_defconfig > > @@ -37,6 +37,6 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_GENIMAGE=y > > BR2_PACKAGE_HOST_UBOOT_TOOLS=y > > diff --git a/configs/orangepi_zero3_defconfig b/configs/orangepi_zero3_defconfig > > index c6aa9c991a6c..78c7d6daff00 100644 > > --- a/configs/orangepi_zero3_defconfig > > +++ b/configs/orangepi_zero3_defconfig > > @@ -38,6 +38,6 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_GENIMAGE=y > > BR2_PACKAGE_HOST_UBOOT_TOOLS=y > > diff --git a/configs/orangepi_zero_plus2_defconfig b/configs/orangepi_zero_plus2_defconfig > > index 2b7ad2064d96..73b18533a28e 100644 > > --- a/configs/orangepi_zero_plus2_defconfig > > +++ b/configs/orangepi_zero_plus2_defconfig > > @@ -45,5 +45,5 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_GENIMAGE=y > > diff --git a/configs/orangepi_zero_plus_defconfig b/configs/orangepi_zero_plus_defconfig > > index 48c8e993f020..c6eee1d4115b 100644 > > --- a/configs/orangepi_zero_plus_defconfig > > +++ b/configs/orangepi_zero_plus_defconfig > > @@ -34,5 +34,5 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_GENIMAGE=y > > diff --git a/configs/pine64_defconfig b/configs/pine64_defconfig > > index 8975f3b1a211..f719cd9d2fef 100644 > > --- a/configs/pine64_defconfig > > +++ b/configs/pine64_defconfig > > @@ -29,7 +29,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > BR2_PACKAGE_HOST_DOSFSTOOLS=y > > BR2_PACKAGE_HOST_GENIMAGE=y > > BR2_PACKAGE_HOST_MTOOLS=y > > diff --git a/support/testing/tests/boot/test_atf.py b/support/testing/tests/boot/test_atf.py > > index 6142dd36c12a..d00bfa0ff931 100644 > > --- a/support/testing/tests/boot/test_atf.py > > +++ b/support/testing/tests/boot/test_atf.py > > @@ -25,7 +25,7 @@ class TestATFAllwinner(infra.basetest.BRTest): > > BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y > > BR2_TARGET_UBOOT_SPL=y > > BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" > > - BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > + BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > """ > > > > def test_run(self): > > -- > > Hello Dario, > > here: > https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/ > > Julien said that it does not need to be /dev/null, > and that it works fine with just an empty string > (if the default is the empty string). > > > So, shouldn't you simply be able to remove the: > > BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > lines from the defconfigs, without any need to add any > BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > lines to the defconfigs? Since I can't physically test the patch on the board, this way I'm sure that the modification is definitely backward compatible. This is the rationale I followed. Thanks and regards, Dario > > > Kind regards, > Niklas
On Tue, Feb 11, 2025 at 10:53:28AM +0100, Dario Binacchi wrote: > > Hello Dario, > > > > here: > > https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/ > > > > Julien said that it does not need to be /dev/null, > > and that it works fine with just an empty string > > (if the default is the empty string). > > > > > > So, shouldn't you simply be able to remove the: > > > > BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > > > > lines from the defconfigs, without any need to add any > > BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" > > > > lines to the defconfigs? > > Since I can't physically test the patch on the board, this way > I'm sure that the modification is definitely backward compatible. > This is the rationale I followed. Considering that the problem is that the build fails if you don't have this, there should be no need to physically test on the board. You could simply build the defconfig for one of these boards: $ make foo_defconfig && make sha256sum the uboot binary. Then apply your patch and: $ make foo_defconfig && uboot-rebuild then sha256sum the new uboot binary. If the sha256sums match, I think you are good. Personally, I think it would be cleaner if these defconfigs could drop these lines, since they shouldn't be needed once your patch is applied. Kind regards, Niklas To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
>>>>> "Dario" == Dario Binacchi <dario.binacchi@amarulasolutions.com> writes: > The commit 4bce3270d680 ("Config.in: timeout earlier when connecting to > download servers"), among other things, adds the connection timeout > parameter to the default scp command: > config BR2_SCP > string "Secure copy (scp) command" > default "scp -o ConnectTimeout=10" > Since the package/pkg-download.mk file exports this command using the > SCP variable: > export SCP := $(call qstrip,$(BR2_SCP)) > and the U-Boot Makefile uses this variable as the path for the system > control processor (SCP) firmware blob: > cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ > $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \ > --toolpath $(objtree)/tools \ > $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ > build -u -d $(binman_dtb) -O . -m \ > --allow-missing --fake-ext-blobs \ > $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ > -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ > $(foreach f,$(of_list_dirs),-I $(f)) -a of-list=$(of_list) \ > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > -a atf-bl31-path=${BL31} \ > -a tee-os-path=${TEE} \ > -a ti-dm-path=${TI_DM} \ > -a opensbi-path=${OPENSBI} \ > -a default-dt=$(default_dt) \ > -a scp-path=$(SCP) \ > the following error occurs: > BINMAN .binman_stamp > usage: binman [-h] [-B BUILD_DIR] [-D] [-H] [--tooldir TOOLDIR] [--toolpath TOOLPATH] [-T THREADS] [--test-section-timeout] [-v VERBOSITY] [-V] > {build,bintool-docs,entry-docs,ls,extract,replace,sign,test,tool} ... > binman: error: unrecognized arguments: -o ConnectTimeout=10 > make[2]: *** [Makefile:1126: .binman_stamp] Error 2 > The issue was already present, as the scp command was being passed > instead of the path to the SCP firmware, but it is now detected due to > the compilation error. Indeed. > Adding the BR2_TARGET_UBOOT_SCP_FIRMWARE option allows passing the > correct parameter to U-Boot, even if it is not set. This also requires > removing the SCP setting from BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS for > configurations that previously set this variable explicitly. > Fixes: 4bce3270d680 ("Config.in: timeout earlier when connecting to download servers") > Suggested-by: Julien Olivain <ju.o@free.fr> > Co-Developed-by: Julien Olivain <ju.o@free.fr> > Signed-off-by: Julien Olivain <ju.o@free.fr> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> So the real fix is presumably to stop globally exporting all these variables in package/pkg-download.mk. I don't right away see why they couldn't just be passed in $(PKG)_DL_ENV to the dl-wrapper instead.
Hi Niklas, Dario, All, On 11/02/2025 11:13, Niklas Cassel via buildroot wrote: > On Tue, Feb 11, 2025 at 10:53:28AM +0100, Dario Binacchi wrote: >> > Hello Dario, >> > >> > here: >> > https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/ >> > >> > Julien said that it does not need to be /dev/null, >> > and that it works fine with just an empty string >> > (if the default is the empty string). >> > >> > >> > So, shouldn't you simply be able to remove the: >> > >> > BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" >> > >> > lines from the defconfigs, without any need to add any >> > BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" >> > >> > lines to the defconfigs? >> >> Since I can't physically test the patch on the board, this way >> I'm sure that the modification is definitely backward compatible. >> This is the rationale I followed. > > Considering that the problem is that the build fails if you don't have > this, > there should be no need to physically test on the board. > > You could simply build the defconfig for one of these boards: > $ make foo_defconfig && make > sha256sum the uboot binary. > > Then apply your patch and: > $ make foo_defconfig && uboot-rebuild > then sha256sum the new uboot binary. > > If the sha256sums match, I think you are good. > > Personally, I think it would be cleaner if these defconfigs could drop > these lines, since they shouldn't be needed once your patch is applied. I was able to do some more tests around this. I tested with orangepi_zero_plus2_defconfig, since I have access to a board. So, some versions of uboot (e.g. v2024.10) are building fine when SCP is empty, but build print a warning. This is what I initially seen when building orangepi_zero_plus2_defconfig. Some other versions of uboot (e.g. v2023.10 and v2025.01) are failing to build by default, but can configured to ignore those errors with the uboot make option BINMAN_ALLOW_MISSING=1. All versions are building and booting on my test board if SCP=/dev/null is passed. See upstream commits: https://source.denx.de/u-boot/u-boot/-/commit/b38da15a054c4ce5ac7c46147995f1387ab24d3b https://source.denx.de/u-boot/u-boot/-/commit/8bbd8a35942aee05adca4c8909b133df23b91b3a https://source.denx.de/u-boot/u-boot/-/commit/bbc3d12516ec759379d71819ff49b8574f233aec ... So, Dario, you were right to be conservative. Thank you for that. Also, reading the uboot documentation: https://source.denx.de/u-boot/u-boot/-/blob/v2025.01/board/sunxi/README.sunxi64#L64 It seems this SCP is very specific to sunxi. There is no infratructure in Buildroot to build it (or to download a binary). I initially thought this binary would come from a firmware package. I now see a limited use of such BR2_TARGET_UBOOT_SCP_FIRMWARE, if any, in this state. It is also not completely fixing the current issue, due to the different behaviors of uboot versions. So Peter's suggestion to avoid exporting globally the SCP variable (and other download infra variables) in package/pkg-download.mk seems a better solution now. See: https://lore.kernel.org/buildroot/87zfis2zsg.fsf@dell.be.48ers.dk/T/#me93f1a884e422fea63917d4c7992291a38dba4f8 I think is worth exploring this path. In the meantime, the workaround can still be to set: BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" > Kind regards, > Niklas Best regards, Julien. To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On 11/02/2025 17:48, Peter Korsgaard wrote: >>>>>> "Dario" == Dario Binacchi <dario.binacchi@amarulasolutions.com> writes: > > > The commit 4bce3270d680 ("Config.in: timeout earlier when connecting to > > download servers"), among other things, adds the connection timeout > > parameter to the default scp command: > > > config BR2_SCP > > string "Secure copy (scp) command" > > default "scp -o ConnectTimeout=10" > > > Since the package/pkg-download.mk file exports this command using the > > SCP variable: > > > export SCP := $(call qstrip,$(BR2_SCP)) > > > and the U-Boot Makefile uses this variable as the path for the system > > control processor (SCP) firmware blob: > > > cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ > > $(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \ > > --toolpath $(objtree)/tools \ > > $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ > > build -u -d $(binman_dtb) -O . -m \ > > --allow-missing --fake-ext-blobs \ > > $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ > > -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ > > $(foreach f,$(of_list_dirs),-I $(f)) -a of-list=$(of_list) \ > > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > > -a atf-bl31-path=${BL31} \ > > -a tee-os-path=${TEE} \ > > -a ti-dm-path=${TI_DM} \ > > -a opensbi-path=${OPENSBI} \ > > -a default-dt=$(default_dt) \ > > -a scp-path=$(SCP) \ > > > the following error occurs: > > > BINMAN .binman_stamp > > usage: binman [-h] [-B BUILD_DIR] [-D] [-H] [--tooldir TOOLDIR] [--toolpath TOOLPATH] [-T THREADS] [--test-section-timeout] [-v VERBOSITY] [-V] > > {build,bintool-docs,entry-docs,ls,extract,replace,sign,test,tool} ... > > binman: error: unrecognized arguments: -o ConnectTimeout=10 > > make[2]: *** [Makefile:1126: .binman_stamp] Error 2 > > > The issue was already present, as the scp command was being passed > > instead of the path to the SCP firmware, but it is now detected due to > > the compilation error. > > Indeed. > > > Adding the BR2_TARGET_UBOOT_SCP_FIRMWARE option allows passing the > > correct parameter to U-Boot, even if it is not set. This also requires > > removing the SCP setting from BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS for > > configurations that previously set this variable explicitly. > > > Fixes: 4bce3270d680 ("Config.in: timeout earlier when connecting to download servers") > > Suggested-by: Julien Olivain <ju.o@free.fr> > > Co-Developed-by: Julien Olivain <ju.o@free.fr> > > Signed-off-by: Julien Olivain <ju.o@free.fr> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > So the real fix is presumably to stop globally exporting all these > variables in package/pkg-download.mk. I don't right away see why they > couldn't just be passed in $(PKG)_DL_ENV to the dl-wrapper instead. It shouldn't be in _DL_ENV, but directly in the DOWNLOAD macro like is already done for TAR. Also, they are Buildroot-internal environment variables, so they should normally be prefixed by BR_. Regards, Arnout To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index f17f932c9e95..6087534fee2d 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -744,4 +744,12 @@ config BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS List of custom make options passed at build time. Can be used for example to pass a DEVICE_TREE= value. +config BR2_TARGET_UBOOT_SCP_FIRMWARE + string "System Control Processor (SCP) firmware location" + help + Location of a SCP firmware binary. + + If not empty, holds firmware for an external platform-specific + coprocessor. + endif # BR2_TARGET_UBOOT diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index 2796b0a31010..18997cbdbe26 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -176,7 +176,8 @@ UBOOT_MAKE_OPTS += \ ARCH=$(UBOOT_ARCH) \ HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \ HOSTLDFLAGS="$(HOST_LDFLAGS)" \ - $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) + $(call qstrip,$(BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS)) \ + SCP=$(BR2_TARGET_UBOOT_SCP_FIRMWARE) # Disable FDPIC if enabled by default in toolchain ifeq ($(BR2_BINFMT_FDPIC),y) diff --git a/configs/olimex_a64_olinuxino_defconfig b/configs/olimex_a64_olinuxino_defconfig index ad446ea18c82..b63ea51bc6d3 100644 --- a/configs/olimex_a64_olinuxino_defconfig +++ b/configs/olimex_a64_olinuxino_defconfig @@ -29,7 +29,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_FORMAT_CUSTOM=y BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y diff --git a/configs/orangepi_pc2_defconfig b/configs/orangepi_pc2_defconfig index 46d04b34c845..d61ffd0f5f24 100644 --- a/configs/orangepi_pc2_defconfig +++ b/configs/orangepi_pc2_defconfig @@ -33,5 +33,5 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_GENIMAGE=y diff --git a/configs/orangepi_zero2w_defconfig b/configs/orangepi_zero2w_defconfig index c2030b05c20a..64c06d42315a 100644 --- a/configs/orangepi_zero2w_defconfig +++ b/configs/orangepi_zero2w_defconfig @@ -37,6 +37,6 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/configs/orangepi_zero3_defconfig b/configs/orangepi_zero3_defconfig index c6aa9c991a6c..78c7d6daff00 100644 --- a/configs/orangepi_zero3_defconfig +++ b/configs/orangepi_zero3_defconfig @@ -38,6 +38,6 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/configs/orangepi_zero_plus2_defconfig b/configs/orangepi_zero_plus2_defconfig index 2b7ad2064d96..73b18533a28e 100644 --- a/configs/orangepi_zero_plus2_defconfig +++ b/configs/orangepi_zero_plus2_defconfig @@ -45,5 +45,5 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_GENIMAGE=y diff --git a/configs/orangepi_zero_plus_defconfig b/configs/orangepi_zero_plus_defconfig index 48c8e993f020..c6eee1d4115b 100644 --- a/configs/orangepi_zero_plus_defconfig +++ b/configs/orangepi_zero_plus_defconfig @@ -34,5 +34,5 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_GENIMAGE=y diff --git a/configs/pine64_defconfig b/configs/pine64_defconfig index 8975f3b1a211..f719cd9d2fef 100644 --- a/configs/pine64_defconfig +++ b/configs/pine64_defconfig @@ -29,7 +29,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" -BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" +BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y diff --git a/support/testing/tests/boot/test_atf.py b/support/testing/tests/boot/test_atf.py index 6142dd36c12a..d00bfa0ff931 100644 --- a/support/testing/tests/boot/test_atf.py +++ b/support/testing/tests/boot/test_atf.py @@ -25,7 +25,7 @@ class TestATFAllwinner(infra.basetest.BRTest): BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" - BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" + BR2_TARGET_UBOOT_SCP_FIRMWARE="/dev/null" """ def test_run(self):