From bcd4e6f3bd79faef0e57f5ff8adc8b6b4ecfa005 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:55:52 -0600 Subject: 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. Signed-off-by: Simon Glass --- arch/Kconfig | 1 + arch/x86/Kconfig | 4 ++++ arch/x86/cpu/quark/Kconfig | 1 + 3 files changed, 6 insertions(+) (limited to 'arch') diff --git a/arch/Kconfig b/arch/Kconfig index 9be02d1319f..7f3cbe2ec88 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -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 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index ff4f06ed79c..01ffaea132c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -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 diff --git a/arch/x86/cpu/quark/Kconfig b/arch/x86/cpu/quark/Kconfig index 430cce184d4..2fee38aed79 100644 --- a/arch/x86/cpu/quark/Kconfig +++ b/arch/x86/cpu/quark/Kconfig @@ -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 -- cgit v1.2.3 From fab4f3231f7d5a68e3ee698a01f2038d18ff3496 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:55:53 -0600 Subject: 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. Signed-off-by: Simon Glass --- arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c index cddf4fd3d57..f148d48b6a3 100644 --- a/arch/arm/mach-rockchip/spl.c +++ b/arch/arm/mach-rockchip/spl.c @@ -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)) -- cgit v1.2.3 From 9b312e26fc772965e6b48c2b452c08d42a9e288f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:55:57 -0600 Subject: 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 Signed-off-by: Simon Glass --- 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(-) (limited to 'arch') diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index 51b6e018bd7..c87f00141f1 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -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; }; diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index a2559e2db08..0451db735e7 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -6,7 +6,13 @@ #include / { - binman { + binman: binman { + multiple-images; + }; +}; + +&binman { + simple-bin { filename = "u-boot-rockchip.bin"; pad-byte = <0xff>; diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index fcab1d5cee9..407bf3fbeae 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -367,6 +367,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" diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index afb62fca78e..bb715e9d0e6 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -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 -- cgit v1.2.3 From c4cea2bbf995764f325a907061c22ecd6768cf7b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:55:58 -0600 Subject: 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. Signed-off-by: Simon Glass --- 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(-) (limited to 'arch') diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi index 7bddc3acdbb..390ac2bb5a9 100644 --- a/arch/arm/dts/rk3399-gru-u-boot.dtsi +++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi @@ -4,3 +4,7 @@ */ #include "rk3399-u-boot.dtsi" + +&spi_flash { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi index 7ac88392f2c..f9c5bb607ba 100644 --- a/arch/arm/dts/rk3399-gru.dtsi +++ b/arch/arm/dts/rk3399-gru.dtsi @@ -537,7 +537,7 @@ ap_i2c_audio: &i2c8 { pinctrl-names = "default", "sleep"; pinctrl-1 = <&spi1_sleep>; - spiflash@0 { + spi_flash: spiflash@0 { compatible = "jedec,spi-nor"; reg = <0>; diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi index 82377824085..ecd230c7202 100644 --- a/arch/arm/dts/rk3399-u-boot.dtsi +++ b/arch/arm/dts/rk3399-u-boot.dtsi @@ -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@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; }; diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index 254b9c5b4d7..17628f91712 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -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", -- cgit v1.2.3 From 3077026ea1852473011ec7de25087d95ea4e6ddd Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:00 -0600 Subject: 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. Signed-off-by: Simon Glass --- arch/arm/mach-tegra/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 15e76840281..a397748b72b 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -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 -- cgit v1.2.3 From e6385c7e9c0f66a55aa3de540afc7b2b56c78712 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:01 -0600 Subject: 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. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- 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(-) (limited to 'arch') diff --git a/Makefile b/Makefile index 347bef4a383..d4a16067564 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index f25603109e0..4153f7e3713 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -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 diff --git a/arch/arm/mach-at91/config.mk b/arch/arm/mach-at91/config.mk index 9a023efb193..5426394651e 100644 --- a/arch/arm/mach-at91/config.mk +++ b/arch/arm/mach-at91/config.mk @@ -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 diff --git a/arch/arm/mach-davinci/config.mk b/arch/arm/mach-davinci/config.mk index 5a33982e2d3..4674cae43b1 100644 --- a/arch/arm/mach-davinci/config.mk +++ b/arch/arm/mach-davinci/config.mk @@ -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 diff --git a/arch/arm/mach-k3/config.mk b/arch/arm/mach-k3/config.mk index f7afef610c4..c9538718e7a 100644 --- a/arch/arm/mach-k3/config.mk +++ b/arch/arm/mach-k3/config.mk @@ -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 diff --git a/arch/arm/mach-keystone/config.mk b/arch/arm/mach-keystone/config.mk index 5806f8f5d1a..5a16891f234 100644 --- a/arch/arm/mach-keystone/config.mk +++ b/arch/arm/mach-keystone/config.mk @@ -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 diff --git a/arch/arm/mach-omap2/config.mk b/arch/arm/mach-omap2/config.mk index af455366ed9..4f0d2598fa8 100644 --- a/arch/arm/mach-omap2/config.mk +++ b/arch/arm/mach-omap2/config.mk @@ -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 diff --git a/arch/arm/mach-rmobile/Makefile b/arch/arm/mach-rmobile/Makefile index a3fdcc3bc0e..3206bce7220 100644 --- a/arch/arm/mach-rmobile/Makefile +++ b/arch/arm/mach-rmobile/Makefile @@ -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 diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk index 403af2a225e..c30bf482f72 100644 --- a/arch/arm/mach-stm32mp/config.mk +++ b/arch/arm/mach-stm32mp/config.mk @@ -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 diff --git a/board/BuR/brppt1/config.mk b/board/BuR/brppt1/config.mk index b11b544c37c..6853135f838 100644 --- a/board/BuR/brppt1/config.mk +++ b/board/BuR/brppt1/config.mk @@ -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 diff --git a/board/BuR/brppt2/config.mk b/board/BuR/brppt2/config.mk index fa973db7626..0d1638a97ac 100644 --- a/board/BuR/brppt2/config.mk +++ b/board/BuR/brppt2/config.mk @@ -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 diff --git a/board/BuR/brsmarc1/config.mk b/board/BuR/brsmarc1/config.mk index 0692988507b..1de971876c3 100644 --- a/board/BuR/brsmarc1/config.mk +++ b/board/BuR/brsmarc1/config.mk @@ -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) \ No newline at end of file + $(call if_changed,prodzip) diff --git a/board/imgtec/boston/config.mk b/board/imgtec/boston/config.mk index 8cfc9c68943..c1e242f1088 100644 --- a/board/imgtec/boston/config.mk +++ b/board/imgtec/boston/config.mk @@ -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 diff --git a/board/intel/edison/config.mk b/board/intel/edison/config.mk index fdcbbdf3b1a..8c6087e2908 100644 --- a/board/intel/edison/config.mk +++ b/board/intel/edison/config.mk @@ -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) diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index e6d56a1286f..d528c994ff2 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -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), $^) > $@ diff --git a/tools/binman/README b/tools/binman/README index a6a3ee48aaf..37ee3fc2d3b 100644 --- a/tools/binman/README +++ b/tools/binman/README @@ -220,7 +220,7 @@ u-boot-.bin: checkbinman FORCE endif This assumes that u-boot-.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 -- cgit v1.2.3 From be17bcb9af3bf8c0054c4cd5b2a5e469181897b5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:02 -0600 Subject: 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. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c2c577f60c1..6a2e88fed25 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -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 -- cgit v1.2.3 From e999bea485b3bec03b8135d78e670fea20201931 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:07 -0600 Subject: 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. Reviewed-by: Bin Meng Signed-off-by: Simon Glass --- Makefile | 24 ++++++++++++++++-------- arch/arm/dts/rockchip-u-boot.dtsi | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'arch') diff --git a/Makefile b/Makefile index e347e9fc4a6..e9882c60fcf 100644 --- a/Makefile +++ b/Makefile @@ -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) \ diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index 0451db735e7..eae3ee715da 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -11,6 +11,7 @@ }; }; +#ifdef CONFIG_SPL &binman { simple-bin { filename = "u-boot-rockchip.bin"; @@ -25,3 +26,4 @@ }; }; }; +#endif -- cgit v1.2.3 From a32dd071485b17137b6d6088d26cee8011c5b9fc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:12 -0600 Subject: 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. Signed-off-by: Simon Glass --- 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 (limited to 'arch') diff --git a/Kconfig b/Kconfig index 92a8a69f730..4462432956a 100644 --- a/Kconfig +++ b/Kconfig @@ -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 diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index c87f00141f1..e3c6c10f130 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -4,6 +4,7 @@ */ #include "rockchip-u-boot.dtsi" +#include "rockchip-optee.dtsi" / { chosen { diff --git a/arch/arm/dts/rockchip-optee.dtsi b/arch/arm/dts/rockchip-optee.dtsi new file mode 100644 index 00000000000..cde9b81b26b --- /dev/null +++ b/arch/arm/dts/rockchip-optee.dtsi @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2020 Google LLC + */ + +#include + +#if defined(CONFIG_HAS_ROM) && defined(CONFIG_FIT) +&binman { + itb { + filename = "u-boot.itb"; + fit { + fit,external-offset = ; + description = "FIT image with OP-TEE support"; + #address-cells = <1>; + + images { + uboot { + description = "U-Boot"; + type = "standalone"; + os = "U-Boot"; + arch = "arm"; + compression = "none"; + load = ; + + u-boot-nodtb { + }; + }; + optee { + description = "OP-TEE"; + type = "firmware"; + arch = "arm"; + os = "tee"; + compression = "none"; + load = <(CONFIG_SYS_SDRAM_BASE + 0x8400000)>; + entry = <(CONFIG_SYS_SDRAM_BASE + 0x8400000)>; + + blob-ext { + filename = "tee.bin"; + }; + }; + fdt { + description = CONFIG_SYS_BOARD; + type = "flat_dt"; + compression = "none"; + + u-boot-dtb { + }; + }; + }; + + configurations { + default = "conf"; + conf { + description = CONFIG_SYS_BOARD; + firmware = "optee"; + loadables = "uboot"; + fdt = "fdt"; + }; + }; + }; + }; +}; +#endif diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index bb715e9d0e6..20a00c5be78 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -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 diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig index 6bdcc85eac7..66bc387d8d3 100644 --- a/configs/evb-rk3288_defconfig +++ b/configs/evb-rk3288_defconfig @@ -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_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb" -- cgit v1.2.3 From 5a1140527dfb5b81165c2c1b4f50d02b4c029e82 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:14 -0600 Subject: rockchip: Drop the fit_spl_optee.sh script Now that all board use binman instead of this script, drop it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- 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 (limited to 'arch') diff --git a/arch/arm/mach-rockchip/fit_spl_optee.sh b/arch/arm/mach-rockchip/fit_spl_optee.sh deleted file mode 100755 index 4118472d9f2..00000000000 --- a/arch/arm/mach-rockchip/fit_spl_optee.sh +++ /dev/null @@ -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 - -[ -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 -- cgit v1.2.3 From a78466af82e4db6ffba40f45dadc904233eb06de Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:15 -0600 Subject: 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. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/dts/u-boot.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index f0f8c71761a..1e0a985b43b 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -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; -- cgit v1.2.3 From 9589c447e82417dba6b6bf4ccd55d6d0f89ae1ef Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 13:56:17 -0600 Subject: 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. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/Kconfig | 7 ++++++- arch/x86/dts/u-boot.dtsi | 6 +++++- configs/chromebox_panther_defconfig | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 01ffaea132c..cbca69ef6b3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -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" diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index 1e0a985b43b..fa8106c8b8c 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -75,11 +75,15 @@ u-boot { offset = ; }; -# 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 = ; }; +# else + u-boot-nodtb { + offset = ; + }; # endif #endif #ifdef CONFIG_HAVE_MICROCODE diff --git a/configs/chromebox_panther_defconfig b/configs/chromebox_panther_defconfig index d559e034b1c..701edf0d07f 100644 --- a/configs/chromebox_panther_defconfig +++ b/configs/chromebox_panther_defconfig @@ -8,7 +8,9 @@ CONFIG_DEFAULT_DEVICE_TREE="chromebox_panther" 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 -- cgit v1.2.3 From 037a56d6b1e2a2ce45454b2629800ee5e7f6b46e Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Fri, 24 Jul 2020 15:51:53 +0200 Subject: sandbox, test: change hog gpio Since commit 9ba84329dc45 ("sandbox, test: add test for GPIO_HOG function"), the gpio_a 0,1,2 and 3 are used by hog in test.dts. But 2 leds 'sandbox:red' and 'sandbox:green' are using gpio_a 0 and 1. As hog always request his gpios, the led command on both led is broken: => led sandbox:red LED 'sandbox:red' not found (err=-16) The gpio is already requested by hog, so it can't be enabled for led 'sandbox:red'. This commit change the gpio used by hog to 10, 11, 12 and 13, so the led command could be used again with 'sandbox:red' and 'sandbox:green'. Signed-off-by: Philippe Reynes Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher --- arch/sandbox/dts/test.dts | 8 ++++---- test/dm/gpio.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'arch') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 2ae42397216..2325ec6e69d 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -355,22 +355,22 @@ hog_input_active_low { gpio-hog; input; - gpios = <0 GPIO_ACTIVE_LOW>; + gpios = <10 GPIO_ACTIVE_LOW>; }; hog_input_active_high { gpio-hog; input; - gpios = <1 GPIO_ACTIVE_HIGH>; + gpios = <11 GPIO_ACTIVE_HIGH>; }; hog_output_low { gpio-hog; output-low; - gpios = <2 GPIO_ACTIVE_HIGH>; + gpios = <12 GPIO_ACTIVE_HIGH>; }; hog_output_high { gpio-hog; output-high; - gpios = <3 GPIO_ACTIVE_HIGH>; + gpios = <13 GPIO_ACTIVE_HIGH>; }; }; diff --git a/test/dm/gpio.c b/test/dm/gpio.c index 29701389fcd..b7ee8fc3cae 100644 --- a/test/dm/gpio.c +++ b/test/dm/gpio.c @@ -114,21 +114,21 @@ static int dm_test_gpio(struct unit_test_state *uts) /* add gpio hog tests */ ut_assertok(gpio_hog_lookup_name("hog_input_active_low", &desc)); ut_asserteq(GPIOD_IS_IN | GPIOD_ACTIVE_LOW, desc->flags); - ut_asserteq(0, desc->offset); + ut_asserteq(10, desc->offset); ut_asserteq(1, dm_gpio_get_value(desc)); ut_assertok(gpio_hog_lookup_name("hog_input_active_high", &desc)); ut_asserteq(GPIOD_IS_IN, desc->flags); - ut_asserteq(1, desc->offset); + ut_asserteq(11, desc->offset); ut_asserteq(0, dm_gpio_get_value(desc)); ut_assertok(gpio_hog_lookup_name("hog_output_low", &desc)); ut_asserteq(GPIOD_IS_OUT, desc->flags); - ut_asserteq(2, desc->offset); + ut_asserteq(12, desc->offset); ut_asserteq(0, dm_gpio_get_value(desc)); ut_assertok(dm_gpio_set_value(desc, 1)); ut_asserteq(1, dm_gpio_get_value(desc)); ut_assertok(gpio_hog_lookup_name("hog_output_high", &desc)); ut_asserteq(GPIOD_IS_OUT, desc->flags); - ut_asserteq(3, desc->offset); + ut_asserteq(13, desc->offset); ut_asserteq(1, dm_gpio_get_value(desc)); ut_assertok(dm_gpio_set_value(desc, 0)); ut_asserteq(0, dm_gpio_get_value(desc)); @@ -137,8 +137,8 @@ static int dm_test_gpio(struct unit_test_state *uts) ut_assertok(gpio_lookup_name("hog_input_active_low", &dev, &offset, &gpio)); ut_asserteq_str(dev->name, "base-gpios"); - ut_asserteq(0, offset); - ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 0, gpio); + ut_asserteq(10, offset); + ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 10, gpio); ut_assert(gpio_lookup_name("hog_not_exist", &dev, &offset, &gpio)); -- cgit v1.2.3 From bd3e4882c7f4e9c3bec7b4482756b5f14064ee64 Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Fri, 24 Jul 2020 18:19:48 +0200 Subject: sandbox: dtsi: add buttons Adds two buttons on sandbox so button framework may be tested. Reviewed-by: Simon Glass Signed-off-by: Philippe Reynes --- arch/sandbox/dts/sandbox.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arch') diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi index e1f68cd552a..c76ecc013c9 100644 --- a/arch/sandbox/dts/sandbox.dtsi +++ b/arch/sandbox/dts/sandbox.dtsi @@ -15,6 +15,20 @@ #sound-dai-cells = <1>; }; + buttons { + compatible = "gpio-keys"; + + summer { + gpios = <&gpio_a 3 0>; + label = "summer"; + }; + + christmas { + gpios = <&gpio_a 4 0>; + label = "christmas"; + }; + }; + gpio_a: gpios@0 { u-boot,dm-pre-reloc; gpio-controller; -- cgit v1.2.3 From a6c6f0f0c8880b2f3d04784eef49f85b78d0f29e Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Fri, 24 Jul 2020 18:19:51 +0200 Subject: test/py: add tests for the button commands Adds tests for the button commands. Reviewed-by: Simon Glass Signed-off-by: Philippe Reynes --- arch/sandbox/dts/test.dts | 14 ++++++++++++++ test/py/tests/test_button.py | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/py/tests/test_button.py (limited to 'arch') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 2325ec6e69d..491893a17dc 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -51,6 +51,20 @@ #sound-dai-cells = <1>; }; + buttons { + compatible = "gpio-keys"; + + summer { + gpios = <&gpio_a 3 0>; + label = "summer"; + }; + + christmas { + gpios = <&gpio_a 4 0>; + label = "christmas"; + }; + }; + cros_ec: cros-ec { reg = <0 0>; compatible = "google,cros-ec-sandbox"; diff --git a/test/py/tests/test_button.py b/test/py/tests/test_button.py new file mode 100644 index 00000000000..98067a98f28 --- /dev/null +++ b/test/py/tests/test_button.py @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0+ + +import pytest + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_button') +def test_button_exit_statuses(u_boot_console): + """Test that non-input button commands correctly return the command + success/failure status.""" + + expected_response = 'rc:0' + response = u_boot_console.run_command('button list; echo rc:$?') + assert(expected_response in response) + response = u_boot_console.run_command('button summer; echo rc:$?') + assert(expected_response in response) + + expected_response = 'rc:1' + response = u_boot_console.run_command('button nonexistent-button; echo rc:$?') + assert(expected_response in response) -- cgit v1.2.3