From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.1230.1689086238870353729 for ; Tue, 11 Jul 2023 07:37:19 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: nishant.sharma@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B44381FB; Tue, 11 Jul 2023 07:38:00 -0700 (PDT) Received: from usa.arm.com (iss-desktop02.cambridge.arm.com [10.1.196.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 96B7E3F740; Tue, 11 Jul 2023 07:37:17 -0700 (PDT) From: "Nishant Sharma" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta Subject: [edk2-platforms][PATCH V1 04/20] ArmPkg: Add data structures to receive FF-A boot information Date: Tue, 11 Jul 2023 15:36:42 +0100 Message-Id: <20230711143658.781597-5-nishant.sharma@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711143658.781597-1-nishant.sharma@arm.com> References: <20230711143658.781597-1-nishant.sharma@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Achin Gupta The SPMC will pass the manifest to the StMM SP which contains the boot information required for SP initialisation. This patch defines the data structures defined in Section 5.4 of the FF-A v1.1 BETA0 spec to enable this support. The manifest is identified by the TF-A UUID_TOS_FW_CONFIG. Signed-off-by: Achin Gupta Signed-off-by: Nishant Sharma --- ArmPkg/Include/IndustryStandard/ArmFfaSvc.h | 69 +++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h b/ArmPkg/Include= /IndustryStandard/ArmFfaSvc.h index 4126a4985bb2..54cc96598032 100644 --- a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h @@ -3,7 +3,7 @@ communication between S-EL0 and the Secure Partition Manager(SPM) =20 - Copyright (c) 2020, ARM Limited. All rights reserved. + Copyright (c) 2020 - 2023, ARM Limited. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -53,4 +53,71 @@ // https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/kernel/s= tmm_sp.c#L66 #define ARM_FFA_DESTINATION_ENDPOINT_ID 3 =20 +/***********************************************************************= ******* + * Boot information protocol as per the FF-A v1.1 spec. + ***********************************************************************= ******/ +#define FFA_INIT_DESC_SIGNATURE 0x00000FFA + +/* Boot information type. */ +#define FFA_BOOT_INFO_TYPE_STD 0x0U +#define FFA_BOOT_INFO_TYPE_IMPL 0x1U + +#define FFA_BOOT_INFO_TYPE_MASK 0x1U +#define FFA_BOOT_INFO_TYPE_SHIFT 0x7U +#define FFA_BOOT_INFO_TYPE(type) \ + (((type) & FFA_BOOT_INFO_TYPE_MASK) \ + << FFA_BOOT_INFO_TYPE_SHIFT) + +/* Boot information identifier. */ +#define FFA_BOOT_INFO_TYPE_ID_FDT 0x0U +#define FFA_BOOT_INFO_TYPE_ID_HOB 0x1U + +#define FFA_BOOT_INFO_TYPE_ID_MASK 0x3FU +#define FFA_BOOT_INFO_TYPE_ID_SHIFT 0x0U +#define FFA_BOOT_INFO_TYPE_ID(type) \ + (((type) & FFA_BOOT_INFO_TYPE_ID_MASK) \ + << FFA_BOOT_INFO_TYPE_ID_SHIFT) + +/* Format of Flags Name field. */ +#define FFA_BOOT_INFO_FLAG_NAME_STRING 0x0U +#define FFA_BOOT_INFO_FLAG_NAME_UUID 0x1U + +#define FFA_BOOT_INFO_FLAG_NAME_MASK 0x3U +#define FFA_BOOT_INFO_FLAG_NAME_SHIFT 0x0U +#define FFA_BOOT_INFO_FLAG_NAME(type) \ + (((type) & FFA_BOOT_INFO_FLAG_NAME_MASK) \ + << FFA_BOOT_INFO_FLAG_NAME_SHIFT) + +/* Format of Flags Contents field. */ +#define FFA_BOOT_INFO_FLAG_CONTENT_ADR 0x0U +#define FFA_BOOT_INFO_FLAG_CONTENT_VAL 0x1U + +#define FFA_BOOT_INFO_FLAG_CONTENT_MASK 0x1U +#define FFA_BOOT_INFO_FLAG_CONTENT_SHIFT 0x2U +#define FFA_BOOT_INFO_FLAG_CONTENT(content) \ + (((content) & FFA_BOOT_INFO_FLAG_CONTENT_MASK) \ + << FFA_BOOT_INFO_FLAG_CONTENT_SHIFT) + +// Descriptor to pass boot information as per the FF-A v1.1 spec. +typedef struct { + UINT32 Name[4]; + UINT8 Type; + UINT8 Reserved; + UINT16 Flags; + UINT32 SizeBotInfo; + UINT64 Content; +} EFI_FFA_BOOT_INFO_DESC; + +// Descriptor that contains boot info blobs size, number of desc it coin= tains +// size of each descriptor and offset to the first descriptor. +typedef struct { + UINT32 Magic; // 0xFFA^M + UINT32 Version; + UINT32 SizeBootInfoBlob; + UINT32 SizeBootInfoDesc; + UINT32 CountBootInfoDesc; + UINT32 OffsetBootInfoDesc; + UINT64 Reserved; +} EFI_FFA_BOOT_INFO_HEADER; + #endif // ARM_FFA_SVC_H_ --=20 2.34.1