diff options
author | Abner Chang <abner.chang@amd.com> | 2023-03-03 09:34:46 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-03-26 18:15:27 +0000 |
commit | 69e59545b14739e004d3f0452411e195d2a3c197 (patch) | |
tree | 2e22249753a4db9deafa3d3f95e5628ff49c9e13 /MdePkg/Include/IndustryStandard | |
parent | 2c93253c95dbbc161650dfaeccaa3d866a2e29f2 (diff) | |
download | edk2-69e59545b14739e004d3f0452411e195d2a3c197.zip edk2-69e59545b14739e004d3f0452411e195d2a3c197.tar.gz edk2-69e59545b14739e004d3f0452411e195d2a3c197.tar.bz2 |
MdePkg/Include: Add IPMI KCS definitions
BZ #4354
This change adds definitions for IPMI KCS.
Spec ref:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html
Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Acked-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
Diffstat (limited to 'MdePkg/Include/IndustryStandard')
-rw-r--r-- | MdePkg/Include/IndustryStandard/IpmiKcs.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/MdePkg/Include/IndustryStandard/IpmiKcs.h b/MdePkg/Include/IndustryStandard/IpmiKcs.h new file mode 100644 index 0000000..b4f9b51 --- /dev/null +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h @@ -0,0 +1,76 @@ +/** @file
+ IPMI KCS Register Definitions
+
+ Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+ @par Revision Reference:
+ IPMI Specification
+ Version 2.0, Rev. 1.1
+ https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html
+**/
+
+#ifndef IPMI_KCS_H_
+#define IPMI_KCS_H_
+
+#define IPMI_KCS_STATUS_REGISTER_OFFSET 1
+#define IPMI_KCS_COMMAND_REGISTER_OFFSET 1
+#define IPMI_KCS_DATA_OUT_REGISTER_OFFSET 0
+#define IPMI_KCS_DATA_IN_REGISTER_OFFSET 0
+
+///
+/// IPMI KCS Interface Status Bits
+///
+#define IPMI_KCS_OBF BIT0
+#define IPMI_KCS_IBF BIT1
+#define IPMI_KCS_SMS_ATN BIT2
+#define IPMI_KCS_COMMAND_DATA BIT3
+#define IPMI_KCS_OEM1 BIT4
+#define IPMI_KCS_OEM2 BIT5
+#define IPMI_KCS_S0 BIT6
+#define IPMI_KCS_S1 BIT7
+
+///
+/// IPMI KCS Interface Control Codes
+///
+#define IPMI_KCS_CONTROL_CODE_GET_STATUS_ABORT 0x60
+#define IPMI_KCS_CONTROL_CODE_WRITE_START 0x61
+#define IPMI_KCS_CONTROL_CODE_WRITE_END 0x62
+#define IPMI_KCS_CONTROL_CODE_READ 0x68
+
+///
+/// Status Codes
+///
+#define IPMI_KCS_STATUS_NO_ERROR 0x00
+#define IPMI_KCS_STATUS_ABORT 0x01
+#define IPMI_KCS_STATUS_ILLEGAL 0x02
+#define IPMI_KCS_STATUS_LENGTH_ERROR 0x06
+#define IPMI_KCS_STATUS_UNSPECIFIED 0xFF
+
+///
+/// KCS Interface State Bit
+///
+typedef enum {
+ IpmiKcsIdleState = 0,
+ IpmiKcsReadState,
+ IpmiKcsWriteState,
+ IpmiKcsErrorState
+} IPMI_KCS_STATE;
+
+///
+/// IPMI KCS Interface Request Format
+///
+typedef struct {
+ UINT8 NetFunc;
+ UINT8 Command;
+ UINT8 Data[];
+} IPMI_KCS_REQUEST_HEADER;
+
+///
+/// IPMI KCS Interface Response Format
+///
+typedef struct {
+ UINT8 NetFunc;
+ UINT8 Command;
+} IPMI_KCS_RESPONSE_HEADER;
+#endif
|