diff options
author | Tom Rini <trini@konsulko.com> | 2022-05-02 19:02:44 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-05-02 19:02:44 -0400 |
commit | edb6982b5800603a67ff3710ef074ff7ac86e5ea (patch) | |
tree | fc34fe0a38d6f3884c60993ce06fb0f58536d60a /scripts/Makefile.spl | |
parent | 2406a91734eb4eeeb50fdfaeff65d0b7f464dba9 (diff) | |
parent | a31eff3015afc80429e2734781eaf52e48ab6663 (diff) | |
download | u-boot-WIP/02May2022.tar.gz |
Merge branch '2022-05-02-add-verifying-program-loader'WIP/02May2022
To quote the author:
U-Boot provides a verified-boot feature based around FIT, but there is
no standard way of implementing it for a board. At present the various
required pieces must be built up separately, to produce a working
implementation. In particular, there is no built-in support for selecting
A/B boot or recovery mode.
This series introduces VPL, a verified program loader phase for U-Boot.
Its purpose is to run the verified-boot process and decide which SPL
binary should be run. It is critical that this decision happens before
SPL runs, since SPL sets up SDRAM and we need to be able to update the
SDRAM-init code in the field.
Adding VPL into the boot flow provides a standard place to implement
verified boot. This series includes the phase itself, some useful Kconfig
options and a sandbox_vpl build for sandbox. No verfied-boot support is
provided in this series.
Most of the patches in this series are fixes and improvements to docs and
various Kconfig conditions for SPL.
Diffstat (limited to 'scripts/Makefile.spl')
-rw-r--r-- | scripts/Makefile.spl | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 6ad82cecfb7..f047d4e0941 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -27,8 +27,16 @@ UBOOTINCLUDE := -I$(obj)/include $(UBOOTINCLUDE) KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD ifeq ($(CONFIG_TPL_BUILD),y) KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD +else +ifeq ($(CONFIG_VPL_BUILD),y) +KBUILD_CPPFLAGS += -DCONFIG_VPL_BUILD +endif endif +ifeq ($(CONFIG_VPL_BUILD),y) +SPL_BIN := u-boot-vpl +SPL_NAME := vpl +else ifeq ($(CONFIG_TPL_BUILD),y) SPL_BIN := u-boot-tpl SPL_NAME := tpl @@ -36,16 +44,21 @@ else SPL_BIN := u-boot-spl SPL_NAME := spl endif +endif export SPL_NAME ifdef CONFIG_SPL_BUILD SPL_ := SPL_ +ifeq ($(CONFIG_VPL_BUILD),y) +SPL_TPL_ := VPL_ +else ifeq ($(CONFIG_TPL_BUILD),y) SPL_TPL_ := TPL_ else SPL_TPL_ := SPL_ endif +endif else SPL_ := SPL_TPL_ := @@ -57,6 +70,9 @@ endif ifeq ($(obj)$(CONFIG_SUPPORT_TPL),tpl) $(error You cannot build TPL without enabling CONFIG_SUPPORT_TPL) endif +ifeq ($(obj)$(CONFIG_SUPPORT_VPL),vpl) +$(error You cannot build VPL without enabling CONFIG_SUPPORT_VPL) +endif include $(srctree)/config.mk include $(srctree)/arch/$(ARCH)/Makefile @@ -90,17 +106,12 @@ libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/ endif libs-y += common/init/ -# Special handling for a few options which support SPL/TPL -ifeq ($(CONFIG_TPL_BUILD),y) -libs-$(CONFIG_TPL_LIBCOMMON_SUPPORT) += boot/ common/ cmd/ env/ -libs-$(CONFIG_TPL_LIBGENERIC_SUPPORT) += lib/ -else -libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += boot/ common/ cmd/ env/ -libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/ +# Special handling for a few options which support SPL/TPL/VPL +libs-$(CONFIG_$(SPL_TPL_)LIBCOMMON_SUPPORT) += boot/ common/ cmd/ env/ +libs-$(CONFIG_$(SPL_TPL_)LIBGENERIC_SUPPORT) += lib/ ifdef CONFIG_SPL_FRAMEWORK libs-$(CONFIG_PARTITIONS) += disk/ endif -endif libs-y += drivers/ libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/ @@ -109,7 +120,7 @@ libs-y += dts/ libs-y += fs/ libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/ libs-$(CONFIG_SPL_NET) += net/ -libs-$(CONFIG_SPL_UNIT_TEST) += test/ +libs-$(CONFIG_$(SPL_TPL_)UNIT_TEST) += test/ head-y := $(addprefix $(obj)/,$(head-y)) libs-y := $(addprefix $(obj)/,$(libs-y)) @@ -182,7 +193,7 @@ LDPPFLAGS += \ sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p') # Turn various CONFIG symbols into IMAGE symbols for easy reuse of -# the scripts between SPL and TPL. +# the scripts between SPL, TPL and VPL. ifneq ($(CONFIG_$(SPL_TPL_)MAX_SIZE),) LDPPFLAGS += -DIMAGE_MAX_SIZE=$(CONFIG_$(SPL_TPL_)MAX_SIZE) endif @@ -264,6 +275,7 @@ ifeq ($(CONFIG_SYS_SOC),"at91") INPUTS-y += $(obj)/boot.bin endif +ifndef CONFIG_VPL_BUILD ifdef CONFIG_TPL_BUILD INPUTS-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \ $(obj)/u-boot-x86-reset16-tpl.bin @@ -271,6 +283,7 @@ else INPUTS-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \ $(obj)/u-boot-x86-reset16-spl.bin endif +endif INPUTS-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin INPUTS-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin @@ -307,7 +320,7 @@ endif ifneq ($(build_dtb),) $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \ - $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \ + $(if $(CONFIG_$(SPL_TPL_)SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \ $(FINAL_DTB_CONTAINER) FORCE $(call if_changed,cat) @@ -398,7 +411,7 @@ LDFLAGS_$(SPL_BIN) += $(call ld-option, --no-dynamic-linker) LDFLAGS_$(SPL_BIN) += --build-id=none -# Pick the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL) +# Pick the best match (e.g. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL) ifneq ($(CONFIG_$(SPL_TPL_)TEXT_BASE),) LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_$(SPL_TPL_)TEXT_BASE) endif |