From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.1968.1689182877625700756 for ; Wed, 12 Jul 2023 10:27:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=dmGPFiqP; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: osde@linux.microsoft.com) Received: from [10.137.194.171] (unknown [131.107.1.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 1899C21C44E5; Wed, 12 Jul 2023 10:27:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1899C21C44E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1689182877; bh=2YpHnNvGQhx+hnpFyB73+QecadLaQNQOJrkhAAzYI2E=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dmGPFiqPWOX19CQl0noMzBwJx4JKysuh+qr9TGo36lfErYekiDOsfCm7/y4ICgaJF 9PONWlOicSdKhVGqmXuipLZa9QMcERd5o89w6Cz0fViNxyJKiv87k4Igz2jg+wBVeE wWF3WJQFRD5KNjR4VO9ex5PmWUMOMH0oTkKUIy8w= Message-ID: <0f50aa89-96e3-775a-e794-65b7d8ed8713@linux.microsoft.com> Date: Wed, 12 Jul 2023 10:27:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [edk2-devel] [edk2-platforms][PATCH V1 04/20] ArmPkg: Add data structures to receive FF-A boot information To: devel@edk2.groups.io, nishant.sharma@arm.com Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta References: <20230711143658.781597-1-nishant.sharma@arm.com> <20230711143658.781597-5-nishant.sharma@arm.com> From: "Oliver Smith-Denny" In-Reply-To: <20230711143658.781597-5-nishant.sharma@arm.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/11/2023 7:36 AM, Nishant Sharma wrote: > 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) > > - Copyright (c) 2020, ARM Limited. All rights reserved. > + Copyright (c) 2020 - 2023, ARM Limited. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -53,4 +53,71 @@ > // https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/kernel/stmm_sp.c#L66 > #define ARM_FFA_DESTINATION_ENDPOINT_ID 3 > > +/****************************************************************************** > + * 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 cointains typo, should be "contains" > +// size of each descriptor and offset to the first descriptor. > +typedef struct { > + UINT32 Magic; // 0xFFA^M caught a copy paste "^M" here. Thanks, Oliver > + UINT32 Version; > + UINT32 SizeBootInfoBlob; > + UINT32 SizeBootInfoDesc; > + UINT32 CountBootInfoDesc; > + UINT32 OffsetBootInfoDesc; > + UINT64 Reserved; > +} EFI_FFA_BOOT_INFO_HEADER; > + > #endif // ARM_FFA_SVC_H_