]> xenbits.xensource.com Git - ovmf.git/commitdiff
MdePkg/IndustryStandard: Add definitions for IPMI SSIF
authorTinh Nguyen <tinhnguyen@os.amperecomputing.com>
Sun, 7 May 2023 09:29:11 +0000 (17:29 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 12 May 2023 04:00:18 +0000 (04:00 +0000)
BZ#: 4434 - Add IPMI SSIF definitions.

Specification reference:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.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: Abner Chang <abner.chang@amd.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdePkg/Include/IndustryStandard/IpmiSsif.h [new file with mode: 0644]

diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h b/MdePkg/Include/IndustryStandard/IpmiSsif.h
new file mode 100644 (file)
index 0000000..a5bfa14
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+  IPMI SSIF Definitions\r
+\r
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+  @par Revision Reference:\r
+    - IPMI Specification\r
+      Version 2.0, Rev. 1.1\r
+\r
+  https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html\r
+**/\r
+\r
+#ifndef IPMI_SSIF_H_\r
+#define IPMI_SSIF_H_\r
+\r
+///\r
+/// Definitions for SMBUS Commands for SSIF\r
+/// Table 12 - Summary of SMBUS Commands for SSIF\r
+///\r
+\r
+/// Write block\r
+#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE        0x02\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START   0x06\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_MIDDLE  0x07\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_END     0x08\r
+\r
+/// Read block\r
+#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_READ        0x03\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_START   0x03\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_MIDDLE  0x09\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_END     0x09\r
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_RETRY   0x0A\r
+\r
+///\r
+/// Definitions for Multi-Part Read Transactions\r
+/// Section 12.5\r
+///\r
+#define IPMI_SSIF_MULTI_PART_READ_START_SIZE      0x1E\r
+#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN1  0x00\r
+#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN2  0x01\r
+#define IPMI_SSIF_MULTI_PART_READ_END_PATTERN     0xFF\r
+\r
+///\r
+/// IPMI SSIF maximum message size\r
+///\r
+#define IPMI_SSIF_INPUT_MESSAGE_SIZE_MAX   0xFF\r
+#define IPMI_SSIF_OUTPUT_MESSAGE_SIZE_MAX  0xFF\r
+\r
+///\r
+/// IPMI SMBus system interface maximum packet size in byte\r
+///\r
+#define IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES  0x20\r
+\r
+typedef enum {\r
+  IpmiSsifPacketStart = 0,\r
+  IpmiSsifPacketMiddle,\r
+  IpmiSsifPacketEnd,\r
+  IpmiSsifPacketSingle,\r
+  IpmiSsifPacketMax\r
+} IPMI_SSIF_PACKET_ATTRIBUTE;\r
+\r
+#pragma pack (1)\r
+///\r
+/// IPMI SSIF Interface Request Format\r
+/// Section 12.2 and 12.3\r
+///\r
+typedef struct {\r
+  UINT8    NetFunc;\r
+  UINT8    Command;\r
+} IPMI_SSIF_REQUEST_HEADER;\r
+\r
+///\r
+/// IPMI SSIF Interface Response Format\r
+/// Section 12.4 and 12.5\r
+///\r
+typedef struct {\r
+  UINT8    StartPattern[2];\r
+  UINT8    NetFunc;\r
+  UINT8    Command;\r
+} IPMI_SSIF_RESPONSE_PACKET_START;\r
+\r
+typedef struct {\r
+  UINT8    BlockNumber;\r
+} IPMI_SSIF_RESPONSE_PACKET_MIDDLE;\r
+\r
+typedef struct {\r
+  UINT8    EndPattern;\r
+} IPMI_SSIF_RESPONSE_PACKET_END;\r
+\r
+typedef struct {\r
+  UINT8    NetFunc;\r
+  UINT8    Command;\r
+} IPMI_SSIF_RESPONSE_SINGLE_PACKET;\r
+\r
+#pragma pack ()\r
+\r
+#endif /* IPMI_SSIF_H_ */\r