rockchip: x86: Support building ROM files automatically with binman
Subsystems (15)
v4 cover rockchip: x86: Support building ROM files automatically with binman
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.
This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a BUILD_ROM environment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.
A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing.
This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the fit_spl_optee.sh script.
Other archs and the rest of rockchip could be migrated too.
This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).
Changes in v4:
- Add a new CONFIG_ROCKCHIP_SPI_IMAGE to control SPI-image generation
- Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
- Update for changes to arch/arm/mach-k3/config.mk
- Move the .itb output to a separate rockchip-optee.dtsi file
- Add a check for CONFIG_FIT before building the .its
Changes in v3:
- Add a comment about CONFIG_SPL_FRAMEWORK
- Drop rockchip changes which should not be in this patch
- Move in the rockchip changes mistakenly in the earlier x86 patch
- Drop use of rk322x.dtsi
- Add changes to rk3288-u-boot.dtsi instead
- Drop leftover debugging
Changes in v2:
- Drop 'rockchip' tag since this commit no-longer affects rockchip yet
- Drop ROM_NEEDS_BLOBS for baytrail since HAVE_FSP already selects it
- Add patches to partially migrate rockchip to use binman
Simon Glass (27):
x86: Change how selection of ROMs works
rockchip: Allow Bob to use SPI boot
Makefile: Allow building .rom files for non-x86 boards
rockchip: jerry: Add serial support
rockchip: bob: Support SPI-flash booting
rockchip: Enable building a SPI ROM image on jerry
rockchip: Enable building a SPI ROM image on bob
tegra: Drop the unused non-binman code
tegra: Don't enable binman on ARMv8 SoCs
Makefile: Rename ALL-y to INPUTS-y
powerpc: mpc85xx: Only enable binman when it is needed
x86: Makefile: Drop explicit targets built by binman
x86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM
sunxi: Makefile: Drop explicit targets built by binman
tegra: Makefile: Drop explicit targets built by binman
mediatek: Makefile: Drop explicit targets built by binman
Makefile: Move CONFIG_TOOLS_DEBUG check to later
Makefile: Fix a long line in cmd_mkfitimage
Makefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty
Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
rockchip: Convert evb-rk3288 over to use binman
rockchip: Convert evb-rk3229 over to use binman
rockchip: Drop the fit_spl_optee.sh script
x86: Move the fdtmap away from the binary blobs
x86: chromebook_link64: Correct the image layout
x86: chromebook_panther: Correct the image layout
x86: chromebook_samus_tpl: Correct the image layout
Kconfig | 29 +++- Makefile | 169 ++++++++++------------ arch/Kconfig | 1 + arch/arm/config.mk | 10 +- arch/arm/dts/rk3288-u-boot.dtsi | 25 ++++ arch/arm/dts/rk3399-gru-u-boot.dtsi | 4 + arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 ++++ arch/arm/dts/rockchip-optee.dtsi | 64 ++++++++ arch/arm/dts/rockchip-u-boot.dtsi | 10 +- arch/arm/mach-at91/config.mk | 2 +- arch/arm/mach-davinci/config.mk | 2 +- arch/arm/mach-k3/config.mk | 10 +- arch/arm/mach-keystone/config.mk | 4 +- arch/arm/mach-omap2/config.mk | 28 ++-- arch/arm/mach-rmobile/Makefile | 2 +- arch/arm/mach-rockchip/Kconfig | 9 ++ arch/arm/mach-rockchip/fit_spl_optee.sh | 84 ----------- arch/arm/mach-rockchip/rk3288/Kconfig | 3 + arch/arm/mach-rockchip/rk3399/Kconfig | 2 + arch/arm/mach-rockchip/spl.c | 3 +- arch/arm/mach-stm32mp/config.mk | 4 +- arch/arm/mach-tegra/Kconfig | 2 +- arch/powerpc/Kconfig | 2 +- arch/x86/Kconfig | 11 +- arch/x86/cpu/quark/Kconfig | 1 + arch/x86/dts/u-boot.dtsi | 10 +- board/BuR/brppt1/config.mk | 4 +- board/BuR/brppt2/config.mk | 4 +- board/BuR/brsmarc1/config.mk | 6 +- board/imgtec/boston/config.mk | 2 +- board/intel/edison/config.mk | 2 +- configs/am335x_evm_defconfig | 1 + configs/am335x_hs_evm_defconfig | 1 + configs/am335x_hs_evm_uart_defconfig | 1 + configs/am43xx_evm_defconfig | 1 + configs/am43xx_evm_rtconly_defconfig | 1 + configs/am43xx_evm_usbhost_boot_defconfig | 1 + configs/am43xx_hs_evm_defconfig | 1 + configs/am57xx_evm_defconfig | 1 + configs/am57xx_hs_evm_defconfig | 1 + configs/am57xx_hs_evm_usb_defconfig | 1 + configs/am65x_evm_a53_defconfig | 1 + configs/am65x_evm_r5_defconfig | 1 + configs/am65x_hs_evm_a53_defconfig | 1 + configs/am65x_hs_evm_r5_defconfig | 1 + configs/chromebook_bob_defconfig | 4 +- configs/chromebook_jerry_defconfig | 1 + configs/chromebook_link64_defconfig | 2 + configs/chromebook_samus_tpl_defconfig | 2 +- configs/chromebox_panther_defconfig | 2 + configs/dh_imx6_defconfig | 1 + configs/display5_defconfig | 1 + configs/display5_factory_defconfig | 1 + configs/dra7xx_evm_defconfig | 1 + configs/dra7xx_hs_evm_defconfig | 1 + configs/dra7xx_hs_evm_usb_defconfig | 1 + configs/evb-rk3229_defconfig | 2 +- configs/evb-rk3288_defconfig | 2 +- configs/imx6qdl_icore_mipi_defconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 1 + configs/imx6qdl_icore_rqs_defconfig | 1 + configs/j721e_evm_a72_defconfig | 1 + configs/j721e_evm_r5_defconfig | 1 + configs/j721e_hs_evm_a72_defconfig | 1 + configs/j721e_hs_evm_r5_defconfig | 1 + configs/ls1046ardb_qspi_spl_defconfig | 1 + configs/mccmon6_nor_defconfig | 1 + configs/mccmon6_sd_defconfig | 1 + configs/mx6sabreauto_defconfig | 1 + configs/mx6sabresd_defconfig | 1 + configs/pico-imx6_defconfig | 1 + configs/qemu-x86_64_defconfig | 2 +- configs/qemu-x86_defconfig | 1 - configs/sandbox_spl_defconfig | 1 + configs/socfpga_arria10_defconfig | 1 + configs/stm32mp15_dhcom_basic_defconfig | 1 + configs/stm32mp15_dhcor_basic_defconfig | 1 + configs/wandboard_defconfig | 1 + configs/xilinx_zynq_virt_defconfig | 1 + scripts/Makefile.spl | 24 +-- tools/binman/README | 2 +- 82 files changed, 373 insertions(+), 248 deletions(-) create mode 100644 arch/arm/dts/rockchip-optee.dtsi delete mode 100755 arch/arm/mach-rockchip/fit_spl_optee.sh
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 1/27 x86: Change how selection of ROMs works
Most x86 boards build a u-boot.rom which is programmed into SPI flash. But this is not unique to x86. For example some rockchip boards can also boot from SPI flash.
Also, at least on x86, binary blobs are sadly quite common. It is not possible to build a functional image without them, and U-Boot needs to know this at build time.
Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary blobs are also needed. If they are not needed, it is safe to build the ROM always. Otherwise we still require the BUILD_ROM environment variable.
For now this affects only x86, but future patches will enable this for rockchip too.
---
(no changes since v2)
Changes in v2:
- Drop 'rockchip' tag since this commit no-longer affects rockchip yet
- Drop ROM_NEEDS_BLOBS for baytrail since HAVE_FSP already selects it
Kconfig | 18 +++++++++++++++++- Makefile | 18 +++++++++++++----- arch/Kconfig | 1 + arch/x86/Kconfig | 4 ++++ arch/x86/cpu/quark/Kconfig | 1 + 5 files changed, 36 insertions(+), 6 deletions(-)
Kconfig +17 -1
@@ -276,9 +276,25 @@ config PHYS_64BIT This can be used not only for 64bit SoCs, but also for large physical address extension on 32bit SoCs. +config HAS_ROM + bool + select BINMAN + help + Enables building of a u-boot.rom target. This collects U-Boot and + any necessary binary blobs. + +config ROM_NEEDS_BLOBS + bool + depends on HAS_ROM + help + Enable this if building the u-boot.rom target needs binary blobs, and + so cannot be done normally. In this case, pass BUILD_ROM=1 to make + to tell U-Boot to build the ROM. + config BUILD_ROM bool "Build U-Boot as BIOS replacement" - depends on X86 + depends on HAS_ROM + default y if !ROM_NEEDS_BLOBS help This option allows to build a ROM version of U-Boot. The build process generally requires several binary blobs
Makefile +13 -5
@@ -921,9 +921,12 @@ ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf ALL-$(CONFIG_EFI_APP) += u-boot-app.efi ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi +ifneq ($(CONFIG_HAS_ROM),) ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom +ALL-y += u-boot.rom endif +endif + ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin endif
@@ -1585,7 +1588,7 @@ endif # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in # the middle. This is handled by binman based on an image description in the # board's device tree. -ifneq ($(CONFIG_X86_RESET_VECTOR),) +ifneq ($(CONFIG_HAS_ROM),) rom: u-boot.rom FORCE refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE
@@ -1595,11 +1598,12 @@ quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -u-boot.rom: u-boot-x86-start16.bin u-boot-x86-reset16.bin u-boot.bin \ +rom-deps := u-boot.bin +ifdef CONFIG_X86 +rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \ - $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE - $(call if_changed,binman) + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 u-boot-x86-start16.bin: u-boot FORCE
@@ -1610,6 +1614,10 @@ u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) endif +u-boot.rom: $(rom-deps) FORCE + $(call if_changed,binman) +endif + ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),) u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
arch/Kconfig +1 -0
@@ -160,6 +160,7 @@ config X86 select TIMER select USE_PRIVATE_LIBGCC select X86_TSC_TIMER + imply HAS_ROM if X86_RESET_VECTOR imply BLK imply CMD_DM imply CMD_FPGA_LOADMK
arch/x86/Kconfig +4 -0
@@ -360,6 +360,8 @@ config HAVE_FSP bool "Add an Firmware Support Package binary" depends on !EFI select USE_HOB + select HAS_ROM + select ROM_NEEDS_BLOBS help Select this option to add an Firmware Support Package binary to the resulting U-Boot image. It is a binary blob which U-Boot uses
@@ -519,6 +521,8 @@ config ENABLE_MRC_CACHE config HAVE_MRC bool "Add a System Agent binary" + select HAS_ROM + select ROM_NEEDS_BLOBS depends on !HAVE_FSP help Select this option to add a System Agent binary to
arch/x86/cpu/quark/Kconfig +1 -0
@@ -24,6 +24,7 @@ if INTEL_QUARK config HAVE_RMU bool "Add a Remote Management Unit (RMU) binary" + select ROM_NEEDS_BLOBS help Select this option to add a Remote Management Unit (RMU) binary to the resulting U-Boot image. It is a data block (up to 64K) of
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 1/27 x86: Change how selection of ROMs works
Most x86 boards build a u-boot.rom which is programmed into SPI flash. But this is not unique to x86. For example some rockchip boards can also boot from SPI flash.
Also, at least on x86, binary blobs are sadly quite common. It is not possible to build a functional image without them, and U-Boot needs to know this at build time.
Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary blobs are also needed. If they are not needed, it is safe to build the ROM always. Otherwise we still require the BUILD_ROM environment variable.
For now this affects only x86, but future patches will enable this for rockchip too.
---
(no changes since v2)
Changes in v2:
- Drop 'rockchip' tag since this commit no-longer affects rockchip yet
- Drop ROM_NEEDS_BLOBS for baytrail since HAVE_FSP already selects it
Kconfig | 18 +++++++++++++++++- Makefile | 18 +++++++++++++----- arch/Kconfig | 1 + arch/x86/Kconfig | 4 ++++ arch/x86/cpu/quark/Kconfig | 1 + 5 files changed, 36 insertions(+), 6 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 2/27 rockchip: Allow Bob to use SPI boot
In reply to Simon GlassBob is a Chromebook and can boot from SPI flash. Add it to the condition check for this.
---
(no changes since v1)
arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/spl.c +2 -1
@@ -54,7 +54,8 @@ u32 spl_boot_device(void)#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY ) || \ defined(CONFIG_TARGET_CHROMEBIT_MICKEY ) || \ defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) || \ - defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY ) + defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY ) || \ + defined(CONFIG_TARGET_CHROMEBOOK_BOB )return BOOT_DEVICE_SPI ;#endif if (CONFIG_IS_ENABLED (ROCKCHIP_BACK_TO_BROM ))
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 2/27 rockchip: Allow Bob to use SPI boot
Bob is a Chromebook and can boot from SPI flash. Add it to the condition check for this.
---
(no changes since v1)
arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 2/27 rockchip: Allow Bob to use SPI boot
In reply to Simon GlassHi Simon,
? 2020/7/20 ??3:55, Simon Glass ??:
Quoted 16 lines
Bob is a Chromebook and can boot from SPI flash. Add it to the condition check for this.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/mach-rockchip/spl.c +0
-0
arch/arm/mach-rockchip/spl.c u32 spl_boot_device(void) · line 58
Quoted 6 lines
arch/arm/mach-rockchip/spl.c +2
-1@@ -54,7 +54,8 @@ u32 spl_boot_device(void)#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY ) || \ defined(CONFIG_TARGET_CHROMEBIT_MICKEY ) || \ defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) || \ - defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY ) + defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY ) || \ + defined(CONFIG_TARGET_CHROMEBOOK_BOB )
Can we use "u-boot,spl-boot-order" in dts instead of hardcode define here?
Thanks,
- Kever
Quoted 3 lines
arch/arm/mach-rockchip/spl.c +0
-0return BOOT_DEVICE_SPI ;#endif if (CONFIG_IS_ENABLED (ROCKCHIP_BACK_TO_BROM ))
PATCH v4 2/27 rockchip: Allow Bob to use SPI boot
Hi Kever,
Quoted 15 lines · Kever Yang
Hi Simon,
? 2020/7/20 ??3:55, Simon Glass ??:
Quoted 11 lines
Bob is a Chromebook and can boot from SPI flash. Add it to the condition check for this.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 13 lines
arch/arm/mach-rockchip/spl.c u32 spl_boot_device(void) · line 58
Quoted 11 lines
arch/arm/mach-rockchip/spl.c +2
-1@@ -54,7 +54,8 @@ u32 spl_boot_device(void)#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY ) || \ defined(CONFIG_TARGET_CHROMEBIT_MICKEY ) || \ defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) || \ - defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY ) + defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY ) || \ + defined(CONFIG_TARGET_CHROMEBOOK_BOB )Can we use "u-boot,spl-boot-order" in dts instead of hardcode define here?
Yes that sounds better. Will take a look.
Regards,
Simon
PATCH v4 3/27 Makefile: Allow building .rom files for non-x86 boards
In reply to Simon GlassSome non-x86 devices can use SPI flash to boot and need to produce images of a fixed size to program the flash.
Add a way to handle this for non-x86 boards.
---
(no changes since v3)
Changes in v3:
- Add a comment about CONFIG_SPL_FRAMEWORK
Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Makefile +14 -0
@@ -1612,6 +1612,20 @@ u-boot-x86-start16.bin: u-boot FORCE OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) + +else # !CONFIG_X86 + +ifdef CONFIG_SPL +rom-deps += spl/u-boot-spl.bin + +# We can rely on CONFIG_SPL_FRAMEWORK being set for boards that use binman +rom-deps += u-boot.img +endif + +ifdef CONFIG_TPL +rom-deps += tpl/u-boot-tpl.bin +endif + endif u-boot.rom: $(rom-deps) FORCE
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 3/27 Makefile: Allow building .rom files for non-x86 boards
Some non-x86 devices can use SPI flash to boot and need to produce images of a fixed size to program the flash.
Add a way to handle this for non-x86 boards.
---
(no changes since v3)
Changes in v3:
- Add a comment about CONFIG_SPL_FRAMEWORK
Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Applied to u-boot-dm, thanks!
PATCH v4 4/27 rockchip: jerry: Add serial support
In reply to Simon GlassThis option allows the serial console to work correctly. Add it.
---
(no changes since v1)
configs/chromebook_jerry_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/chromebook_jerry_defconfig +1 -0
@@ -85,6 +85,7 @@ CONFIG_PWM_ROCKCHIP=y CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_ROCKCHIP_SERIAL=y CONFIG_SOUND=y CONFIG_I2S=y CONFIG_I2S_ROCKCHIP=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 4/27 rockchip: jerry: Add serial support
This option allows the serial console to work correctly. Add it.
---
(no changes since v1)
configs/chromebook_jerry_defconfig | 1 + 1 file changed, 1 insertion(+)
Applied to u-boot-dm, thanks!
PATCH v4 5/27 rockchip: bob: Support SPI-flash booting
In reply to Simon GlassUpdate the config for chromebook_bob to support booting from SPI flash. The existing SPL size is too small since ATF is needed, so double it.
---
(no changes since v1)
configs/chromebook_bob_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
configs/chromebook_bob_defconfig +3 -1
@@ -3,7 +3,7 @@ CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x00200000 CONFIG_SPL_GPIO_SUPPORT=y CONFIG_ENV_OFFSET=0x3F8000 -CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000 +CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 CONFIG_SPL_TEXT_BASE=0xff8c2000 CONFIG_ROCKCHIP_RK3399=y CONFIG_ROCKCHIP_BOOT_MODE_REG=0
@@ -40,6 +40,7 @@ CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_ROCKCHIP_GPIO=y CONFIG_I2C_CROS_EC_TUNNEL=y CONFIG_SYS_I2C_ROCKCHIP=y
@@ -53,6 +54,7 @@ CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_SF_DEFAULT_BUS=1 CONFIG_SF_DEFAULT_SPEED=20000000 CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_DM_ETH=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 5/27 rockchip: bob: Support SPI-flash booting
Update the config for chromebook_bob to support booting from SPI flash. The existing SPL size is too small since ATF is needed, so double it.
---
(no changes since v1)
configs/chromebook_bob_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 6/27 rockchip: Enable building a SPI ROM image on jerry
In reply to Simon GlassAdd a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for jerry.
Change the binman image definition to support multiple images, since it may be used to build both u-boot-rockchip.bin and u-boot.rom
---
Changes in v4:
- Add a new CONFIG_ROCKCHIP_SPI_IMAGE to control SPI-image generation
arch/arm/dts/rk3288-u-boot.dtsi | 24 ++++++++++++++++++++++++ arch/arm/dts/rockchip-u-boot.dtsi | 8 +++++++- arch/arm/mach-rockchip/Kconfig | 9 +++++++++ arch/arm/mach-rockchip/rk3288/Kconfig | 2 ++ 4 files changed, 42 insertions(+), 1 deletion(-)
arch/arm/dts/rk3288-u-boot.dtsi +24 -0
@@ -12,6 +12,30 @@ }; }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3288 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x20000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + }; + }; +}; +#endif + &dmc { u-boot,dm-pre-reloc; };
arch/arm/dts/rockchip-u-boot.dtsi +7 -1
@@ -6,7 +6,13 @@ #include <config.h> / { - binman { + binman: binman { + multiple-images; + }; +}; + +&binman { + simple-bin { filename = "u-boot-rockchip.bin"; pad-byte = <0xff>;
arch/arm/mach-rockchip/Kconfig +9 -0
@@ -366,6 +366,15 @@ config TPL_ROCKCHIP_EARLYRETURN_TO_BROM config SPL_MMC_SUPPORT default y if !SPL_ROCKCHIP_BACK_TO_BROM +config ROCKCHIP_SPI_IMAGE + bool "Build a SPI image for rockchip" + depends on HAS_ROM + help + Some Rockchip SoCs support booting from SPI flash. Enable this + option to produce a 4MB SPI-flash image (called u-boot.rom) + containing U-Boot. The image is built by binman. U-Boot sits near + the start of the image. + source "arch/arm/mach-rockchip/px30/Kconfig" source "arch/arm/mach-rockchip/rk3036/Kconfig" source "arch/arm/mach-rockchip/rk3128/Kconfig"
arch/arm/mach-rockchip/rk3288/Kconfig +2 -0
@@ -5,7 +5,9 @@ choice config TARGET_CHROMEBOOK_JERRY bool "Google/Rockchip Veyron-Jerry Chromebook" + select HAS_ROM select BOARD_LATE_INIT + select ROCKCHIP_SPI_IMAGE help Jerry is a RK3288-based clamshell device with 2 USB 3.0 ports, HDMI, an 11.9 inch EDP display, micro-SD card, touchpad and
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 6/27 rockchip: Enable building a SPI ROM image on jerry
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for jerry.
Change the binman image definition to support multiple images, since it may be used to build both u-boot-rockchip.bin and u-boot.rom
---
Changes in v4:
- Add a new CONFIG_ROCKCHIP_SPI_IMAGE to control SPI-image generation
arch/arm/dts/rk3288-u-boot.dtsi | 24 ++++++++++++++++++++++++ arch/arm/dts/rockchip-u-boot.dtsi | 8 +++++++- arch/arm/mach-rockchip/Kconfig | 9 +++++++++ arch/arm/mach-rockchip/rk3288/Kconfig | 2 ++ 4 files changed, 42 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
In reply to Simon GlassAdd a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for bob.
---
Changes in v4:
- Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
arch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)
arch/arm/dts/rk3399-gru-u-boot.dtsi +4 -0
@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};
arch/arm/dts/rk3399-gru.dtsi +1 -1
@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;
arch/arm/dts/rk3399-u-boot.dtsi +27 -0
@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9 +#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1; }; cic: syscon at ff620000 {
@@ -57,6 +60,30 @@ }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + }; + }; +}; +#endif + &cru { u-boot,dm-pre-reloc; };
arch/arm/mach-rockchip/rk3399/Kconfig +2 -0
@@ -5,6 +5,8 @@ choice config TARGET_CHROMEBOOK_BOB bool "Asus Flip C101PA Chromebook (RK3399)" + select HAS_ROM + select ROCKCHIP_SPI_IMAGE help Bob is a small RK3299-based device similar in apperance to Minnie. It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Add a simple binman config and enable CONFIG_HAS_ROM so that U-Boot produces a ROM for bob.
---
Changes in v4:
- Use CONFIG_ROCKCHIP_SPI_IMAGE to select the image
arch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
In reply to Simon GlassHi Simon,
Quoted 73 lines · Simon Glass
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +13
-0@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9 +#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1; }; cic: syscon at ff620000 {@@ -57,6 +60,30 @@ }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl {
arch/arm/dts/rk3399-u-boot.dtsi line 82
Quoted 10 lines
arch/arm/dts/rk3399-u-boot.dtsi +10
-0+ }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + };
There is a output name 'u-boot.rom' including:
- u-boot-spl output with mkimage cmd at offset 0?
- u-boot-img at offset 0x40000, how this is generated and what is inside? does binary in bl31.elf included?
- u-boot at offset 0x300000, what is this binary and where is it from?
Thanks,
- Kever
Quoted 20 lines
arch/arm/dts/rk3399-u-boot.dtsi +4
-0+ }; +}; +#endif + &cru { u-boot,dm-pre-reloc; };arch/arm/mach-rockchip/rk3399/Kconfig +2
-0@@ -5,6 +5,8 @@ choice config TARGET_CHROMEBOOK_BOB bool "Asus Flip C101PA Chromebook (RK3399)" + select HAS_ROM + select ROCKCHIP_SPI_IMAGE help Bob is a small RK3299-based device similar in apperance to Minnie. It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Hi Kever,
Quoted 90 lines · Kever Yang
Hi Simon,
Quoted 73 lines · Simon Glass
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +13
-0@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9 +#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1; }; cic: syscon at ff620000 {@@ -57,6 +60,30 @@ }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl {arch/arm/dts/rk3399-u-boot.dtsi line 82
Quoted 10 lines
arch/arm/dts/rk3399-u-boot.dtsi +10
-0+ }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + };There is a output name 'u-boot.rom' including:
Quoted 1 line
- u-boot-spl output with mkimage cmd at offset 0?
Yes
Quoted 3 lines
- u-boot-img at offset
0x40000, how this is generated and what is inside? does binary in bl31.elf included?
It is just the u-boot.img file created by the Makefile. There is no BL31.
Quoted 2 lines
- u-boot at offset
0x300000, what is this binary and where is it from?
This is u-boot.bin as created by the Makefile.
Regards,
Simon
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Hi Simon,
Quoted 23 lines · Simon Glass
Quoted 22 lines
Quoted 10 lines
arch/arm/dts/rk3399-u-boot.dtsi +10
-0+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl {arch/arm/dts/rk3399-u-boot.dtsi line 82
Quoted 10 lines
arch/arm/dts/rk3399-u-boot.dtsi +10
-0+ }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + };There is a output name 'u-boot.rom' including:
Quoted 1 line
- u-boot-spl output with mkimage cmd at offset 0?
Quoted 8 lines
Yes
Quoted 2 lines
- u-boot-img at offset
0x40000, how this is generated and what is inside? does binary in bl31.elf included?It is just the u-boot.img file created by the
Makefile. There is no BL31.Quoted 1 line
- u-boot at offset
0x300000, what is this binary and where is it from?This is u-boot.bin as created by the
Makefile.
Why do you need both u-boot.img and u-boot.bin, I don't understand this.
And if there is no BL31, the system is not possible to boot up.
Thanks,
- Kever
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Hi Kever,
Quoted 35 lines · Kever Yang
Hi Simon,
On 2020/8/8 ??9:28, Simon Glass wrote:
arch/arm/dts/rk3399-u-boot.dtsi +20
-0+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + };There is a output name 'u-boot.rom' including:
- u-boot-spl output with mkimage cmd at offset 0?
Yes
- u-boot-img at offset
0x40000, how this is generated and what is inside? does binary in bl31.elf included?
Quoted 7 lines
It is just the u-boot.img file created by the
Makefile. There is no BL31.- u-boot at offset
0x300000, what is this binary and where is it from?This is u-boot.bin as created by the
Makefile.Why do you need both u-boot.img and u-boot.bin, I don't understand this.
Neither do I. It needs a look.
Quoted 2 lines
And if there is no BL31, the system is not possible to boot up.
This was done quite a while ago with the objective of getting a basic U-Boot going on this board, so it needs more work to finish it off.
Regards,
SImon
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
In reply to Simon GlassHi Simon,
Quoted 46 lines · On Sun, 19 Jul 2020 13:55:58 -0600 Simon Glass <[email protected]> wrote:
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +0
-0@@ -4,11 +4,14 @@ */
arch/arm/dts/rk3399-u-boot.dtsi line 14
Quoted 10 lines
arch/arm/dts/rk3399-u-boot.dtsi +3
-0#define USB_CLASS_HUB 9 +#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1;
I don't really understand why but this added alias break spi flash
detection on rockpro64.
Removing it make it work again.
Cheers,
Quoted 50 lines
arch/arm/dts/rk3399-u-boot.dtsi +24
-0}; cic: syscon at ff620000 {@@ -57,6 +60,30 @@ }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + }; + }; +}; +#endif + &cru { u-boot,dm-pre-reloc; };arch/arm/mach-rockchip/rk3399/Kconfig +2
-0@@ -5,6 +5,8 @@ choice config TARGET_CHROMEBOOK_BOB bool "Asus Flip C101PA Chromebook (RK3399)" + select HAS_ROM + select ROCKCHIP_SPI_IMAGE help Bob is a small RK3299-based device similar in apperance to Minnie. It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
Signature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Hello,
Quoted 56 lines · Emmanuel Vadot
Hi Simon,
Quoted 48 lines · On Sun, 19 Jul 2020 13:55:58 -0600 Simon Glass <[email protected]> wrote:
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +0
-0@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9
Quoted 12 lines
arch/arm/dts/rk3399-u-boot.dtsi line 14
Quoted 8 lines
arch/arm/dts/rk3399-u-boot.dtsi +3
-0+#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1;I don't really understand why but this added alias break spi flash detection on rockpro64.
Removing it make it work again.
I've noticed the same problem - rockpro64 already had an alias
spi0 = &spi1;
so after this change there are spi0 and spi1 aliases pointing to &spi1. In U-Boot proper, that seems to cause the SPI flash to appear on bus 1 rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0 doesn't.
So I tried removing the spi0 alias and setting CONFIG_SF_DEFAULT_BUS=1 which fixed the flash detection in U-Boot proper, but now the SPL can't load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)" It seems like SPL doesn't pay attention to the spi1 alias in the same way that U-boot proper does, I haven't yet figured out why.
Quoted 57 lines
Cheers,
Quoted 50 lines
arch/arm/dts/rk3399-u-boot.dtsi +24
-0}; cic: syscon at ff620000 {@@ -57,6 +60,30 @@ }; +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE +&binman { + rom { + filename = "u-boot.rom"; + size = <0x400000>; + pad-byte = <0xff>; + + mkimage { + args = "-n rk3399 -T rkspi"; + u-boot-spl { + }; + }; + u-boot-img { + offset = <0x40000>; + }; + u-boot { + offset = <0x300000>; + }; + fdtmap { + }; + }; +}; +#endif + &cru { u-boot,dm-pre-reloc; };arch/arm/mach-rockchip/rk3399/Kconfig +0
-0@@ -5,6 +5,8 @@ choiceconfig
TARGET_CHROMEBOOK_BOBbool "Asus Flip C101PA Chromebook (RK3399)"arch/arm/mach-rockchip/rk3399/Kconfig +2
-0+ select HAS_ROM + select ROCKCHIP_SPI_IMAGEhelp
Bob is a small RK3299-based device similar in apperance to Minnie. It has two USB 3.0 type-C ports, 4GB of SDRAM, WiFi and a 10.1",Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-googSignature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Hi Hugh,
Quoted 80 lines · Hugh Cole-Baker
Hello,
Quoted 56 lines · Emmanuel Vadot
Hi Simon,
Quoted 48 lines · On Sun, 19 Jul 2020 13:55:58 -0600 Simon Glass <[email protected]> wrote:
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +0
-0@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9Quoted 12 lines
arch/arm/dts/rk3399-u-boot.dtsi line 14
Quoted 8 lines
arch/arm/dts/rk3399-u-boot.dtsi +3
-0+#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1;I don't really understand why but this added alias break spi flash detection on rockpro64.
Removing it make it work again.I've noticed the same problem - rockpro64 already had an alias
spi0 = &spi1;
so after this change there are spi0 and spi1 aliases pointing to &spi1. In U-Boot proper, that seems to cause the SPI flash to appear on bus 1 rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0 doesn't.
Quoted 6 lines
So I tried removing the spi0 alias and setting
CONFIG_SF_DEFAULT_BUS=1which fixed the flash detection in U-Boot proper, but now the SPL can't load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)" It seems like SPL doesn't pay attention to the spi1 alias in the same way that U-boot proper does, I haven't yet figured out why.
Could this be CONFIG_SPL_DM_SEQ_ALIAS ?
Regards,
Simon
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
Hi Simon,
Quoted 90 lines · On Tue, 3 Nov 2020 08:11:59 -0700 Simon Glass <[email protected]> wrote:
Hi Hugh,
Quoted 80 lines · Hugh Cole-Baker
Hello,
Quoted 56 lines · Emmanuel Vadot
Hi Simon,
Quoted 48 lines · On Sun, 19 Jul 2020 13:55:58 -0600 Simon Glass <[email protected]> wrote:
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +0
-0@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9Quoted 12 lines
arch/arm/dts/rk3399-u-boot.dtsi line 14
Quoted 8 lines
arch/arm/dts/rk3399-u-boot.dtsi +3
-0+#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1;I don't really understand why but this added alias break spi flash detection on rockpro64.
Removing it make it work again.I've noticed the same problem - rockpro64 already had an alias
spi0 = &spi1;
so after this change there are spi0 and spi1 aliases pointing to &spi1. In U-Boot proper, that seems to cause the SPI flash to appear on bus 1 rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0 doesn't.
Quoted 6 lines
So I tried removing the spi0 alias and setting
CONFIG_SF_DEFAULT_BUS=1which fixed the flash detection in U-Boot proper, but now the SPL can't load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)" It seems like SPL doesn't pay attention to the spi1 alias in the same way that U-boot proper does, I haven't yet figured out why.
Quoted 4 lines
Could this be
CONFIG_SPL_DM_SEQ_ALIAS?Regards,
Simon
I don't know if you suggested to set CONFIG_SPL_DM_SEQ_ALIAS=y in
configs/rockpro64-rk3399_defconfig but this doesn't help.
Cheers,
Signature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
PATCH v4 7/27 rockchip: Enable building a SPI ROM image on bob
In reply to Simon GlassHi Simon,
Quoted 92 lines · Simon Glass
Hi Hugh,
Quoted 80 lines · Hugh Cole-Baker
Hello,
Quoted 56 lines · Emmanuel Vadot
Hi Simon,
Quoted 48 lines · On Sun, 19 Jul 2020 13:55:58 -0600 Simon Glass <[email protected]> wrote:
Add a simple binman config and enable
CONFIG_HAS_ROMso that U-Boot produces a ROM for bob.Signed-off-by Simon Glass <[email protected]>---
Changes in v4:
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the imagearch/arm/dts/rk3399-gru-u-boot.dtsi | 4 ++++ arch/arm/dts/rk3399-gru.dtsi | 2 +- arch/arm/dts/rk3399-u-boot.dtsi | 27 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3399/Kconfig | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-)arch/arm/dts/rk3399-gru-u-boot.dtsi +4
-0@@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +};arch/arm/dts/rk3399-gru.dtsi +1
-1@@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash at 0 { + spi_flash: spiflash at 0 { compatible = "jedec,spi-nor"; reg = <0>;arch/arm/dts/rk3399-u-boot.dtsi +0
-0@@ -4,11 +4,14 @@ */ #define USB_CLASS_HUB 9Quoted 12 lines
arch/arm/dts/rk3399-u-boot.dtsi line 14
Quoted 8 lines
arch/arm/dts/rk3399-u-boot.dtsi +3
-0+#include "rockchip-u-boot.dtsi" + / { aliases { mmc0 = &sdhci; mmc1 = &sdmmc; pci0 = &pcie0; + spi1 = &spi1;I don't really understand why but this added alias break spi flash detection on rockpro64.
Removing it make it work again.I've noticed the same problem - rockpro64 already had an alias
spi0 = &spi1;
so after this change there are spi0 and spi1 aliases pointing to &spi1. In U-Boot proper, that seems to cause the SPI flash to appear on bus 1 rather than the former bus 0, e.g. sf probe 1:0 works but sf probe 0:0 doesn't.
Quoted 6 lines
So I tried removing the spi0 alias and setting
CONFIG_SF_DEFAULT_BUS=1which fixed the flash detection in U-Boot proper, but now the SPL can't load U-Boot from SPI flash - it fails with an "Invalid bus 1 (err=-19)" It seems like SPL doesn't pay attention to the spi1 alias in the same way that U-boot proper does, I haven't yet figured out why.
Quoted 4 lines
Could this be
CONFIG_SPL_DM_SEQ_ALIAS?Regards,
Simon
Thanks for the pointer, that was the last missing piece to get SPI boot working again on my board. I've just submitted a patch with the fix.
Regards,
Hugh
PATCH v4 8/27 tegra: Drop the unused non-binman code
In reply to Simon GlassThis has been in the Makefile long enough to ensure migration is complete. Drop it.
---
(no changes since v1)
Makefile | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-)
Makefile +1 -15
@@ -1646,23 +1646,9 @@ u-boot-x86-with-spl.bin: spl/u-boot-spl.bin u-boot.bin FORCE $(call if_changed,binman) ifneq ($(CONFIG_ARCH_TEGRA),) -ifneq ($(CONFIG_BINMAN),) # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin -%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: \ - spl/%-spl %.bin FORCE +%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE $(call if_changed,binman) -else -OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE - $(call if_changed,pad_cat) - -OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) -u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE - $(call if_changed,pad_cat) - -u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE - $(call if_changed,copy) -endif # binman endif OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 8/27 tegra: Drop the unused non-binman code
This has been in the Makefile long enough to ensure migration is complete. Drop it.
---
(no changes since v1)
Makefile | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 9/27 tegra: Don't enable binman on ARMv8 SoCs
In reply to Simon GlassAt present only the ARMv7 tegra SoCs actually use binman to create an image. Change the config to reflect this, since otherwise running binman will produce an error.
---
(no changes since v1)
arch/arm/mach-tegra/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-tegra/Kconfig +1 -1
@@ -41,7 +41,6 @@ config TEGRA_PMC_SECURE config TEGRA_COMMON bool "Tegra common options" - select BINMAN select BOARD_EARLY_INIT_F select CLK select DM
@@ -69,6 +68,7 @@ config TEGRA_NO_BPMP config TEGRA_ARMV7_COMMON bool "Tegra 32-bit common options" + select BINMAN select CPU_V7A select SPL select SPL_BOARD_INIT if SPL
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 9/27 tegra: Don't enable binman on ARMv8 SoCs
At present only the ARMv7 tegra SoCs actually use binman to create an image. Change the config to reflect this, since otherwise running binman will produce an error.
---
(no changes since v1)
arch/arm/mach-tegra/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 10/27 Makefile: Rename ALL-y to INPUTS-y
In reply to Simon GlassWhen binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs.
Rename the variable to indicate this, and add a new 'inputs' target.
---
Changes in v4:
- Update for changes to arch/arm/mach-k3/config.mk
Makefile | 60 +++++++++++++++++--------------- arch/arm/config.mk | 10 +++--- arch/arm/mach-at91/config.mk | 2 +- arch/arm/mach-davinci/config.mk | 2 +- arch/arm/mach-k3/config.mk | 10 +++--- arch/arm/mach-keystone/config.mk | 4 +-- arch/arm/mach-omap2/config.mk | 28 +++++++-------- arch/arm/mach-rmobile/Makefile | 2 +- arch/arm/mach-stm32mp/config.mk | 4 +-- board/BuR/brppt1/config.mk | 4 +-- board/BuR/brppt2/config.mk | 4 +-- board/BuR/brsmarc1/config.mk | 6 ++-- board/imgtec/boston/config.mk | 2 +- board/intel/edison/config.mk | 2 +- scripts/Makefile.spl | 24 ++++++------- tools/binman/README | 2 +- 16 files changed, 85 insertions(+), 81 deletions(-)
Makefile +32 -28
@@ -885,80 +885,80 @@ quiet_cmd_static_rela = cmd_static_rela = endif -# Always append ALL so that arch config.mk's can add custom ones -ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check +# Always append INPUTS so that arch config.mk's can add custom ones +INPUTS-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check -ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin +INPUTS-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin ifeq ($(CONFIG_SPL_FSL_PBL),y) -ALL-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin +INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin else ifneq ($(CONFIG_NXP_ESBC), y) # For Secure Boot The Image needs to be signed and Header must also # be included. So The image has to be built explicitly -ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl +INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl endif endif -ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin +INPUTS-$(CONFIG_SPL) += spl/u-boot-spl.bin ifeq ($(CONFIG_MX6)$(CONFIG_IMX_HAB), yy) -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img else ifeq ($(CONFIG_MX7)$(CONFIG_IMX_HAB), yy) -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img else -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot.img endif endif -ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb +INPUTS-$(CONFIG_TPL) += tpl/u-boot-tpl.bin +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot.dtb ifeq ($(CONFIG_SPL_FRAMEWORK),y) -ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img endif -ALL-$(CONFIG_OF_HOSTFILE) += u-boot.dtb +INPUTS-$(CONFIG_OF_HOSTFILE) += u-boot.dtb ifneq ($(CONFIG_SPL_TARGET),) -ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) +INPUTS-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%) endif -ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf -ALL-$(CONFIG_EFI_APP) += u-boot-app.efi -ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi +INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf +INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi +INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi ifneq ($(CONFIG_HAS_ROM),) ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -ALL-y += u-boot.rom +INPUTS-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom endif endif ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) -ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin +INPUTS-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin endif # Build a combined spl + u-boot image for sunxi ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) -ALL-y += u-boot-sunxi-with-spl.bin +INPUTS-y += u-boot-sunxi-with-spl.bin endif # enable combined SPL/u-boot/dtb rules for tegra ifeq ($(CONFIG_ARCH_TEGRA)$(CONFIG_SPL),yy) -ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin -ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin +INPUTS-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin +INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin endif -ALL-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin +INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) -ALL-y += $(CONFIG_BUILD_TARGET:"%"=%) +INPUTS-y += $(CONFIG_BUILD_TARGET:"%"=%) endif ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy) -ALL-y += init_sp_bss_offset_check +INPUTS-y += init_sp_bss_offset_check endif ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) -ALL-y += u-boot-with-dtb.bin +INPUTS-y += u-boot-with-dtb.bin endif ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) -ALL-y += u-boot-rockchip.bin +INPUTS-y += u-boot-rockchip.bin endif LDFLAGS_u-boot += $(LDFLAGS_FINAL)
@@ -1015,7 +1015,11 @@ quiet_cmd_cfgcheck = CFGCHK $2 cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ $(srctree)/scripts/config_whitelist.txt $(srctree) -all: $(ALL-y) +PHONY += inputs +inputs: $(INPUTS-y) + +all: inputs + ifeq ($(CONFIG_DEPRECATED),y) $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.") ifeq ($(CONFIG_SPI),y)
arch/arm/config.mk +5 -5
@@ -122,7 +122,7 @@ endif ifneq ($(CONFIG_SPL_BUILD),y) # Check that only R_ARM_RELATIVE relocations are generated. -ALL-y += checkarmreloc +INPUTS-y += checkarmreloc # The movt / movw can hardcode 16 bit parts of the addresses in the # instruction. Relocation is not supported for that case, so disable # such usage by requiring word relocations.
@@ -154,17 +154,17 @@ endif ifneq ($(CONFIG_IMX_CONFIG),) ifdef CONFIG_SPL ifndef CONFIG_SPL_BUILD -ALL-y += SPL +INPUTS-y += SPL endif else ifeq ($(CONFIG_OF_SEPARATE),y) -ALL-y += u-boot-dtb.imx +INPUTS-y += u-boot-dtb.imx else -ALL-y += u-boot.imx +INPUTS-y += u-boot.imx endif endif ifneq ($(CONFIG_VF610),) -ALL-y += u-boot.vyb +INPUTS-y += u-boot.vyb endif endif
arch/arm/mach-at91/config.mk +1 -1
@@ -4,6 +4,6 @@ endif ifeq ($(CONFIG_CPU_V7A),y) ifndef CONFIG_SPL_BUILD -ALL-y += u-boot.img +INPUTS-y += u-boot.img endif endif
arch/arm/mach-davinci/config.mk +1 -1
@@ -2,5 +2,5 @@ # # Copyright (C) 2012, Texas Instruments, Incorporated - http://www.ti.com/ ifndef CONFIG_SPL_BUILD -ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.ais +INPUTS-$(CONFIG_SPL_FRAMEWORK) += u-boot.ais endif
arch/arm/mach-k3/config.mk +5 -5
@@ -44,7 +44,7 @@ tiboot3.bin: image_check FORCE $(srctree)/tools/k3_gen_x509_cert.sh -c 16 -b $(obj)/u-boot-spl.bin \ -o $@ -l $(CONFIG_SPL_TEXT_BASE) -k $(KEY) -ALL-y += tiboot3.bin +INPUTS-y += tiboot3.bin endif ifdef CONFIG_ARM64
@@ -52,10 +52,10 @@ ifdef CONFIG_ARM64 ifeq ($(CONFIG_TI_SECURE_DEVICE),y) SPL_ITS := u-boot-spl-k3_HS.its $(SPL_ITS): export IS_HS=1 -ALL-y += tispl.bin_HS +INPUTS-y += tispl.bin_HS else SPL_ITS := u-boot-spl-k3.its -ALL-y += tispl.bin +INPUTS-y += tispl.bin endif quiet_cmd_k3_mkits = MKITS $@
@@ -70,9 +70,9 @@ endif else ifeq ($(CONFIG_TI_SECURE_DEVICE),y) -ALL-y += u-boot.img_HS +INPUTS-y += u-boot.img_HS else -ALL-y += u-boot.img +INPUTS-y += u-boot.img endif endif
arch/arm/mach-keystone/config.mk +2 -2
@@ -9,9 +9,9 @@ include $(srctree)/arch/arm/mach-omap2/config_secure.mk ifndef CONFIG_SPL_BUILD ifeq ($(CONFIG_TI_SECURE_DEVICE),y) -ALL-y += u-boot_HS_MLO +INPUTS-y += u-boot_HS_MLO else -ALL-y += MLO +INPUTS-y += MLO endif endif
arch/arm/mach-omap2/config.mk +14 -14
@@ -18,9 +18,9 @@ ifeq ($(CONFIG_TI_SECURE_DEVICE),y) # Refer to README.ti-secure for more info # For booting spl from QSPI or NOR use # u-boot-spl_HS_X-LOADER ifeq ($(CONFIG_OMAP54XX),y) -ALL-y += u-boot-spl_HS_MLO -ALL-y += u-boot-spl_HS_ULO -ALL-y += u-boot-spl_HS_X-LOADER +INPUTS-y += u-boot-spl_HS_MLO +INPUTS-y += u-boot-spl_HS_ULO +INPUTS-y += u-boot-spl_HS_X-LOADER endif # On AM43XX: #
@@ -30,8 +30,8 @@ endif # For booting spl from all other media use # u-boot-spl_HS_ISSW ifeq ($(CONFIG_AM43XX),y) -ALL-y += u-boot-spl_HS_SPI_X-LOADER -ALL-y += u-boot-spl_HS_ISSW +INPUTS-y += u-boot-spl_HS_SPI_X-LOADER +INPUTS-y += u-boot-spl_HS_ISSW endif # On AM33XX: #
@@ -47,21 +47,21 @@ endif # For booting spl over UART, USB, or Ethernet use # u-boot-spl_HS_2ND ifeq ($(CONFIG_AM33XX),y) -ALL-y += u-boot-spl_HS_SPI_X-LOADER -ALL-y += u-boot-spl_HS_X-LOADER -ALL-y += u-boot-spl_HS_MLO -ALL-y += u-boot-spl_HS_2ND +INPUTS-y += u-boot-spl_HS_SPI_X-LOADER +INPUTS-y += u-boot-spl_HS_X-LOADER +INPUTS-y += u-boot-spl_HS_MLO +INPUTS-y += u-boot-spl_HS_2ND endif else -ALL-y += MLO +INPUTS-y += MLO ifeq ($(CONFIG_AM33XX),y) -ALL-y += MLO.byteswap +INPUTS-y += MLO.byteswap endif endif else ifeq ($(CONFIG_TI_SECURE_DEVICE),y) -ALL-$(CONFIG_QSPI_BOOT) += u-boot_HS_XIP_X-LOADER -ALL-$(CONFIG_SPL_LOAD_FIT) += u-boot_HS.img +INPUTS-$(CONFIG_QSPI_BOOT) += u-boot_HS_XIP_X-LOADER +INPUTS-$(CONFIG_SPL_LOAD_FIT) += u-boot_HS.img endif -ALL-y += u-boot.img +INPUTS-y += u-boot.img endif
arch/arm/mach-rmobile/Makefile +1 -1
@@ -84,5 +84,5 @@ spl/u-boot-spl.scif: spl/u-boot-spl.srec spl/u-boot-spl.bin # if srec_cat is present build u-boot-spl.scif by default has_srec_cat = $(call try-run,srec_cat -VERSion,y,n) -ALL-$(has_srec_cat) += u-boot-spl.scif +INPUTS-$(has_srec_cat) += u-boot-spl.scif CLEAN_FILES += u-boot-spl.scif
arch/arm/mach-stm32mp/config.mk +2 -2
@@ -4,10 +4,10 @@ # ifndef CONFIG_SPL -ALL-y += u-boot.stm32 +INPUTS-y += u-boot.stm32 else ifdef CONFIG_SPL_BUILD -ALL-y += u-boot-spl.stm32 +INPUTS-y += u-boot-spl.stm32 endif endif
board/BuR/brppt1/config.mk +2 -2
@@ -25,8 +25,8 @@ cmd_prodzip = \ zip -9 -r $@ misc/* >/dev/null $< ifeq ($(hw-platform-y),brppt1-spi) -ALL-y += $(hw-platform-y)_prog.bin -ALL-y += $(hw-platform-y)_prod.zip +INPUTS-y += $(hw-platform-y)_prog.bin +INPUTS-y += $(hw-platform-y)_prod.zip endif $(hw-platform-y)_prog.bin: u-boot-dtb.img spl/u-boot-spl.bin
board/BuR/brppt2/config.mk +2 -2
@@ -24,8 +24,8 @@ cmd_prodzip = \ ifeq ($(hw-platform-y),brppt2) ifneq ($(CONFIG_SPL_BUILD),y) -ALL-y += $(hw-platform-y)_prog.bin -ALL-y += $(hw-platform-y)_prod.zip +INPUTS-y += $(hw-platform-y)_prog.bin +INPUTS-y += $(hw-platform-y)_prod.zip endif endif
board/BuR/brsmarc1/config.mk +3 -3
@@ -23,11 +23,11 @@ cmd_prodzip = \ cp u-boot-dtb.img misc/ && \ zip -9 -r $@ misc/* >/dev/null $< -ALL-y += $(hw-platform-y)_prog.bin -ALL-y += $(hw-platform-y)_prod.zip +INPUTS-y += $(hw-platform-y)_prog.bin +INPUTS-y += $(hw-platform-y)_prod.zip $(hw-platform-y)_prog.bin: u-boot-dtb.img spl/u-boot-spl.bin $(call if_changed,prodbin) $(hw-platform-y)_prod.zip: $(hw-platform-y)_prog.bin - $(call if_changed,prodzip) + $(call if_changed,prodzip)
board/imgtec/boston/config.mk +1 -1
@@ -11,5 +11,5 @@ u-boot.mcs: u-boot.bin # if srec_cat is present build u-boot.mcs by default has_srec_cat = $(call try-run,srec_cat -VERSion,y,n) -ALL-$(has_srec_cat) += u-boot.mcs +INPUTS-$(has_srec_cat) += u-boot.mcs CLEAN_FILES += u-boot.mcs
board/intel/edison/config.mk +1 -1
@@ -10,7 +10,7 @@ cmd_mkalign_eds = \ dd if=$^ of=$@ bs=4k seek=1 2>/dev/null && \ mv $@ $^ -ALL-y += u-boot-align.bin +INPUTS-y += u-boot-align.bin u-boot-align.bin: u-boot.bin $(call if_changed,mkalign_eds)
scripts/Makefile.spl +12 -12
@@ -213,42 +213,42 @@ spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE $(call if_changed,mkimage) endif -ALL-y += $(obj)/$(SPL_BIN).bin +INPUTS-y += $(obj)/$(SPL_BIN).bin ifdef CONFIG_SAMSUNG -ALL-y += $(obj)/$(BOARD)-spl.bin +INPUTS-y += $(obj)/$(BOARD)-spl.bin endif ifneq ($(CONFIG_TARGET_SOCFPGA_GEN5)$(CONFIG_TARGET_SOCFPGA_ARRIA10),) -ALL-y += $(obj)/$(SPL_BIN).sfp +INPUTS-y += $(obj)/$(SPL_BIN).sfp endif ifdef CONFIG_ARCH_SUNXI -ALL-y += $(obj)/sunxi-spl.bin +INPUTS-y += $(obj)/sunxi-spl.bin ifdef CONFIG_NAND_SUNXI -ALL-y += $(obj)/sunxi-spl-with-ecc.bin +INPUTS-y += $(obj)/sunxi-spl-with-ecc.bin endif endif ifeq ($(CONFIG_SYS_SOC),"at91") -ALL-y += $(obj)/boot.bin +INPUTS-y += $(obj)/boot.bin endif ifdef CONFIG_TPL_BUILD -ALL-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \ +INPUTS-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \ $(obj)/u-boot-x86-reset16-tpl.bin else -ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \ +INPUTS-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \ $(obj)/u-boot-x86-reset16-spl.bin endif -ALL-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin -ALL-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin +INPUTS-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin +INPUTS-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin -ALL-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin +INPUTS-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin -all: $(ALL-y) +all: $(INPUTS-y) quiet_cmd_cat = CAT $@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@
tools/binman/README +1 -1
@@ -220,7 +220,7 @@ u-boot-<your_suffix>.bin: <input_file_1> <input_file_2> checkbinman FORCE endif This assumes that u-boot-<your_suffix>.bin is a target, and is the final file -that you need to produce. You can make it a target by adding it to ALL-y +that you need to produce. You can make it a target by adding it to INPUTS-y either in the main Makefile or in a config.mk file in your arch subdirectory. Once binman is executed it will pick up its instructions from a device-tree
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 10/27 Makefile: Rename ALL-y to INPUTS-y
When binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs.
Rename the variable to indicate this, and add a new 'inputs' target.
---
Changes in v4:
- Update for changes to arch/arm/mach-k3/config.mk
Makefile | 60 +++++++++++++++++--------------- arch/arm/config.mk | 10 +++--- arch/arm/mach-at91/config.mk | 2 +- arch/arm/mach-davinci/config.mk | 2 +- arch/arm/mach-k3/config.mk | 10 +++--- arch/arm/mach-keystone/config.mk | 4 +-- arch/arm/mach-omap2/config.mk | 28 +++++++-------- arch/arm/mach-rmobile/Makefile | 2 +- arch/arm/mach-stm32mp/config.mk | 4 +-- board/BuR/brppt1/config.mk | 4 +-- board/BuR/brppt2/config.mk | 4 +-- board/BuR/brsmarc1/config.mk | 6 ++-- board/imgtec/boston/config.mk | 2 +- board/intel/edison/config.mk | 2 +- scripts/Makefile.spl | 24 ++++++------- tools/binman/README | 2 +- 16 files changed, 85 insertions(+), 81 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 11/27 powerpc: mpc85xx: Only enable binman when it is needed
In reply to Simon GlassQuite a few boards using this SoC family don't use binman, yet CONFIG_BINMAN is enabled for all of them. But the option should only be enabled if we expect binman to produce an image. Calling binman when the device tree is missing, etc. will cause failer.
Add a condition so that CONFIG_BINMAN is only enabled as needed.
---
(no changes since v1)
arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -1
@@ -20,7 +20,7 @@ config MPC85xx select CREATE_ARCH_SYMLINK select SYS_FSL_DDR select SYS_FSL_DDR_BE - select BINMAN + select BINMAN if OF_SEPARATE imply CMD_HASH imply CMD_IRQ imply USB_EHCI_HCD if USB
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 11/27 powerpc: mpc85xx: Only enable binman when it is needed
Quite a few boards using this SoC family don't use binman, yet CONFIG_BINMAN is enabled for all of them. But the option should only be enabled if we expect binman to produce an image. Calling binman when the device tree is missing, etc. will cause failer.
Add a condition so that CONFIG_BINMAN is only enabled as needed.
---
(no changes since v1)
arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 12/27 x86: Makefile: Drop explicit targets built by binman
In reply to Simon GlassOn x86 various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
Update the Makefile to have a separate, final step which runs binman, once all input dependencies are present.
This avoid sprinkling the Makefile with arch-specific code.
---
(no changes since v3)
Changes in v3:
- Drop rockchip changes which should not be in this patch
Makefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)
Makefile +14 -49
@@ -921,16 +921,6 @@ INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi -ifneq ($(CONFIG_HAS_ROM),) -ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -INPUTS-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom -endif -endif - -ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) -INPUTS-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin -endif - # Build a combined spl + u-boot image for sunxi ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) INPUTS-y += u-boot-sunxi-with-spl.bin
@@ -961,6 +951,10 @@ ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) INPUTS-y += u-boot-rockchip.bin endif +INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ + $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ + $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) + LDFLAGS_u-boot += $(LDFLAGS_FINAL) # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
@@ -1018,7 +1012,14 @@ cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ PHONY += inputs inputs: $(INPUTS-y) -all: inputs +all: .binman_stamp inputs +ifeq ($(CONFIG_BINMAN),y) + $(call if_changed,binman) +endif + +# Timestamp file to make sure that binman always runs +.binman_stamp: FORCE + @touch $@ ifeq ($(CONFIG_DEPRECATED),y) $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.")
@@ -1311,7 +1312,7 @@ quiet_cmd_binman = BINMAN $@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ --toolpath $(objtree)/tools \ $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ - build -u -d u-boot.dtb -O . -m \ + build -u -d u-boot.dtb -O . -m --allow-missing \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ $(BINMAN_$(@F))
@@ -1588,27 +1589,11 @@ u-boot-br.bin: u-boot FORCE endif endif -# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including -# reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in -# the middle. This is handled by binman based on an image description in the -# board's device tree. -ifneq ($(CONFIG_HAS_ROM),) -rom: u-boot.rom FORCE - -refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE - $(call if_changed,copy) - quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -rom-deps := u-boot.bin ifdef CONFIG_X86 -rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ - $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ - $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \ - $(if $(CONFIG_HAVE_REFCODE),refcode.bin) - OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 u-boot-x86-start16.bin: u-boot FORCE $(call if_changed,objcopy)
@@ -1617,24 +1602,7 @@ OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) -else # !CONFIG_X86 - -ifdef CONFIG_SPL -rom-deps += spl/u-boot-spl.bin - -# We can rely on CONFIG_SPL_FRAMEWORK being set for boards that use binman -rom-deps += u-boot.img -endif - -ifdef CONFIG_TPL -rom-deps += tpl/u-boot-tpl.bin -endif - -endif - -u-boot.rom: $(rom-deps) FORCE - $(call if_changed,binman) -endif +endif # CONFIG_X86 ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),)
@@ -1646,9 +1614,6 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE endif endif -u-boot-x86-with-spl.bin: spl/u-boot-spl.bin u-boot.bin FORCE - $(call if_changed,binman) - ifneq ($(CONFIG_ARCH_TEGRA),) # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin %-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 12/27 x86: Makefile: Drop explicit targets built by binman
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
Update the Makefile to have a separate, final step which runs binman, once all input dependencies are present.
This avoid sprinkling the Makefile with arch-specific code.
---
(no changes since v3)
Changes in v3:
- Drop rockchip changes which should not be in this patch
Makefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 12/27 x86: Makefile: Drop explicit targets built by binman - BREAKS NETWORK ON SUNXI
Quoted 15 lines · Simon Glass
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.Signed-off-by Simon Glass <[email protected]>---
(no changes since v3)
Quoted 8 lines
Changes in v3:
- Drop rockchip changes which should not be in this patchMakefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)Applied to u-boot-dm, thanks!
Dear Simon,
since this patch merged as 42b18df80fdb network is broken on the pine64-lts_defconfig:
Net: phy interface7
Could not get PHY for ethernet at 1c30000: addr 1
No ethernet found.
=> dhcp
phy interface7mdio_register: non unique device name 'ethernet at 1c30000' Could not get PHY for ethernet at 1c30000: addr 1
Please, provide a fix.
Best regards
Heinrich
PATCH v4 12/27 x86: Makefile: Drop explicit targets built by binman - BREAKS NETWORK ON SUNXI
Quoted 34 lines · Heinrich Schuchardt
Quoted 15 lines · Simon Glass
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.Signed-off-by Simon Glass <[email protected]>---
(no changes since v3)
Quoted 8 lines
Changes in v3:
- Drop rockchip changes which should not be in this patchMakefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)Applied to u-boot-dm, thanks!
Dear Simon,
since this patch merged as
42b18df80fdbnetwork is broken on the pine64-lts_defconfig:Net: phy interface7
Could not get PHY for ethernet at 1c30000: addr 1
No ethernet found.
Quoted 6 lines
=> dhcp
phy interface7mdio_register: non unique device name 'ethernet at 1c30000' Could not get PHY for ethernet at 1c30000: addr 1Please, provide a fix.
The last build steps with your patch are:
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin ./tools/binman/binman --toolpath ./tools build -u -d u-boot.dtb -O . -m --allow-missing -I . -I . -I ./board/sunxi
The file before binman is ok. After binman u-boot-sunxi-with-spl.bin is broken.
Nowhere in the commit message you state that you want to run binman on sunxi boards.
Best regards
Heinrich
PATCH v4 12/27 x86: Makefile: Drop explicit targets built by binman - BREAKS NETWORK ON SUNXI
Hi Heinrich,
Quoted 49 lines · Heinrich Schuchardt
Quoted 34 lines · Heinrich Schuchardt
Quoted 15 lines · Simon Glass
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.Signed-off-by Simon Glass <[email protected]>---
(no changes since v3)
Quoted 8 lines
Changes in v3:
- Drop rockchip changes which should not be in this patchMakefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)Applied to u-boot-dm, thanks!
Dear Simon,
since this patch merged as
42b18df80fdbnetwork is broken on the pine64-lts_defconfig:Net: phy interface7
Could not get PHY for ethernet at 1c30000: addr 1
No ethernet found.Quoted 6 lines
=> dhcp
phy interface7mdio_register: non unique device name 'ethernet at 1c30000' Could not get PHY for ethernet at 1c30000: addr 1Please, provide a fix.
The last build steps with your patch are:
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
./tools/binman/binman--toolpath ./tools build -u -d u-boot.dtb -O . -m --allow-missing -I . -I . -I ./board/sunxi
Quoted 5 lines
The file before binman is ok. After binman u-boot-sunxi-with-spl.bin is broken.
Nowhere in the commit message you state that you want to run binman on sunxi boards.
Please see the existing thread with Andre. I'm going to take another look at this later today.
Regards,
SImon
PATCH v4 12/27 x86: Makefile: Drop explicit targets built by binman - BREAKS NETWORK ON SUNXI
Hi Heinrich,
Quoted 58 lines · Simon Glass
Hi Heinrich,
Quoted 54 lines · Heinrich Schuchardt
Quoted 34 lines · Heinrich Schuchardt
Quoted 15 lines · Simon Glass
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.Signed-off-by Simon Glass <[email protected]>---
(no changes since v3)
Quoted 8 lines
Changes in v3:
- Drop rockchip changes which should not be in this patchMakefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)Applied to u-boot-dm, thanks!
Dear Simon,
since this patch merged as
42b18df80fdbnetwork is broken on the pine64-lts_defconfig:Net: phy interface7
Could not get PHY for ethernet at 1c30000: addr 1
No ethernet found.Quoted 6 lines
=> dhcp
phy interface7mdio_register: non unique device name 'ethernet at 1c30000' Could not get PHY for ethernet at 1c30000: addr 1Please, provide a fix.
The last build steps with your patch are:
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
./tools/binman/binman--toolpath ./tools build -u -d u-boot.dtb -O . -m --allow-missing -I . -I . -I ./board/sunxiThe file before binman is ok. After binman u-boot-sunxi-with-spl.bin is broken.
Nowhere in the commit message you state that you want to run binman on sunxi boards.
BTW the commit does not change this. Sunxi boards were already using binman.
Quoted 3 lines
Please see the existing thread with Andre. I'm going to take another look at this later today.
- simon
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
Quoted 6 lines · Simon Glass
Quoted 6 lines
Quoted 6 lines
The last build steps with your patch are:
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
./tools/binman/binman--toolpath ./tools build -u -d u-boot.dtb -O . -m --allow-missing -I . -I . -I ./board/sunxi
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
The file before binman is ok. After binman u-boot-sunxi-with-spl.bin is broken.
Nowhere in the commit message you state that you want to run binman on sunxi boards.
BTW the commit does not change this. Sunxi boards were already using binman.
That is only half true. Before this commit, binman was *not* run for sunxi when CONFIG_ARM64=y. 32-bit boards used binman with u-boot.img, and 64-bit boards used mksunxi_fit_atf.sh to generate a FIT.
Since converting mksunxi_fit_atf.sh to the binman equivalent is nontrivial (how do you expect to get environment variables into the device tree?), binman should be disabled for sunxi with CONFIG_ARM64=y.
A workaround for those affected by this breakage: instead of running make with no goals, run make u-boot-sunxi-with-spl.bin or the recently-added make inputs to skip the binman step.
Regards,
Samuel
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
Hi,
Quoted 20 lines · Samuel Holland
Quoted 6 lines · Simon Glass
Quoted 6 lines
Quoted 6 lines
The last build steps with your patch are:
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
./tools/binman/binman--toolpath ./tools build -u -d u-boot.dtb -O . -m --allow-missing -I . -I . -I ./board/sunxiQuoted 7 lines
Quoted 5 lines
Quoted 5 lines
The file before binman is ok. After binman u-boot-sunxi-with-spl.bin is broken.
Nowhere in the commit message you state that you want to run binman on sunxi boards.
BTW the commit does not change this. Sunxi boards were already using binman.
That is only half true. Before this commit, binman was *not* run for sunxi when
CONFIG_ARM64=y. 32-bit boards used binman with u-boot.img, and 64-bit boards usedmksunxi_fit_atf.shto generate a FIT.
Quoted 7 lines
Since converting
mksunxi_fit_atf.shto the binman equivalent is nontrivial (how do you expect to get environment variables into the device tree?), binman should be disabled for sunxi withCONFIG_ARM64=y.A workaround for those affected by this breakage: instead of running
makewith no goals, runmake u-boot-sunxi-with-spl.binor the recently-addedmake inputsto skip the binman step.
It's a bit confusing, but the problem is that binman does create that file, overwriting what is there, but the binman definition lacks ATF.
So I think a little hack can fix it for now. Will send a patch.
Regards,
SImon
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
In reply to Samuel HollandHi Samuel,
Quoted 11 lines · Samuel Holland
Quoted 9 lines · Simon Glass
Quoted 9 lines
Quoted 9 lines
The last build steps with your patch are:
cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
./tools/binman/binman--toolpath ./tools build -u -d u-boot.dtb -O . -m --allow-missing -I . -I . -I ./board/sunxiThe file before binman is ok. After binman u-boot-sunxi-with-spl.bin is broken.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Nowhere in the commit message you state that you want to run binman on sunxi boards.
BTW the commit does not change this. Sunxi boards were already using binman.
That is only half true. Before this commit, binman was *not* run for sunxi when
CONFIG_ARM64=y. 32-bit boards used binman with u-boot.img, and 64-bit boards usedmksunxi_fit_atf.shto generate a FIT.
Yes that's right. CONFIG_BINMAN was enabled but binman was not executed.
Quoted 4 lines
Since converting
mksunxi_fit_atf.shto the binman equivalent is nontrivial (how do you expect to get environment variables into the device tree?), binman should be disabled for sunxi withCONFIG_ARM64=y.
It shouldn't be too hard. See commit a32dd071485 for an example.
I don't think you need environment variables...but if so, what for? The BL31_ADDR should really move to Kconfig I think, and BL31 can be used to pass another -I parameter to binman.
The only new thing I can see is needing to create dtb and config nodes on the fly. How about a new sunxi-fit etype which subclasses Entry_fit and expands _ReadSubnode() to generate the extra nodes and properties?
Regards,
SImon
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
In reply to Simon GlassOn 19/07/2020 20:56, Simon Glass wrote:
Hi,
Quoted 9 lines
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.
it seems that this patch (committed as 42b18df80fdb) breaks sunxi(!). When building current master, the Trusted Firmware binary does not make it into the u-boot-sunxi-with-spl.bin file. U-Boot still runs, but Linux won't get very far without BL31. To me it looks like we combine u-boot.img with the SPL, instead of u-boot.itb. Only the latter contains bl31.bin.
I bisected down into the hunks of this patch here, and by reverting just hunk #3 (the one introducing .binman_stamp) it works again. My knowledge of the U-Boot build system is somewhat limited, so I don't immediately see the problem or a fix.
A simple way to verify a build is complete would be:
$ strings u-boot-sunxi-with-spl.bin | grep BL31 If it reports some lines, TF-A is included and it would work correctly. If it comes back empty, TF-A is missing and we won't boot.
I would be grateful for any insights!
Cheers,
Andre
Quoted 134 lines
Signed-off-by Simon Glass <[email protected]>---
(no changes since v3)
Changes in v3:
- Drop rockchip changes which should not be in this patchMakefile | 63 +++++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-)Makefile +14
-49@@ -921,16 +921,6 @@ INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi -ifneq ($(CONFIG_HAS_ROM),) -ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),) -INPUTS-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom -endif -endif - -ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy) -INPUTS-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin -endif - # Build a combined spl + u-boot image for sunxi ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) INPUTS-y += u-boot-sunxi-with-spl.bin@@ -961,6 +951,10 @@ ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) INPUTS-y += u-boot-rockchip.bin endif +INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ + $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ + $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) + LDFLAGS_u-boot += $(LDFLAGS_FINAL) # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.@@ -1018,7 +1012,14 @@ cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ PHONY += inputs inputs: $(INPUTS-y) -all: inputs +all: .binman_stamp inputs +ifeq ($(CONFIG_BINMAN),y) + $(call if_changed,binman) +endif + +# Timestamp file to make sure that binman always runs +.binman_stamp: FORCE + @touch $@ ifeq ($(CONFIG_DEPRECATED),y) $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.")@@ -1311,7 +1312,7 @@ quiet_cmd_binman = BINMAN $@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ --toolpath $(objtree)/tools \ $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ - build -u -d u-boot.dtb -O . -m \ + build -u -d u-boot.dtb -O . -m --allow-missing \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ $(BINMAN_$(@F))@@ -1588,27 +1589,11 @@ u-boot-br.bin: u-boot FORCE endif endif -# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including -# reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in -# the middle. This is handled by binman based on an image description in the -# board's device tree. -ifneq ($(CONFIG_HAS_ROM),) -rom: u-boot.rom FORCE - -refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE - $(call if_changed,copy) - quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -rom-deps := u-boot.bin ifdef CONFIG_X86 -rom-deps += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ - $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ - $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \ - $(if $(CONFIG_HAVE_REFCODE),refcode.bin) - OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 u-boot-x86-start16.bin: u-boot FORCE $(call if_changed,objcopy)@@ -1617,24 +1602,7 @@ OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) -else # !CONFIG_X86 - -ifdef CONFIG_SPL -rom-deps += spl/u-boot-spl.bin - -# We can rely on CONFIG_SPL_FRAMEWORK being set for boards that use binman -rom-deps += u-boot.img -endif - -ifdef CONFIG_TPL -rom-deps += tpl/u-boot-tpl.bin -endif - -endif - -u-boot.rom: $(rom-deps) FORCE - $(call if_changed,binman) -endif +endif # CONFIG_X86 ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),)@@ -1646,9 +1614,6 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE endif endif -u-boot-x86-with-spl.bin: spl/u-boot-spl.bin u-boot.bin FORCE - $(call if_changed,binman) - ifneq ($(CONFIG_ARCH_TEGRA),) # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin %-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
Hi Andr?,
Quoted 27 lines · Andr? Przywara
On 19/07/2020 20:56, Simon Glass wrote:
Hi,
Quoted 9 lines
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.it seems that this patch (committed as
42b18df80fdb) breaks sunxi(!). When building current master, the Trusted Firmware binary does not make it into the u-boot-sunxi-with-spl.bin file. U-Boot still runs, but Linux won't get very far without BL31. To me it looks like we combine u-boot.img with the SPL, instead of u-boot.itb. Only the latter contains bl31.bin.I bisected down into the hunks of this patch here, and by reverting just hunk #3 (the one introducing .binman_stamp) it works again. My knowledge of the U-Boot build system is somewhat limited, so I don't immediately see the problem or a fix.
Quoted 6 lines
A simple way to verify a build is complete would be:
$ strings u-boot-sunxi-with-spl.bin | grep BL31 If it reports some lines, TF-A is included and it would work correctly. If it comes back empty, TF-A is missing and we won't boot.I would be grateful for any insights!
Thanks for the info. Which board is this?
Regards,
SImon
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
Quoted 30 lines · Simon Glass
Hi Andr?,
Quoted 27 lines · Andr? Przywara
On 19/07/2020 20:56, Simon Glass wrote:
Hi,
Quoted 9 lines
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.it seems that this patch (committed as
42b18df80fdb) breaks sunxi(!). When building current master, the Trusted Firmware binary does not make it into the u-boot-sunxi-with-spl.bin file. U-Boot still runs, but Linux won't get very far without BL31. To me it looks like we combine u-boot.img with the SPL, instead of u-boot.itb. Only the latter contains bl31.bin.I bisected down into the hunks of this patch here, and by reverting just hunk #3 (the one introducing .binman_stamp) it works again. My knowledge of the U-Boot build system is somewhat limited, so I don't immediately see the problem or a fix.
Quoted 8 lines
Quoted 6 lines
A simple way to verify a build is complete would be:
$ strings u-boot-sunxi-with-spl.bin | grep BL31 If it reports some lines, TF-A is included and it would work correctly. If it comes back empty, TF-A is missing and we won't boot.I would be grateful for any insights!
Thanks for the info. Which board is this?
I happened to see this on bananapi_m64_defconfig, but any arm64 sunxi board should be affected.
Thanks,
Andre
sunxi/arm64 build broken (was: [PATCH v4 12/27] x86: Makefile: Drop explicit targets built by binman)
Hi Andr?,
Quoted 37 lines · Andr? Przywara
Quoted 35 lines · Simon Glass
Hi Andr?,
Quoted 32 lines · Andr? Przywara
On 19/07/2020 20:56, Simon Glass wrote:
Hi,
Quoted 9 lines
On x86 various files that need to be created by binman. It does not make sense to enumerate these in the
Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.Update the
Makefileto have a separate, final step which runs binman, once all input dependencies are present.This avoid sprinkling the
Makefilewith arch-specific code.it seems that this patch (committed as
42b18df80fdb) breaks sunxi(!). When building current master, the Trusted Firmware binary does not make it into the u-boot-sunxi-with-spl.bin file. U-Boot still runs, but Linux won't get very far without BL31. To me it looks like we combine u-boot.img with the SPL, instead of u-boot.itb. Only the latter contains bl31.bin.I bisected down into the hunks of this patch here, and by reverting just hunk #3 (the one introducing .binman_stamp) it works again. My knowledge of the U-Boot build system is somewhat limited, so I don't immediately see the problem or a fix.
A simple way to verify a build is complete would be:
$ strings u-boot-sunxi-with-spl.bin | grep BL31 If it reports some lines, TF-A is included and it would work correctly. If it comes back empty, TF-A is missing and we won't boot.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
I would be grateful for any insights!
Thanks for the info. Which board is this?
I happened to see this on
bananapi_m64_defconfig, but any arm64 sunxi board should be affected.
OK thanks, will try that. The problem is not obvious to me but I'll take another look before the end of today.
Regards,
SImon
PATCH v4 13/27 x86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM
In reply to Simon GlassThis Kconfig is not needed anymore since U-Boot will build the ROM if the required binary blobs exist.
The BUILD_ROM environment variable used to request that the ROM be built. Now this always happens if the required binary blobs are available. Update it to mean that U-Boot should fail if the ROM cannot be built. This behaviour should be compatible with how it used to work.
---
(no changes since v1)
Kconfig | 7 +++++-- Makefile | 3 ++- configs/qemu-x86_64_defconfig | 1 - configs/qemu-x86_defconfig | 1 - 4 files changed, 7 insertions(+), 5 deletions(-)
Kconfig +5 -2
@@ -288,8 +288,11 @@ config ROM_NEEDS_BLOBS depends on HAS_ROM help Enable this if building the u-boot.rom target needs binary blobs, and - so cannot be done normally. In this case, pass BUILD_ROM=1 to make - to tell U-Boot to build the ROM. + so cannot be done normally. In this case, U-Boot will only build the + ROM if the required blobs exist. If not, you will see an warning like: + + Image 'main-section' is missing external blobs and is non-functional: + intel-descriptor intel-me intel-refcode intel-vga intel-mrc config BUILD_ROM bool "Build U-Boot as BIOS replacement"
Makefile +2 -1
@@ -1312,7 +1312,8 @@ quiet_cmd_binman = BINMAN $@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ --toolpath $(objtree)/tools \ $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ - build -u -d u-boot.dtb -O . -m --allow-missing \ + build -u -d u-boot.dtb -O . \ + $(if $(BUILD_ROM),,-m --allow-missing) \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ $(BINMAN_$(@F))
configs/qemu-x86_64_defconfig +0 -1
@@ -18,7 +18,6 @@ CONFIG_GENERATE_ACPI_TABLE=y CONFIG_X86_OFFSET_U_BOOT=0xfff00000 CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx" CONFIG_DISTRO_DEFAULTS=y -CONFIG_BUILD_ROM=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y CONFIG_BOOTSTAGE=y
configs/qemu-x86_defconfig +0 -1
@@ -8,7 +8,6 @@ CONFIG_GENERATE_PIRQ_TABLE=y CONFIG_GENERATE_MP_TABLE=y CONFIG_GENERATE_ACPI_TABLE=y CONFIG_DISTRO_DEFAULTS=y -CONFIG_BUILD_ROM=y CONFIG_FIT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 13/27 x86: Drop CONFIG_BUILD_ROM and repurpose BUILD_ROM
This Kconfig is not needed anymore since U-Boot will build the ROM if the required binary blobs exist.
The BUILD_ROM environment variable used to request that the ROM be built. Now this always happens if the required binary blobs are available. Update it to mean that U-Boot should fail if the ROM cannot be built. This behaviour should be compatible with how it used to work.
---
(no changes since v1)
Kconfig | 7 +++++-- Makefile | 3 ++- configs/qemu-x86_64_defconfig | 1 - configs/qemu-x86_defconfig | 1 - 4 files changed, 7 insertions(+), 5 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 14/27 sunxi: Makefile: Drop explicit targets built by binman
In reply to Simon GlassOn sunxi various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
This avoid sprinkling the Makefile with arch-specific code.
---
(no changes since v1)
Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Makefile +2 -5
@@ -922,7 +922,7 @@ INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi # Build a combined spl + u-boot image for sunxi -ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy) +ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy) INPUTS-y += u-boot-sunxi-with-spl.bin endif
@@ -1606,10 +1606,7 @@ u-boot-x86-reset16.bin: u-boot FORCE endif # CONFIG_X86 ifneq ($(CONFIG_ARCH_SUNXI),) -ifeq ($(CONFIG_ARM64),) -u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE - $(call if_changed,binman) -else +ifeq ($(CONFIG_ARM64),y) u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE $(call if_changed,cat) endif
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 15/27 tegra: Makefile: Drop explicit targets built by binman
In reply to Simon GlassOn tegra various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
This avoid sprinkling the Makefile with arch-specific code.
---
(no changes since v1)
Makefile | 12 ------------ 1 file changed, 12 deletions(-)
Makefile +0 -12
@@ -926,12 +926,6 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy) INPUTS-y += u-boot-sunxi-with-spl.bin endif -# enable combined SPL/u-boot/dtb rules for tegra -ifeq ($(CONFIG_ARCH_TEGRA)$(CONFIG_SPL),yy) -INPUTS-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin -INPUTS-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin -endif - INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin # Add optional build target if defined in board/cpu/soc headers
@@ -1612,12 +1606,6 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE endif endif -ifneq ($(CONFIG_ARCH_TEGRA),) -# Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin -%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: spl/%-spl %.bin FORCE - $(call if_changed,binman) -endif - OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI) u-boot-app.efi: u-boot FORCE $(call if_changed,zobjcopy)
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 15/27 tegra: Makefile: Drop explicit targets built by binman
On tegra various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
This avoid sprinkling the Makefile with arch-specific code.
---
(no changes since v1)
Makefile | 12 ------------ 1 file changed, 12 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 16/27 mediatek: Makefile: Drop explicit targets built by binman
In reply to Simon GlassOn mediatek various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
This avoid sprinkling the Makefile with arch-specific code.
Also update the binman definition so that idbloader.img is only needed when SPL is actually being used.
---
(no changes since v3)
Changes in v3:
- Move in the rockchip changes mistakenly in the earlier x86 patch
Makefile | 24 ++++++++++++++++-------- arch/arm/dts/rockchip-u-boot.dtsi | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-)
Makefile +16 -8
@@ -926,7 +926,10 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy) INPUTS-y += u-boot-sunxi-with-spl.bin endif +# Generate this input file for binman +ifeq ($(CONFIG_SPL),) INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin +endif # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),)
@@ -941,9 +944,20 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) INPUTS-y += u-boot-with-dtb.bin endif -ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL),yy) +ifeq ($(CONFIG_ARCH_ROCKCHIP),y) +# On ARM64 this target is produced by binman so we don't need this dep +ifeq ($(CONFIG_ARM64),y) +ifeq ($(CONFIG_SPL),y) +# TODO: Get binman to generate this too INPUTS-y += u-boot-rockchip.bin endif +else +ifeq ($(CONFIG_SPL),y) +# Generate these inputs for binman which will create the output files +INPUTS-y += idbloader.img u-boot.img +endif +endif +endif INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
@@ -1459,10 +1473,7 @@ idbloader.img: spl/u-boot-spl.bin FORCE $(call if_changed,mkimage) endif -ifeq ($(CONFIG_ARM64),) -u-boot-rockchip.bin: idbloader.img u-boot.img FORCE - $(call if_changed,binman) -else +ifeq ($(CONFIG_ARM64),y) OBJCOPYFLAGS_u-boot-rockchip.bin = -I binary -O binary \ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff u-boot-rockchip.bin: idbloader.img u-boot.itb FORCE
@@ -1689,9 +1700,6 @@ u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE ifeq ($(CONFIG_SPL),y) spl/u-boot-spl-mtk.bin: spl/u-boot-spl - -u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE - $(call if_changed,binman) else MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
arch/arm/dts/rockchip-u-boot.dtsi +2 -0
@@ -11,6 +11,7 @@ }; }; +#ifdef CONFIG_SPL &binman { simple-bin { filename = "u-boot-rockchip.bin";
@@ -25,3 +26,4 @@ }; }; }; +#endif
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 16/27 mediatek: Makefile: Drop explicit targets built by binman
On mediatek various files that need to be created by binman. It does not make sense to enumerate these in the Makefile. They are described in the configuration (devicetree) for each board and we can simply run binman (always) to generate them.
This avoid sprinkling the Makefile with arch-specific code.
Also update the binman definition so that idbloader.img is only needed when SPL is actually being used.
---
(no changes since v3)
Changes in v3:
- Move in the rockchip changes mistakenly in the earlier x86 patch
Makefile | 24 ++++++++++++++++-------- arch/arm/dts/rockchip-u-boot.dtsi | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 17/27 Makefile: Move CONFIG_TOOLS_DEBUG check to later
In reply to Simon GlassAt present this is checked before the config has been loaded by the Makefile, so it doesn't work.
Move the check to later.
---
(no changes since v1)
Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Makefile +3 -1
@@ -278,7 +278,7 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) HOSTCC = cc HOSTCXX = c++ KBUILD_HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ - $(if $(CONFIG_TOOLS_DEBUG),-g) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) + $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
@@ -735,6 +735,8 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS) KBUILD_AFLAGS += $(KAFLAGS) KBUILD_CFLAGS += $(KCFLAGS) +KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g) + # Use UBOOTINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option UBOOTINCLUDE := \
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 17/27 Makefile: Move CONFIG_TOOLS_DEBUG check to later
At present this is checked before the config has been loaded by the Makefile, so it doesn't work.
Move the check to later.
---
(no changes since v1)
Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 18/27 Makefile: Fix a long line in cmd_mkfitimage
In reply to Simon GlassFix this line which is over the limit.
---
(no changes since v1)
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
@@ -999,7 +999,8 @@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) quiet_cmd_mkfitimage = MKIMAGE $@ -cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@\ +cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) \ + -f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) quiet_cmd_cat = CAT $@
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 18/27 Makefile: Fix a long line in cmd_mkfitimage
Fix this line which is over the limit.
---
(no changes since v1)
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 19/27 Makefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty
In reply to Simon GlassAt present we use the empty string to indicate that there is no FIT generator, but this doesn't allow an individual board to undefine it. Create a separate bool instead.
Update the config of the boards which currently have an empty string.
---
(no changes since v1)
Kconfig | 6 +++++- Makefile | 2 +- configs/am335x_evm_defconfig | 1 + configs/am335x_hs_evm_defconfig | 1 + configs/am335x_hs_evm_uart_defconfig | 1 + configs/am43xx_evm_defconfig | 1 + configs/am43xx_evm_rtconly_defconfig | 1 + configs/am43xx_evm_usbhost_boot_defconfig | 1 + configs/am43xx_hs_evm_defconfig | 1 + configs/am57xx_evm_defconfig | 1 + configs/am57xx_hs_evm_defconfig | 1 + configs/am57xx_hs_evm_usb_defconfig | 1 + configs/am65x_evm_a53_defconfig | 1 + configs/am65x_evm_r5_defconfig | 1 + configs/am65x_hs_evm_a53_defconfig | 1 + configs/am65x_hs_evm_r5_defconfig | 1 + configs/dh_imx6_defconfig | 1 + configs/display5_defconfig | 1 + configs/display5_factory_defconfig | 1 + configs/dra7xx_evm_defconfig | 1 + configs/dra7xx_hs_evm_defconfig | 1 + configs/dra7xx_hs_evm_usb_defconfig | 1 + configs/imx6qdl_icore_mipi_defconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 1 + configs/imx6qdl_icore_rqs_defconfig | 1 + configs/j721e_evm_a72_defconfig | 1 + configs/j721e_evm_r5_defconfig | 1 + configs/j721e_hs_evm_a72_defconfig | 1 + configs/j721e_hs_evm_r5_defconfig | 1 + configs/ls1046ardb_qspi_spl_defconfig | 1 + configs/mccmon6_nor_defconfig | 1 + configs/mccmon6_sd_defconfig | 1 + configs/mx6sabreauto_defconfig | 1 + configs/mx6sabresd_defconfig | 1 + configs/pico-imx6_defconfig | 1 + configs/qemu-x86_64_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + configs/socfpga_arria10_defconfig | 1 + configs/stm32mp15_dhcom_basic_defconfig | 1 + configs/stm32mp15_dhcor_basic_defconfig | 1 + configs/wandboard_defconfig | 1 + configs/xilinx_zynq_virt_defconfig | 1 + 42 files changed, 46 insertions(+), 2 deletions(-)
Kconfig +5 -1
@@ -596,9 +596,13 @@ config SPL_FIT_SOURCE U-Boot FIT image. This could specify further image to load and/or execute. +config USE_SPL_FIT_GENERATOR + bool "Use a script to generate the .its script" + default y if SPL_FIT + config SPL_FIT_GENERATOR string ".its file generator script for U-Boot FIT image" - depends on SPL_FIT + depends on USE_SPL_FIT_GENERATOR default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI default "arch/arm/mach-rockchip/make_fit_atf.py" if SPL_LOAD_FIT && ARCH_ROCKCHIP default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if SPL_LOAD_FIT && ARCH_ZYNQMP
Makefile +1 -1
@@ -1350,7 +1350,7 @@ U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) $(call if_changed,copy) else -ifneq ($(CONFIG_SPL_FIT_GENERATOR),"") +ifneq ($(CONFIG_USE_SPL_FIT_GENERATOR),) U_BOOT_ITS := u-boot.its ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-imx/mkimage_fit_atf.sh") U_BOOT_ITS_DEPS += u-boot-nodtb.bin
configs/am335x_evm_defconfig +1 -0
@@ -6,6 +6,7 @@ CONFIG_AM33XX=y CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_LOGLEVEL=3
configs/am335x_hs_evm_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_LOGLEVEL=3
configs/am335x_hs_evm_uart_defconfig +1 -0
@@ -13,6 +13,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd" CONFIG_LOGLEVEL=3
configs/am43xx_evm_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_SPL_DRIVERS_MISC_SUPPORT=y CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_MISC_INIT_R is not set
configs/am43xx_evm_rtconly_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_SPL_RTC_DDR_SUPPORT=y CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_MISC_INIT_R is not set
configs/am43xx_evm_usbhost_boot_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_AM43XX=y CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_MISC_INIT_R is not set
configs/am43xx_hs_evm_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_INFO_QUIET=y
configs/am57xx_evm_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_AHCI=y CONFIG_DEFAULT_DEVICE_TREE="am572x-idk" CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
configs/am57xx_hs_evm_defconfig +1 -0
@@ -22,6 +22,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
configs/am57xx_hs_evm_usb_defconfig +1 -0
@@ -24,6 +24,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
configs/am65x_evm_a53_defconfig +1 -0
@@ -26,6 +26,7 @@ CONFIG_DEFAULT_DEVICE_TREE="k3-am654-base-board" CONFIG_DISTRO_DEFAULTS=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_CONSOLE_MUX=y
configs/am65x_evm_r5_defconfig +1 -0
@@ -24,6 +24,7 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="k3-am654-r5-base-board" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_BOOTCOMMAND=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_STACK_R=y
configs/am65x_hs_evm_a53_defconfig +1 -0
@@ -29,6 +29,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_fit_${boot}; run get_overlaystring; run run_fit" CONFIG_CONSOLE_MUX=y
configs/am65x_hs_evm_r5_defconfig +1 -0
@@ -26,6 +26,7 @@ CONFIG_DEFAULT_DEVICE_TREE="k3-am654-r5-base-board" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_BOOTCOMMAND=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_STACK_R=y
configs/dh_imx6_defconfig +1 -0
@@ -25,6 +25,7 @@ CONFIG_DISTRO_DEFAULTS=y # CONFIG_SYS_MALLOC_F is not set CONFIG_FIT=y CONFIG_SPL_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTDELAY=3 # CONFIG_USE_BOOTCOMMAND is not set
configs/display5_defconfig +1 -0
@@ -28,6 +28,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q" CONFIG_SUPPORT_RAW_INITRD=y
configs/display5_factory_defconfig +1 -0
@@ -25,6 +25,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6Q" CONFIG_BOOTDELAY=3
configs/dra7xx_evm_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_AHCI=y CONFIG_DEFAULT_DEVICE_TREE="dra7-evm" CONFIG_DISTRO_DEFAULTS=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
configs/dra7xx_hs_evm_defconfig +1 -0
@@ -22,6 +22,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
configs/dra7xx_hs_evm_usb_defconfig +1 -0
@@ -25,6 +25,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
configs/imx6qdl_icore_mipi_defconfig +1 -0
@@ -20,6 +20,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTDELAY=3
configs/imx6qdl_icore_mmc_defconfig +1 -0
@@ -23,6 +23,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTDELAY=3
configs/imx6qdl_icore_rqs_defconfig +1 -0
@@ -17,6 +17,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTDELAY=3
configs/j721e_evm_a72_defconfig +1 -0
@@ -27,6 +27,7 @@ CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-common-proc-board" CONFIG_DISTRO_DEFAULTS=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y
configs/j721e_evm_r5_defconfig +1 -0
@@ -23,6 +23,7 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_BOOTCOMMAND=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_BOARD_INIT=y
configs/j721e_hs_evm_a72_defconfig +1 -0
@@ -28,6 +28,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_IMAGE_POST_PROCESS=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit" CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y
configs/j721e_hs_evm_r5_defconfig +1 -0
@@ -26,6 +26,7 @@ CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_BOOTCOMMAND=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_STACK_R=y
configs/ls1046ardb_qspi_spl_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y CONFIG_QSPI_BOOT=y CONFIG_BOOTDELAY=10
configs/mccmon6_nor_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_nor.cfg" # CONFIG_USE_BOOTCOMMAND is not set CONFIG_BOARD_LATE_INIT=y
configs/mccmon6_sd_defconfig +1 -0
@@ -17,6 +17,7 @@ CONFIG_SPL=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_sd.cfg" # CONFIG_USE_BOOTCOMMAND is not set CONFIG_BOARD_LATE_INIT=y
configs/mx6sabreauto_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_NXP_BOARD_REVISION=y CONFIG_FIT=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y
configs/mx6sabresd_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_FIT=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" # CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y
configs/pico-imx6_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTCOMMAND="run default_boot" CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
configs/qemu-x86_64_defconfig +1 -0
@@ -20,6 +20,7 @@ CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx" CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_SHOW_BOOT_PROGRESS=y
configs/sandbox_spl_defconfig +1 -0
@@ -13,6 +13,7 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_BOOTSTAGE_FDT=y
configs/socfpga_arria10_defconfig +1 -0
@@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria10_socdk_sdmmc" CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200" # CONFIG_USE_BOOTCOMMAND is not set
configs/stm32mp15_dhcom_basic_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTCOMMAND="run bootcmd_stm32mp" CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
configs/stm32mp15_dhcor_basic_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTCOMMAND="run bootcmd_stm32mp" CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
configs/wandboard_defconfig +1 -0
@@ -23,6 +23,7 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd" # CONFIG_CONSOLE_MUX is not set
configs/xilinx_zynq_virt_defconfig +1 -0
@@ -15,6 +15,7 @@ CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_USE_PREBOOT=y CONFIG_SPL_STACK_R=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 19/27 Makefile: Allow CONFIG_SPL_FIT_GENERATOR to be empty
At present we use the empty string to indicate that there is no FIT generator, but this doesn't allow an individual board to undefine it. Create a separate bool instead.
Update the config of the boards which currently have an empty string.
---
(no changes since v1)
Kconfig | 6 +++++- Makefile | 2 +- configs/am335x_evm_defconfig | 1 + configs/am335x_hs_evm_defconfig | 1 + configs/am335x_hs_evm_uart_defconfig | 1 + configs/am43xx_evm_defconfig | 1 + configs/am43xx_evm_rtconly_defconfig | 1 + configs/am43xx_evm_usbhost_boot_defconfig | 1 + configs/am43xx_hs_evm_defconfig | 1 + configs/am57xx_evm_defconfig | 1 + configs/am57xx_hs_evm_defconfig | 1 + configs/am57xx_hs_evm_usb_defconfig | 1 + configs/am65x_evm_a53_defconfig | 1 + configs/am65x_evm_r5_defconfig | 1 + configs/am65x_hs_evm_a53_defconfig | 1 + configs/am65x_hs_evm_r5_defconfig | 1 + configs/dh_imx6_defconfig | 1 + configs/display5_defconfig | 1 + configs/display5_factory_defconfig | 1 + configs/dra7xx_evm_defconfig | 1 + configs/dra7xx_hs_evm_defconfig | 1 + configs/dra7xx_hs_evm_usb_defconfig | 1 + configs/imx6qdl_icore_mipi_defconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 1 + configs/imx6qdl_icore_rqs_defconfig | 1 + configs/j721e_evm_a72_defconfig | 1 + configs/j721e_evm_r5_defconfig | 1 + configs/j721e_hs_evm_a72_defconfig | 1 + configs/j721e_hs_evm_r5_defconfig | 1 + configs/ls1046ardb_qspi_spl_defconfig | 1 + configs/mccmon6_nor_defconfig | 1 + configs/mccmon6_sd_defconfig | 1 + configs/mx6sabreauto_defconfig | 1 + configs/mx6sabresd_defconfig | 1 + configs/pico-imx6_defconfig | 1 + configs/qemu-x86_64_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + configs/socfpga_arria10_defconfig | 1 + configs/stm32mp15_dhcom_basic_defconfig | 1 + configs/stm32mp15_dhcor_basic_defconfig | 1 + configs/wandboard_defconfig | 1 + configs/xilinx_zynq_virt_defconfig | 1 + 42 files changed, 46 insertions(+), 2 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
In reply to Simon GlassThis option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
Makefile +9 -0
@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG
@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
Applied to u-boot-dm, thanks!
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
In reply to Simon GlassHi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --
Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based on CONFIG_OF_LIST. If you look at arch/arm/mach-zynqmp/mkimage_fit_atf.sh you will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.
Thanks,
Michal
Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?
The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See _ReadSubNodes() in fit.py for an example.
You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 5 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.
I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Regards,
Simon
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to config_1. ZynqMP is setting up default based on default DT configured at that time.
In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Thanks,
Michal
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Michal,
Quoted 106 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Quoted 5 lines
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
Regards,
SImon
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 106 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Quoted 5 lines
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
With BINMAN_FDT enabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?
This is my binman configuration.
(quoted diff) +0 -0
b/arch/arm/dts/zynqmp-u-boot.dtsi
new file mode 100644
index 000000000000..b3364d3e2df8
arch/arm/dts/zynqmp-u-boot.dtsi new file +70 -0
70 lines not on this page · raw message
Anyway compare to current script default option is hardcoded to config-1. Current arch/arm/mach-zynqmp/mkimage_fit_atf.sh is also setting up default option based on selected default DT (I can fix this by implementing board_fit_config_name_match() but IIRC it is looping over all configurations and slowing down boot).
I will play with it a little bit more to get more experience with it
Thanks,
Michal
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 4 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?
Is this in SPL? Perhaps something is filtering out the node.
Quoted 81 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};
Quoted 8 lines
Anyway compare to current script default option is hardcoded to config-1.
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).
Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
Quoted 2 lines
I will play with it a little bit more to get more experience with it
OK good luck!
Regards,
Simon
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Simon,
Quoted 135 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow. SPL->ATF->FULL U-Boot.
Quoted 86 lines
Quoted 84 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to board_fit_config_name_match() to select proper configuration from SPL
+ if (!strcmp(name, DEVICE_TREE))
+ return 0;
DEVICE_TREE is setup in generated/dt.h.
I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
Thanks,
Michal
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Michal,
Quoted 139 lines · Michal Simek
Hi Simon,
Quoted 135 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow.
SPL->ATF->FULLU-Boot.
That needs debugging. I can't understand how the /binman node can be missing in U-Boot. The C library is very simple and doesn't handle finding nodes in multiple images...perhaps that is the problem?
Quoted 101 lines
Quoted 87 lines
Quoted 85 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to
board_fit_config_name_match()to select proper configuration from SPL(quoted diff) +2
-0+ if (!strcmp(name, DEVICE_TREE)) + return 0;
Quoted 4 lines
DEVICE_TREEis setup ingenerated/dt.h.I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
OK I see. In that case I think we need another entry argument to pass ${DEVICE_TREE} to the fit entry, and pass it in to binman from the Makefile with another -a parameter.
Quoted 3 lines
Thanks,
Michal
Regards,
Simon
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi,
Quoted 146 lines · Simon Glass
Hi Michal,
Quoted 143 lines · Michal Simek
Hi Simon,
Quoted 139 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 4 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow.
SPL->ATF->FULLU-Boot.That needs debugging. I can't understand how the /binman node can be missing in U-Boot. The C library is very simple and doesn't handle finding nodes in multiple images...perhaps that is the problem?
I found the reason for this behavior. On our platforms we are checking specific address where DTB can be placed. And because I have played with it also with previous image. It was pick up automatically.
But still missing why BINMAN_FDT should be enabled by default on platforms which don't call any binman functions. I see that you are calling that functions from x86 platforms to try to map and find out some image offsets/positions and it looks like that you are loading them. I can imagine that this could be use for example for better space utilization that my boot.bin with SPL can be followed immediately by u-boot.itb in qspi. But for supporting this I expect spl_spi.c needs to be aligned. And adding support in a generic way there needs to be an agreement on node name which should be loaded.
Quoted 101 lines
Quoted 101 lines
Quoted 87 lines
Quoted 85 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to
board_fit_config_name_match()to select proper configuration from SPL(quoted diff) +2
-0+ if (!strcmp(name, DEVICE_TREE)) + return 0;
Quoted 8 lines
Quoted 4 lines
DEVICE_TREEis setup ingenerated/dt.h.I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
OK I see. In that case I think we need another entry argument to pass ${DEVICE_TREE} to the fit entry, and pass it in to binman from the
Makefilewith another -a parameter.
Can you please include this option?
Also what's the easiest way to compose multiple images though binman and share images among others configurations?
I will generate u-boot.itb through binman and then I want to use this file for composing qspi image. Should I just point to u-boot.itb as blob with filename?
Layout for qspi is quite simply spl/boot.bin which is generated as ./tools/mkimage -T zynqmpimage -R ./"" -n "/home/monstr/data/disk/u-boot-bins/zynqmp/pmu.bin" -d spl/u-boot-spl-align.bin spl/boot.bin >/dev/null && cat /dev/null
And then u-boot.itb placed at CONFIG_SYS_SPI_KERNEL_OFFS offset.
Thanks,
Michal
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Michal,
Quoted 162 lines · Michal Simek
Hi,
Quoted 146 lines · Simon Glass
Hi Michal,
Quoted 143 lines · Michal Simek
Hi Simon,
Quoted 139 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 4 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow.
SPL->ATF->FULLU-Boot.That needs debugging. I can't understand how the /binman node can be missing in U-Boot. The C library is very simple and doesn't handle finding nodes in multiple images...perhaps that is the problem?
I found the reason for this behavior. On our platforms we are checking specific address where DTB can be placed. And because I have played with it also with previous image. It was pick up automatically.
Quoted 9 lines
But still missing why
BINMAN_FDTshould be enabled by default on platforms which don't call any binman functions. I see that you are calling that functions from x86 platforms to try to map and find out some image offsets/positions and it looks like that you are loading them. I can imagine that this could be use for example for better space utilization that my boot.bin with SPL can be followed immediately by u-boot.itb in qspi. But for supporting this I expectspl_spi.cneeds to be aligned. And adding support in a generic way there needs to be an agreement on node name which should be loaded.
If you don't need CONFIG_BINMAN_FDT then it is fine to disable it. You could do that by updating the default condition there, or selecting a different value for your arch.
Quoted 105 lines
Quoted 105 lines
Quoted 105 lines
Quoted 89 lines
Quoted 87 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to
board_fit_config_name_match()to select proper configuration from SPL(quoted diff) +2
-0+ if (!strcmp(name, DEVICE_TREE)) + return 0;
DEVICE_TREEis setup ingenerated/dt.h.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
OK I see. In that case I think we need another entry argument to pass ${DEVICE_TREE} to the fit entry, and pass it in to binman from the
Makefilewith another -a parameter.Can you please include this option?
OK I'll add something in the v2 series.
Quoted 7 lines
Also what's the easiest way to compose multiple images though binman and share images among others configurations?
I will generate u-boot.itb through binman and then I want to use this file for composing qspi image. Should I just point to u-boot.itb as blob with filename?
At present binman doesn't support including one image in another, although since generation of images is ordered, yes it should be possible to do it that way.
Quoted 4 lines
Layout for qspi is quite simply spl/boot.bin which is generated as
./tools/mkimage-T zynqmpimage -R ./"" -n "/home/monstr/data/disk/u-boot-bins/zynqmp/pmu.bin" -d spl/u-boot-spl-align.bin spl/boot.bin >/dev/null && cat/dev/null
OK you should be able to use the mkimage entry-type for that.
Quoted 2 lines
And then u-boot.itb placed at
CONFIG_SYS_SPI_KERNEL_OFFSoffset.
OK, you can access CONFIG options in the .dtsi
Can you please point me to the docs for zynqmp in the U-Boot tree? I see stuff about zynq inthe tree but it is quite old. I think there needs to be a link from doc/board/xilinx
Also is there a low-cost zynqmp board about? I'm thinking about adding it to my lab.
Finally, these boards seem to use CONFIG_OF_EMBED which is not allowed. Can you fix that sometime?
Regards,
Simon
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Simon,
Quoted 287 lines · Simon Glass
Hi Michal,
Quoted 162 lines · Michal Simek
Hi,
Quoted 146 lines · Simon Glass
Hi Michal,
Quoted 143 lines · Michal Simek
Hi Simon,
Quoted 139 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 4 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow.
SPL->ATF->FULLU-Boot.That needs debugging. I can't understand how the /binman node can be missing in U-Boot. The C library is very simple and doesn't handle finding nodes in multiple images...perhaps that is the problem?
I found the reason for this behavior. On our platforms we are checking specific address where DTB can be placed. And because I have played with it also with previous image. It was pick up automatically.
Quoted 9 lines
But still missing why
BINMAN_FDTshould be enabled by default on platforms which don't call any binman functions. I see that you are calling that functions from x86 platforms to try to map and find out some image offsets/positions and it looks like that you are loading them. I can imagine that this could be use for example for better space utilization that my boot.bin with SPL can be followed immediately by u-boot.itb in qspi. But for supporting this I expectspl_spi.cneeds to be aligned. And adding support in a generic way there needs to be an agreement on node name which should be loaded.If you don't need
CONFIG_BINMAN_FDTthen it is fine to disable it. You could do that by updating the default condition there, or selecting a different value for your arch.Quoted 108 lines
Quoted 108 lines
Quoted 107 lines
Quoted 89 lines
Quoted 87 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to
board_fit_config_name_match()to select proper configuration from SPL(quoted diff) +2
-0+ if (!strcmp(name, DEVICE_TREE)) + return 0;
DEVICE_TREEis setup ingenerated/dt.h.I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
OK I see. In that case I think we need another entry argument to pass ${DEVICE_TREE} to the fit entry, and pass it in to binman from the
Makefilewith another -a parameter.Can you please include this option?
OK I'll add something in the v2 series.
Thanks.
Quoted 5 lines
Quoted 5 lines
Also what's the easiest way to compose multiple images though binman and share images among others configurations?
Quoted 7 lines
Quoted 3 lines
I will generate u-boot.itb through binman and then I want to use this file for composing qspi image. Should I just point to u-boot.itb as blob with filename?
At present binman doesn't support including one image in another, although since generation of images is ordered, yes it should be possible to do it that way.
ok.
Quoted 7 lines
Quoted 5 lines
Layout for qspi is quite simply spl/boot.bin which is generated as
./tools/mkimage-T zynqmpimage -R ./"" -n "/home/monstr/data/disk/u-boot-bins/zynqmp/pmu.bin" -d spl/u-boot-spl-align.bin spl/boot.bin >/dev/null && cat/dev/nullOK you should be able to use the mkimage entry-type for that.
Normally it should be enough
mkimage {
args = "-T zynqmpimage -R $CONFIG_BOOT_INIT_FILE";
u-boot-spl-align {
};
};It means I would have to create new type for u-boot-spl-align file. And second in argument there is $CONFIG_BOOT_INIT_FILE.
Anyway I can simply take spl/boot.bin which is generated already as the part of build and don't need to call mkimage from here.
Quoted 9 lines
Quoted 3 lines
And then u-boot.itb placed at
CONFIG_SYS_SPI_KERNEL_OFFSoffset.OK, you can access CONFIG options in the .dtsi
Can you please point me to the docs for zynqmp in the U-Boot tree? I see stuff about zynq inthe tree but it is quite old. I think there needs to be a link from doc/board/xilinx
We haven't really spent any time on writing proper doc for zynqmp. But I normally just do this.
setup arm64 toochain
make xilinx_zynqmp_virt_defconfig
FillCONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE - which points to pmu configuration object.
andCONFIG_PMUFW_INIT_FILE - which points to PMU binary file.
export DEVICE_TREE=zynqmp-zcu104-revC
make -j8
you get u-boot.itb and spl/boot.bin. You copy them to SD card and boot from it. This will get you to u-boot running from EL3.
if you add bl31.bin to your source tree or point to it via BL31 variable itb is created with ATF inside and you will get to to SPL->ATF->U-Boot in EL2.
Quoted 3 lines
Also is there a low-cost zynqmp board about? I'm thinking about adding it to my lab.
The cheapest is likely ultra96/zcu100. But v1 is sold out and v2 is made by Avnet and they changed a lot of components and never invested time to really support this board upstream.
But let me ask around if we have any v1 which we can share.
Quoted 3 lines
Finally, these boards seem to use
CONFIG_OF_EMBEDwhich is not allowed. Can you fix that sometime?
Only that mini configurations which is used only for memory tests or flash programming. Conversion to OF_SEPARATE should be easy but we need to retest all configurations again.
Thanks,
Michal
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Michal,
Quoted 325 lines · Michal Simek
Hi Simon,
Quoted 287 lines · Simon Glass
Hi Michal,
Quoted 162 lines · Michal Simek
Hi,
Quoted 146 lines · Simon Glass
Hi Michal,
Quoted 143 lines · Michal Simek
Hi Simon,
Quoted 139 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 50 lines
This option is used to run arch-specific shell scripts which produce .its files which are used to produce FIT images. We already have binman which is designed to produce firmware images. It is more powerful and has tests.
So this option should be deprecated and not used. Existing uses should be migrated.
Mentions of this in code reviews over the last year or so do not seem to have resulted in action, and things are getting worse.
So let's add a warning.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)Makefile +9
-1@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "See doc/driver-model/migration.rst for more info." @echo >&2 "====================================================" endif +endif +ifneq ($(CONFIG_SPL_FIT_GENERATOR),) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate" + @echo >&2 "to binman instead, to avoid the proliferation of" + @echo >&2 "arch-specific scripts with no tests." + @echo >&2 "====================================================" endif @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG@@ -1345,6 +1352,8 @@ endif # Boards with more complex image requirements can provide an .its source file # or a generator script +# NOTE: Please do not use this. We are migrating away from Makefile rules to use +# binman instead. ifneq ($(CONFIG_SPL_FIT_SOURCE),"") U_BOOT_ITS := u-boot.its $(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) --Quoted 2 lines
2.28.0.rc0.105.gf9edc3c819-goog
Quoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 4 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow.
SPL->ATF->FULLU-Boot.That needs debugging. I can't understand how the /binman node can be missing in U-Boot. The C library is very simple and doesn't handle finding nodes in multiple images...perhaps that is the problem?
I found the reason for this behavior. On our platforms we are checking specific address where DTB can be placed. And because I have played with it also with previous image. It was pick up automatically.
Quoted 9 lines
But still missing why
BINMAN_FDTshould be enabled by default on platforms which don't call any binman functions. I see that you are calling that functions from x86 platforms to try to map and find out some image offsets/positions and it looks like that you are loading them. I can imagine that this could be use for example for better space utilization that my boot.bin with SPL can be followed immediately by u-boot.itb in qspi. But for supporting this I expectspl_spi.cneeds to be aligned. And adding support in a generic way there needs to be an agreement on node name which should be loaded.If you don't need
CONFIG_BINMAN_FDTthen it is fine to disable it. You could do that by updating the default condition there, or selecting a different value for your arch.Quoted 108 lines
Quoted 108 lines
Quoted 107 lines
Quoted 89 lines
Quoted 87 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to
board_fit_config_name_match()to select proper configuration from SPL(quoted diff) +2
-0+ if (!strcmp(name, DEVICE_TREE)) + return 0;
DEVICE_TREEis setup ingenerated/dt.h.I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
OK I see. In that case I think we need another entry argument to pass ${DEVICE_TREE} to the fit entry, and pass it in to binman from the
Makefilewith another -a parameter.Can you please include this option?
OK I'll add something in the v2 series.
Thanks.
Quoted 5 lines
Quoted 5 lines
Also what's the easiest way to compose multiple images though binman and share images among others configurations?
Quoted 7 lines
Quoted 3 lines
I will generate u-boot.itb through binman and then I want to use this file for composing qspi image. Should I just point to u-boot.itb as blob with filename?
At present binman doesn't support including one image in another, although since generation of images is ordered, yes it should be possible to do it that way.
ok.
Quoted 7 lines
Quoted 5 lines
Layout for qspi is quite simply spl/boot.bin which is generated as
./tools/mkimage-T zynqmpimage -R ./"" -n "/home/monstr/data/disk/u-boot-bins/zynqmp/pmu.bin" -d spl/u-boot-spl-align.bin spl/boot.bin >/dev/null && cat/dev/nullOK you should be able to use the mkimage entry-type for that.
Normally it should be enough
Quoted 8 lines
mkimage { args = "-T zynqmpimage -R $CONFIG_BOOT_INIT_FILE"; u-boot-spl-align { }; };It means I would have to create new type for u-boot-spl-align file. And second in argument there is $CONFIG_BOOT_INIT_FILE.
One option would be to allow args to be a list of strings, i.e. one string per argument. Then you could do:
args = "-T", "zynqmpimage", "-R", CONFIG_BOOT_INIT_FILE;
Quoted 3 lines
Anyway I can simply take spl/boot.bin which is generated already as the part of build and don't need to call mkimage from here.
The goal here is to get rid of arch-specific stuff in Makefile.
Quoted 26 lines
Quoted 11 lines
Quoted 5 lines
And then u-boot.itb placed at
CONFIG_SYS_SPI_KERNEL_OFFSoffset.OK, you can access CONFIG options in the .dtsi
Can you please point me to the docs for zynqmp in the U-Boot tree? I see stuff about zynq inthe tree but it is quite old. I think there needs to be a link from doc/board/xilinx
We haven't really spent any time on writing proper doc for zynqmp. But I normally just do this.
setup arm64 toochain
makexilinx_zynqmp_virt_defconfig
FillCONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE- which points to pmu configuration object.
andCONFIG_PMUFW_INIT_FILE- which points to PMU binary file.export DEVICE_TREE=zynqmp-zcu104-revC
make -j8
Quoted 6 lines
you get u-boot.itb and spl/boot.bin. You copy them to SD card and boot from it. This will get you to u-boot running from EL3.
if you add bl31.bin to your source tree or point to it via BL31 variable itb is created with ATF inside and you will get to to SPL->ATF->U-Boot in EL2.
Would you mind putting the above in a patch?
Quoted 9 lines
Quoted 4 lines
Also is there a low-cost zynqmp board about? I'm thinking about adding it to my lab.
The cheapest is likely ultra96/zcu100. But v1 is sold out and v2 is made by Avnet and they changed a lot of components and never invested time to really support this board upstream.
But let me ask around if we have any v1 which we can share.
OK ta. I can't see any around.
Quoted 8 lines
Quoted 4 lines
Finally, these boards seem to use
CONFIG_OF_EMBEDwhich is not allowed. Can you fix that sometime?Only that mini configurations which is used only for memory tests or flash programming. Conversion to
OF_SEPARATEshould be easy but we need to retest all configurations again.
OK. That should really be done as a priority as it should not have been done that way. Perhaps after the binman conversion?
Regards,
Simon
PATCH v4 20/27 Makefile: Warn against using CONFIG_SPL_FIT_GENERATOR
Hi Simon,
Quoted 374 lines · Simon Glass
Hi Michal,
Quoted 325 lines · Michal Simek
Hi Simon,
Quoted 287 lines · Simon Glass
Hi Michal,
Quoted 162 lines · Michal Simek
Hi,
Quoted 146 lines · Simon Glass
Hi Michal,
Quoted 143 lines · Michal Simek
Hi Simon,
Quoted 139 lines · Simon Glass
Hi Michal,
Quoted 119 lines · Michal Simek
Hi Simon,
Quoted 115 lines · Simon Glass
Hi Michal,
Quoted 111 lines · Michal Simek
Hi Simon,
Quoted 77 lines · Simon Glass
Hi Michal,
Quoted 57 lines · Michal Simek
Hi Simon,
ne 19. 7. 2020 v 22:06 odes?latel Simon Glass <[email protected]> napsal:
Quoted 52 lines
This option is used to run arch-specific shell scripts which produce .its
files which are used to produce FIT images. We already have binman which
is designed to produce firmware images. It is more powerful and has tests.So this option should be deprecated and not used. Existing uses should be
migrated.Mentions of this in code reviews over the last year or so do not seem to
have resulted in action, and things are getting worse.So let's add a warning.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
---(no changes since v1)
Makefile | 9 +++++++++
1 file changed, 9 insertions(+)diff --git a/Makefile b/Makefile
index f1b5be1882..d73c10a973 100644
--- a/Makefile
+++ b/Makefile
@@ -1148,6 +1148,13 @@ ifneq ($(CONFIG_DM_ETH),y)
@echo >&2 "See doc/driver-model/migration.rst for more info."
@echo >&2 "===================================================="
endif
+endif
+ifneq ($(CONFIG_SPL_FIT_GENERATOR),)
+ @echo >&2 "===================== WARNING ======================"
+ @echo >&2 "This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate"
+ @echo >&2 "to binman instead, to avoid the proliferation of"
+ @echo >&2 "arch-specific scripts with no tests."
+ @echo >&2 "===================================================="
endif
@# Check that this build does not use CONFIG options that we do not
@# know about unless they are in Kconfig. All the existing CONFIG
@@ -1345,6 +1352,8 @@ endif# Boards with more complex image requirements can provide an .its source file
# or a generator script
+# NOTE: Please do not use this. We are migrating away from Makefile rules to use
+# binman instead.
ifneq ($(CONFIG_SPL_FIT_SOURCE),"")
U_BOOT_ITS := u-boot.its
$(U_BOOT_ITS): $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
--
2.28.0.rc0.105.gf9edc3c819-googQuoted 8 lines
I just got to this conversion and I am curious how that transition should look like.
I found how FIT image is created which is fine but I didn't find any reference on how to generate images based onCONFIG_OF_LIST. If you look atarch/arm/mach-zynqmp/mkimage_fit_atf.shyou will see that I loop over this entry and create multiple DT nodes and the same amount of configurations to cover it. Is this supported by binman? If yes, what's the syntax for it?The easiest way is probably to create a new entry type, like zynq-fit. Then you can generate the DT using the sequence writer functions. See
_ReadSubNodes()infit.pyfor an example.You can perhaps have a template subnode and use that in a for loop to generate the nodes.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I tried several configurations and we can use that for generating qspi images and also images with different configurations to have them ready
but first I need to be able to handle the case above.I was thinking of converting sunxi which has the same need, but it sounds like you are on the case. Let me know if you need help.
Nope. I just saw that message and started to play with it to find out what needs to be done and how this fits to bigger picture. If this doesn't work directly then the work needs to be planned which will take time especially when this utility is new for us and we could have issues with writing code in python. Would be good if you can do the first shot because you know this utility and I am more than happy to test it, try and adopt if needed for our case.
Sunxi is very similar case as is zynqmp. Difference is they hardcode default configuration to
config_1. ZynqMP is setting up default based on default DT configured at that time.In connection to binman I see that there would be a need to generate images with ATF and without ATF in configuration node and with different default configuration. There could be also a need to add additional loadable entry such as bitstreams.
Back to zynq-fit new entry type. I don't think it should be zynq/zynqmp type because as was state in commit message u-boot.itb generation is very similar for all these boards that's why name for this new entry should be generic.
Quoted 8 lines
Quoted 3 lines
I sent an initial series to add this to binman. I've since found a few problems so will send a v2 at some point. You can try it out at u-boot-dm/binman-working
I looked at this branch and add my changes on the top.
The first thing what I see is that I miss fit,fdt-list = "of-list"; in sunxi dt file. I had to add it to work for me.
Ah yes, I decided to add this at the last minute so it is not relying on a convention.
Quoted 4 lines
With
BINMAN_FDTenabled I am getting error that there is no valid "binman node" in DT. I didn't study that code yet but that's the point of keeping this DT node out there?Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Is this in SPL? Perhaps something is filtering out the node.
Nope in full U-Boot but in SPL flow.
SPL->ATF->FULLU-Boot.That needs debugging. I can't understand how the /binman node can be missing in U-Boot. The C library is very simple and doesn't handle finding nodes in multiple images...perhaps that is the problem?
I found the reason for this behavior. On our platforms we are checking specific address where DTB can be placed. And because I have played with it also with previous image. It was pick up automatically.
Quoted 9 lines
But still missing why
BINMAN_FDTshould be enabled by default on platforms which don't call any binman functions. I see that you are calling that functions from x86 platforms to try to map and find out some image offsets/positions and it looks like that you are loading them. I can imagine that this could be use for example for better space utilization that my boot.bin with SPL can be followed immediately by u-boot.itb in qspi. But for supporting this I expectspl_spi.cneeds to be aligned. And adding support in a generic way there needs to be an agreement on node name which should be loaded.If you don't need
CONFIG_BINMAN_FDTthen it is fine to disable it. You could do that by updating the default condition there, or selecting a different value for your arch.Quoted 108 lines
Quoted 108 lines
Quoted 107 lines
Quoted 89 lines
Quoted 87 lines
This is my binman configuration.
arch/arm/dts/zynqmp-u-boot.dtsi new file +70
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Xilinx, Inc. + */ + +#include <config.h> + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot-itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + description = "FIT image with ATF support"; + fit,fdt-list = "of-list"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "firmware"; + os = "u-boot"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + entry = <CONFIG_SYS_TEXT_BASE>; + + u-boot-nodtb { + }; + }; + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + os = "arm-trusted-firmware"; + arch = "arm64"; + compression = "none"; + load = <0xfffea000>; /* FIXME */ + entry = <0xfffea000>; + + blob-ext { + filename = "bl31.bin"; + }; + }; + @fdt-SEQ { + description = "NAME"; + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + @config-SEQ { + description = "NAME"; + firmware = "atf"; + loadables = "uboot"; + fdt = "fdt-SEQ"; + }; + }; + }; + fdtmap{}; + }; + +};Anyway compare to current script default option is hardcoded to config-1.
Quoted 7 lines
Quoted 4 lines
Current
arch/arm/mach-zynqmp/mkimage_fit_atf.shis also setting up default option based on selected default DT (I can fix this by implementingboard_fit_config_name_match()but IIRC it is looping over all configurations and slowing down boot).Is this using an environment variable to select the default? Would it be OK to put this in the DT for each individual board?
I have added this code to
board_fit_config_name_match()to select proper configuration from SPL(quoted diff) +2
-0+ if (!strcmp(name, DEVICE_TREE)) + return 0;
DEVICE_TREEis setup ingenerated/dt.h.I am not quite sure what you mean by put this to each individual board. Like a property for SPL which DT should be select?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
OK I see. In that case I think we need another entry argument to pass ${DEVICE_TREE} to the fit entry, and pass it in to binman from the
Makefilewith another -a parameter.Can you please include this option?
OK I'll add something in the v2 series.
Thanks.
Quoted 5 lines
Quoted 5 lines
Also what's the easiest way to compose multiple images though binman and share images among others configurations?
Quoted 7 lines
Quoted 3 lines
I will generate u-boot.itb through binman and then I want to use this file for composing qspi image. Should I just point to u-boot.itb as blob with filename?
At present binman doesn't support including one image in another, although since generation of images is ordered, yes it should be possible to do it that way.
ok.
Quoted 7 lines
Quoted 5 lines
Layout for qspi is quite simply spl/boot.bin which is generated as
./tools/mkimage-T zynqmpimage -R ./"" -n "/home/monstr/data/disk/u-boot-bins/zynqmp/pmu.bin" -d spl/u-boot-spl-align.bin spl/boot.bin >/dev/null && cat/dev/nullOK you should be able to use the mkimage entry-type for that.
Normally it should be enough
Quoted 8 lines
mkimage { args = "-T zynqmpimage -R $CONFIG_BOOT_INIT_FILE"; u-boot-spl-align { }; };It means I would have to create new type for u-boot-spl-align file. And second in argument there is $CONFIG_BOOT_INIT_FILE.
One option would be to allow args to be a list of strings, i.e. one string per argument. Then you could do:
args = "-T", "zynqmpimage", "-R",
CONFIG_BOOT_INIT_FILE;Quoted 3 lines
Anyway I can simply take spl/boot.bin which is generated already as the part of build and don't need to call mkimage from here.
The goal here is to get rid of arch-specific stuff in
Makefile.Quoted 26 lines
Quoted 11 lines
Quoted 5 lines
And then u-boot.itb placed at
CONFIG_SYS_SPI_KERNEL_OFFSoffset.OK, you can access CONFIG options in the .dtsi
Can you please point me to the docs for zynqmp in the U-Boot tree? I see stuff about zynq inthe tree but it is quite old. I think there needs to be a link from doc/board/xilinx
We haven't really spent any time on writing proper doc for zynqmp. But I normally just do this.
setup arm64 toochain
makexilinx_zynqmp_virt_defconfig
FillCONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE- which points to pmu configuration object.
andCONFIG_PMUFW_INIT_FILE- which points to PMU binary file.export DEVICE_TREE=zynqmp-zcu104-revC
make -j8
Quoted 8 lines
Quoted 6 lines
you get u-boot.itb and spl/boot.bin. You copy them to SD card and boot from it. This will get you to u-boot running from EL3.
if you add bl31.bin to your source tree or point to it via BL31 variable itb is created with ATF inside and you will get to to SPL->ATF->U-Boot in EL2.
Would you mind putting the above in a patch?
I have sent patches which updates documentation.
Thanks,
Michal
PATCH v4 21/27 rockchip: Convert evb-rk3288 over to use binman
In reply to Simon GlassAt present this board uses a custom script to produce the .its file. Update it to use binman instead. Binman can create all the images that are needed.
---
Changes in v4:
- Move the .itb output to a separate rockchip-optee.dtsi file
- Add a check for CONFIG_FIT before building the .its
Changes in v3:
- Drop use of rk322x.dtsi
- Add changes to rk3288-u-boot.dtsi instead
Kconfig | 2 +- arch/arm/dts/rk3288-u-boot.dtsi | 1 + arch/arm/dts/rockchip-optee.dtsi | 64 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3288/Kconfig | 1 + configs/evb-rk3288_defconfig | 2 +- 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/rockchip-optee.dtsi
Kconfig +1 -1
@@ -321,7 +321,7 @@ config BUILD_TARGET default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_GEN5 default "u-boot-spl.kwb" if ARCH_MVEBU && SPL default "u-boot-elf.srec" if RCAR_GEN3 - default "u-boot.itb" if SPL_LOAD_FIT && (ARCH_ROCKCHIP || \ + default "u-boot.itb" if !BINMAN && SPL_LOAD_FIT && (ARCH_ROCKCHIP || \ ARCH_SUNXI || RISCV || ARCH_ZYNQMP) default "u-boot.kwb" if ARCH_KIRKWOOD default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
arch/arm/dts/rk3288-u-boot.dtsi +1 -0
@@ -4,6 +4,7 @@ */ #include "rockchip-u-boot.dtsi" +#include "rockchip-optee.dtsi" / { chosen {
arch/arm/dts/rockchip-optee.dtsi new file +64 -0
64 lines not on this page · raw message
arch/arm/mach-rockchip/rk3288/Kconfig +1 -0
@@ -48,6 +48,7 @@ config TARGET_CHROMEBOOK_SPEEDY config TARGET_EVB_RK3288 bool "Evb-RK3288" + select HAS_ROM select BOARD_LATE_INIT select TPL help
configs/evb-rk3288_defconfig +1 -1
@@ -14,7 +14,7 @@ CONFIG_DEBUG_UART=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/fit_spl_optee.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_PREBOOT=y CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb"
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 21/27 rockchip: Convert evb-rk3288 over to use binman
At present this board uses a custom script to produce the .its file. Update it to use binman instead. Binman can create all the images that are needed.
---
Changes in v4:
- Move the .itb output to a separate rockchip-optee.dtsi file
- Add a check for CONFIG_FIT before building the .its
Changes in v3:
- Drop use of rk322x.dtsi
- Add changes to rk3288-u-boot.dtsi instead
Kconfig | 2 +- arch/arm/dts/rk3288-u-boot.dtsi | 1 + arch/arm/dts/rockchip-optee.dtsi | 64 +++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3288/Kconfig | 1 + configs/evb-rk3288_defconfig | 2 +- 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/rockchip-optee.dtsi
Applied to u-boot-dm, thanks!
PATCH v4 22/27 rockchip: Convert evb-rk3229 over to use binman
In reply to Simon GlassAt present this board uses a custom script to produce the .its file. Update it to use binman instead. Binman can create all the images that are needed.
---
(no changes since v3)
Changes in v3:
- Drop leftover debugging
configs/evb-rk3229_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/evb-rk3229_defconfig +1 -1
@@ -15,7 +15,7 @@ CONFIG_DEBUG_UART=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/fit_spl_optee.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rk3229-evb.dtb" # CONFIG_DISPLAY_CPUINFO is not set
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 22/27 rockchip: Convert evb-rk3229 over to use binman
At present this board uses a custom script to produce the .its file. Update it to use binman instead. Binman can create all the images that are needed.
---
(no changes since v3)
Changes in v3:
- Drop leftover debugging
configs/evb-rk3229_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH v4 23/27 rockchip: Drop the fit_spl_optee.sh script
In reply to Simon GlassNow that all board use binman instead of this script, drop it.
---
(no changes since v1)
arch/arm/mach-rockchip/fit_spl_optee.sh | 84 ------------------------- 1 file changed, 84 deletions(-) delete mode 100755 arch/arm/mach-rockchip/fit_spl_optee.sh
arch/arm/mach-rockchip/fit_spl_optee.sh deleted +0 -84
@@ -1,84 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0+ -# -# Copyright (C) 2019 Rockchip Electronic Co.,Ltd -# -# Script to generate FIT image source for 32-bit Rockchip SoCs with -# U-Boot proper, OPTEE, and devicetree. -# -# usage: $0 <dt_name> - -[ -z "$TEE" ] && TEE="tee.bin" - -if [ ! -f $TEE ]; then - echo "WARNING: TEE file $TEE NOT found, U-Boot.itb is non-functional" >&2 - echo "Please export path for TEE or copy tee.bin to U-Boot folder" >&2 - TEE=/dev/null -fi - -dtname=$1 -text_base=`sed -n "/SYS_TEXT_BASE=/s/CONFIG_SYS_TEXT_BASE=//p" .config \ - |tr -d '\r'` -dram_base=`sed -n "/SYS_SDRAM_BASE=/s/CONFIG_SYS_SDRAM_BASE=//p" \ - include/autoconf.mk|tr -d '\r'` -tee_base=`echo "obase=16;$(($dram_base+0x8400000))"|bc` -tee_base='0x'$tee_base - -cat << __HEADER_EOF -/* - * Copyright (C) 2017-2019 Rockchip Electronic Co.,Ltd - * - * Simple U-boot FIT source file containing U-Boot, dtb and optee - */ - -/dts-v1/; - -/ { - description = "FIT image with OP-TEE support"; - #address-cells = <1>; - - images { - uboot { - description = "U-Boot"; - data = /incbin/("u-boot-nodtb.bin"); - type = "standalone"; - os = "U-Boot"; - arch = "arm"; - compression = "none"; - load = <$text_base>; - }; - optee { - description = "OP-TEE"; - data = /incbin/("$TEE"); - type = "firmware"; - arch = "arm"; - os = "tee"; - compression = "none"; - load = <$tee_base>; - entry = <$tee_base>; - }; - fdt { - description = "$(basename $dtname .dtb)"; - data = /incbin/("$dtname"); - type = "flat_dt"; - compression = "none"; - }; -__HEADER_EOF - -cat << __CONF_HEADER_EOF - }; - - configurations { - default = "conf"; - conf { - description = "$(basename $dtname .dtb)"; - firmware = "optee"; - loadables = "uboot"; - fdt = "fdt"; - }; -__CONF_HEADER_EOF - -cat << __ITS_EOF - }; -}; -__ITS_EOF
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 23/27 rockchip: Drop the fit_spl_optee.sh script
Now that all board use binman instead of this script, drop it.
---
(no changes since v1)
arch/arm/mach-rockchip/fit_spl_optee.sh | 84 ------------------------- 1 file changed, 84 deletions(-) delete mode 100755 arch/arm/mach-rockchip/fit_spl_optee.sh
Applied to u-boot-dm, thanks!
PATCH v4 24/27 x86: Move the fdtmap away from the binary blobs
In reply to Simon GlassThis causes conflicts on chromebook_link64. Move it to after U-Boot where there should be plenty of space.
---
(no changes since v1)
arch/x86/dts/u-boot.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/dts/u-boot.dtsi +2 -2
@@ -92,6 +92,8 @@ u-boot-dtb { }; #endif + fdtmap { + }; #ifdef CONFIG_HAVE_X86_FIT intel-fit { };
@@ -139,8 +141,6 @@ filename = CONFIG_FSP_FILE_S; }; #endif - fdtmap { - }; #ifdef CONFIG_HAVE_CMC intel-cmc { filename = CONFIG_CMC_FILE;
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 24/27 x86: Move the fdtmap away from the binary blobs
This causes conflicts on chromebook_link64. Move it to after U-Boot where there should be plenty of space.
---
(no changes since v1)
arch/x86/dts/u-boot.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 25/27 x86: chromebook_link64: Correct the image layout
In reply to Simon GlassAt present the image layout is not correct, since it uses the SDRAM address of the 64-bit U-Boot as the ROM address. Fix this.
---
(no changes since v1)
configs/chromebook_link64_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/chromebook_link64_defconfig +2 -0
@@ -17,8 +17,10 @@ CONFIG_HAVE_MRC=y CONFIG_SMP=y CONFIG_HAVE_VGA_BIOS=y CONFIG_DEFAULT_DEVICE_TREE="chromebook_link" +CONFIG_X86_OFFSET_U_BOOT=0xffa00000 CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_SHOW_BOOT_PROGRESS=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 25/27 x86: chromebook_link64: Correct the image layout
At present the image layout is not correct, since it uses the SDRAM address of the 64-bit U-Boot as the ROM address. Fix this.
---
(no changes since v1)
configs/chromebook_link64_defconfig | 2 ++ 1 file changed, 2 insertions(+)
Applied to u-boot-dm, thanks!
PATCH v4 26/27 x86: chromebook_panther: Correct the image layout
In reply to Simon GlassThis board does not have microcode but at present that is not supported by Kconfig nor the binman image layout. Fix both of these.
---
(no changes since v1)
arch/x86/Kconfig | 7 ++++++- arch/x86/dts/u-boot.dtsi | 6 +++++- configs/chromebox_panther_defconfig | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-)
arch/x86/Kconfig +6 -1
@@ -594,8 +594,13 @@ config HAVE_REFCODE Various peripherals may fail to work. config HAVE_MICROCODE - bool + bool "Board requires a microcode binary" default y if !FSP_VERSION2 + help + Enable this if the board requires microcode to be loaded on boot. + Typically this is handed by the FSP for modern boards, but for + some older boards, it must be programmed by U-Boot, and that form + part of the image. config SMP bool "Enable Symmetric Multiprocessing"
arch/x86/dts/u-boot.dtsi +5 -1
@@ -75,11 +75,15 @@ u-boot { offset = <CONFIG_SYS_TEXT_BASE>; }; -# else +# elif defined(CONFIG_HAVE_MICROCODE) /* If there is no SPL then we need to put microcode in U-Boot */ u-boot-with-ucode-ptr { offset = <CONFIG_X86_OFFSET_U_BOOT>; }; +# else + u-boot-nodtb { + offset = <CONFIG_X86_OFFSET_U_BOOT>; + }; # endif #endif #ifdef CONFIG_HAVE_MICROCODE
configs/chromebox_panther_defconfig +2 -0
@@ -7,7 +7,9 @@ CONFIG_NR_DRAM_BANKS=8 CONFIG_VENDOR_GOOGLE=y CONFIG_TARGET_CHROMEBOX_PANTHER=y CONFIG_HAVE_MRC=y +# CONFIG_HAVE_MICROCODE is not set CONFIG_HAVE_VGA_BIOS=y +CONFIG_X86_OFFSET_U_BOOT=0xffa00000 CONFIG_FIT=y CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 26/27 x86: chromebook_panther: Correct the image layout
This board does not have microcode but at present that is not supported by Kconfig nor the binman image layout. Fix both of these.
---
(no changes since v1)
arch/x86/Kconfig | 7 ++++++- arch/x86/dts/u-boot.dtsi | 6 +++++- configs/chromebox_panther_defconfig | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-)
Applied to u-boot-dm, thanks!
PATCH v4 27/27 x86: chromebook_samus_tpl: Correct the image layout
In reply to Simon GlassAt present there is not enough space for U-Boot due to the EFI loader. Correct this.
---
(no changes since v2)
Changes in v2:
- Add patches to partially migrate rockchip to use binman
configs/chromebook_samus_tpl_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/chromebook_samus_tpl_defconfig +1 -1
@@ -17,8 +17,8 @@ CONFIG_HAVE_MRC=y CONFIG_HAVE_REFCODE=y CONFIG_SMP=y CONFIG_HAVE_VGA_BIOS=y -CONFIG_X86_OFFSET_U_BOOT=0xfff00000 CONFIG_DEFAULT_DEVICE_TREE="chromebook_samus" +CONFIG_X86_OFFSET_U_BOOT=0xffee0000 CONFIG_BOOTSTAGE=y CONFIG_BOOTSTAGE_REPORT=y CONFIG_SHOW_BOOT_PROGRESS=y
Signature · 1 line
2.28.0.rc0.105.gf9edc3c819-goog
PATCH v4 27/27 x86: chromebook_samus_tpl: Correct the image layout
At present there is not enough space for U-Boot due to the EFI loader. Correct this.
---
(no changes since v2)
Changes in v2:
- Add patches to partially migrate rockchip to use binman
configs/chromebook_samus_tpl_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
v4 cover rockchip: x86: Support building ROM files automatically with binman
In reply to Simon GlassHi Simon,
Quoted 29 lines · Simon Glass
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.
This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a
BUILD_ROMenvironment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing.
This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the
fit_spl_optee.shscript.Other archs and the rest of rockchip could be migrated too.
This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).
Changes in v4:
- Add a newCONFIG_ROCKCHIP_SPI_IMAGEto control SPI-image generation
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the image
- Update for changes toarch/arm/mach-k3/config.mk
- Move the .itb output to a separaterockchip-optee.dtsifile
- Add a check forCONFIG_FITbefore building the .its
Quoted 7 lines
Changes in v3:
- Add a comment aboutCONFIG_SPL_FRAMEWORK
- Drop rockchip changes which should not be in this patch
- Move in the rockchip changes mistakenly in the earlier x86 patch
- Drop use ofrk322x.dtsi
- Add changes tork3288-u-boot.dtsiinstead
- Drop leftover debugging
It looks you have applied part of the v3 in u-boot-dm, and sent the remaining patches as v4?
I re-assigned this series to you in patchwork.
Regards,
Bin
v4 cover rockchip: x86: Support building ROM files automatically with binman
Hi Bin,
Quoted 41 lines · Bin Meng
Hi Simon,
Quoted 29 lines · Simon Glass
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.
This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a
BUILD_ROMenvironment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing.
This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the
fit_spl_optee.shscript.Other archs and the rest of rockchip could be migrated too.
This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).
Changes in v4:
- Add a newCONFIG_ROCKCHIP_SPI_IMAGEto control SPI-image generation
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the image
- Update for changes toarch/arm/mach-k3/config.mk
- Move the .itb output to a separaterockchip-optee.dtsifile
- Add a check forCONFIG_FITbefore building the .itsQuoted 7 lines
Changes in v3:
- Add a comment aboutCONFIG_SPL_FRAMEWORK
- Drop rockchip changes which should not be in this patch
- Move in the rockchip changes mistakenly in the earlier x86 patch
- Drop use ofrk322x.dtsi
- Add changes tork3288-u-boot.dtsiinstead
- Drop leftover debugging
Quoted 4 lines
It looks you have applied part of the v3 in u-boot-dm, and sent the remaining patches as v4?
I re-assigned this series to you in patchwork.
Yes I applied the binman patches and those that were reviewed.
I am not sure if this shold be an x86 or rockchip series, or perhaps we just wait until people have had a look.
Regards,
Simon
v4 cover rockchip: x86: Support building ROM files automatically with binman
Hi Kever (and other Rockchip people),
Are there any more comments on this series? I can pick it up via -dm but I would like to get more comments if possible. I'd also like to see if someone can take on removing the other ad-hoc Rockchip script.
Regards,
Simon
Quoted 57 lines · Simon Glass
Hi Bin,
Quoted 41 lines · Bin Meng
Hi Simon,
Quoted 29 lines · Simon Glass
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.
This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a
BUILD_ROMenvironment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing.
This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the
fit_spl_optee.shscript.Other archs and the rest of rockchip could be migrated too.
This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).
Changes in v4:
- Add a newCONFIG_ROCKCHIP_SPI_IMAGEto control SPI-image generation
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the image
- Update for changes toarch/arm/mach-k3/config.mk
- Move the .itb output to a separaterockchip-optee.dtsifile
- Add a check forCONFIG_FITbefore building the .itsQuoted 7 lines
Changes in v3:
- Add a comment aboutCONFIG_SPL_FRAMEWORK
- Drop rockchip changes which should not be in this patch
- Move in the rockchip changes mistakenly in the earlier x86 patch
- Drop use ofrk322x.dtsi
- Add changes tork3288-u-boot.dtsiinstead
- Drop leftover debuggingQuoted 4 lines
It looks you have applied part of the v3 in u-boot-dm, and sent the remaining patches as v4?
I re-assigned this series to you in patchwork.
Yes I applied the binman patches and those that were reviewed.
I am not sure if this shold be an x86 or rockchip series, or perhaps we just wait until people have had a look.
Regards,
Simon
v4 cover rockchip: x86: Support building ROM files automatically with binman
Hi Simon,
??? Sorry for reply late.
??? It's OK to use binman to generate firmware for 32bit SoCs which
only have optee.bin
which is easy replacement.
I still have some confuse(I'm sure I've ask before but I can't find now, sorry):
- to support feature like this(Jagan asked in anoter thread):
??? tools/mkimage -n rk3399 -T rksd -d
tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img
??? Note that there are 2 inputs instead of 1 so that we can get
correct size for each of them in the header.
- bl31.elf parse which including multi binaries, we need to split them first, and also sign them into u-boot.itb
arch/arm/mach-rockchip/make_fit_atf.py
??? If the feature in this script can be replaced by binman, them all
the rockchip platform can use binman.
- For rockchip platform we need separate idbloader.img and u-boot.itb
??? In many case, people don't want to erase the space which are not
the space for idbloader.img and u-boot.itb
??? eg. space at offset 0 is gpt, there should be available gpt in the
beginning and end of disk;
??? space between idbloader and u-boot.itb may have some useful vendor
data;
??? I can have a try if you can help give me some guide about how to
implement these features with binman,
them I can make it available to all other rockchip boards if all these features are available.
Thanks,
- Kever
Quoted 64 lines · Simon Glass
Hi Kever (and other Rockchip people),
Are there any more comments on this series? I can pick it up via -dm but I would like to get more comments if possible. I'd also like to see if someone can take on removing the other ad-hoc Rockchip script.
Regards,
SimonQuoted 52 lines · Simon Glass
Hi Bin,
Quoted 38 lines · Bin Meng
Hi Simon,
Quoted 28 lines · Simon Glass
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.
This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a
BUILD_ROMenvironment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing.
This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the
fit_spl_optee.shscript.Other archs and the rest of rockchip could be migrated too.
This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).
Changes in v4:
- Add a newCONFIG_ROCKCHIP_SPI_IMAGEto control SPI-image generation
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the image
- Update for changes toarch/arm/mach-k3/config.mk
- Move the .itb output to a separaterockchip-optee.dtsifile
- Add a check forCONFIG_FITbefore building the .itsQuoted 7 lines
Changes in v3:
- Add a comment aboutCONFIG_SPL_FRAMEWORK
- Drop rockchip changes which should not be in this patch
- Move in the rockchip changes mistakenly in the earlier x86 patch
- Drop use ofrk322x.dtsi
- Add changes tork3288-u-boot.dtsiinstead
- Drop leftover debuggingQuoted 4 lines
It looks you have applied part of the v3 in u-boot-dm, and sent the remaining patches as v4?
I re-assigned this series to you in patchwork.
Yes I applied the binman patches and those that were reviewed.
I am not sure if this shold be an x86 or rockchip series, or perhaps we just wait until people have had a look.
Regards,
Simon
v4 cover rockchip: x86: Support building ROM files automatically with binman
Hi Kever,
Quoted 13 lines · Kever Yang
Hi Simon,
Sorry for reply late.
It's OK to use binman to generate firmware for 32bit SoCs which
only have optee.binwhich is easy replacement.
I still have some
confuse(I'm sure I've ask before but I can't find now, sorry):
Quoted 7 lines
- to support feature like this(Jagan asked in anoter thread):
tools/mkimage-n rk3399 -T rksd -d
tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.imgNote that there are 2 inputs instead of 1 so that we can get
correct size for each of them in the header.
What I suggest is to add two subnodes to the mkimage node, one with each file. At present this means to combine the two files into one and pass them to mkimage with '-d'. So perhaps add a new property to the mkimage node, like 'multi-input' and change mkimage.py to read that property and behave differently in ObtainContents() in that case.
Quoted 3 lines
- bl31.elf parse which including multi binaries, we need to split them first, and also sign them into u-boot.itb
See elf.py which has Elf parsing. The cbfs_util.py file calls DecodeElf() which should be helpful. You can create a new rockchip-atf type to do what you want, if the Rockchip code is speical.
Quoted 5 lines
arch/arm/mach-rockchip/make_fit_atf.pyIf the feature in this script can be replaced by binman, them all
the rockchip platform can use binman.
Yes and it is written in Python too, so some of the code can move over into binman etypes.
Quoted 11 lines
- For rockchip platform we need separate idbloader.img and u-boot.itb
In many case, people don't want to erase the space which are not
the space for idbloader.img and u-boot.itbeg. space at offset 0 is gpt, there should be available gpt in the
beginning and end of disk;space between idbloader and u-boot.itb may have some useful vendor
data;
Well you can perhaps output an image that has everything in one file as well as a few other files that contain the pieces. Then you can cover both options.
Quoted 6 lines
I can have a try if you can help give me some guide about how to
implement these features with binman,them I can make it available to all other rockchip boards if all these features are available.
That sounds good. I am happy to help!
Regards,
Simon
Quoted 70 lines
Thanks,
- KeverQuoted 64 lines · Simon Glass
Hi Kever (and other Rockchip people),
Are there any more comments on this series? I can pick it up via -dm but I would like to get more comments if possible. I'd also like to see if someone can take on removing the other ad-hoc Rockchip script.
Regards,
SimonQuoted 52 lines · Simon Glass
Hi Bin,
Quoted 38 lines · Bin Meng
Hi Simon,
Quoted 28 lines · Simon Glass
Rockchip-based Chromebooks support booting from SPI flash. It is annoying to have to manually build the SPI image when the SD image is built automatically.
This feature is already available for x86 devices, so the existing mechanism is reused. Briefly, this allows a
BUILD_ROMenvironment variable to be provided to indicate that any required binary blobs are present and it is safe to build the ROM.A new 'mkimage' type is added to binman to support building binaries containing mkimagem using a binman definition to configure it. This avoids Makefile/shell/Python code to do the same thing.
This series also migrates some rockchip boards to use binman to produce their FIT as well, resulting in removing the
fit_spl_optee.shscript.Other archs and the rest of rockchip could be migrated too.
This series uses binman to produce a ROM image on two selected Chromebooks, Bob (RK3399) and Jerry (RK3388).
Changes in v4:
- Add a newCONFIG_ROCKCHIP_SPI_IMAGEto control SPI-image generation
- UseCONFIG_ROCKCHIP_SPI_IMAGEto select the image
- Update for changes toarch/arm/mach-k3/config.mk
- Move the .itb output to a separaterockchip-optee.dtsifile
- Add a check forCONFIG_FITbefore building the .itsQuoted 7 lines
Changes in v3:
- Add a comment aboutCONFIG_SPL_FRAMEWORK
- Drop rockchip changes which should not be in this patch
- Move in the rockchip changes mistakenly in the earlier x86 patch
- Drop use ofrk322x.dtsi
- Add changes tork3288-u-boot.dtsiinstead
- Drop leftover debuggingQuoted 4 lines
It looks you have applied part of the v3 in u-boot-dm, and sent the remaining patches as v4?
I re-assigned this series to you in patchwork.
Yes I applied the binman patches and those that were reviewed.
I am not sure if this shold be an x86 or rockchip series, or perhaps we just wait until people have had a look.
Regards,
Simon