public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Tinh Nguyen" <tinhnguyen@os.amperecomputing.com>
To: devel@edk2.groups.io
Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com,
	abner.chang@amd.com,
	Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
Subject: [PATCH v4 1/3] MdePkg/IndustryStandard: Add definitions for IPMI SSIF
Date: Sun,  7 May 2023 16:29:11 +0700	[thread overview]
Message-ID: <20230507092913.2109108-2-tinhnguyen@os.amperecomputing.com> (raw)
In-Reply-To: <20230507092913.2109108-1-tinhnguyen@os.amperecomputing.com>

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>
---
 MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 ++++++++++++++++++++
 1 file changed, 98 insertions(+)

diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h b/MdePkg/Include/IndustryStandard/IpmiSsif.h
new file mode 100644
index 000000000000..a5bfa14a9dfa
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiSsif.h
@@ -0,0 +1,98 @@
+/** @file
+  IPMI SSIF Definitions
+
+  Copyright (c) 2023, Ampere Computing LLC. 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_SSIF_H_
+#define IPMI_SSIF_H_
+
+///
+/// Definitions for SMBUS Commands for SSIF
+/// Table 12 - Summary of SMBUS Commands for SSIF
+///
+
+/// Write block
+#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE        0x02
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START   0x06
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_MIDDLE  0x07
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_END     0x08
+
+/// Read block
+#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_READ        0x03
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_START   0x03
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_MIDDLE  0x09
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_END     0x09
+#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_RETRY   0x0A
+
+///
+/// Definitions for Multi-Part Read Transactions
+/// Section 12.5
+///
+#define IPMI_SSIF_MULTI_PART_READ_START_SIZE      0x1E
+#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN1  0x00
+#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN2  0x01
+#define IPMI_SSIF_MULTI_PART_READ_END_PATTERN     0xFF
+
+///
+/// IPMI SSIF maximum message size
+///
+#define IPMI_SSIF_INPUT_MESSAGE_SIZE_MAX   0xFF
+#define IPMI_SSIF_OUTPUT_MESSAGE_SIZE_MAX  0xFF
+
+///
+/// IPMI SMBus system interface maximum packet size in byte
+///
+#define IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES  0x20
+
+typedef enum {
+  IpmiSsifPacketStart = 0,
+  IpmiSsifPacketMiddle,
+  IpmiSsifPacketEnd,
+  IpmiSsifPacketSingle,
+  IpmiSsifPacketMax
+} IPMI_SSIF_PACKET_ATTRIBUTE;
+
+#pragma pack (1)
+///
+/// IPMI SSIF Interface Request Format
+/// Section 12.2 and 12.3
+///
+typedef struct {
+  UINT8    NetFunc;
+  UINT8    Command;
+} IPMI_SSIF_REQUEST_HEADER;
+
+///
+/// IPMI SSIF Interface Response Format
+/// Section 12.4 and 12.5
+///
+typedef struct {
+  UINT8    StartPattern[2];
+  UINT8    NetFunc;
+  UINT8    Command;
+} IPMI_SSIF_RESPONSE_PACKET_START;
+
+typedef struct {
+  UINT8    BlockNumber;
+} IPMI_SSIF_RESPONSE_PACKET_MIDDLE;
+
+typedef struct {
+  UINT8    EndPattern;
+} IPMI_SSIF_RESPONSE_PACKET_END;
+
+typedef struct {
+  UINT8    NetFunc;
+  UINT8    Command;
+} IPMI_SSIF_RESPONSE_SINGLE_PACKET;
+
+#pragma pack ()
+
+#endif /* IPMI_SSIF_H_ */
-- 
2.40.0


  reply	other threads:[~2023-05-07  9:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07  9:29 [PATCH v4 0/3] Add IPMI SSIF definitions Tinh Nguyen
2023-05-07  9:29 ` Tinh Nguyen [this message]
2023-05-07  9:29 ` [PATCH v4 2/3] MdePkg: Add new PCDs for IPMI SSIF Tinh Nguyen
2023-05-07  9:29 ` [PATCH v4 3/3] MdePkg/IndustryStandard: Add IPMI Interface Capabilities definitions Tinh Nguyen
2023-05-08  1:07 ` 回复: [PATCH v4 0/3] Add IPMI SSIF definitions gaoliming
2023-05-12  8:49   ` Tinh Nguyen
2023-05-12  9:16     ` Chang, Abner
2023-05-12  9:34       ` Tinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230507092913.2109108-2-tinhnguyen@os.amperecomputing.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox