From 648d2d8e2dab8cf939350a1788c5204751dcc9be Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 30 Jan 2025 22:12:43 -0800 Subject: [PATCH] feat(qemu): add hob support for qemu platforms This change introduces the hob support for both qemu platforms (virt and sbsa). As the hob list feature relies on transfer list, the transfer list support is promoted to common qemu build configuration. The platforms specific definitions are updated accordingly. Change-Id: I473d83388fe95408d34515bf7bcbdd64ce4e777d Signed-off-by: Kun Qin --- plat/qemu/common/common.mk | 8 ++++++++ plat/qemu/qemu/platform.mk | 4 ---- plat/qemu/qemu_sbsa/include/platform_def.h | 24 +++++++++++++++------- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/plat/qemu/common/common.mk b/plat/qemu/common/common.mk index 5e3a61afb..2dc89bccb 100644 --- a/plat/qemu/common/common.mk +++ b/plat/qemu/common/common.mk @@ -153,4 +153,12 @@ ifeq ($(BRANCH_PROTECTION),$(filter $(BRANCH_PROTECTION),1 2 3)) PLAT_BL_COMMON_SOURCES += plat/arm/common/aarch64/arm_pauth.c endif +ifeq (${TRANSFER_LIST}, 1) +include lib/transfer_list/transfer_list.mk +endif + +ifeq (${HOB_LIST}, 1) +include lib/hob/hob.mk +endif + endif diff --git a/plat/qemu/qemu/platform.mk b/plat/qemu/qemu/platform.mk index 70e9fafe2..bd75abc55 100644 --- a/plat/qemu/qemu/platform.mk +++ b/plat/qemu/qemu/platform.mk @@ -39,10 +39,6 @@ $(eval $(call add_define,SPMC_OPTEE)) add-lib-optee := yes endif -ifeq (${TRANSFER_LIST},1) -include lib/transfer_list/transfer_list.mk -endif - ifeq ($(NEED_BL32),yes) $(eval $(call add_define,QEMU_LOAD_BL32)) endif diff --git a/plat/qemu/qemu_sbsa/include/platform_def.h b/plat/qemu/qemu_sbsa/include/platform_def.h index 06e8abf56..9979fe11e 100644 --- a/plat/qemu/qemu_sbsa/include/platform_def.h +++ b/plat/qemu/qemu_sbsa/include/platform_def.h @@ -150,9 +150,19 @@ */ #define BL31_SIZE 0x400000 #define BL31_BASE (BL31_LIMIT - BL31_SIZE) -#define BL31_LIMIT (BL1_RW_BASE) +#define BL31_LIMIT (BL1_RW_BASE - FW_HANDOFF_SIZE) #define BL31_PROGBITS_LIMIT BL1_RW_BASE +#if TRANSFER_LIST +#define FW_HANDOFF_BASE BL31_LIMIT +#define FW_HANDOFF_LIMIT (FW_HANDOFF_BASE + FW_HANDOFF_SIZE) +#define FW_HANDOFF_SIZE 0x4000 +#else +#define FW_HANDOFF_SIZE 0 +#endif +#if TRANSFER_LIST +#define FW_NS_HANDOFF_BASE (NS_IMAGE_OFFSET - FW_HANDOFF_SIZE) +#endif /* * BL3-2 specific defines. @@ -174,14 +184,14 @@ #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 42) #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 42) #if SPM_MM +#define MAX_MMAP_REGIONS 13 +#define MAX_XLAT_TABLES 13 +#elif ENABLE_RME +#define MAX_MMAP_REGIONS 15 +#define MAX_XLAT_TABLES 15 +#else #define MAX_MMAP_REGIONS 12 #define MAX_XLAT_TABLES 12 -#elif ENABLE_RME -#define MAX_MMAP_REGIONS 14 -#define MAX_XLAT_TABLES 14 -#else -#define MAX_MMAP_REGIONS 11 -#define MAX_XLAT_TABLES 11 #endif #define MAX_IO_DEVICES 3 #define MAX_IO_HANDLES 4