From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id CE8697803D0 for ; Thu, 29 Aug 2024 07:19:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=duZems/aNQd34Hmeya9T5jjTJa4II2mgxr/ZfgH0CVE=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1724915978; v=1; b=K83w2TjTFpLwWtKKzz4x6s3qtshUD5IzaVIXHqLvXOGHu063TLOw2FyT28EeM/y+VfeCAdpm YVMx8KiMnqXo0hY/NeicMVOzpVZiLT8WF2IgY8S6KKjn2fhNJvrvjvwDVO3qDNlEeLak6AyMMPG jO+uu3OuCZdvcfO+iRHsLEWnddy2SpsYYobCnSrmNL1Gb1E3GW39SYc+1stbGVKaxIkkxY3yxTS Phbigp59Y3qsVryqzBOzhxrjRBVD+91+rJLBepe/me5Ikl6Ilr064xMqqXMAcByr5ZdhqkuXwU+ rE3wPN8ONItpON2aa8wdBeberMa/32snkYsmG6nYDq44g== X-Received: by 127.0.0.2 with SMTP id DC3vYY7687511xB34D1PQXin; Thu, 29 Aug 2024 00:19:37 -0700 X-Received: from CY4PR05CU001.outbound.protection.outlook.com (CY4PR05CU001.outbound.protection.outlook.com [40.93.198.93]) by mx.groups.io with SMTP id smtpd.web10.7047.1724915976632490331 for ; Thu, 29 Aug 2024 00:19:36 -0700 X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by CYYPR01MB8243.prod.exchangelabs.com (2603:10b6:930:ba::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 07:19:34 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f%3]) with mapi id 15.20.7897.021; Thu, 29 Aug 2024 07:19:34 +0000 From: "Nhi Pham via groups.io" To: Chuong Tran OS , "devel@edk2.groups.io" , Nhi Pham OS CC: "quic_llindhol@quicinc.com" , Chuong Tran OS , "Rebecca Cran OS" Subject: Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] JadePkg: Add ACPI SPMI table Thread-Topic: [edk2-devel] [edk2-platforms][PATCH v2 1/1] JadePkg: Add ACPI SPMI table Thread-Index: AQHa7uBlqKGFsvBN3kScU7PjkBGL27IzJBmAgAEMy4eACbjpYg== Date: Thu, 29 Aug 2024 07:19:34 +0000 Message-ID: References: <20240815065551.3796734-1-nhi@os.amperecomputing.com> <17EE3BD6D36E09DB.23723@groups.io> In-Reply-To: <17EE3BD6D36E09DB.23723@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Enabled=True;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SiteId=3bc2b170-fd94-476d-b0ce-4229bdc904a7;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SetDate=2024-08-29T07:19:33.350Z;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Name=Confidential;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ContentBits=0;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Method=Standard; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR01MB7287:EE_|CYYPR01MB8243:EE_ x-ms-office365-filtering-correlation-id: ba56d44c-3b55-45c0-313c-08dcc7faeeeb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?ixXF0M/dHnLExHoA2W83vNOoNmSLV99TY+hozXdFuCRBiLMTdLx2ag+UcgdB?= =?us-ascii?Q?rp+dgYKdmIUlTtaxoFdeTriFHFjG6FnT/PCSC40+yHyrXWW+gAgIwETDOw2g?= =?us-ascii?Q?dkQwHvnwkqXyQ4dUG19/Qb/h0lQy8qZsV8lVDWoQ21xE/M78/mikETMO4pnA?= =?us-ascii?Q?SuFlnaB3iGjYqIShanGuvRQosEdmz1nf1hUPgRMzvylGFIPJxfuyUrK7C2IX?= =?us-ascii?Q?NUYtYxaTQ3jEZ7e2qc7Ifwmry8t/QYgCY6NnWL8ubVQ0/BPUiHmWIN0xpMT+?= =?us-ascii?Q?WAXyxoLGCJt9+frasJVbn3M0+4NMqV6flr5KUvYCpW0HPbKJSmSG4srsn2XA?= =?us-ascii?Q?3G1d9wOkJ5zJ7ovFAjDBl8yFMrl4fijyO38blz6YjrT5cMkvQPhiChsqXH0l?= =?us-ascii?Q?dAl6QtPLyRfHi9UCoMpPsxYyjzb124ZODYxKYXA/I/gU5Z3Agj1KhBXlMsZb?= =?us-ascii?Q?4CnhbdNbhQ7noUNlW2bcN0pnHuBLHlHd+YpmavWG/12QnkQhDk/omjTxtUDx?= =?us-ascii?Q?X+1jCxghuOhH0mZQdXb7WxZi/+vnqBmvqNI8bXJCGLl3AzxxoNR/jrS1RRp/?= =?us-ascii?Q?bLfZjGx6ucwt//RhshDhGQWfPdPxR2w6XIW5t1e12S97ft5DIvKQvvkpEo5A?= =?us-ascii?Q?tNpD8C0Zc0vnkYXGmQjLdNmr3BfbDZLDvtOWH8shiadQ8ijFi8pTZ8zj5dna?= =?us-ascii?Q?+xZUJ5GxOX0JzOH1jURtrn6b8s5O1f+JVzMl/9RUBj07bdKxTWAbiJwkMnGI?= =?us-ascii?Q?1VvWTBHukNPxGp6ZAzPhp/A0wyLqc4WGnABsdy8uHKxycIswSdK/A7bsWkDZ?= =?us-ascii?Q?o3bwm1CK2Nw0jgyF6JYWPNRho3m+oUznk2XLywhwdqZJJd20g1Wa0AOsvPIu?= =?us-ascii?Q?3vtHo2x/A2I0hQ8lqSjLS7Pcb9qMYfvwyrMfZcXg3X299JXj+ZmeXf0yuIbc?= =?us-ascii?Q?LFSbwL0D7okxhZj2T2wUI7HY6mgK9aI2u/6Yas2w1+HC0VQswaPeycNTS8zc?= =?us-ascii?Q?t73Hhi5U4CbwXSnCxnmPliUCJYmeiMNwrJXzBNhqu/Wo8kgrdTsTFVnH4/Hp?= =?us-ascii?Q?pLeSbMwY2MHpDI16fw6n5LGzkRYrSyUu2b/VuuVIuP5CdSg/0Tkwn8dXYcX+?= =?us-ascii?Q?+O2FHaOwQXPjPfNQmNzlWpELYw+JQhRm+LBRN6TwiPRVbpuZn5cUvLuEAdOk?= =?us-ascii?Q?k49GVqeIK2rul97vQAM4BofdB/Si4Xjf08scq1kLyzSXy5pPXRvmyK4O7bka?= =?us-ascii?Q?b2zP3bDs6VvWb7siWKY/uS2s35RzJo5cP6XYReKcqxWFY9vwESe/YZrctPQx?= =?us-ascii?Q?SZIJDBhS4AAPey9KNlGpB5kCWW562qO2xjC2876JuH0Txa5exTKDWrXhES02?= =?us-ascii?Q?loSXBXM=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4IO6V9MNiSrWpma9Chl2lxUZfhSqYb+zmvzDRidJpx4Tza/06F5ti0AuKgxP?= =?us-ascii?Q?hwshmNe3WoHwipWiTHjX50e87D+7uN8DWxnDc56wbl9mIBSxZvnZr0HpWk7W?= =?us-ascii?Q?vqtKzi9VBnJTb/HJENIIO/cjYV3JznGMMfa2fTvXH2+Rc8JNWtfDBbf1RHrI?= =?us-ascii?Q?jTyFJlLuRB+Qp+kTfpbBRnHYZqibeRnJk2ppL+H/M6dtSAzRPakbtPVji+ro?= =?us-ascii?Q?mWmjfv+bTu6nzYL4GGO/rDAe+LP640gyYArYlSgF+LUyXHu/Me5sjyN0xKEJ?= =?us-ascii?Q?qfI0Cy8Bh7a+9hazeysc23mY9rbVty1QrIpdSXuDas1bfhdPgtOiPfOSL4NV?= =?us-ascii?Q?dpyxaj/xGoGcJAvOlzFOU5gEG9+4S784OMy6tl8CxJmBuw+Q9XiPIhpIjPBk?= =?us-ascii?Q?FV6AVlVd0mEKlQoPmQo27Mj7lwHGVI++dux36SMSiRwWGULjqKfSEzoEELO9?= =?us-ascii?Q?m3YjMuxAF7tu5UY+M+PEXZItlPdcExj4pZo5lZV7AXuBMBlLPbXqDJHfypQA?= =?us-ascii?Q?2jycMjVHfhxctXb7GhW+jI3pouqyIuWiNVLp+s//oji8YJ/909KjBj0s/gs/?= =?us-ascii?Q?PSoeq7E9EqHj6yxK9qJ+cfZnVjg/UhriI4LTjpMsfEABtH2nzKFQZuMMvbsk?= =?us-ascii?Q?Awil0z02ExAQX5TSON0zYxePdsDnD1N8M/Xe2bBxzkoSRTYpFLit7fO3ZK3Q?= =?us-ascii?Q?y1AGnN+D+vMRhbXcZDXwd7mR4ejLBRpflzLim8MZ7jnHE0Nr7sjIpGRzuryl?= =?us-ascii?Q?LWz3kjtC9R+uvOd8/bNNNhIS4Qo2xHOkK7WUjjIQ5/R1BkKnvL72RhnFNymz?= =?us-ascii?Q?RqvwHFL9hOUZc29C4cSJWaequzXFRCVdYR7C0gpdidwj9IYyaz5yS2MsWr8O?= =?us-ascii?Q?t0sWdvs7hVDLmTTE2CZgBTGLByQoUzTgjpXzJSfPlyvDIUFhmqqc/dlo4RSK?= =?us-ascii?Q?Z8V8+lKDqYH3ftLfwwsc8lOcfhEYP2GCXF4fE/9nsN7jZiOMeFBMNmfhwiwm?= =?us-ascii?Q?tUhHMz9eqe3Su9sON948xdOPq1oHhmGDRNnAdeGw0VzTJsJgp+o0ykGkqpCX?= =?us-ascii?Q?7QErEmtdVumFisFI39Dj2ma6hbObYKmpBysRgoex0wJMQFQSywWoDWJaTfDF?= =?us-ascii?Q?pansPSdvPJWHEC9nMfvvU51V/mEBw7pAaQoGNiBjJVaaRMK4u1HP1vJEoulL?= =?us-ascii?Q?rhoU7OoQztJPiwOs49pYOvX5n3lPZfFp83/aojfwfCvQl8zcg/44GHon2nNr?= =?us-ascii?Q?j/B8x5leBNus0DRHM1cohliD57vewYGLu9m2B+4izH3LdlS8nL8rwutYwFkk?= =?us-ascii?Q?3YRFBkCcs7qwNu2f9nkq8XrC9qnUmWy/xKeUE9lYLJ5t1TNL0452ycAiWAby?= =?us-ascii?Q?rurb8EiwGwMcYz6s2WwvMzMVsL1guIxFbw7GLUbQlBvlqL+CsGlQfjM3TFuw?= =?us-ascii?Q?nY9dspudQHejmwOPDLDlj4FmAEwKj+imqwKpPkPrcmASA7fkHbA+ESdMOfoE?= =?us-ascii?Q?yKeSef5N4fMuO25eHFwIBraotVNng79wGW/b7u3+uYSYun46fGVAQgWhORe5?= =?us-ascii?Q?9DheOOAmzJq49VMqt1ejeQDRl78zbMod/4givxBsCdzSE8pp7JPPHD2BjeVJ?= =?us-ascii?Q?oA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba56d44c-3b55-45c0-313c-08dcc7faeeeb X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2024 07:19:34.3675 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9c0O3mzyx2nu4lthsHsSI8v9ZC2sisDO442EaDUcdrjV+V1OsjnYnUSZZB+9U+vl3vyEQEVn5NDLwHllpUe6l+qsmxnuWS4OLGeYZn7jqMA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8243 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 29 Aug 2024 00:19:36 -0700 Resent-From: nhi@os.amperecomputing.com Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: wb67tIZNjUqsVP1CCSNaUzlNx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_PH0PR01MB7287192253773AF2BC2745D996962PH0PR01MB7287prod_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=K83w2TjT; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_PH0PR01MB7287192253773AF2BC2745D996962PH0PR01MB7287prod_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed as 146cb5322498..c400d971093f Thanks, Nhi ________________________________ From: devel@edk2.groups.io on behalf of Nhi Pham via= groups.io Sent: Friday, August 23, 2024 9:51 AM To: Chuong Tran OS ; devel@edk2.groups.i= o Cc: quic_llindhol@quicinc.com ; Chuong Tran OS <= chuong@os.amperecomputing.com>; Rebecca Cran OS Subject: Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] JadePkg: Add ACPI = SPMI table Thanks for the review. I will push after the IPMI SSIF support is merged. Regards, Nhi ________________________________ From: Chuong Tran OS Sent: Thursday, August 22, 2024 5:49 PM To: Nhi Pham OS ; devel@edk2.groups.io Cc: quic_llindhol@quicinc.com ; Chuong Tran OS <= chuong@os.amperecomputing.com>; Rebecca Cran OS Subject: Re: [edk2-platforms][PATCH v2 1/1] JadePkg: Add ACPI SPMI table Reviewed-by: Chuong Tran Thanks, Chuong On 8/15/2024 1:55 PM, Nhi Pham wrote: > This implements ACPI SPMI table as defined in the IPMI specification. > > Signed-off-by: Nhi Pham > --- > v2: > + Remove EFIAPI > + Make the function UpdateIpmiSpecRevision() static > + Change 0x0F to 0xF to be more readable. > > Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf | = 4 + > Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h | = 12 +++ > Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.c | = 5 + > Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c | 1= 13 ++++++++++++++++++++ > 4 files changed, 134 insertions(+) > > diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform= Dxe.inf b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.i= nf > index 8ab6a790ce07..6c26b6e7141c 100644 > --- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf > +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf > @@ -27,12 +27,14 @@ [Sources.common] > AcpiPlatformDxe.c > AcpiPptt.c > AcpiSlit.c > + AcpiSpmi.c > AcpiSrat.c > > [Packages] > ArmPkg/ArmPkg.dec > ArmPlatformPkg/ArmPlatformPkg.dec > EmbeddedPkg/EmbeddedPkg.dec > + Features/ManageabilityPkg/ManageabilityPkg.dec > MdeModulePkg/MdeModulePkg.dec > MdePkg/MdePkg.dec > Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec > @@ -46,6 +48,7 @@ [LibraryClasses] > DebugLib > FlashLib > HobLib > + IpmiCommandLib > MailboxInterfaceLib > SystemFirmwareInterfaceLib > TimerLib > @@ -64,6 +67,7 @@ [Pcd] > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision > gAmpereTokenSpaceGuid.PcdPmproDbBaseReg > gAmpereTokenSpaceGuid.PcdSmproDbBaseReg > + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr > > [Guids] > gArmMpCoreInfoGuid > diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform= .h b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h > index 170aeff24d59..5fac393bb9e8 100644 > --- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h > +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h > @@ -83,4 +83,16 @@ AcpiInstallIort ( > VOID > ); > > +/** > + Install SPMI (Service Processor Management Interface table) table. > + > + @retval EFI_SUCCESS The table was installed successfully. > + @retval Others Failed to install the table. > + > +**/ > +EFI_STATUS > +AcpiInstallSpmiTable ( > + VOID > + ); > + > #endif /* ACPI_PLATFORM_H_ */ > diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform= Dxe.c b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.c > index 28c422dff166..a82a93d23fa2 100644 > --- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.c > +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.c > @@ -114,6 +114,11 @@ InstallAcpiOnReadyToBoot ( > DEBUG ((DEBUG_INFO, "Populate BERT record\n")); > } > > + Status =3D AcpiInstallSpmiTable (); > + if (!EFI_ERROR (Status)) { > + DEBUG ((DEBUG_INFO, "Installed SPMI table\n")); > + } > + > // > // Close the event, so it will not be signalled again. > // > diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c b= /Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c > new file mode 100644 > index 000000000000..937f02093185 > --- /dev/null > +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c > @@ -0,0 +1,113 @@ > +/** @file > + > + Copyright (c) 2024, Ampere Computing LLC. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include "AcpiPlatform.h" > + > +// > +// SPMI Revision (as defined in IPMI v2.0 spec.) > +// > +#define EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE_REVISION = 0x05 > + > +STATIC EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE mSpmiTable= =3D { > + __ACPI_HEADER ( > + EFI_ACPI_6_3_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE, > + EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE, > + EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE_REVISION > + ), > + 0x04, // SMBUS System Interface (SSIF) > + 0x01, // Reserved - Must be 0x01 for backward comp= atiblity > + 0, // Specification Revision > + 0, // Interrupt Type > + 0, // GPE > + EFI_ACPI_RESERVED_BYTE, // Reserved > + 0, // PCI Device Flag > + 0, // Global System Interrupt > + { > + 0x04, // Address Space ID: 4 (SM= BUS) > + 0, // Register Bit Width > + 0, // Register Bit Offset > + 0x01, // Address Size: 1 (Byte A= ccess) > + FixedPcdGet8 (PcdIpmiSsifSmbusSlaveAddr), // Address (7-bit SMBUS Ad= dress of BMC SSIF) > + }, > + { > + { > + 0, // UID Byte 1 > + 0, // UID Byte 2 > + 0, // UID Byte 3 > + 0 // UID Byte 4 > + } > + }, > + EFI_ACPI_RESERVED_BYTE // Reserved for backward compatiblity > +}; > + > +static > +EFI_STATUS > +UpdateIpmiSpecRevision ( > + EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE *SpmiTable > + ) > +{ > + EFI_STATUS Status; > + IPMI_GET_DEVICE_ID_RESPONSE DeviceId; > + > + Status =3D IpmiGetDeviceId (&DeviceId); > + if (!EFI_ERROR (Status) && (DeviceId.CompletionCode =3D=3D IPMI_COMP_C= ODE_NORMAL)) { > + // BCD Format > + SpmiTable->SpecificationRevision =3D DeviceId.SpecificationVersion = & 0xF0; > + SpmiTable->SpecificationRevision |=3D (DeviceId.SpecificationVersion= & 0xF) << 8; > + } > + > + return Status; > +} > + > +/** > + Install SPMI (Service Processor Management Interface table) table. > + > + @retval EFI_SUCCESS The table was installed successfully. > + @retval Others Failed to install the table. > + > +**/ > +EFI_STATUS > +AcpiInstallSpmiTable ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + EFI_ACPI_TABLE_PROTOCOL *AcpiTableProtocol; > + UINTN SpmiTableKey; > + > + Status =3D gBS->LocateProtocol ( > + &gEfiAcpiTableProtocolGuid, > + NULL, > + (VOID **)&AcpiTableProtocol > + ); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > + Status =3D UpdateIpmiSpecRevision (&mSpmiTable); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Failed to update IPMI Specification Revisi= on - %r\n", __func__, Status)); > + return Status; > + } > + > + Status =3D AcpiTableProtocol->InstallAcpiTable ( > + AcpiTableProtocol, > + (VOID *)&mSpmiTable, > + mSpmiTable.Header.Length, > + &SpmiTableKey > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Failed to install SPMI table - %r\n", __fu= nc__, Status)); > + return Status; > + } > + > + return EFI_SUCCESS; > +} -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120428): https://edk2.groups.io/g/devel/message/120428 Mute This Topic: https://groups.io/mt/107909806/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_PH0PR01MB7287192253773AF2BC2745D996962PH0PR01MB7287prod_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Pushed as 146cb5322498..c400d971093f

Thanks,
Nhi

From: devel@edk2.groups.io = <devel@edk2.groups.io> on behalf of Nhi Pham via groups.io <nhi=3D= os.amperecomputing.com@groups.io>
Sent: Friday, August 23, 2024 9:51 AM
To: Chuong Tran OS <chuong@amperemail.onmicrosoft.com>; devel@= edk2.groups.io <devel@edk2.groups.io>
Cc: quic_llindhol@quicinc.com <quic_llindhol@quicinc.com>; Chu= ong Tran OS <chuong@os.amperecomputing.com>; Rebecca Cran OS <rebe= cca@os.amperecomputing.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] JadePkg: Ad= d ACPI SPMI table
 
Thanks for the review. I will push after the IPMI SSIF support is merged.

Regards,
Nhi

From: Chuong Tran OS <= chuong@amperemail.onmicrosoft.com>
Sent: Thursday, August 22, 2024 5:49 PM
To: Nhi Pham OS <nhi@os.amperecomputing.com>; devel@edk2.group= s.io <devel@edk2.groups.io>
Cc: quic_llindhol@quicinc.com <quic_llindhol@quicinc.com>; Chu= ong Tran OS <chuong@os.amperecomputing.com>; Rebecca Cran OS <rebe= cca@os.amperecomputing.com>
Subject: Re: [edk2-platforms][PATCH v2 1/1] JadePkg: Add ACPI SPMI t= able
 
