From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com []) by mx.groups.io with SMTP id smtpd.web09.933.1574903199589090118 for ; Wed, 27 Nov 2019 17:07:21 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 17:07:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,251,1571727600"; d="scan'208";a="383667783" Received: from makuback-desk1.amr.corp.intel.com ([10.7.159.162]) by orsmga005.jf.intel.com with ESMTP; 27 Nov 2019 17:07:20 -0800 From: "Kubacki, Michael A" To: devel@edk2.groups.io Cc: Sai Chaganty , Liming Gao Subject: [edk2-platforms][PATCH V2 15/47] Features/Intel/IpmiFeaturePkg: Add modules Date: Wed, 27 Nov 2019 17:05:42 -0800 Message-Id: <20191128010614.43628-16-michael.a.kubacki@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20191128010614.43628-1-michael.a.kubacki@intel.com> References: <20191128010614.43628-1-michael.a.kubacki@intel.com> This change adds the modules for the IPMI feature to IpmiFeaturePkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec | 8 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 78 +++++- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc | 2 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 8 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf | 3 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf | 47 ++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf | 33 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf | 37 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf | 37 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf | 35 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf | 34 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf | 32 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf | 33 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf | 37 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.c | 257 ++++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.c | 236 ++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.c | 236 ++++++++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.c | 84 +++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.c | 67 +++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.c | 150 ++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.c | 96 ++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.c | 112 +++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.c | 164 +++++++++++++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/BmcSsdt.asl | 28 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/IpmiOprRegions.asi | 58 +++++ 25 files changed, 1909 insertions(+), 3 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec index 4c43fc5f49..1426496d28 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -36,3 +36,11 @@ [PcdsFeatureFlag] gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable|FALSE|BOOLEAN|0xA0000001 + +[PcdsFixedAtBuild] + gIpmiFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels|3|UINT8|0xF0000001 + +[PcdsDynamic, PcdsDynamicEx] + gIpmiFeaturePkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0xD0000001 + gIpmiFeaturePkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0xD0000002 + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress|0xCA2|UINT16|0xD0000003 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc index c6a385108b..a82f18a68c 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc @@ -18,6 +18,12 @@ # ################################################################################ [Defines] +!ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" +!endif +!ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" +!endif ################################################################################ # @@ -32,6 +38,36 @@ BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf + + ##################################### + # IPMI Feature Package + ##################################### + IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf + +[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] + ####################################### + # Edk2 Packages + ####################################### + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf + +[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER] + ####################################### + # Edk2 Packages + ####################################### + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf ################################################################################ # @@ -47,17 +83,50 @@ # generated for it, but the binary will not be put into any firmware volume. # ################################################################################ -[Components] +# +# Feature PEI Components +# + +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +# is completed. +[Components.IA32] + ##################################### + # IPMI Feature Package + ##################################### + + # Add library instances here that are not included in package components and should be tested + # in the package build. + + OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf + + # Add components here that should be included in the package build. + OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf + OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf + +# +# Feature DXE Components +# + +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +# is completed. +[Components.X64] ##################################### # IPMI Feature Package ##################################### # Add library instances here that are not included in package components and should be tested # in the package build. - OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf + OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf # Add components here that should be included in the package build. + OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf + OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf + OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf + OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf + OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf + OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf + OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf ################################################################################################### # @@ -67,6 +136,9 @@ # applied for any modules or only those modules with the specific # module style (EDK or EDKII) specified in [Components] section. # +# For advanced features, it is recommended to enable [BuildOptions] in +# the applicable INF file so it does not affect the whole board package +# build when this DSC file is active. +# ################################################################################################### [BuildOptions] - *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 623a52650f..6a3eed0882 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -22,6 +22,8 @@ SUPPORTED_ARCHITECTURES = IA32|X64 BUILD_TARGETS = DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT + PEI_ARCH = IA32 + DXE_ARCH = X64 # # This package always builds the feature. diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf index c3847c54c7..b5b37ddd9f 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf @@ -6,3 +6,11 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent # ## + + INF OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf + INF OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf + INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf + INF OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf + INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf + INF OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf + INF OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf index 0c82d7eb02..4aa2d8e9da 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf @@ -6,3 +6,6 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent # ## + +INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf +INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf new file mode 100644 index 0000000000..a84813f55c --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/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 = 0x00010005 + BASE_NAME = BmcAcpi + FILE_GUID = F59DAA23-D5D5-4d16-91FC-D03ABDC12FFE + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = BmcAcpiEntryPoint + +[Sources] + BmcAcpi.c + BmcSsdt/BmcSsdt.asl + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + UefiDriverEntryPoint + BaseMemoryLib + DebugLib + UefiLib + +[Protocols] + gEfiFirmwareVolume2ProtocolGuid + gEfiAcpiTableProtocolGuid + +[Pcd] + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId + +[Depex] + gEfiAcpiTableProtocolGuid + +[BuildOptions] + *_*_*_ASL_FLAGS = -oi diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf new file mode 100644 index 0000000000..665b3d9bda --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf @@ -0,0 +1,33 @@ +### @file +# Component description file for BMC ELOG. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = BmcElog + FILE_GUID = 8A17F6CA-BF1A-45C4-FFFF-FFFF0C829DDD + MODULE_TYPE = DXE_DRIVER + PI_SPECIFICATION_VERSION = 0x0001000A + VERSION_STRING = 1.0 + ENTRY_POINT = InitializeBmcElogLayer + +[Sources] + BmcElog.c + +[Packages] + MdePkg/MdePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + DebugLib + UefiBootServicesTableLib + IpmiCommandLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf new file mode 100644 index 0000000000..85836cd8ee --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf @@ -0,0 +1,37 @@ +### @file +# Component description file for IPMI FRB. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[defines] + INF_VERSION = 0x00010005 + BASE_NAME = FrbDxe + FILE_GUID = F6C7812D-81BF-4e6d-A87D-E75AF17BD511 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = FrbDxeEntryPoint + +[Sources] + FrbDxe.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + UefiDriverEntryPoint + MemoryAllocationLib + UefiLib + DebugLib + BaseMemoryLib + IpmiCommandLib + PcdLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf new file mode 100644 index 0000000000..7ad00ae574 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf @@ -0,0 +1,37 @@ +### @file +# Component description file for IPMI FRB PEIM. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[defines] + INF_VERSION = 0x00010005 + BASE_NAME = FrbPei + FILE_GUID = 7F9F9788-9F1F-4725-895C-3932F1A04DE8 + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + ENTRY_POINT = InitializeFrbPei + +[Sources] + FrbPei.c + +[Packages] + MdePkg/MdePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + PeimEntryPoint + DebugLib + BaseMemoryLib + PcdLib + IpmiCommandLib + +[Pcd] + gIpmiFeaturePkgTokenSpaceGuid.PcdFRB2EnabledFlag + gIpmiFeaturePkgTokenSpaceGuid.PcdFRBTimeoutValue + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf new file mode 100644 index 0000000000..0778b221c1 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf @@ -0,0 +1,35 @@ +### @file +# Component description file for IPMI FRU. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = IpmiFru + FILE_GUID = 3F1D6464-2B4C-4640-BAC4-3DD905D26CDA + MODULE_TYPE = DXE_DRIVER + PI_SPECIFICATION_VERSION = 0x0001000A + VERSION_STRING = 1.0 + ENTRY_POINT = InitializeFru + +[Sources] + IpmiFru.c + +[Packages] + MdePkg/MdePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + UefiLib + DebugLib + UefiBootServicesTableLib + BaseMemoryLib + IpmiCommandLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf new file mode 100644 index 0000000000..68ff70cd43 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf @@ -0,0 +1,34 @@ +### @file +# Component description file for IPMI initialization. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DxeIpmiInit + FILE_GUID = 07A01ACF-46D5-48de-A63D-74FA92AA8450 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = IpmiInterfaceInit + +[Sources] + DxeIpmiInit.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + UefiBootServicesTableLib + DebugLib + UefiDriverEntryPoint + IpmiCommandLib + TimerLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf new file mode 100644 index 0000000000..825451ede1 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf @@ -0,0 +1,32 @@ +### @file +# Component description file for IPMI initialization in PEI. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = PeiIpmiInit + FILE_GUID = D8F57F4E-D67D-4f2c-8351-C7092986542F + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + ENTRY_POINT = PeimIpmiInterfaceInit + +[Sources] + PeiIpmiInit.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + PeimEntryPoint + DebugLib + IpmiCommandLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf new file mode 100644 index 0000000000..7e7d2826cb --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf @@ -0,0 +1,33 @@ +### @file +# Component description file for IPMI OS watch dog timer driver. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = OsWdt + FILE_GUID = BE9B694A-B5D9-48e0-A527-6E1A49EB7028 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = DriverInit + +[Sources] + OsWdt.c + +[Packages] + MdePkg/MdePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + DebugLib + UefiBootServicesTableLib + BaseMemoryLib + IpmiCommandLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf new file mode 100644 index 0000000000..826144e537 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf @@ -0,0 +1,37 @@ +### @file +# Component description file for IPMI Serial Over LAN (SOL) driver. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = SolStatus + FILE_GUID = F9887B5E-2D46-4213-8794-14F1FD39F6B8 + MODULE_TYPE = DXE_DRIVER + PI_SPECIFICATION_VERSION = 0x0001000A + VERSION_STRING = 1.0 + ENTRY_POINT = SolStatusEntryPoint + +[Sources] + SolStatus.c + +[Packages] + MdePkg/MdePkg.dec + OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec + +[Pcd] + gIpmiFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels + +[LibraryClasses] + UefiDriverEntryPoint + DebugLib + UefiBootServicesTableLib + IpmiCommandLib + PcdLib + +[Depex] + TRUE diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.c new file mode 100644 index 0000000000..990b4b9e83 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.c @@ -0,0 +1,257 @@ +/** @file + 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 an + FV protocol, then it will return the first FV that contains the ACPI table + storage file. + + @param Protocol - The protocol to find. + Instance - Return pointer to the first instance of the protocol. + 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 = 0; + EFI_FV_FILE_ATTRIBUTES Attributes; + UINTN Size; + UINTN Index; + + Status = gBS->LocateHandleBuffer (ByProtocol, Protocol, NULL, &NumberOfHandles, &HandleBuffer); + if (EFI_ERROR (Status)) { + return Status; + } + // + // Looking for FV with ACPI storage file + // + for (Index = 0; Index < NumberOfHandles; Index++) { + Status = gBS->HandleProtocol (HandleBuffer[Index], Protocol, Instance); + ASSERT (!EFI_ERROR (Status)); + + if (!Type) { + // + // Not looking for the FV protocol, so find the first instance of the + // protocol. There should not be any errors because our handle buffer + // should always contain at least one or LocateHandleBuffer would have + // returned not found. + // + break; + } + // + // See if it has the ACPI storage file + // + Status = ((EFI_FIRMWARE_VOLUME2_PROTOCOL *) (*Instance))->ReadFile ( + *Instance, + &gEfiCallerIdGuid, + NULL, + &Size, + &FileType, + &Attributes, + &FvStatus + ); + + // + // If we found it, then we are done + // + if (!EFI_ERROR (Status)) { + break; + } + } + + gBS->FreePool (HandleBuffer); + return Status; +} + + +EFI_STATUS +UpdateDeviceSsdtTable ( + IN OUT EFI_ACPI_COMMON_HEADER *Table + ) +{ + EFI_ACPI_DESCRIPTION_HEADER *TableHeader = NULL; + UINT64 TempOemTableId; + UINT8 *DataPtr; + EFI_ACPI_IO_PORT_DESCRIPTOR *IoRsc; + + TableHeader = (EFI_ACPI_DESCRIPTION_HEADER *)Table; + + // + // Update the OEMID and OEM Table ID. + // + CopyMem (&TableHeader->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof(TableHeader->OemId)); + TempOemTableId = PcdGet64 (PcdAcpiDefaultOemTableId); + CopyMem (&TableHeader->OemTableId, &TempOemTableId, sizeof(UINT64)); + TableHeader->CreatorId = EFI_ACPI_CREATOR_ID; + TableHeader->CreatorRevision = EFI_ACPI_CREATOR_REVISION; + + // + // Update IO(Decode16, 0xCA2, 0xCA2, 0, 2) + // + DEBUG ((DEBUG_INFO, "UpdateDeviceSsdtTable - IPMI\n")); + for (DataPtr = (UINT8 *)(Table + 1); + DataPtr < (UINT8 *) ((UINT8 *) Table + Table->Length - 4); + DataPtr++) { + if (CompareMem(DataPtr, "_CRS", 4) == 0) { + DataPtr += 4; // Skip _CRS + ASSERT (*DataPtr == AML_BUFFER_OP); + DataPtr ++; // Skip AML_BUFFER_OP + ASSERT ((*DataPtr & (BIT7|BIT6)) == 0); + DataPtr ++; // Skip PkgLength - 0xD + ASSERT ((*DataPtr) == AML_BYTE_PREFIX); + DataPtr ++; // Skip BufferSize OpCode + DataPtr ++; // Skip BufferSize - 0xA + IoRsc = (VOID *)DataPtr; + ASSERT (IoRsc->Header.Bits.Type == ACPI_SMALL_ITEM_FLAG); + ASSERT (IoRsc->Header.Bits.Name == ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME); + ASSERT (IoRsc->Header.Bits.Length == sizeof(EFI_ACPI_IO_PORT_DESCRIPTOR) - sizeof(ACPI_SMALL_RESOURCE_HEADER)); + DEBUG ((DEBUG_INFO, "IPMI IO Base in ASL update - 0x%04x <= 0x%04x\n", IoRsc->BaseAddressMin, PcdGet16(PcdIpmiIoBaseAddress))); + IoRsc->BaseAddressMin = PcdGet16(PcdIpmiIoBaseAddress); + IoRsc->BaseAddressMax = PcdGet16(PcdIpmiIoBaseAddress); + } + } + + return EFI_SUCCESS; +} + +/** + + Entry point for Acpi platform driver. + + @param ImageHandle - A handle for the image that is initializing this driver. + @param 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 = 0; + EFI_ACPI_COMMON_HEADER *CurrentTable = NULL; + UINTN TableHandle = 0; + UINT32 FvStatus; + UINT32 Size; + + EFI_ACPI_TABLE_PROTOCOL *AcpiTable; + UINTN TableSize; + + + // + // Find the AcpiTable protocol + // + Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID**)&AcpiTable); + if (EFI_ERROR (Status)) { + return EFI_ABORTED; + } + + // + // Locate the firmware volume protocol + // + Status = LocateSupportProtocol (&gEfiFirmwareVolume2ProtocolGuid, (VOID **) &FwVol, 1); + if (EFI_ERROR (Status)) { + return Status; + } + + Status = EFI_SUCCESS; + Instance = 0; + + // + // Read tables from the storage file. + // + while (!EFI_ERROR (Status)) { + CurrentTable = NULL; + + Status = FwVol->ReadSection ( + FwVol, + &gEfiCallerIdGuid, + EFI_SECTION_RAW, + Instance, + (VOID **) &CurrentTable, + (UINTN *) &Size, + &FvStatus + ); + if (!EFI_ERROR (Status)) { + // + // Perform any table specific updates. + // + AcpiStatus = UpdateDeviceSsdtTable (CurrentTable); + if (!EFI_ERROR (AcpiStatus)) { + + TableHandle = 0; + TableSize = ((EFI_ACPI_DESCRIPTION_HEADER *) CurrentTable)->Length; + ASSERT (Size >= TableSize); + + Status = AcpiTable->InstallAcpiTable ( + AcpiTable, + CurrentTable, + TableSize, + &TableHandle + ); + + ASSERT_EFI_ERROR (Status); + } + + // + // Increment the instance + // + Instance++; + } + } + + return EFI_SUCCESS; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.c new file mode 100644 index 0000000000..a6d075b19c --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.c @@ -0,0 +1,236 @@ +/** @file + BMC Event Log functions. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +CheckIfSelIsFull ( + VOID + ); + +/*++ + + Routine Description: + This function verifies the BMC SEL is full and When it is reports the error to the Error Manager. + + Arguments: + None + + Returns: + EFI_SUCCESS + EFI_DEVICE_ERROR + +--*/ +EFI_STATUS +WaitTillErased ( + UINT8 *ResvId + ) +/*++ + +Routine Description: + +Arguments: + + BmcElogPrivateData - Bmc event log instance + ResvId - Reserved ID + +Returns: + + EFI_SUCCESS + EFI_NO_RESPONSE + +--*/ +{ + INTN Counter; + IPMI_CLEAR_SEL_REQUEST ClearSel; + IPMI_CLEAR_SEL_RESPONSE ClearSelResponse; + + Counter = 0x200; + ZeroMem (&ClearSelResponse, sizeof(ClearSelResponse)); + + while (TRUE) { + ZeroMem (&ClearSel, sizeof(ClearSel)); + ClearSel.Reserve[0] = ResvId[0]; + ClearSel.Reserve[1] = ResvId[1]; + ClearSel.AscC = 0x43; + ClearSel.AscL = 0x4C; + ClearSel.AscR = 0x52; + ClearSel.Erase = 0x00; + + IpmiClearSel ( + &ClearSel, + &ClearSelResponse + ); + + if ((ClearSelResponse.ErasureProgress & 0xf) == 1) { + return EFI_SUCCESS; + } + // + // If there is not a response from the BMC controller we need to return and not hang. + // + --Counter; + if (Counter == 0x0) { + return EFI_NO_RESPONSE; + } + } +} + +EFI_STATUS +EfiActivateBmcElog ( + IN BOOLEAN *EnableElog, + OUT BOOLEAN *ElogStatus + ) +/*++ + +Routine Description: + +Arguments: + + This - Protocol pointer + DataType - indicate event log type + EnableElog - Enable/Disable event log + ElogStatus - return log status + +Returns: + + EFI_STATUS + +--*/ +{ + EFI_STATUS Status; + UINT8 ElogStat; + IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST SetBmcGlobalEnables; + IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE GetBmcGlobalEnables; + UINT8 CompletionCode; + + Status = EFI_SUCCESS; + ElogStat = 0; + + Status = IpmiGetBmcGlobalEnables (&GetBmcGlobalEnables); + if (EFI_ERROR(Status)) { + return Status; + } + + if (EnableElog == NULL) { + *ElogStatus = GetBmcGlobalEnables.GetEnables.Bits.SystemEventLogging; + } else { + if (Status == EFI_SUCCESS) { + if (*EnableElog) { + ElogStat = 1; + } + + CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + 1, sizeof(UINT8)); + SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging = ElogStat; + + Status = IpmiSetBmcGlobalEnables (&SetBmcGlobalEnables, &CompletionCode); + } + } + + return Status; +} + +EFI_STATUS +SetElogRedirInstall ( + VOID + ) +/*++ + +Routine Description: + +Arguments: + + None + +Returns: + + EFI_SUCCESS + +--*/ +{ + BOOLEAN EnableElog; + BOOLEAN ElogStatus; + + // + // Activate the Event Log (This should depend upon Setup). + // + EfiActivateBmcElog (&EnableElog, &ElogStatus); + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +InitializeBmcElogLayer ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + +Arguments: + + ImageHandle - ImageHandle of the loaded driver + SystemTable - Pointer to the System Table + +Returns: + + EFI_STATUS + +--*/ +{ + SetElogRedirInstall (); + + CheckIfSelIsFull (); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +CheckIfSelIsFull ( + VOID + ) +/*++ + + Routine Description: + This function verifies the BMC SEL is full and When it is reports the error to the Error Manager. + + Arguments: + None + + Returns: + EFI_SUCCESS + EFI_DEVICE_ERROR + +--*/ +{ + EFI_STATUS Status; + UINT8 SelIsFull; + IPMI_GET_SEL_INFO_RESPONSE SelInfo; + + Status = IpmiGetSelInfo (&SelInfo); + if (EFI_ERROR (Status)) { + return EFI_DEVICE_ERROR; + } + + // + // Check the Bit7 of the OperationByte if SEL is OverFlow. + // + SelIsFull = (SelInfo.OperationSupport & 0x80); + DEBUG ((DEBUG_INFO, "SelIsFull - 0x%x\n", SelIsFull)); + + return EFI_SUCCESS; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.c new file mode 100644 index 0000000000..28e384490b --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.c @@ -0,0 +1,236 @@ +/** @file + IPMI FRB Driver. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EfiDisableFrb ( + VOID + ) +/*++ + + Routine Description: + This routine disables the specified FRB timer. + + Arguments: + This - This pointer + FrbType - Type of FRB timer to get data on + + Returns: + EFI_SUCCESS - FRB timer was disabled + EFI_ABORTED - Timer was already stopped + EFI_UNSUPPORTED - This type of FRB timer is not supported. + +--*/ +{ + EFI_STATUS Status; + IPMI_SET_WATCHDOG_TIMER_REQUEST SetWatchdogTimer; + UINT8 CompletionCode; + IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer; + + Status = IpmiGetWatchdogTimer (&GetWatchdogTimer); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Check if timer is still running, if not abort disable routine. + // + if (GetWatchdogTimer.TimerUse.Bits.TimerRunning == 0) { + return EFI_ABORTED; + } + + ZeroMem (&SetWatchdogTimer, sizeof(SetWatchdogTimer)); + // + // Just flip the Timer Use bit. This should release the timer. + // + SetWatchdogTimer.TimerUse.Bits.TimerRunning = 0; + SetWatchdogTimer.TimerUse.Bits.TimerUse = IPMI_WATCHDOG_TIMER_BIOS_FRB2; + SetWatchdogTimer.TimerUseExpirationFlagsClear &= ~BIT2; + SetWatchdogTimer.TimerUseExpirationFlagsClear |= BIT1 | BIT4; + + Status = IpmiSetWatchdogTimer (&SetWatchdogTimer, &CompletionCode); + return Status; +} + +VOID +EFIAPI +DisableFRB2Handler ( + IN EFI_EVENT Event, + IN VOID *Context + ) +/*++ + + Routine Description: + Disables FRB2. This function gets called each time the + EFI_EVENT_SIGNAL_READY_TO_BOOT gets signaled + + Arguments: + Standard event notification function arguments: + Event - the event that is signaled. + Context - not used here. + + Returns: + +--*/ +{ + DEBUG((DEBUG_ERROR, "!!! enter DisableFRB2Handler()!!!\n")); + + EfiDisableFrb (); +} + +EFI_STATUS +CheckForAndReportErrors( + VOID + ) +/*++ + + Routine Description: + Check the Watchdog timer expiration flags and report the kind of watchdog + timeout occurred to the Error Manager. + + Arguments: + + Returns: + EFI_SUCCESS - Errors retrieved and reported + +--*/ +{ + EFI_STATUS Status; + IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer; + IPMI_SET_WATCHDOG_TIMER_REQUEST SetWatchdogTimer; + UINT8 CompletionCode; + + // + // Get the Watchdog timer info to find out what kind of timer expiration occurred. + // + Status = IpmiGetWatchdogTimer (&GetWatchdogTimer); + if (EFI_ERROR (Status)) { + return Status; + } + // + // If FRB2 Failure occurred, report it to the error manager and log a SEL. + // + if ((GetWatchdogTimer.TimerUseExpirationFlagsClear & BIT1) != 0) { + // + // Report the FRB2 time-out error + // + } else if ((GetWatchdogTimer.TimerUseExpirationFlagsClear & BIT3) != 0) { + // + // Report the OS Watchdog timer failure + // + } + + // + // Need to clear Timer expiration flags after checking. + // + ZeroMem (&SetWatchdogTimer, sizeof(SetWatchdogTimer)); + SetWatchdogTimer.TimerUse = GetWatchdogTimer.TimerUse; + SetWatchdogTimer.TimerActions = GetWatchdogTimer.TimerActions; + SetWatchdogTimer.PretimeoutInterval = GetWatchdogTimer.PretimeoutInterval; + SetWatchdogTimer.TimerUseExpirationFlagsClear = GetWatchdogTimer.TimerUseExpirationFlagsClear; + SetWatchdogTimer.InitialCountdownValue = GetWatchdogTimer.InitialCountdownValue; + SetWatchdogTimer.TimerUse.Bits.TimerRunning = 1; + SetWatchdogTimer.TimerUseExpirationFlagsClear |= BIT1 | BIT2 | BIT3; + + Status = IpmiSetWatchdogTimer (&SetWatchdogTimer, &CompletionCode); + + return Status; +} + +EFI_STATUS +ReportFrb2Status ( + VOID + ) +/*++ + + Routine Description: + This routine is built only when DEBUG_MODE is enabled. It is used + to report the status of FRB2 when the FRB2 driver is installed. + + Arguments: + none + + Returns: + EFI_SUCCESS: All info was retrieved and reported + EFI_ERROR: There was an error during info retrieval + +--*/ +{ + EFI_STATUS Status; + IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer; + + // + // Get the Watchdog timer info to find out what kind of timer expiration occurred. + // + Status = IpmiGetWatchdogTimer (&GetWatchdogTimer); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "Failed to get Watchdog Timer info from BMC.\n")); + return Status; + } + + // + // Check if timer is running, report status to DEBUG_MODE output. + // + if (GetWatchdogTimer.TimerUse.Bits.TimerRunning == 1) { + DEBUG ((DEBUG_INFO, "FRB2 Timer is running.\n")); + } else { + DEBUG ((DEBUG_INFO, "FRB2 Timer is not running.\n")); + } + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +FrbDxeEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + + Routine Description: + This is the standard EFI driver point. This function intitializes + the private data required for creating FRB Driver. + + Arguments: + ImageHandle - Handle for the image of this driver + SystemTable - Pointer to the EFI System Table + + Returns: + EFI_SUCCESS - Protocol successfully started and installed + EFI_UNSUPPORTED - Protocol can't be started + +--*/ +{ + EFI_EVENT ReadyToBootEvent; + EFI_STATUS Status; + + CheckForAndReportErrors(); + ReportFrb2Status (); + + // + // Register the event to Disable FRB2 before Boot. + // + Status = EfiCreateEventReadyToBootEx ( + TPL_NOTIFY, + DisableFRB2Handler, + NULL, + &ReadyToBootEvent + ); + + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.c new file mode 100644 index 0000000000..3e65eb9dad --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.c @@ -0,0 +1,84 @@ +/** @file + IPMI FRB PEIM. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +#include + +VOID +SetWatchDogTimer ( + IN BOOLEAN Frb2Enabled + ) +{ + EFI_STATUS Status; + IPMI_SET_WATCHDOG_TIMER_REQUEST FrbTimer; + IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer; + UINT8 CompletionCode; + + Status = IpmiGetWatchdogTimer (&GetWatchdogTimer); + if (EFI_ERROR(Status)) { + return ; + } + + if (Frb2Enabled) { + ZeroMem (&FrbTimer, sizeof(FrbTimer)); + //Byte 1 + FrbTimer.TimerUse.Bits.TimerUse = IPMI_WATCHDOG_TIMER_BIOS_FRB2; + //Byte 2 + FrbTimer.TimerActions.Uint8 = 0; //NormalBoot, NoTimeOutInterrupt. i.e no action when BMC watchdog timeout + //Byte 3 + FrbTimer.PretimeoutInterval = 0; + //Byte 4 + FrbTimer.TimerUseExpirationFlagsClear |= BIT1; //set Frb2ExpirationFlag + + //Data Byte 5/6 + FrbTimer.InitialCountdownValue = PcdGet16(PcdFRBTimeoutValue) * 10; + + //Set BMC watchdog timer + Status = IpmiSetWatchdogTimer (&FrbTimer, &CompletionCode); + Status = IpmiResetWatchdogTimer (&CompletionCode); + } +} + +EFI_STATUS +EFIAPI +InitializeFrbPei ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + +Arguments: + + FfsHeader + PeiServices + +Returns: + + EFI_SUCCESS + +--*/ +{ + BOOLEAN Frb2Enabled; + + // + // If we are booting with defaults, then make sure FRB2 is enabled. + // + Frb2Enabled = PcdGetBool (PcdFRB2EnabledFlag); + + SetWatchDogTimer (Frb2Enabled); + + return EFI_SUCCESS; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.c new file mode 100644 index 0000000000..58e1fb4d7e --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.c @@ -0,0 +1,67 @@ +/** @file + IPMI FRU Driver. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +InitializeFru ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize SM Redirection Fru Layer + +Arguments: + + ImageHandle - ImageHandle of the loaded driver + SystemTable - Pointer to the System Table + +Returns: + + EFI_STATUS + +--*/ +{ + EFI_STATUS Status; + IPMI_GET_DEVICE_ID_RESPONSE ControllerInfo; + IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST GetFruInventoryAreaInfoRequest; + IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE GetFruInventoryAreaInfoResponse; + + // + // Get all the SDR Records from BMC and retrieve the Record ID from the structure for future use. + // + Status = IpmiGetDeviceId (&ControllerInfo); + if (EFI_ERROR (Status)) { + DEBUG((DEBUG_ERROR, "!!! IpmiFru IpmiGetDeviceId Status=%x\n", Status)); + return Status; + } + + DEBUG((DEBUG_ERROR, "!!! IpmiFru FruInventorySupport %x\n", ControllerInfo.DeviceSupport.Bits.FruInventorySupport)); + + if (ControllerInfo.DeviceSupport.Bits.FruInventorySupport) { + GetFruInventoryAreaInfoRequest.DeviceId = 0; + Status = IpmiGetFruInventoryAreaInfo (&GetFruInventoryAreaInfoRequest, &GetFruInventoryAreaInfoResponse); + if (EFI_ERROR (Status)) { + DEBUG((DEBUG_ERROR, "!!! IpmiFru IpmiGetFruInventoryAreaInfo Status=%x\n", Status)); + return Status; + } + DEBUG((DEBUG_ERROR, "!!! IpmiFru InventoryAreaSize=%x\n", GetFruInventoryAreaInfoResponse.InventoryAreaSize)); + } + + return EFI_SUCCESS; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.c new file mode 100644 index 0000000000..0639c3b2a1 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.c @@ -0,0 +1,150 @@ +/** @file + IPMI stack initialization. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +#define BMC_TIMEOUT 30 // [s] How long shall BIOS wait for BMC +#define BMC_KCS_TIMEOUT 5 // [s] Single KSC request timeout + +EFI_STATUS +GetSelfTest ( + VOID + ) +/*++ + +Routine Description: + + Execute the Get Self Test results command to determine whether or not the BMC self tests + have passed + +Arguments: + + mIpmiInstance - Data structure describing BMC variables and used for sending commands + StatusCodeValue - An array used to accumulate error codes for later reporting. + ErrorCount - Counter used to keep track of error codes in StatusCodeValue + +Returns: + + EFI_SUCCESS - BMC Self test results are retrieved and saved into BmcStatus + EFI_DEVICE_ERROR - BMC failed to return self test results. + +--*/ +{ + EFI_STATUS Status; + IPMI_SELF_TEST_RESULT_RESPONSE TestResult; + + // + // Get the SELF TEST Results. + // + Status = IpmiGetSelfTestResult (&TestResult); + if (EFI_ERROR(Status)) { + DEBUG((DEBUG_ERROR, "\n[IPMI] BMC does not respond (status: %r)!\n\n", Status)); + return Status; + } + + DEBUG((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", TestResult.Result, TestResult.Param)); + + return EFI_SUCCESS; +} + +EFI_STATUS +GetDeviceId ( + OUT BOOLEAN *UpdateMode + ) +/*++ + +Routine Description: + Execute the Get Device ID command to determine whether or not the BMC is in Force Update + Mode. If it is, then report it to the error manager. + +Arguments: + +Returns: + Status + +--*/ +{ + EFI_STATUS Status; + IPMI_GET_DEVICE_ID_RESPONSE BmcInfo; + UINT32 Retries; + + // + // Set up a loop to retry for up to 30 seconds. Calculate retries not timeout + // so that in case KCS is not enabled and EfiIpmiSendCommand() returns + // immediately we will not wait all the 30 seconds. + // + Retries = BMC_TIMEOUT / BMC_KCS_TIMEOUT + 1; + // + // Get the device ID information for the BMC. + // + do { + Status = IpmiGetDeviceId (&BmcInfo); + if (!EFI_ERROR(Status)) { + break; + } + DEBUG ((DEBUG_ERROR, "[IPMI] BMC does not respond (status: %r), %d retries left\n", Status, Retries)); + MicroSecondDelay(50 * 1000); + if (Retries-- == 0) { + return Status; + } + } while (TRUE); + + DEBUG(( + DEBUG_INFO, + "[IPMI] BMC Device ID: 0x%02X, firmware version: %d.%02X\n", + BmcInfo.DeviceId, + BmcInfo.FirmwareRev1.Bits.MajorFirmwareRev, + BmcInfo.MinorFirmwareRev + )); + *UpdateMode = (BOOLEAN)BmcInfo.FirmwareRev1.Bits.UpdateMode; + return Status; +} + +/** + The entry point of the Ipmi DXE. + +@param[in] ImageHandle - Handle of this driver image +@param[in] SystemTable - Table containing standard EFI services + +@retval EFI_SUCCESS - Always success is returned even if KCS does not function + + **/ +EFI_STATUS +EFIAPI +IpmiInterfaceInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + BOOLEAN UpdateMode; + EFI_STATUS Status; + + DEBUG((DEBUG_ERROR,"IPMI Dxe:Get BMC Device Id\n")); + + // + // Get the Device ID and check if the system is in Force Update mode. + // + Status = GetDeviceId (&UpdateMode); + // + // Do not continue initialization if the BMC is in Force Update Mode. + // + if (!EFI_ERROR(Status) && !UpdateMode) { + // + // Get the SELF TEST Results. + // + GetSelfTest (); + } + + return EFI_SUCCESS; +} + + diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.c new file mode 100644 index 0000000000..062d20c44e --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.c @@ -0,0 +1,96 @@ +/** @file + IPMI stack initialization in PEI. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +#define BMC_TIMEOUT_PEI 50 // [s] How long shall BIOS wait for BMC +#define BMC_KCS_TIMEOUT 5 // [s] Single KSC request timeout + +EFI_STATUS +GetDeviceId ( + OUT BOOLEAN *UpdateMode + ) +/*++ + +Routine Description: + Execute the Get Device ID command to determine whether or not the BMC is in Force Update + Mode. If it is, then report it to the error manager. + +Arguments: + +Returns: + Status + +--*/ +{ + EFI_STATUS Status; + IPMI_GET_DEVICE_ID_RESPONSE BmcInfo; + UINT32 Retries; + + // + // Set up a loop to retry for up to 30 seconds. Calculate retries not timeout + // so that in case KCS is not enabled and EfiIpmiSendCommand() returns + // immediately we will not wait all the 30 seconds. + // + Retries = BMC_TIMEOUT_PEI/ BMC_KCS_TIMEOUT + 1; + // + // Get the device ID information for the BMC. + // + do { + Status = IpmiGetDeviceId (&BmcInfo); + if (!EFI_ERROR(Status)) { + break; + } + DEBUG ((DEBUG_ERROR, "[IPMI] BMC does not respond (status: %r), %d retries left\n", Status, Retries)); + if (Retries-- == 0) { + return Status; + } + } while (TRUE); + + DEBUG(( + DEBUG_INFO, + "[IPMI] BMC Device ID: 0x%02X, firmware version: %d.%02X\n", + BmcInfo.DeviceId, + BmcInfo.FirmwareRev1.Bits.MajorFirmwareRev, + BmcInfo.MinorFirmwareRev + )); + *UpdateMode = (BOOLEAN)BmcInfo.FirmwareRev1.Bits.UpdateMode; + return Status; +} + +/** + The entry point of the Ipmi PEIM. + + @param FileHandle Handle of the file being invoked. + @param PeiServices Describes the list of possible PEI Services. + + @retval EFI_SUCCESS Indicates that Ipmi initialization completed successfully. + @retval Others Indicates that Ipmi initialization could not complete successfully. +**/ +EFI_STATUS +EFIAPI +PeimIpmiInterfaceInit ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + BOOLEAN UpdateMode; + EFI_STATUS Status; + + DEBUG ((DEBUG_INFO, "IPMI Peim:Get BMC Device Id\n")); + + // + // Get the Device ID and check if the system is in Force Update mode. + // + Status = GetDeviceId (&UpdateMode); + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.c new file mode 100644 index 0000000000..6d6cb21d08 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.c @@ -0,0 +1,112 @@ +/** @file + IPMI Os watchdog timer Driver. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +BOOLEAN mOsWdtFlag = FALSE; + +EFI_EVENT mExitBootServicesEvent; + +VOID +EFIAPI +EnableEfiOsBootWdtHandler ( + IN EFI_EVENT Event, + IN VOID *Context + ) +/*++ + +Routine Description: + Enable the OS Boot Watchdog Timer. + Is called only on legacy or EFI OS boot. + +Arguments: + Event - Event type + *Context - Context for the event + +Returns: + None + +--*/ +{ + EFI_STATUS Status; + IPMI_SET_WATCHDOG_TIMER_REQUEST SetWatchdogTimer; + UINT8 CompletionCode; + IPMI_GET_WATCHDOG_TIMER_RESPONSE GetWatchdogTimer; + static BOOLEAN OsWdtEventHandled = FALSE; + + DEBUG((DEBUG_ERROR, "!!! EnableEfiOsBootWdtHandler()!!!\n")); + + // + // Make sure it processes once only. And proceess it only if OsWdtFlag==TRUE; + // + if (OsWdtEventHandled || !mOsWdtFlag) { + return ; + } + + OsWdtEventHandled = TRUE; + + Status = IpmiGetWatchdogTimer (&GetWatchdogTimer); + if (EFI_ERROR (Status)) { + return ; + } + + ZeroMem (&SetWatchdogTimer, sizeof(SetWatchdogTimer)); + // + // Just flip the Timer Use bit. This should release the timer. + // + SetWatchdogTimer.TimerUse.Bits.TimerRunning = 1; + SetWatchdogTimer.TimerUse.Bits.TimerUse = IPMI_WATCHDOG_TIMER_OS_LOADER; + SetWatchdogTimer.TimerActions.Uint8 = IPMI_WATCHDOG_TIMER_ACTION_HARD_RESET; + SetWatchdogTimer.TimerUseExpirationFlagsClear &= ~BIT4; + SetWatchdogTimer.TimerUseExpirationFlagsClear |= BIT1 | BIT2; + SetWatchdogTimer.InitialCountdownValue = 600; // 100ms / count + + Status = IpmiSetWatchdogTimer (&SetWatchdogTimer, &CompletionCode); + return ; +} + +EFI_STATUS +EFIAPI +DriverInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + This is the standard EFI driver point. This function intitializes + the private data required for creating ASRR Driver. + +Arguments: + As required for DXE driver enrty routine. + ImageHandle - ImageHandle of the loaded driver + SystemTable - Pointer to the System Table + +Returns: + @retval EFI_SUCCESS Protocol successfully started and installed. + @retval EFI_OUT_OF_RESOURCES The event could not be allocated. + +--*/ +{ + EFI_STATUS Status; + + Status = gBS->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, + TPL_NOTIFY, + EnableEfiOsBootWdtHandler, + NULL, + &mExitBootServicesEvent + ); + + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.c new file mode 100644 index 0000000000..0e3c538d8c --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.c @@ -0,0 +1,164 @@ +/** @file + IPMI Serial Over Lan Driver. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SOL_CMD_RETRY_COUNT 10 + +/*++ + +Routine Description: + + This routine gets the SOL payload status or settings for a specific channel. + +Arguments: + Channel - LAN channel naumber. + ParamSel - Configuration parameter selection. + Data - Information returned from BMC. +Returns: + EFI_SUCCESS - SOL configuration parameters are successfully read from BMC. + Others - SOL configuration parameters could not be read from BMC. + +--*/ +EFI_STATUS +GetSOLStatus ( + IN UINT8 Channel, + IN UINT8 ParamSel, + IN OUT UINT8 *Data + ) +{ + EFI_STATUS Status = EFI_SUCCESS; + IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST GetConfigurationParametersRequest; + IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE GetConfigurationParametersResponse; + UINT32 DataSize; + UINT8 RetryCount; + + for (RetryCount = 0; RetryCount < SOL_CMD_RETRY_COUNT; RetryCount++) { + ZeroMem (&GetConfigurationParametersRequest, sizeof(GetConfigurationParametersRequest)); + GetConfigurationParametersRequest.ChannelNumber.Bits.ChannelNumber = Channel; + GetConfigurationParametersRequest.ParameterSelector = ParamSel; + + ZeroMem (&GetConfigurationParametersResponse, sizeof(GetConfigurationParametersResponse)); + + DataSize = sizeof(GetConfigurationParametersResponse); + Status = IpmiGetSolConfigurationParameters ( + &GetConfigurationParametersRequest, + &GetConfigurationParametersResponse, + &DataSize + ); + + if (Status == EFI_SUCCESS){ + break; + } else { + gBS->Stall(100000); + } + } + + if (Status == EFI_SUCCESS) { + *Data = GetConfigurationParametersResponse.ParameterData[0]; + } + + return Status; +} + +/*++ + +Routine Description: + + This routine sets the SOL payload configuration parameters for a specific channel. + +Arguments: + Channel - LAN channel naumber. + ParamSel - Configuration parameter selection. + Data - Configuration parameter values. +Returns: + EFI_SUCCESS - SOL configuration parameters are sent to BMC. + Others - SOL configuration parameters could not be sent to BMC. + +--*/ +EFI_STATUS +SetSOLParams ( + IN UINT8 Channel, + IN UINT8 ParamSel, + IN UINT8 Data + ) +{ + EFI_STATUS Status = EFI_SUCCESS; + IPMI_SET_SOL_CONFIGURATION_PARAMETERS_REQUEST SetConfigurationParametersRequest; + UINT8 CompletionCode; + UINT8 RetryCount; + + for (RetryCount = 0; RetryCount < SOL_CMD_RETRY_COUNT; RetryCount++) { + ZeroMem (&SetConfigurationParametersRequest, sizeof(SetConfigurationParametersRequest)); + SetConfigurationParametersRequest.ChannelNumber.Bits.ChannelNumber = Channel; + SetConfigurationParametersRequest.ParameterSelector = ParamSel; + SetConfigurationParametersRequest.ParameterData[0] = Data; + + CompletionCode = 0; + + Status = IpmiSetSolConfigurationParameters ( + &SetConfigurationParametersRequest, + sizeof(SetConfigurationParametersRequest), + &CompletionCode + ); + + if (Status == EFI_SUCCESS) { + break; + } else { + gBS->Stall(100000); + } + } + + return Status; +} + +EFI_STATUS +EFIAPI +SolStatusEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + + Routine Description: + This is the standard EFI driver point. This function initializes + the private data required for creating SOL Status Driver. + + Arguments: + ImageHandle - Handle for the image of this driver + SystemTable - Pointer to the EFI System Table + + Returns: + EFI_SUCCESS - Protocol successfully installed + EFI_UNSUPPORTED - Protocol can't be installed. + +--*/ +{ + EFI_STATUS Status = EFI_SUCCESS; + UINT8 Channel; + BOOLEAN SolEnabled = FALSE; + + for (Channel = 1; Channel <= PcdGet8 (PcdMaxSOLChannels); Channel++) { + Status = GetSOLStatus (Channel, IPMI_SOL_CONFIGURATION_PARAMETER_SOL_ENABLE, &SolEnabled); + if (Status == EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "SOL enabling status for channel %x is %x\n", Channel, SolEnabled)); + } else { + DEBUG ((DEBUG_ERROR, "Failed to get channel %x SOL status from BMC!, status is %x\n", Channel, Status)); + } + } + + return Status; +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/BmcSsdt.asl b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/BmcSsdt.asl new file mode 100644 index 0000000000..2194e6a88c --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/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 signifies that integers + // declared within the Definition Block are to be evaluated as 64-bit values + "INTEL", // OEM ID (6 byte string) + "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/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/IpmiOprRegions.asi b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/IpmiOprRegions.asi new file mode 100644 index 0000000000..ffd6af3944 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/IpmiOprRegions.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] = Plug and Play BMC Detection enabled in setup + // [31:01] = Reserved = 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 the 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) + + -- 2.16.2.windows.1