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 7FA56D801DE for ; Thu, 22 Aug 2024 22:17:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=CFPPoR9qczPjD3OtS4nrgADkqOQyGiFiuhf7Ku82pvI=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To: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:Content-Transfer-Encoding; s=20240206; t=1724365064; v=1; b=TawwiQzAXh5mFMbWyTAPhybABaR2cni37enyNN8RX5ZHYr01cejyOGOMK3WsRCGYDSL/KI9d X/z2bbhsOWcn4lVSft+8fuMx5hAZnY9ye2SbXIQ2CtoMv+a8Kh/yJTgT6/cR3buUnyP2IgMsOb/ BZ4gYY0mWqEWxAm1QXiMkojOMnem3evVBl004LGrHl0Y6f8wPmJv76vO4eYQhFDVhDDsfKWr92K gXEqziKV8oon0igzWyGLz0G2ViOHPNG80rY8rDGN26tt9Sj8munTBoeEXO8zGxyL8GvVUt985WB vHPZdhj3XIF13YBl0lfBtySfvMb8IqbYE7skazVDW02Dw== X-Received: by 127.0.0.2 with SMTP id aj04YY7687511xbXkcfTg3N3; Thu, 22 Aug 2024 15:17:42 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.132]) by mx.groups.io with SMTP id smtpd.web10.10696.1724323765174013188 for ; Thu, 22 Aug 2024 03:49:25 -0700 X-Received: from DM4PR01MB7596.prod.exchangelabs.com (2603:10b6:8:60::8) by MWHPR01MB8699.prod.exchangelabs.com (2603:10b6:303:284::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.29; Thu, 22 Aug 2024 10:49:21 +0000 X-Received: from DM4PR01MB7596.prod.exchangelabs.com ([fe80::835c:1756:e2e1:7410]) by DM4PR01MB7596.prod.exchangelabs.com ([fe80::835c:1756:e2e1:7410%4]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 10:49:21 +0000 Message-ID: Date: Thu, 22 Aug 2024 17:49:13 +0700 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [edk2-platforms][PATCH v2 1/1] JadePkg: Add ACPI SPMI table To: Nhi Pham , devel@edk2.groups.io Cc: quic_llindhol@quicinc.com, chuong@os.amperecomputing.com, rebecca@os.amperecomputing.com References: <20240815065551.3796734-1-nhi@os.amperecomputing.com> From: Chuong Tran In-Reply-To: <20240815065551.3796734-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SI2PR01CA0010.apcprd01.prod.exchangelabs.com (2603:1096:4:191::12) To DM4PR01MB7596.prod.exchangelabs.com (2603:10b6:8:60::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR01MB7596:EE_|MWHPR01MB8699:EE_ X-MS-Office365-Filtering-Correlation-Id: 59322c2d-4544-4d96-2006-08dcc298145e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?utf-8?B?bWFFQnBwcWRUd3ZKdTdVY3Jxc0syRUl1YzhiRWVRclVCVUR5TjRpSTdoSzVj?= =?utf-8?B?SEVPVG1mRGtQbDVDVENFWnJqV2krRGQ2QkdzM1pwYkhaT0p5NXJQWlVoUThO?= =?utf-8?B?SjVCb0VuWEt6a3VnOHordTAzWWFocnNlRlh5dURqVGZHY0RYRmtDUnFDRjYx?= =?utf-8?B?WWRRSHBEUEh1dVZ5aGU5V1NoejVZS2xhRUdGdkxmSWI5QktBbU96RFJ0V0VC?= =?utf-8?B?Ynk0L2ZJS2FmTldObTBxV0ZIQms1OWhwQVZhO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5ZnRLSmxHbFJUZ090dEdrOUFGdzRMUWR6ZXY4M1lG?= =?utf-8?B?ckI0WGU1clF1dnBhb0YyQlUvWmNJM3ZWZGk1WE1pSE00S0UrT0ZCZFFEOWt0?= =?utf-8?B?dGpDRHF4bGN6K28rR0lnUExQYmlFQXlqdzBkbEF1bWZyM2JycHZTZUk3NWpi?= =?utf-8?B?RmVIb1UraGJXS2loeFlYZGhBWk1ObWh1RzhlTis1ZnYxZUVCNUhjUlpRNXpJ?= =?utf-8?Q?M98RyzZjdxSUazI2Ay/xFIA=3D?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59322c2d-4544-4d96-2006-08dcc298145e X-MS-Exchange-CrossTenant-AuthSource: DM4PR01MB7596.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 10:49:21.3973 (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: 2lrBwbr1ZW+1A72lug2JcPL1mHqCiHB5Ok19C4T4BLzWT8z8guBphLQaaw4TNwNC8IBaTjPvaWHSamoNp/X5hlroP+1AWvUnUL4/ZkXOHfM5j/Ow9yo8Cv90iV8bZQl9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR01MB8699 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, 22 Aug 2024 15:17:40 -0700 Resent-From: chuong@amperemail.onmicrosoft.com Reply-To: devel@edk2.groups.io,chuong@amperemail.onmicrosoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: www7hrOgSXMvcT7QVNfEoud6x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=TawwiQzA; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none 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 > =20 > [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 > =20 > [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 > ); > =20 > +/** > + 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")); > } > =20 > + 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 (#120396): https://edk2.groups.io/g/devel/message/120396 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-