Reviewed-by: Chuong Tran <chuong@os.amperecom= puting.com>

Thanks,
Chuong

On 8/15/2024 1:55 PM, Nhi Pham wrote:
> This implements ACPI SPMI table as defined in the IPMI specification.<= br> >
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
> v2:
>      + Remove EFIAPI
>      + Make the function UpdateIpmiSpecRevisi= on() static
>      + Change 0x0F to 0xF to be more readable= .
>
>   Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatfo= rmDxe.inf |   4 +
>   Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatfo= rm.h      |  12 +++
>   Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatfo= rmDxe.c   |   5 +
>   Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c=           | 113 ++++++++++++++= ++++++
>   4 files changed, 134 insertions(+)
>
> diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatf= ormDxe.inf b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDx= e.inf
> index 8ab6a790ce07..6c26b6e7141c 100644
> --- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.= inf
> +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.= inf
> @@ -27,12 +27,14 @@ [Sources.common]
>     AcpiPlatformDxe.c
>     AcpiPptt.c
>     AcpiSlit.c
> +  AcpiSpmi.c
>     AcpiSrat.c
>  
>   [Packages]
>     ArmPkg/ArmPkg.dec
>     ArmPlatformPkg/ArmPlatformPkg.dec
>     EmbeddedPkg/EmbeddedPkg.dec
> +  Features/ManageabilityPkg/ManageabilityPkg.dec
>     MdeModulePkg/MdeModulePkg.dec
>     MdePkg/MdePkg.dec
>     Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.d= ec
> @@ -46,6 +48,7 @@ [LibraryClasses]
>     DebugLib
>     FlashLib
>     HobLib
> +  IpmiCommandLib
>     MailboxInterfaceLib
>     SystemFirmwareInterfaceLib
>     TimerLib
> @@ -64,6 +67,7 @@ [Pcd]
>     gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultC= reatorRevision
>     gAmpereTokenSpaceGuid.PcdPmproDbBaseReg
>     gAmpereTokenSpaceGuid.PcdSmproDbBaseReg
> +  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr
>  
>   [Guids]
>     gArmMpCoreInfoGuid
> diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatf= orm.h b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h
> index 170aeff24d59..5fac393bb9e8 100644
> --- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h > +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatform.h > @@ -83,4 +83,16 @@ AcpiInstallIort (
>     VOID
>     );
>  
> +/**
> +  Install SPMI (Service Processor Management Interface table) ta= ble.
> +
> +  @retval EFI_SUCCESS   The table was installed succes= sfully.
> +  @retval Others        Faile= d to install the table.
> +
> +**/
> +EFI_STATUS
> +AcpiInstallSpmiTable (
> +  VOID
> +  );
> +
>   #endif /* ACPI_PLATFORM_H_ */
> diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatf= ormDxe.c b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.= c
> index 28c422dff166..a82a93d23fa2 100644
> --- a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.= c
> +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.= c
> @@ -114,6 +114,11 @@ InstallAcpiOnReadyToBoot (
>       DEBUG ((DEBUG_INFO, "Populate= BERT record\n"));
>     }
>  
> +  Status =3D AcpiInstallSpmiTable ();
> +  if (!EFI_ERROR (Status)) {
> +    DEBUG ((DEBUG_INFO, "Installed SPMI table\n&q= uot;));
> +  }
> +
>     //
>     // Close the event, so it will not be signalle= d again.
>     //
> diff --git a/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.= c b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c
> new file mode 100644
> index 000000000000..937f02093185
> --- /dev/null
> +++ b/Platform/Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiSpmi.c
> @@ -0,0 +1,113 @@
> +/** @file
> +
> +  Copyright (c) 2024, Ampere Computing LLC. All rights reserved.= <BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <IndustryStandard/Ipmi.h>
> +#include <IndustryStandard/ServiceProcessorManagementInterfaceTabl= e.h>
> +#include <Library/IpmiCommandLib.h>
> +#include "AcpiPlatform.h"
> +
> +//
> +// SPMI Revision (as defined in IPMI v2.0 spec.)
> +//
> +#define EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE_REVISIO= N  0x05
> +
> +STATIC EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE  mS= pmiTable =3D {
> +  __ACPI_HEADER (
> +    EFI_ACPI_6_3_SERVER_PLATFORM_MANAGEMENT_INTERFACE_= TABLE_SIGNATURE,
> +    EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TA= BLE,
> +    EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TA= BLE_REVISION
> +    ),
> +  0x04,         &nb= sp;           // SMBUS Sy= stem Interface (SSIF)
> +  0x01,         &nb= sp;           // Reserved= - Must be 0x01 for backward compatiblity
> +  0,          =             &nb= sp; // Specification Revision
> +  0,          =             &nb= sp; // Interrupt Type
> +  0,          =             &nb= sp; // GPE
> +  EFI_ACPI_RESERVED_BYTE,   // Reserved
> +  0,          =             &nb= sp; // PCI Device Flag
> +  0,          =             &nb= sp; // Global System Interrupt
> +  {
> +    0x04,       &nb= sp;            =             &nb= sp;    // Address Space ID: 4 (SMBUS)
> +    0,        =             &nb= sp;            =        // Register Bit Width
> +    0,        =             &nb= sp;            =        // Register Bit Offset
> +    0x01,       &nb= sp;            =             &nb= sp;    // Address Size: 1 (Byte Access)
> +    FixedPcdGet8 (PcdIpmiSsifSmbusSlaveAddr), // Addre= ss (7-bit SMBUS Address of BMC SSIF)
> +  },
> +  {
> +    {
> +      0,  // UID Byte 1
> +      0,  // UID Byte 2
> +      0,  // UID Byte 3
> +      0   // UID Byte 4
> +    }
> +  },
> +  EFI_ACPI_RESERVED_BYTE    // Reserved for backw= ard compatiblity
> +};
> +
> +static
> +EFI_STATUS
> +UpdateIpmiSpecRevision (
> +  EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE  *S= pmiTable
> +  )
> +{
> +  EFI_STATUS        &nbs= p;          Status;
> +  IPMI_GET_DEVICE_ID_RESPONSE  DeviceId;
> +
> +  Status =3D IpmiGetDeviceId (&DeviceId);
> +  if (!EFI_ERROR (Status) && (DeviceId.CompletionCode = =3D=3D IPMI_COMP_CODE_NORMAL)) {
> +    // BCD Format
> +    SpmiTable->SpecificationRevision  =3D Devi= ceId.SpecificationVersion & 0xF0;
> +    SpmiTable->SpecificationRevision |=3D (DeviceId= .SpecificationVersion & 0xF) << 8;
> +  }
> +
> +  return Status;
> +}
> +
> +/**
> +  Install SPMI (Service Processor Management Interface table) ta= ble.
> +
> +  @retval EFI_SUCCESS   The table was installed succes= sfully.
> +  @retval Others        Faile= d to install the table.
> +
> +**/
> +EFI_STATUS
> +AcpiInstallSpmiTable (
> +  VOID
> +  )
> +{
> +  EFI_STATUS        &nbs= p;      Status;
> +  EFI_ACPI_TABLE_PROTOCOL  *AcpiTableProtocol;
> +  UINTN         &nb= sp;          SpmiTableKey;
> +
> +  Status =3D gBS->LocateProtocol (
> +           &nb= sp;      &gEfiAcpiTableProtocolGuid,
> +           &nb= sp;      NULL,
> +           &nb= sp;      (VOID **)&AcpiTableProtocol
> +           &nb= sp;      );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
> +
> +  Status =3D UpdateIpmiSpecRevision (&mSpmiTable);
> +  if (EFI_ERROR (Status)) {
> +    DEBUG ((DEBUG_ERROR, "%a: Failed to update IP= MI Specification Revision - %r\n", __func__, Status));
> +    return Status;
> +  }
> +
> +  Status =3D AcpiTableProtocol->InstallAcpiTable (
> +           &nb= sp;            =         AcpiTableProtocol,
> +           &nb= sp;            =         (VOID *)&mSpmiTable,
> +           &nb= sp;            =         mSpmiTable.Header.Length,
> +           &nb= sp;            =         &SpmiTableKey
> +           &nb= sp;            =         );
> +  if (EFI_ERROR (Status)) {
> +    DEBUG ((DEBUG_ERROR, "%a: Failed to install S= PMI table - %r\n", __func__, Status));
> +    return Status;
> +  }
> +
> +  return EFI_SUCCESS;
> +}

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#120428) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_PH0PR01MB7287192253773AF2BC2745D996962PH0PR01MB7287prod_--