1 # SPDX-License-Identifier: BSD-3-Clause
3 VBOOT_BUILD_DIR ?
= $(abspath
$(obj
)/external
/vboot
)
4 VBOOT_FW_LIB
= $(VBOOT_BUILD_DIR
)/vboot_fw.a
5 TLCL_LIB
= $(VBOOT_BUILD_DIR
)/tlcl.a
7 vboot_fw-objs
+= $(VBOOT_FW_LIB
)
8 tlcl-objs
+= $(TLCL_LIB
)
10 kconfig-to-binary
=$(if
$(strip $(1)),1,0)
11 vboot-fixup-includes
= $(filter -I
$(coreboottop
)/%, $(1)) \
12 $(patsubst -I
%,-I
$(top
)/%,\
13 $(patsubst include/%.h
,$(top
)/include/%.h
,\
14 $(filter-out -I
$(obj
),\
15 $(filter-out -I
$(coreboottop
)/%,$(1)))))
17 VBOOT_FIRMWARE_ARCH-
$(CONFIG_LP_ARCH_ARM
) := arm
18 VBOOT_FIRMWARE_ARCH-
$(CONFIG_LP_ARCH_X86
) := x86
19 VBOOT_FIRMWARE_ARCH-
$(CONFIG_LP_ARCH_ARM64
) := arm64
21 ifneq ($(CONFIG_LP_ARCH_MOCK
),)
22 VBOOT_FIRMWARE_ARCH-y
:= mock
24 VBOOT_CFLAGS
+= $(call vboot-fixup-includes
,$(CFLAGS
))
25 VBOOT_CFLAGS
+= -I
$(abspath
$(obj
))
28 ifeq ($(VBOOT_FIRMWARE_ARCH-y
),)
29 $(error vboot requires architecture to be set in the configuration
)
32 # Enable vboot debug by default
33 VBOOT_CFLAGS
+= -DVBOOT_DEBUG
35 ifeq ($(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION
),y
)
36 CPPFLAGS_common
+= -DVB2_X86_RSA_ACCELERATION
39 $(VBOOT_FW_LIB
): $(obj
)/libpayload-config.h
40 @printf
" MAKE $(subst $(obj)/,,$(@))\n"
41 +$(Q
) FIRMWARE_ARCH
="$(VBOOT_FIRMWARE_ARCH-y)" \
43 CFLAGS
="$(VBOOT_CFLAGS)" \
44 $(MAKE
) -C
"$(VBOOT_SOURCE)" \
45 TPM2_MODE
=$(call kconfig-to-binary
, $(CONFIG_LP_VBOOT_TPM2_MODE
)) \
46 X86_SHA_EXT
=$(call kconfig-to-binary
, $(CONFIG_LP_VBOOT_X86_SHA_EXT
)) \
47 VB2_X86_RSA_ACCELERATION
=$(call kconfig-to-binary
, $(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION
)) \
48 ARMV8_CRYPTO_EXT
=$(call kconfig-to-binary
, $(CONFIG_LP_VBOOT_SHA_ARMV8_CE
)) \
49 ARM64_RSA_ACCELERATION
=$(call kconfig-to-binary
, $(CONFIG_LP_VBOOT_ARM64_RSA_ACCELERATION
)) \
51 BUILD
="$(VBOOT_BUILD_DIR)" \
53 $(VBOOT_BUILD_DIR
)/vboot_fw.a tlcl
55 $(TLCL_LIB
): $(VBOOT_FW_LIB
)
57 .PHONY
: $(VBOOT_FW_LIB
) $(TLCL_LIB
)