public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Add IPMI SSIF definitions
@ 2023-04-28  3:59 Tinh Nguyen
  2023-04-28  3:59 ` [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Tinh Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Tinh Nguyen @ 2023-04-28  3:59 UTC (permalink / raw)
  To: devel
  Cc: patches, michael.d.kinney, gaoliming, zhiguang.liu, abner.chang,
	Tinh Nguyen

The first of a series of patches for IPMI SSIF support.

Tinh Nguyen (2):
  MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions

 MdePkg/MdePkg.dec                              | 26 ++++++
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 +++++++
 MdePkg/Include/IndustryStandard/IpmiSsif.h     | 98 ++++++++++++++++++++
 3 files changed, 155 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h

--
2.40.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  2023-04-28  3:59 [PATCH 0/2] Add IPMI SSIF definitions Tinh Nguyen
@ 2023-04-28  3:59 ` Tinh Nguyen
  2023-04-28  5:17   ` 回复: " gaoliming
  2023-04-29  3:22   ` Chang, Abner
  2023-04-28  3:59 ` [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions Tinh Nguyen
  2023-04-29  3:35 ` [PATCH 0/2] Add IPMI SSIF definitions Chang, Abner
  2 siblings, 2 replies; 13+ messages in thread
From: Tinh Nguyen @ 2023-04-28  3:59 UTC (permalink / raw)
  To: devel
  Cc: patches, michael.d.kinney, gaoliming, zhiguang.liu, abner.chang,
	Tinh Nguyen

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>
---
 MdePkg/MdePkg.dec                          | 26 ++++++
 MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 ++++++++++++++++++++
 2 files changed, 124 insertions(+)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 7488ccda7a00..518e4200e9af 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -10,6 +10,7 @@
 # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
 # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
 # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule]
   # @Prompt IPMI KCS Interface I/O Base Address
   gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00000031
 
+  ## This is SMBus slave address for the SSIF to the BMC.
+  #  The recommended value defined by IPMI specification is 0x20 (section 12.12).
+  # @Prompt IPMI SSIF SMBus slave address
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x00000032
+
+  ## This is the maximum number of IPMI SSIF request retries.
+  #  The IPMI specification specified min value is 5 (section 12.17).
+  # @Prompt Number of IPMI SSIF request retries.
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0x00000033
+
+  ## This is the required interval for each IPMI request retry.
+  #  The IPMI specification specified a time range of 60ms to 250ms (section 12.17).
+  #  The default setting is min.
+  # @Prompt Time between IPMI SSIF request retries.
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT32|0x00000034
+
+  ## This value is the maximum retries of an IPMI SSIF response
+  # @Prompt Number of IPMI SSIF response retries.
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0x00000035
+
+  ## This is the required interval for each IPMI response retry.
+  #  The IPMI specification specified min value is 60ms (section 12.17).
+  # @Prompt Time-out for a response, internal
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT32|0x00000036
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This value is used to set the base address of PCI express hierarchy.
   # @Prompt PCI Express Base Address.
diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h b/MdePkg/Include/IndustryStandard/IpmiSsif.h
new file mode 100644
index 000000000000..4a97438109a9
--- /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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions
  2023-04-28  3:59 [PATCH 0/2] Add IPMI SSIF definitions Tinh Nguyen
  2023-04-28  3:59 ` [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Tinh Nguyen
@ 2023-04-28  3:59 ` Tinh Nguyen
  2023-04-28  5:41   ` 回复: " gaoliming
  2023-04-29  3:32   ` Chang, Abner
  2023-04-29  3:35 ` [PATCH 0/2] Add IPMI SSIF definitions Chang, Abner
  2 siblings, 2 replies; 13+ messages in thread
From: Tinh Nguyen @ 2023-04-28  3:59 UTC (permalink / raw)
  To: devel
  Cc: patches, michael.d.kinney, gaoliming, zhiguang.liu, abner.chang,
	Tinh Nguyen

This adds more definitions for the IPMI Get System Interface
Capabilities command.

Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
---
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index a5835ba08c00..933303b0fa2c 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -13,6 +13,7 @@
 
   Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
   Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -1046,6 +1047,36 @@ typedef struct {
 //  Constants and Structure definitions for "Get System Interface Capabilities" command to follow here
 //
 
+#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF  0x0
+#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_KCS   0x1
+#define IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SMIC  0x2
+
+typedef union {
+  struct {
+    UINT8    InterfaceType : 4;
+    UINT8    Reserved      : 4;
+  } Bits;
+  UINT8    Uint8;
+} IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST;
+
+typedef union {
+  struct {
+    UINT8    Version            : 3;
+    UINT8    PecSupport         : 1;
+    UINT8    Reserved           : 2;
+    UINT8    TransactionSupport : 2;
+  } Bits;
+  UINT8    Uint8;
+} IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES;
+
+typedef struct {
+  UINT8                                      CompletionCode;
+  UINT8                                      Reserved;
+  IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES    InterfaceCap;
+  UINT8                                      InputMsgSize;
+  UINT8                                      OutputMsgSize;
+} IPMI_GET_SYSTEM_INTERFACE_SSIF_CAPABILITIES_RESPONSE;
+
 //
 //  Definitions for Get System Interface Capabilities command SSIF transaction support
 //
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* 回复: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  2023-04-28  3:59 ` [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Tinh Nguyen
@ 2023-04-28  5:17   ` gaoliming
  2023-04-28  9:01     ` Tinh Nguyen
  2023-04-29  3:22   ` Chang, Abner
  1 sibling, 1 reply; 13+ messages in thread
From: gaoliming @ 2023-04-28  5:17 UTC (permalink / raw)
  To: 'Tinh Nguyen', devel
  Cc: patches, michael.d.kinney, zhiguang.liu, abner.chang

Tinh:
  I suggest to separate this patch. The header file follows the industry
standard. New PCDs in DEC are for EDK2 implementation. They are different
changes. Please separate them. 

Thanks
Liming
> -----邮件原件-----
> 发件人: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> 发送时间: 2023年4月28日 12:00
> 收件人: devel@edk2.groups.io
> 抄送: 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>
> 主题: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
> 
> Specification reference:
> https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ip
> mi-second-gen-interface-spec-v2-rev1-1.html
> 
> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> ---
>  MdePkg/MdePkg.dec                          | 26 ++++++
>  MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 ++++++++++++++++++++
>  2 files changed, 124 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 7488ccda7a00..518e4200e9af 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -10,6 +10,7 @@
>  # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.<BR>
>  # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
>  # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
reserved.<BR>
> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule]
>    # @Prompt IPMI KCS Interface I/O Base Address
> 
> gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x000
> 00031
> 
> +  ## This is SMBus slave address for the SSIF to the BMC.
> +  #  The recommended value defined by IPMI specification is 0x20 (section
> 12.12).
> +  # @Prompt IPMI SSIF SMBus slave address
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x000000
> 32
> +
> +  ## This is the maximum number of IPMI SSIF request retries.
> +  #  The IPMI specification specified min value is 5 (section 12.17).
> +  # @Prompt Number of IPMI SSIF request retries.
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0x0
> 0000033
> +
> +  ## This is the required interval for each IPMI request retry.
> +  #  The IPMI specification specified a time range of 60ms to 250ms
> (section 12.17).
> +  #  The default setting is min.
> +  # @Prompt Time between IPMI SSIF request retries.
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT32
> |0x00000034
> +
> +  ## This value is the maximum retries of an IPMI SSIF response
> +  # @Prompt Number of IPMI SSIF response retries.
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0x0
> 0000035
> +
> +  ## This is the required interval for each IPMI response retry.
> +  #  The IPMI specification specified min value is 60ms (section 12.17).
> +  # @Prompt Time-out for a response, internal
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT3
> 2|0x00000036
> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>    ## This value is used to set the base address of PCI express hierarchy.
>    # @Prompt PCI Express Base Address.
> diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h
> b/MdePkg/Include/IndustryStandard/IpmiSsif.h
> new file mode 100644
> index 000000000000..4a97438109a9
> --- /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/ip
> mi-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




^ permalink raw reply	[flat|nested] 13+ messages in thread

* 回复: [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions
  2023-04-28  3:59 ` [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions Tinh Nguyen
@ 2023-04-28  5:41   ` gaoliming
  2023-04-29  3:32   ` Chang, Abner
  1 sibling, 0 replies; 13+ messages in thread
From: gaoliming @ 2023-04-28  5:41 UTC (permalink / raw)
  To: 'Tinh Nguyen', devel
  Cc: patches, michael.d.kinney, zhiguang.liu, abner.chang

Tinh:
  Please use the specific word in the subject. For example, add Capabilities
definitions.

> -----邮件原件-----
> 发件人: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> 发送时间: 2023年4月28日 12:00
> 收件人: devel@edk2.groups.io
> 抄送: 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>
> 主题: [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more
> definitions
> 
> This adds more definitions for the IPMI Get System Interface
> Capabilities command.
> 
> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> ---
>  MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31
> ++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> index a5835ba08c00..933303b0fa2c 100644
> --- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> @@ -13,6 +13,7 @@
> 
>    Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
>    Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
reserved.<BR>
> +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>  **/
> 
> @@ -1046,6 +1047,36 @@ typedef struct {
>  //  Constants and Structure definitions for "Get System Interface
> Capabilities" command to follow here
>  //
> 
> +#define
> IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF  0x0
> +#define
> IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_KCS   0x1
> +#define
> IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SMIC  0x2
> +

KCS and SMIC type are added. Can you also add KCS and SMIC Capabilities
definitions? 

Thanks
Liming
> +typedef union {
> +  struct {
> +    UINT8    InterfaceType : 4;
> +    UINT8    Reserved      : 4;
> +  } Bits;
> +  UINT8    Uint8;
> +} IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST;
> +
> +typedef union {
> +  struct {
> +    UINT8    Version            : 3;
> +    UINT8    PecSupport         : 1;
> +    UINT8    Reserved           : 2;
> +    UINT8    TransactionSupport : 2;
> +  } Bits;
> +  UINT8    Uint8;
> +} IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES;
> +
> +typedef struct {
> +  UINT8                                      CompletionCode;
> +  UINT8                                      Reserved;
> +  IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES    InterfaceCap;
> +  UINT8                                      InputMsgSize;
> +  UINT8                                      OutputMsgSize;
> +} IPMI_GET_SYSTEM_INTERFACE_SSIF_CAPABILITIES_RESPONSE;
> +
>  //
>  //  Definitions for Get System Interface Capabilities command SSIF
> transaction support
>  //
> --
> 2.40.0




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  2023-04-28  5:17   ` 回复: " gaoliming
@ 2023-04-28  9:01     ` Tinh Nguyen
  0 siblings, 0 replies; 13+ messages in thread
From: Tinh Nguyen @ 2023-04-28  9:01 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io
  Cc: Open Source Submission, michael.d.kinney@intel.com,
	zhiguang.liu@intel.com, abner.chang@amd.com

[-- Attachment #1: Type: text/plain, Size: 7099 bytes --]

Hi Gao,

Thanks for your feedback. I will separate it in v2.

Thanks,
Tinh
________________________________
From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Friday, April 28, 2023 12:17 PM
To: Tinh Nguyen OS <tinhnguyen@os.amperecomputing.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Open Source Submission <patches@amperecomputing.com>; michael.d.kinney@intel.com <michael.d.kinney@intel.com>; zhiguang.liu@intel.com <zhiguang.liu@intel.com>; abner.chang@amd.com <abner.chang@amd.com>
Subject: 回复: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF

Tinh:
  I suggest to separate this patch. The header file follows the industry
standard. New PCDs in DEC are for EDK2 implementation. They are different
changes. Please separate them.

Thanks
Liming
> -----邮件原件-----
> 发件人: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> 发送时间: 2023年4月28日 12:00
> 收件人: devel@edk2.groups.io
> 抄送: 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>
> 主题: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
>
> Specification reference:
> https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ip
> mi-second-gen-interface-spec-v2-rev1-1.html
>
> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> ---
>  MdePkg/MdePkg.dec                          | 26 ++++++
>  MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 ++++++++++++++++++++
>  2 files changed, 124 insertions(+)
>
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 7488ccda7a00..518e4200e9af 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -10,6 +10,7 @@
>  # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.<BR>
>  # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
>  # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
reserved.<BR>
> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule]
>    # @Prompt IPMI KCS Interface I/O Base Address
>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x000
> 00031
>
> +  ## This is SMBus slave address for the SSIF to the BMC.
> +  #  The recommended value defined by IPMI specification is 0x20 (section
> 12.12).
> +  # @Prompt IPMI SSIF SMBus slave address
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x000000
> 32
> +
> +  ## This is the maximum number of IPMI SSIF request retries.
> +  #  The IPMI specification specified min value is 5 (section 12.17).
> +  # @Prompt Number of IPMI SSIF request retries.
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0x0
> 0000033
> +
> +  ## This is the required interval for each IPMI request retry.
> +  #  The IPMI specification specified a time range of 60ms to 250ms
> (section 12.17).
> +  #  The default setting is min.
> +  # @Prompt Time between IPMI SSIF request retries.
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT32
> |0x00000034
> +
> +  ## This value is the maximum retries of an IPMI SSIF response
> +  # @Prompt Number of IPMI SSIF response retries.
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0x0
> 0000035
> +
> +  ## This is the required interval for each IPMI response retry.
> +  #  The IPMI specification specified min value is 60ms (section 12.17).
> +  # @Prompt Time-out for a response, internal
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT3
> 2|0x00000036
> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>    ## This value is used to set the base address of PCI express hierarchy.
>    # @Prompt PCI Express Base Address.
> diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h
> b/MdePkg/Include/IndustryStandard/IpmiSsif.h
> new file mode 100644
> index 000000000000..4a97438109a9
> --- /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/ip
> mi-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




[-- Attachment #2: Type: text/html, Size: 11007 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  2023-04-28  3:59 ` [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Tinh Nguyen
  2023-04-28  5:17   ` 回复: " gaoliming
@ 2023-04-29  3:22   ` Chang, Abner
  2023-05-02  8:09     ` Tinh Nguyen
  1 sibling, 1 reply; 13+ messages in thread
From: Chang, Abner @ 2023-04-29  3:22 UTC (permalink / raw)
  To: Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

[AMD Official Use Only - General]


Hi Tinh,
Below is my comments,

> -----Original Message-----
> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> Sent: Friday, April 28, 2023 12:00 PM
> To: devel@edk2.groups.io
> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
> <Abner.Chang@amd.com>; Tinh Nguyen
> <tinhnguyen@os.amperecomputing.com>
> Subject: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI
> SSIF
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Specification reference:
> https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i
> pmi-second-gen-interface-spec-v2-rev1-1.html
> 
> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> ---
>  MdePkg/MdePkg.dec                          | 26 ++++++
>  MdePkg/Include/IndustryStandard/IpmiSsif.h | 98
> ++++++++++++++++++++
>  2 files changed, 124 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> 7488ccda7a00..518e4200e9af 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -10,6 +10,7 @@
>  # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.<BR>  # Copyright (c) 2021 - 2022, Arm Limited. All rights
> reserved.<BR>  # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> reserved.<BR>
> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2353,6 +2354,31 @@
> [PcdsFixedAtBuild,PcdsPatchableInModule]
>    # @Prompt IPMI KCS Interface I/O Base Address
> 
> gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00
> 000031
> 
> +  ## This is SMBus slave address for the SSIF to the BMC.
> +  #  The recommended value defined by IPMI specification is 0x20 (section
> 12.12).
> +  # @Prompt IPMI SSIF SMBus slave address
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x00000
> 032
> +
> +  ## This is the maximum number of IPMI SSIF request retries.
> +  #  The IPMI specification specified min value is 5 (section 12.17).
> +  # @Prompt Number of IPMI SSIF request retries.
> +
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0
> x000
> + 00033
> +
> +  ## This is the required interval for each IPMI request retry.
> +  #  The IPMI specification specified a time range of 60ms to 250ms (section
> 12.17).
> +  #  The default setting is min.
> +  # @Prompt Time between IPMI SSIF request retries.
> +
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT3
> 2|
> + 0x00000034
Please give the unit to PCD name, for example PcdIpmiSsifRequestRetryIntervalMicrosecond that looks more clear to readers.


> +
> +  ## This value is the maximum retries of an IPMI SSIF response  #
> + @Prompt Number of IPMI SSIF response retries.
> +
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0
> x000
> + 00035
Is 250 times of retry defined in spec? Seems to me it is too many?


> +
> +  ## This is the required interval for each IPMI response retry.
> +  #  The IPMI specification specified min value is 60ms (section 12.17).
> +  # @Prompt Time-out for a response, internal
> +
> +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT
> 32
> + |0x00000036
> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>    ## This value is used to set the base address of PCI express hierarchy.
>    # @Prompt PCI Express Base Address.
> diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h
> b/MdePkg/Include/IndustryStandard/IpmiSsif.h
> new file mode 100644
> index 000000000000..4a97438109a9
> --- /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_
An additional whitespace between "#define"  and "IPMI_SSIF_H_".


> +
> +///
> +/// Definitions for SMBUS Commands for SSIF /// Table 12 - Summary of
> +SMBUS Commands for SSIF ///
> +
> +// Write block
Please have a consist comment format "///".


> +#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
Please have a consist comment format "///".


Thanks
Abner

> +#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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions
  2023-04-28  3:59 ` [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions Tinh Nguyen
  2023-04-28  5:41   ` 回复: " gaoliming
@ 2023-04-29  3:32   ` Chang, Abner
  1 sibling, 0 replies; 13+ messages in thread
From: Chang, Abner @ 2023-04-29  3:32 UTC (permalink / raw)
  To: Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

[AMD Official Use Only - General]

Reviewed-by: Abner Chang <Abner.Chang@amd.com>

> -----Original Message-----
> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> Sent: Friday, April 28, 2023 12:00 PM
> To: devel@edk2.groups.io
> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
> <Abner.Chang@amd.com>; Tinh Nguyen
> <tinhnguyen@os.amperecomputing.com>
> Subject: [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more
> definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> This adds more definitions for the IPMI Get System Interface Capabilities
> command.
> 
> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> ---
>  MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31
> ++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> index a5835ba08c00..933303b0fa2c 100644
> --- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
> @@ -13,6 +13,7 @@
> 
>    Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
>    Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
> +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent  **/
> 
> @@ -1046,6 +1047,36 @@ typedef struct {
>  //  Constants and Structure definitions for "Get System Interface
> Capabilities" command to follow here  //
> 
> +#define
> IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SSIF  0x0
> +#define
> IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_KCS   0x1
> +#define
> IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_INTERFACE_TYPE_SMIC  0x2
> +
> +typedef union {
> +  struct {
> +    UINT8    InterfaceType : 4;
> +    UINT8    Reserved      : 4;
> +  } Bits;
> +  UINT8    Uint8;
> +} IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_REQUEST;
> +
> +typedef union {
> +  struct {
> +    UINT8    Version            : 3;
> +    UINT8    PecSupport         : 1;
> +    UINT8    Reserved           : 2;
> +    UINT8    TransactionSupport : 2;
> +  } Bits;
> +  UINT8    Uint8;
> +} IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES;
> +
> +typedef struct {
> +  UINT8                                      CompletionCode;
> +  UINT8                                      Reserved;
> +  IPMI_SYSTEM_INTERFACE_SSIF_CAPABILITIES    InterfaceCap;
> +  UINT8                                      InputMsgSize;
> +  UINT8                                      OutputMsgSize;
> +} IPMI_GET_SYSTEM_INTERFACE_SSIF_CAPABILITIES_RESPONSE;
> +
>  //
>  //  Definitions for Get System Interface Capabilities command SSIF
> transaction support  //
> --
> 2.40.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/2] Add IPMI SSIF definitions
  2023-04-28  3:59 [PATCH 0/2] Add IPMI SSIF definitions Tinh Nguyen
  2023-04-28  3:59 ` [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Tinh Nguyen
  2023-04-28  3:59 ` [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions Tinh Nguyen
@ 2023-04-29  3:35 ` Chang, Abner
  2023-05-02  8:08   ` Tinh Nguyen
  2 siblings, 1 reply; 13+ messages in thread
From: Chang, Abner @ 2023-04-29  3:35 UTC (permalink / raw)
  To: Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

[AMD Official Use Only - General]

Hi Tinh,
Could you please also create a BZ ticket for tracking this? Thus this information will be also covered by edk2 stable release note.
Thanks
Abner


> -----Original Message-----
> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> Sent: Friday, April 28, 2023 12:00 PM
> To: devel@edk2.groups.io
> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
> <Abner.Chang@amd.com>; Tinh Nguyen
> <tinhnguyen@os.amperecomputing.com>
> Subject: [PATCH 0/2] Add IPMI SSIF definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> The first of a series of patches for IPMI SSIF support.
> 
> Tinh Nguyen (2):
>   MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
>   MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions
> 
>  MdePkg/MdePkg.dec                              | 26 ++++++
>  MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 +++++++
>  MdePkg/Include/IndustryStandard/IpmiSsif.h     | 98
> ++++++++++++++++++++
>  3 files changed, 155 insertions(+)
>  create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h
> 
> --
> 2.40.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/2] Add IPMI SSIF definitions
  2023-04-29  3:35 ` [PATCH 0/2] Add IPMI SSIF definitions Chang, Abner
@ 2023-05-02  8:08   ` Tinh Nguyen
  2023-05-02  8:21     ` Chang, Abner
  0 siblings, 1 reply; 13+ messages in thread
From: Tinh Nguyen @ 2023-05-02  8:08 UTC (permalink / raw)
  To: Chang, Abner, Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

Hi Abner,

Sorry, but I don't have a tianocore bugzilla account.

Please help me to file it on BZ.

Thanks,

- Tinh



On 29/04/2023 10:35, Chang, Abner wrote:
> [AMD Official Use Only - General]
>
> Hi Tinh,
> Could you please also create a BZ ticket for tracking this? Thus this information will be also covered by edk2 stable release note.
> Thanks
> Abner
>
>
>> -----Original Message-----
>> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
>> Sent: Friday, April 28, 2023 12:00 PM
>> To: devel@edk2.groups.io
>> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
>> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
>> <Abner.Chang@amd.com>; Tinh Nguyen
>> <tinhnguyen@os.amperecomputing.com>
>> Subject: [PATCH 0/2] Add IPMI SSIF definitions
>>
>> Caution: This message originated from an External Source. Use proper
>> caution when opening attachments, clicking links, or responding.
>>
>>
>> The first of a series of patches for IPMI SSIF support.
>>
>> Tinh Nguyen (2):
>>    MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
>>    MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions
>>
>>   MdePkg/MdePkg.dec                              | 26 ++++++
>>   MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 +++++++
>>   MdePkg/Include/IndustryStandard/IpmiSsif.h     | 98
>> ++++++++++++++++++++
>>   3 files changed, 155 insertions(+)
>>   create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h
>>
>> --
>> 2.40.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  2023-04-29  3:22   ` Chang, Abner
@ 2023-05-02  8:09     ` Tinh Nguyen
  2023-05-02  8:18       ` Chang, Abner
  0 siblings, 1 reply; 13+ messages in thread
From: Tinh Nguyen @ 2023-05-02  8:09 UTC (permalink / raw)
  To: Chang, Abner, Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

Hi Abner,

On 29/04/2023 10:22, Chang, Abner wrote:
> [AMD Official Use Only - General]
>
>
> Hi Tinh,
> Below is my comments,
>
>> -----Original Message-----
>> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
>> Sent: Friday, April 28, 2023 12:00 PM
>> To: devel@edk2.groups.io
>> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
>> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
>> <Abner.Chang@amd.com>; Tinh Nguyen
>> <tinhnguyen@os.amperecomputing.com>
>> Subject: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI
>> SSIF
>>
>> Caution: This message originated from an External Source. Use proper
>> caution when opening attachments, clicking links, or responding.
>>
>>
>> Specification reference:
>> https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i
>> pmi-second-gen-interface-spec-v2-rev1-1.html
>>
>> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
>> ---
>>   MdePkg/MdePkg.dec                          | 26 ++++++
>>   MdePkg/Include/IndustryStandard/IpmiSsif.h | 98
>> ++++++++++++++++++++
>>   2 files changed, 124 insertions(+)
>>
>> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
>> 7488ccda7a00..518e4200e9af 100644
>> --- a/MdePkg/MdePkg.dec
>> +++ b/MdePkg/MdePkg.dec
>> @@ -10,6 +10,7 @@
>>   # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
>> reserved.<BR>  # Copyright (c) 2021 - 2022, Arm Limited. All rights
>> reserved.<BR>  # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
>> reserved.<BR>
>> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>>   #
>>   # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2353,6 +2354,31 @@
>> [PcdsFixedAtBuild,PcdsPatchableInModule]
>>     # @Prompt IPMI KCS Interface I/O Base Address
>>
>> gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00
>> 000031
>>
>> +  ## This is SMBus slave address for the SSIF to the BMC.
>> +  #  The recommended value defined by IPMI specification is 0x20 (section
>> 12.12).
>> +  # @Prompt IPMI SSIF SMBus slave address
>> +
>> gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x00000
>> 032
>> +
>> +  ## This is the maximum number of IPMI SSIF request retries.
>> +  #  The IPMI specification specified min value is 5 (section 12.17).
>> +  # @Prompt Number of IPMI SSIF request retries.
>> +
>> +
>> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0
>> x000
>> + 00033
>> +
>> +  ## This is the required interval for each IPMI request retry.
>> +  #  The IPMI specification specified a time range of 60ms to 250ms (section
>> 12.17).
>> +  #  The default setting is min.
>> +  # @Prompt Time between IPMI SSIF request retries.
>> +
>> +
>> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT3
>> 2|
>> + 0x00000034
> Please give the unit to PCD name, for example PcdIpmiSsifRequestRetryIntervalMicrosecond that looks more clear to readers.
>
Yeah, it looks good when adding this
>> +
>> +  ## This value is the maximum retries of an IPMI SSIF response  #
>> + @Prompt Number of IPMI SSIF response retries.
>> +
>> +
>> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0
>> x000
>> + 00035
> Is 250 times of retry defined in spec? Seems to me it is too many?

The specification does not define this value. But the current SSIF 
driver into Linux is using 250.
We should use the same value with Linux; it helps BMC handle the retry 
from the host easier.

>
>> +
>> +  ## This is the required interval for each IPMI response retry.
>> +  #  The IPMI specification specified min value is 60ms (section 12.17).
>> +  # @Prompt Time-out for a response, internal
>> +
>> +
>> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT
>> 32
>> + |0x00000036
>> +
>>   [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>>     ## This value is used to set the base address of PCI express hierarchy.
>>     # @Prompt PCI Express Base Address.
>> diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h
>> b/MdePkg/Include/IndustryStandard/IpmiSsif.h
>> new file mode 100644
>> index 000000000000..4a97438109a9
>> --- /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_
> An additional whitespace between "#define"  and "IPMI_SSIF_H_".
will add in v2
>
>> +
>> +///
>> +/// Definitions for SMBUS Commands for SSIF /// Table 12 - Summary of
>> +SMBUS Commands for SSIF ///
>> +
>> +// Write block
> Please have a consist comment format "///".
>
thanks for remind

- Tinh

>> +#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
> Please have a consist comment format "///".
>
>
> Thanks
> Abner
>
>> +#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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
  2023-05-02  8:09     ` Tinh Nguyen
@ 2023-05-02  8:18       ` Chang, Abner
  0 siblings, 0 replies; 13+ messages in thread
From: Chang, Abner @ 2023-05-02  8:18 UTC (permalink / raw)
  To: Tinh Nguyen, Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

[AMD Official Use Only - General]



> -----Original Message-----
> From: Tinh Nguyen <tinhnguyen@amperemail.onmicrosoft.com>
> Sent: Tuesday, May 2, 2023 4:10 PM
> To: Chang, Abner <Abner.Chang@amd.com>; Tinh Nguyen
> <tinhnguyen@os.amperecomputing.com>; devel@edk2.groups.io
> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com
> Subject: Re: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for
> IPMI SSIF
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> On 29/04/2023 10:22, Chang, Abner wrote:
> > [AMD Official Use Only - General]
> >
> >
> > Hi Tinh,
> > Below is my comments,
> >
> >> -----Original Message-----
> >> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> >> Sent: Friday, April 28, 2023 12:00 PM
> >> To: devel@edk2.groups.io
> >> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> >> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
> >> <Abner.Chang@amd.com>; Tinh Nguyen
> >> <tinhnguyen@os.amperecomputing.com>
> >> Subject: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for
> >> IPMI SSIF
> >>
> >> Caution: This message originated from an External Source. Use proper
> >> caution when opening attachments, clicking links, or responding.
> >>
> >>
> >> Specification reference:
> >>
> https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/i
> >> pmi-second-gen-interface-spec-v2-rev1-1.html
> >>
> >> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> >> ---
> >>   MdePkg/MdePkg.dec                          | 26 ++++++
> >>   MdePkg/Include/IndustryStandard/IpmiSsif.h | 98
> >> ++++++++++++++++++++
> >>   2 files changed, 124 insertions(+)
> >>
> >> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> >> 7488ccda7a00..518e4200e9af 100644
> >> --- a/MdePkg/MdePkg.dec
> >> +++ b/MdePkg/MdePkg.dec
> >> @@ -10,6 +10,7 @@
> >>   # Copyright (c) 2022, Loongson Technology Corporation Limited. All
> >> rights reserved.<BR>  # Copyright (c) 2021 - 2022, Arm Limited. All
> >> rights reserved.<BR>  # Copyright (C) 2023 Advanced Micro Devices,
> >> Inc. All rights reserved.<BR>
> >> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
> >>   #
> >>   # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2353,6
> >> +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule]
> >>     # @Prompt IPMI KCS Interface I/O Base Address
> >>
> >>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00
> >> 000031
> >>
> >> +  ## This is SMBus slave address for the SSIF to the BMC.
> >> +  #  The recommended value defined by IPMI specification is 0x20
> >> + (section
> >> 12.12).
> >> +  # @Prompt IPMI SSIF SMBus slave address
> >> +
> >>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x00000
> >> 032
> >> +
> >> +  ## This is the maximum number of IPMI SSIF request retries.
> >> +  #  The IPMI specification specified min value is 5 (section 12.17).
> >> +  # @Prompt Number of IPMI SSIF request retries.
> >> +
> >> +
> >>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0
> >> x000
> >> + 00033
> >> +
> >> +  ## This is the required interval for each IPMI request retry.
> >> +  #  The IPMI specification specified a time range of 60ms to 250ms
> >> + (section
> >> 12.17).
> >> +  #  The default setting is min.
> >> +  # @Prompt Time between IPMI SSIF request retries.
> >> +
> >> +
> >>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT3
> >> 2|
> >> + 0x00000034
> > Please give the unit to PCD name, for example
> PcdIpmiSsifRequestRetryIntervalMicrosecond that looks more clear to
> readers.
> >
> Yeah, it looks good when adding this
> >> +
> >> +  ## This value is the maximum retries of an IPMI SSIF response  #
> >> + @Prompt Number of IPMI SSIF response retries.
> >> +
> >> +
> >>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0
> >> x000
> >> + 00035
> > Is 250 times of retry defined in spec? Seems to me it is too many?
> 
> The specification does not define this value. But the current SSIF driver into
> Linux is using 250.
> We should use the same value with Linux; it helps BMC handle the retry from
> the host easier.
Ok, I got it.

Thanks
Abner
> 
> >
> >> +
> >> +  ## This is the required interval for each IPMI response retry.
> >> +  #  The IPMI specification specified min value is 60ms (section 12.17).
> >> +  # @Prompt Time-out for a response, internal
> >> +
> >> +
> >>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT
> >> 32
> >> + |0x00000036
> >> +
> >>   [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,
> PcdsDynamicEx]
> >>     ## This value is used to set the base address of PCI express hierarchy.
> >>     # @Prompt PCI Express Base Address.
> >> diff --git a/MdePkg/Include/IndustryStandard/IpmiSsif.h
> >> b/MdePkg/Include/IndustryStandard/IpmiSsif.h
> >> new file mode 100644
> >> index 000000000000..4a97438109a9
> >> --- /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_
> > An additional whitespace between "#define"  and "IPMI_SSIF_H_".
> will add in v2
> >
> >> +
> >> +///
> >> +/// Definitions for SMBUS Commands for SSIF /// Table 12 - Summary
> >> +of SMBUS Commands for SSIF ///
> >> +
> >> +// Write block
> > Please have a consist comment format "///".
> >
> thanks for remind
> 
> - Tinh
> 
> >> +#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
> > Please have a consist comment format "///".
> >
> >
> > Thanks
> > Abner
> >
> >> +#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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/2] Add IPMI SSIF definitions
  2023-05-02  8:08   ` Tinh Nguyen
@ 2023-05-02  8:21     ` Chang, Abner
  0 siblings, 0 replies; 13+ messages in thread
From: Chang, Abner @ 2023-05-02  8:21 UTC (permalink / raw)
  To: Tinh Nguyen, Tinh Nguyen, devel@edk2.groups.io
  Cc: patches@amperecomputing.com, michael.d.kinney@intel.com,
	gaoliming@byosoft.com.cn, zhiguang.liu@intel.com

[AMD Official Use Only - General]

Ok, here it is.
Please put BZ# 4344 in the commit message.

https://bugzilla.tianocore.org/show_bug.cgi?id=4434

Regards,
Abner

> -----Original Message-----
> From: Tinh Nguyen <tinhnguyen@amperemail.onmicrosoft.com>
> Sent: Tuesday, May 2, 2023 4:09 PM
> To: Chang, Abner <Abner.Chang@amd.com>; Tinh Nguyen
> <tinhnguyen@os.amperecomputing.com>; devel@edk2.groups.io
> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com
> Subject: Re: [PATCH 0/2] Add IPMI SSIF definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> Sorry, but I don't have a tianocore bugzilla account.
> 
> Please help me to file it on BZ.
> 
> Thanks,
> 
> - Tinh
> 
> 
> 
> On 29/04/2023 10:35, Chang, Abner wrote:
> > [AMD Official Use Only - General]
> >
> > Hi Tinh,
> > Could you please also create a BZ ticket for tracking this? Thus this
> information will be also covered by edk2 stable release note.
> > Thanks
> > Abner
> >
> >
> >> -----Original Message-----
> >> From: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> >> Sent: Friday, April 28, 2023 12:00 PM
> >> To: devel@edk2.groups.io
> >> Cc: patches@amperecomputing.com; michael.d.kinney@intel.com;
> >> gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; Chang, Abner
> >> <Abner.Chang@amd.com>; Tinh Nguyen
> >> <tinhnguyen@os.amperecomputing.com>
> >> Subject: [PATCH 0/2] Add IPMI SSIF definitions
> >>
> >> Caution: This message originated from an External Source. Use proper
> >> caution when opening attachments, clicking links, or responding.
> >>
> >>
> >> The first of a series of patches for IPMI SSIF support.
> >>
> >> Tinh Nguyen (2):
> >>    MdePkg/IndustryStandard: Adds definitions for IPMI SSIF
> >>    MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions
> >>
> >>   MdePkg/MdePkg.dec                              | 26 ++++++
> >>   MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 31 +++++++
> >>   MdePkg/Include/IndustryStandard/IpmiSsif.h     | 98
> >> ++++++++++++++++++++
> >>   3 files changed, 155 insertions(+)
> >>   create mode 100644 MdePkg/Include/IndustryStandard/IpmiSsif.h
> >>
> >> --
> >> 2.40.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-05-02  8:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-28  3:59 [PATCH 0/2] Add IPMI SSIF definitions Tinh Nguyen
2023-04-28  3:59 ` [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Tinh Nguyen
2023-04-28  5:17   ` 回复: " gaoliming
2023-04-28  9:01     ` Tinh Nguyen
2023-04-29  3:22   ` Chang, Abner
2023-05-02  8:09     ` Tinh Nguyen
2023-05-02  8:18       ` Chang, Abner
2023-04-28  3:59 ` [PATCH 2/2] MdePkg/IndustryStandard/IpmiNetFnApp.h: Add more definitions Tinh Nguyen
2023-04-28  5:41   ` 回复: " gaoliming
2023-04-29  3:32   ` Chang, Abner
2023-04-29  3:35 ` [PATCH 0/2] Add IPMI SSIF definitions Chang, Abner
2023-05-02  8:08   ` Tinh Nguyen
2023-05-02  8:21     ` Chang, Abner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox