From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.52]) by mx.groups.io with SMTP id smtpd.web10.49924.1683992976484196886 for ; Sat, 13 May 2023 08:49:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=ghmLjNGF; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.243.52, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gc8uaRL9pK6RrxoRuP8M/+/jPVaeFHfF6URN9mtJh84f8/TV2MoZg/UOq9cfMWGh5ksYquykn4aHvE4y+t+KRGoQqV0Yf9KxYlC+34ykY3KOJV/PwIrqD+h6HxlQMiHhxA8E2NBxS8Kc+Vog/QrpDXmAewsIHec2weoCsXtY2fb+8KDULY+n2Wimskczg9sbVo6mxQjl1sF9eeDcT6TGJG6Dzf02Yvt8hmZEqE83CrybgiLhwiXmYcq1fQZUhUh79CjuCEod0o8odvawLqpQVliYgPvFm6lAnGN6/Oxlf40DGP9You0akTIBDLsa5lXzyqAmspNshsm6uvagIhmZog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iUx983g9Yw37KOIV2fFZIimFAH0ha3ROd2SHsBV5aeI=; b=iz8Y1D0sR9HDzDTGGzM4V8QisuwxSJ/QOJWlxN1ZY0ikVp/zouZ4OPO9eBUfEbI3mGV3KiS9QAAJ5Wp77TQ9NVXIOy2xXFNOIX7jw1jUQcL6WZp86LA8r4l69OY4DgvnTJBs8vtjREKQ7vs5svpT2Vml5ckqxnpI6yYd/JerXdVg8e5vv/yuTR9PUSuYXw9pGXiFJJlV3TAOEeIn9yVSRkPuIO7olxjyye0tWheZQNBzPBy71OXseAjaOxWga3vl73UhtIa12E/Ra3joILAhEykFxsz3YpNla+CJr27OD3Hj3dsgSWenf/xpl2UdUuAD65dRNt/lOdiEtWMnCIDrBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iUx983g9Yw37KOIV2fFZIimFAH0ha3ROd2SHsBV5aeI=; b=ghmLjNGFerwHax+ji5t1JGNGZXSbTPunegxyUB9jVWI/gkL18/9WDbmRHDvurdm8AHooqv/LKBB+D41JtFbbqdi/Ugbznvp5BF96ZW2vyJKTZqywYSbDRlx+8ZYWn/hrpO38ZpbLsHzL3tbrmo6ws3iOKjQTvmbe2ecDANbIAwc= Received: from MN2PR02CA0018.namprd02.prod.outlook.com (2603:10b6:208:fc::31) by DS7PR12MB6216.namprd12.prod.outlook.com (2603:10b6:8:94::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.29; Sat, 13 May 2023 15:49:32 +0000 Received: from BL02EPF0000EE3E.namprd05.prod.outlook.com (2603:10b6:208:fc:cafe::6d) by MN2PR02CA0018.outlook.office365.com (2603:10b6:208:fc::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.29 via Frontend Transport; Sat, 13 May 2023 15:49:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000EE3E.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.11 via Frontend Transport; Sat, 13 May 2023 15:49:31 +0000 Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sat, 13 May 2023 10:49:29 -0500 From: "Chang, Abner" To: CC: Isaac Oram , Abdul Lateef Attar , Nickle Wang , Tinh Nguyen Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI BMC ACPI Driver Date: Sat, 13 May 2023 23:49:18 +0800 Message-ID: <20230513154919.1873-1-abner.chang@amd.com> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Return-Path: Abner.Chang@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3E:EE_|DS7PR12MB6216:EE_ X-MS-Office365-Filtering-Correlation-Id: c74fb069-0f4a-4d6d-3459-08db53c9a48a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vxULCgecH2s5jPWW1RQh0SqVK5IbSvhHtcYghQw5FsvpJJWMjMkczROReK12yeiLEVphlY8UW2LhqIRJ/OA3+ua8HdAHQnvR/eetNFe8ins5JAnLB9z+3WIC3OuqeQW9pv20PRAreHUlFyYSAF6jL8m7TgoHJL7ZMVUAn09tMk+f3PIAkK6YcLN6myZUvWiKMP1+knEP/CQpCqJnGrIZvSC3c4d2fSPBb//NIPTQQYb2FtP9aHcuquJr0hs+245/FHHbzZyP73/RFNsO7AwTE+QAB+zsx8U7a/BxVRmA8MuGkdIrLS012h5Usz3tWMfUzozuVEdFK0YL74w+Tr6V+5Zb+ZdG6cmacmufyWNlkN0GjO0Uy4AA+aXwCU7TdRYLb2iY4pPTjsdmffJZRabKf2ruONGDYil7Su74tfjGUHDTi5owF48TEBo75cUHBAgRCkxh+cJu5IJo4XDiG+flfhMp6F+JtXge6o3O+djEslwnty0QHtOqgI9B5jIoo/aIaOweiuCndgskTmNB7gjpGBHZiY2AP67wTm3VO9ZrCsnku0R6pKjeE2fe/AEX/pa1H1cL428CkR0YkSSGJOacwO+Jcdyej7W2PtespQMcEWDFvCcrJ62ZC2aed1luIqOhBlfm71fVMTdZ/YGp2a8Ysw9nZL7npjWohrtoJ7ouegWOL7q9+zePf9N/uhIGj+/KV8MWvAZedr76TwDtyZMcxq0+W4XYcPBK95HH3ep6gtsoccrEUOrx7gn8jV+B1pug8hHPYGE5Qc8hVNxBZZ2ZViSu1QwqNMk/Irgw6JP1gOE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(39860400002)(396003)(346002)(451199021)(46966006)(40470700004)(36840700001)(6916009)(4326008)(19627235002)(478600001)(70206006)(70586007)(54906003)(186003)(16526019)(36756003)(83380400001)(40460700003)(426003)(336012)(2616005)(36860700001)(47076005)(2876002)(8936002)(8676002)(40480700001)(82310400005)(2906002)(6666004)(316002)(7696005)(81166007)(356005)(86362001)(30864003)(5660300002)(41300700001)(26005)(1076003)(82740400003)(127784003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2023 15:49:31.6641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c74fb069-0f4a-4d6d-3459-08db53c9a48a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000EE3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6216 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Abner Chang IpmiBmcAcpi is cloned from edk2-platforms/Features/Intel/OutOfBandManagement/ IpmiFeaturePkg/BmcAcpi in order to consolidate edk2 system manageability support in one place. Uncustify is applied to C files and no functionalities are changed in this patch. We will still keep the one under IpmiFeaturePkg/BmcAcpi until the reference to this instance are removed from platforms. Signed-off-by: Abner Chang Cc: Isaac Oram Cc: Abdul Lateef Attar Cc: Nickle Wang Cc: Tinh Nguyen --- .../Universal/IpmiBmcAcpi/BmcAcpi.inf | 47 ++++ .../Universal/IpmiBmcAcpi/BmcAcpi.c | 264 ++++++++++++++++++ .../Universal/IpmiBmcAcpi/BmcSsdt/BmcSsdt.asl | 28 ++ .../IpmiBmcAcpi/BmcSsdt/IpmiOprRegions.asi | 58 ++++ 4 files changed, 397 insertions(+) create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi= .inf create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi= .c create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt= /BmcSsdt.asl create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt= /IpmiOprRegions.asi diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf b/= Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf new file mode 100644 index 0000000000..a21c5b9b35 --- /dev/null +++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf @@ -0,0 +1,47 @@ +### @file +# Component description file for BMC ACPI. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BmcAcpi + FILE_GUID =3D 09E3B4BE-F731-4903-AAE6-BD5D573B6140 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D BmcAcpiEntryPoint + +[Sources] + BmcAcpi.c + BmcSsdt/BmcSsdt.asl + +[Packages] + ManageabilityPkg/ManageabilityPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + BaseMemoryLib + DebugLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[Protocols] + gEfiFirmwareVolume2ProtocolGuid + gEfiAcpiTableProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId + +[Depex] + gEfiAcpiTableProtocolGuid + +[BuildOptions] + *_*_*_ASL_FLAGS =3D -oi diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c b/Fe= atures/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c new file mode 100644 index 0000000000..cf066dd095 --- /dev/null +++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c @@ -0,0 +1,264 @@ +/** @file + IPMI BMC ACPI. + + Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +// +// Statements that include other header files +// +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifndef EFI_ACPI_CREATOR_ID +#define EFI_ACPI_CREATOR_ID SIGNATURE_32 ('M', 'S', 'F', 'T') +#endif +#ifndef EFI_ACPI_CREATOR_REVISION +#define EFI_ACPI_CREATOR_REVISION 0x0100000D +#endif + +/** + + Locate the first instance of a protocol. If the protocol requested is a= n + FV protocol, then it will return the first FV that contains the ACPI tab= le + storage file. + + @param [in] Protocol The protocol to find. + @param [in] Instance Return pointer to the first instance of the protoc= ol. + @param [in] Type The type of protocol to locate. + + @retval EFI_SUCCESS The function completed successfully. + @retval EFI_NOT_FOUND The protocol could not be located. + @retval EFI_OUT_OF_RESOURCES There are not enough resources to find the= protocol. + +**/ +EFI_STATUS +LocateSupportProtocol ( + IN EFI_GUID *Protocol, + OUT VOID **Instance, + IN UINT32 Type + ) +{ + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN NumberOfHandles; + EFI_FV_FILETYPE FileType; + UINT32 FvStatus =3D 0; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN Index; + + Status =3D gBS->LocateHandleBuffer (ByProtocol, Protocol, NULL, &NumberO= fHandles, &HandleBuffer); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Looking for FV with ACPI storage file + // + for (Index =3D 0; Index < NumberOfHandles; Index++) { + Status =3D gBS->HandleProtocol (HandleBuffer[Index], Protocol, Instanc= e); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of th= e + // protocol. There should not be any errors because our handle buff= er + // should always contain at least one or LocateHandleBuffer would ha= ve + // returned not found. + // + break; + } + + // + // See if it has the ACPI storage file + // + Status =3D ((EFI_FIRMWARE_VOLUME2_PROTOCOL *)(*Instance))->ReadFile ( + *Instance, + &gEfiCaller= IdGuid, + NULL, + &Size, + &FileType, + &Attributes= , + &FvStatus + ); + + // + // If we found it, then we are done + // + if (!EFI_ERROR (Status)) { + break; + } + } + + gBS->FreePool (HandleBuffer); + return Status; +} + +/** + Update ACPI SSDT for BMC IPMI KCS device + + @param [in] Table Pointer to ACPI SSDT + + @retval EFI_SUCCESS SSDT is updated according to PCD settings +**/ +EFI_STATUS +UpdateDeviceSsdtTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ) +{ + EFI_ACPI_DESCRIPTION_HEADER *TableHeader =3D NULL; + UINT64 TempOemTableId; + UINT8 *DataPtr; + EFI_ACPI_IO_PORT_DESCRIPTOR *IoRsc; + + TableHeader =3D (EFI_ACPI_DESCRIPTION_HEADER *)Table; + + // + // Update the OEMID and OEM Table ID. + // + CopyMem (&TableHeader->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (T= ableHeader->OemId)); + TempOemTableId =3D PcdGet64 (PcdAcpiDefaultOemTableId); + CopyMem (&TableHeader->OemTableId, &TempOemTableId, sizeof (UINT64)); + TableHeader->CreatorId =3D EFI_ACPI_CREATOR_ID; + TableHeader->CreatorRevision =3D EFI_ACPI_CREATOR_REVISION; + + // + // Update IO(Decode16, 0xCA2, 0xCA2, 0, 2) + // + DEBUG ((DEBUG_INFO, "UpdateDeviceSsdtTable - IPMI\n")); + for (DataPtr =3D (UINT8 *)(Table + 1); + DataPtr < (UINT8 *)((UINT8 *)Table + Table->Length - 4); + DataPtr++) + { + if (CompareMem (DataPtr, "_CRS", 4) =3D=3D 0) { + DataPtr +=3D 4; // Skip _CRS + ASSERT (*DataPtr =3D=3D AML_BUFFER_OP); + DataPtr++; // Skip AML_BUFFER_OP + ASSERT ((*DataPtr & (BIT7|BIT6)) =3D=3D 0); + DataPtr++; // Skip PkgLength - 0xD + ASSERT ((*DataPtr) =3D=3D AML_BYTE_PREFIX); + DataPtr++; // Skip BufferSize OpCode + DataPtr++; // Skip BufferSize - 0xA + IoRsc =3D (VOID *)DataPtr; + ASSERT (IoRsc->Header.Bits.Type =3D=3D ACPI_SMALL_ITEM_FLAG); + ASSERT (IoRsc->Header.Bits.Name =3D=3D ACPI_SMALL_IO_PORT_DESCRIPTOR= _NAME); + ASSERT (IoRsc->Header.Bits.Length =3D=3D sizeof (EFI_ACPI_IO_PORT_DE= SCRIPTOR) - sizeof (ACPI_SMALL_RESOURCE_HEADER)); + DEBUG ((DEBUG_INFO, "IPMI IO Base in ASL update - 0x%04x <=3D 0x%04x= \n", IoRsc->BaseAddressMin, PcdGet16 (PcdIpmiKcsIoBaseAddress))); + IoRsc->BaseAddressMin =3D PcdGet16 (PcdIpmiKcsIoBaseAddress); + IoRsc->BaseAddressMax =3D PcdGet16 (PcdIpmiKcsIoBaseAddress); + } + } + + return EFI_SUCCESS; +} + +/** + + Entry point for Acpi platform driver. + + @param [in] ImageHandle A handle for the image that is initializing thi= s driver. + @param [in] SystemTable A pointer to the EFI system table. + + @retval EFI_SUCCESS Driver initialized successfully. + @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +BmcAcpiEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_STATUS AcpiStatus; + + EFI_FIRMWARE_VOLUME2_PROTOCOL *FwVol; + INTN Instance =3D 0; + EFI_ACPI_COMMON_HEADER *CurrentTable =3D NULL; + UINTN TableHandle =3D 0; + UINT32 FvStatus; + UINT32 Size; + + EFI_ACPI_TABLE_PROTOCOL *AcpiTable; + UINTN TableSize; + + // + // Find the AcpiTable protocol + // + Status =3D gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID = **)&AcpiTable); + if (EFI_ERROR (Status)) { + return EFI_ABORTED; + } + + // + // Locate the firmware volume protocol + // + Status =3D LocateSupportProtocol (&gEfiFirmwareVolume2ProtocolGuid, (VOI= D **)&FwVol, 1); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D EFI_SUCCESS; + Instance =3D 0; + + // + // Read tables from the storage file. + // + while (!EFI_ERROR (Status)) { + CurrentTable =3D NULL; + + Status =3D FwVol->ReadSection ( + FwVol, + &gEfiCallerIdGuid, + EFI_SECTION_RAW, + Instance, + (VOID **)&CurrentTable, + (UINTN *)&Size, + &FvStatus + ); + if (!EFI_ERROR (Status)) { + // + // Perform any table specific updates. + // + AcpiStatus =3D UpdateDeviceSsdtTable (CurrentTable); + if (!EFI_ERROR (AcpiStatus)) { + TableHandle =3D 0; + TableSize =3D ((EFI_ACPI_DESCRIPTION_HEADER *)CurrentTable)->Len= gth; + ASSERT (Size >=3D TableSize); + + Status =3D AcpiTable->InstallAcpiTable ( + AcpiTable, + CurrentTable, + TableSize, + &TableHandle + ); + + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + } + } + + return EFI_SUCCESS; +} diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/BmcSsd= t.asl b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/BmcSsdt.asl new file mode 100644 index 0000000000..8157d744c8 --- /dev/null +++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/BmcSsdt.asl @@ -0,0 +1,28 @@ +/** @file + BMC ACPI SSDT. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +DefinitionBlock ( + "BmcSsdt.aml", + "SSDT", + 0x02, // SSDT revision. + // A Revision field value greater than or equal to 2 sig= nifies that integers + // declared within the Definition Block are to be evalua= ted as 64-bit values + "INTEL", // OEM ID (6 byte string), same as PcdAcpiDefaultOemId d= efined in MdeModulePkg.dec + "BMCACPI", // OEM table ID (8 byte string) + 0x0 // OEM version of DSDT table (4 byte Integer) + ) +{ + + External(\_SB.PC00.LPC0, DeviceObj) + + Scope (\_SB.PC00.LPC0) + { + #include "IpmiOprRegions.asi" + } + +} diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/IpmiOp= rRegions.asi b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/Ipmi= OprRegions.asi new file mode 100644 index 0000000000..ffd6af3944 --- /dev/null +++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/IpmiOprRegion= s.asi @@ -0,0 +1,58 @@ +/** @file + IPMI ACPI SSDT. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +Device(IPMC) +{ + // Config DWord, modified during POST + // Bit definitions are the same as PPMFlags: + // [00] =3D Plug and Play BMC Detection enabled in setup + // [31:01] =3D Reserved =3D 0 + + Name(ECFL, 0x80000000) + + // Return the interface specification revision + Method(_SRV) + { + // IPMI Specification Revision v2.0 + Return(0x0200) + } + + Method(_STA, 0) + { + // + // Assume OK + // + Store (0xF, Local0) + + Return(Local0) + + // Bit 0 - Set if the device is present. + // Bit 1 - Set if the device is enabled and decoding its resources= . + // Bit 2 - Set if the device should be shown in the UI. + // Bit 3 - Set if the device is functioning properly (cleared if t= he device failed its diagnostics). + // Bit 4 - Set if the battery is present. + // Bit 5 - Reserved (must be cleared). + } // end of _STA + + // Return the x86 resources consumed by BMC + Name(_CRS, ResourceTemplate() + { + // Uses 8-bit ports 0xCA2-0xCA5 + IO(Decode16, 0xCA2, 0xCA2, 0, 2) + }) + + Name(_HID, "IPI0001") // IPMI device + Name(_IFT, 0x1) // KCS system interface type + Name(_STR, Unicode("IPMI_KCS")) + + Name(_UID, 0) // First interface. + + +} // end of Device(IPMC) + + --=20 2.37.1.windows.1