[edk2][PATCH V1 1/1] MdePkg: Add CEDT structure


Sayanta Pattanayak
 

CXL Early Discovery Table (CEDT) enables OSes to locate CXL Host Bridges
and location of Host Bridge Registers early during boot and configure
Host Bridge Decoders according to ACPI information.

This patch adds CEDT structures of type CXL Host Bridge Structure (CHBS)
and CXL Fixed Memory Window Structure (CFMWS) according to CXL
specification, Revision 3.0, Version 0.7.

Signed-off-by: Sayanta Pattanayak <sayanta.pattanayak@...>
---
MdePkg/Include/IndustryStandard/Acpi64.h | 46 +++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)

Link to github branch for this patch -
https://github.com/SayantaP-arm/edk2/tree/cxl

diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h b/MdePkg/Include/In=
dustryStandard/Acpi64.h
index fe5ebfac2b37..ea799bb617af 100644
--- a/MdePkg/Include/IndustryStandard/Acpi64.h
+++ b/MdePkg/Include/IndustryStandard/Acpi64.h
@@ -2,7 +2,7 @@
ACPI 6.4 definitions from the ACPI Specification Revision 6.4 Jan, 202=
1.
=20
Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.<BR>
- Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.<BR>
+ Copyright (c) 2019 - 2022, Arm Limited All rights reserved.<BR>
=20
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -2833,6 +2833,49 @@ typedef struct {
#define EFI_ACPI_6_4_PHAT_FIRMWARE_HEALTH_DATA_RECORD_UNKNOWN 0=
x02
#define EFI_ACPI_6_4_PHAT_FIRMWARE_HEALTH_DATA_RECORD_ADVISORY 0=
x03
=20
+/**
+ * CEDT structure members, which are common across all types of CEDT
+ * structures.
+**/
+typedef struct {
+ UINT8 Type;
+ UINT8 Reserved;
+ UINT16 Length;
+} EFI_ACPI_CEDT_HEADER;
+
+/**
+ * CXL Host Bridge Structure (CHBS), which describes a CXL Host Bridge.
+ * It identifies which version of CXL Host Bridge is supported and point=
s
+ * to the register block, needed for programming HDM decoder.
+**/
+typedef struct {
+ EFI_ACPI_CEDT_HEADER CedtHeader;
+ UINT32 UID;
+ UINT32 CXLVersion;
+ UINT32 Reserved;
+ UINT64 Base;
+ UINT64 Length;
+} EFI_ACPI_CEDT_CHBS_STRUCTURE;
+
+/**
+ * CXL Fixed Memory Window Structure (CFMWS), describes zero or more
+ * Host Physical Address (HPA) windows, which are associated with each
+ * CXL Host Bridge. Each window represents a contiguous HPA range that
+ * may be interleaved across one or more targets.
+**/
+typedef struct {
+ EFI_ACPI_CEDT_HEADER CedtHeader;
+ UINT32 Reserved1;
+ UINT64 BaseHPA;
+ UINT64 WindowSize;
+ UINT8 ENIW;
+ UINT8 InterleaveArithmetic;
+ UINT16 Reserved2;
+ UINT32 HBIG;
+ UINT16 WindowRestrictions;
+ UINT16 QTGId;
+} EFI_ACPI_CEDT_CFMWS_STRUCTURE;
+
//
// Known table signatures
//
@@ -3152,6 +3195,7 @@ typedef struct {
///
#define EFI_ACPI_6_4_XEN_PROJECT_TABLE_SIGNATURE SIGNATURE_32('X', 'E',=
'N', 'V')
=20
+#define EFI_ACPI_6_4_CEDT_SIGNATURE SIGNATURE_32('C', 'E', 'D', 'T')
#pragma pack()
=20
#endif
--=20
2.17.1