From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web10.11424.1674970757827234066 for ; Sat, 28 Jan 2023 21:39:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=ie6kuEuh; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 04309CD1F6EA for ; Sun, 29 Jan 2023 13:39:15 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1674970755; bh=TNmDnawISNL4v+yfJPVviuTH+7t0ODvMV3pxNKfdNBw=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=ie6kuEuhV06NJJ8WlNykOc1RpdzB4YNNRj0SZOhzJIwHBNBAFwAISv/JZbLwqRXWn 8Jwyr8Xy2nc09q2bWn+jTWYWmV6V0C+qAsNX5+T+XCz0GD1a/KJhb3fvvUFnmky7WS 9LY9F9yyIMGBSkPP1WCOieTZvM3L6jQ3vzLOppdc= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id F4150CD1F6C1 for ; Sun, 29 Jan 2023 13:39:14 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id BD8F3CD1F6BB for ; Sun, 29 Jan 2023 13:39:14 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 429F5CD1F6E7 for ; Sun, 29 Jan 2023 13:39:12 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Sun, 29 Jan 2023 13:39:07 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Rohit Mathew'" , Cc: "'Michael D Kinney'" , "'Sami Mujawar'" , "'Zhiguang Liu'" , "'Thomas Abraham'" , "'Swatisri Kantamsetti'" References: <20230125003920.27627-1-rohit.mathew@arm.com> In-Reply-To: <20230125003920.27627-1-rohit.mathew@arm.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMl1bUEFUQ0ggVjEgMS8xXSBNZGVQa2cvSW5kdXN0cnlTdGFuZGFyZDogYWRkIGRlZmluaXRpb25zIGZvciBNUEFNIEFDUEkgc3BlY2lmaWNhdGlvbg==?= Date: Sun, 29 Jan 2023 13:39:07 +0800 Message-ID: <011901d933a4$01be92a0$053bb7e0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIrt/nw9AznPnybJsgbCYCK/Ixihq4P2ASQ Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Acked-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Rohit Mathew > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA1=D4=C225=C8=D5 8:39 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Michael D Kinney ; Sami = Mujawar > ; Liming Gao ; > Zhiguang Liu ; Thomas Abraham > ; Swatisri Kantamsetti > =D6=F7=CC=E2: [edk2][PATCH V1 1/1] MdePkg/IndustryStandard: add = definitions for > MPAM ACPI specification >=20 > add definitions, macros and types for elements associated with MPAM > ACPI 2.0 specification. >=20 > Signed-off-by: Rohit Mathew > --- > MdePkg/Include/IndustryStandard/Acpi64.h | 7 +- > MdePkg/Include/IndustryStandard/Mpam.h | 229 > ++++++++++++++++++++ > 2 files changed, 235 insertions(+), 1 deletion(-) >=20 > github link: > https://github.com/rohit-arm/edk2/tree/mpam_acpi >=20 > diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h > b/MdePkg/Include/IndustryStandard/Acpi64.h > index 575ca0430c..2be9525979 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, 2021. >=20 > Copyright (c) 2017 - 2022, Intel Corporation. All rights = reserved.
> - Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.
> + Copyright (c) 2019 - 2023, ARM Limited. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent > **/ > @@ -3157,6 +3157,11 @@ typedef struct { > /// > #define EFI_ACPI_6_4_XEN_PROJECT_TABLE_SIGNATURE > SIGNATURE_32('X', 'E', 'N', 'V') >=20 > +/// > +/// "MPAM" Memory System Resource Partitioning and Monitoring Table > +/// > +#define > EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORIN > G_TABLE_SIGNATURE SIGNATURE_32('M', 'P', 'A', 'M') > + > #pragma pack() >=20 > #endif > diff --git a/MdePkg/Include/IndustryStandard/Mpam.h > b/MdePkg/Include/IndustryStandard/Mpam.h > new file mode 100644 > index 0000000000..8e6e72ea28 > --- /dev/null > +++ b/MdePkg/Include/IndustryStandard/Mpam.h > @@ -0,0 +1,229 @@ > +/** @file > + ACPI for Memory System Resource Partitioning and Monitoring 2.0 = (MPAM) > as > + specified in ARM spec DEN0065 > + > + Copyright (c) 2023, Arm Limited. All rights reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Specification Reference: > + - [1] ACPI for Memory System Resource Partitioning and Monitoring = 2.0 > + (https://developer.arm.com/documentation/den0065/latest) > + > + @par Glossary: > + - MPAM - Memory System Resource Partitioning And Monitoring > + - MSC - Memory System Component > + - PCC - Platform Communication Channel > + - RIS - Resource Instance Selection > + - SMMU - Arm System Memory Management Unit > + **/ > + > +#ifndef MPAM_H_ > +#define MPAM_H_ > + > +#include > + > +/// > +/// MPAM Revision > +/// > +#define > EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORIN > G_TABLE_REVISION (0x01) > + > +/// > +/// MPAM Interrupt mode > +/// > +#define EFI_ACPI_MPAM_INTERRUPT_LEVEL_TRIGGERED (0x0) > +#define EFI_ACPI_MPAM_INTERRUPT_EDGE_TRIGGERED (0x1) > + > +/// > +/// MPAM Interrupt type > +/// > +#define EFI_ACPI_MPAM_INTERRUPT_WIRED (0x0) > + > +/// > +/// MPAM Interrupt affinity type > +/// > +#define EFI_ACPI_MPAM_PROCESSOR_AFFINITY (0x0) > +#define EFI_ACPI_MPAM_PROCESSOR_CONTAINER_AFFINITY (0x1) > + > +/// > +/// MPAM MSC affinity valid > +/// > +#define EFI_ACPI_MPAM_AFFINITY_NOT_VALID (0x0) > +#define EFI_ACPI_MPAM_AFFINITY_VALID (0x1) > + > +/// > +/// MPAM Interrupt flag - bit positions > +/// > +#define EFI_ACPI_MPAM_INTERRUPT_MODE_POS (0x0) > +#define EFI_ACPI_MPAM_INTERRUPT_TYPE_POS (0x1) > +#define EFI_ACPI_MPAM_AFFINITY_TYPE_POS (0x3) > +#define EFI_ACPI_MPAM_AFFINITY_VALID_POS (0x4) > +#define EFI_ACPI_MPAM_RESERVED_POS (0x5) > + > +/// > +/// MPAM Location types > +/// as described in document [1], table 11 > +/// > +#define EFI_ACPI_MPAM_LOCATION_PROCESSOR_CACHE (0x0) > +#define EFI_ACPI_MPAM_LOCATION_MEMORY (0x1) > +#define EFI_ACPI_MPAM_LOCATION_SMMU (0x2) > +#define EFI_ACPI_MPAM_LOCATION_MEMORY_CACHE (0x3) > +#define EFI_ACPI_MPAM_LOCATION_ACPI_DEVICE (0x4) > +#define EFI_ACPI_MPAM_LOCATION_INTERCONNECT (0x5) > +#define EFI_ACPI_MPAM_LOCATION_UNKNOWN (0xFF) > + > +/// > +/// MPAM Interface types > +/// > +#define EFI_ACPI_MPAM_INTERFACE_MMIO (0x0) > +#define EFI_ACPI_MPAM_INTERFACE_PCC (0x0A) > + > +#pragma pack(1) > + > +/// > +/// MPAM MSC generic locator descriptor > +/// as described in document [1], table 12 > +/// > +typedef struct { > + UINT64 Descriptor1; > + UINT32 Descriptor2; > +} EFI_ACPI_MPAM_GENERIC_LOCATOR; > + > +/// > +/// MPAM processor cache locator descriptor > +/// as described in document [1], table 13 > +/// > +typedef struct { > + UINT64 CacheReference; > + UINT32 Reserved; > +} EFI_ACPI_MPAM_CACHE_LOCATOR; > + > +/// > +/// MPAM memory locator descriptor > +/// as described in document [1], table 14 > +/// > +typedef struct { > + UINT64 ProximityDomain; > + UINT32 Reserved; > +} EFI_ACPI_MPAM_MEMORY_LOCATOR; > + > +/// > +/// MPAM SMMU locator descriptor > +/// as described in document [1], table 15 > +/// > +typedef struct { > + UINT64 SmmuInterface; > + UINT32 Reserved; > +} EFI_ACPI_MPAM_SMMU_LOCATOR; > + > +/// > +/// MPAM memory-side cache locator descriptor > +/// as described in Document [1], table 16 > +/// > +typedef struct { > + UINT8 Reserved[7]; > + UINT8 Level; > + UINT32 Reference; > +} EFI_ACPI_MPAM_MEMORY_CACHE_LOCATOR; > + > +/// > +/// MPAM ACPI device locator descriptor > +/// as described in document [1], table 17 > +/// > +typedef struct { > + UINT64 AcpiHardwareId; > + UINT32 AcpiUniqueId; > +} EFI_ACPI_MPAM_ACPI_LOCATOR; > + > +/// > +/// MPAM interconnect locator descriptor > +/// as described in document [1], table 18 > +/// > +typedef struct { > + UINT64 InterconnectDescTblOff; > + UINT32 Reserved; > +} EFI_ACPI_MPAM_INTERCONNECT_LOCATOR; > + > +/// > +/// MPAM interconnect descriptor > +/// as described in document [1], table 19 > +/// > +typedef struct { > + UINT32 SourceID; > + UINT32 DestinationID; > + UINT8 LinkType; > + UINT8 Reserved[3]; > +} EFI_ACPI_MPAM_INTERCONNECT_DESCRIPTOR; > + > +/// > +/// MPAM interconnect descriptor table > +/// as described in document [1], table 20 > +/// > +typedef struct { > + UINT8 Signature[16]; > + UINT32 NumDescriptors; > +} EFI_ACPI_MPAM_INTERCONNECT_DESCRIPTOR_TABLE; > + > +/// > +/// MPAM resource locator > +/// > +typedef union { > + EFI_ACPI_MPAM_CACHE_LOCATOR CacheLocator; > + EFI_ACPI_MPAM_MEMORY_LOCATOR MemoryLocator; > + EFI_ACPI_MPAM_SMMU_LOCATOR SmmuLocator; > + EFI_ACPI_MPAM_MEMORY_CACHE_LOCATOR MemCacheLocator; > + EFI_ACPI_MPAM_ACPI_LOCATOR AcpiLocator; > + EFI_ACPI_MPAM_INTERCONNECT_LOCATOR InterconnectIfcLocator; > + EFI_ACPI_MPAM_GENERIC_LOCATOR GenericLocator; > +} EFI_ACPI_MPAM_LOCATOR; > + > +/// > +/// MPAM MSC node body > +/// as described document [1], table 4 > +/// > +typedef struct { > + UINT16 Length; > + UINT8 InterfaceType; > + UINT8 Reserved; > + UINT32 Identifier; > + UINT64 BaseAddress; > + UINT32 MmioSize; > + UINT32 OverflowInterrupt; > + UINT32 OverflowInterruptFlags; > + UINT32 Reserved1; > + UINT32 OverflowInterruptAffinity; > + UINT32 ErrorInterrupt; > + UINT32 ErrorInterruptFlags; > + UINT32 Reserved2; > + UINT32 ErrorInterruptAffinity; > + UINT32 MaxNrdyUsec; > + UINT64 HIDLinkedDevice; > + UINT32 InstanceIDLinkedDevice; > + UINT32 NumResources; > +} EFI_ACPI_MPAM_MSC_NODE; > + > +/// > +/// MPAM MSC resource > +/// as described in document [1], table 9 > +/// > +typedef struct { > + UINT32 Identifier; > + UINT8 RisIndex; > + UINT16 Reserved1; > + UINT8 LocatorType; > + EFI_ACPI_MPAM_LOCATOR Locator; > + UINT32 NumDependencies; > +} EFI_ACPI_MPAM_MSC_RESOURCE; > + > +/// > +/// MPAM Function dependency descriptor > +/// as described in document [1], table 10 > +/// > +typedef struct { > + UINT32 Producer; > + UINT32 Reserved; > +} EFI_ACPI_MPAM_FUNCTIONAL_DEPENDENCY_DESCRIPTOR; > + > +#pragma pack() > + > +#endif > -- > 2.25.1