libpayload/vboot/Makefile.inc: Pass FIRMWARE_ARCH=mock if LP_ARCH_MOCK

If CONFIG_LP_ARCH_MOCK, pass FIRMWARE_ARCH=mock when building vboot
fwlib, so that vboot's Makefile will append the correct flags to CFLAGS.

BUG=none
TEST=(depthcharge) make unit-tests -j
BRANCH=none

Cq-Depend: chromium:5182247
Change-Id: I9ead7f2f93eac5f5c3887074423fb9aa50a489c0
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79956
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Yu-Ping Wu 2024-01-10 15:27:11 +08:00 committed by Felix Held
parent 189c576cdc
commit c6d25cfe29
1 changed files with 11 additions and 8 deletions

View File

@ -13,22 +13,25 @@ vboot-fixup-includes = $(filter -I$(coreboottop)/%, $(1)) \
$(patsubst include/%.h,$(top)/include/%.h,\ $(patsubst include/%.h,$(top)/include/%.h,\
$(filter-out -I$(obj),\ $(filter-out -I$(obj),\
$(filter-out -I$(coreboottop)/%,$(1))))) $(filter-out -I$(coreboottop)/%,$(1)))))
ifeq ($(CONFIG_LP_ARCH_MOCK),)
VBOOT_CFLAGS += $(call vboot-fixup-includes,$(CFLAGS))
VBOOT_CFLAGS += -I$(abspath $(obj))
endif
# Enable vboot debug by default
VBOOT_CFLAGS += -DVBOOT_DEBUG
VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM) := arm VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM) := arm
VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_X86) := x86 VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_X86) := x86
VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64 VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64
ifeq ($(CONFIG_LP_ARCH_MOCK)$(VBOOT_FIRMWARE_ARCH-y),) ifneq ($(CONFIG_LP_ARCH_MOCK),)
VBOOT_FIRMWARE_ARCH-y := mock
else
VBOOT_CFLAGS += $(call vboot-fixup-includes,$(CFLAGS))
VBOOT_CFLAGS += -I$(abspath $(obj))
endif
ifeq ($(VBOOT_FIRMWARE_ARCH-y),)
$(error vboot requires architecture to be set in the configuration) $(error vboot requires architecture to be set in the configuration)
endif endif
# Enable vboot debug by default
VBOOT_CFLAGS += -DVBOOT_DEBUG
ifeq ($(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION),y) ifeq ($(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION),y)
CPPFLAGS_common += -DVB2_X86_RSA_ACCELERATION CPPFLAGS_common += -DVB2_X86_RSA_ACCELERATION
endif endif