From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web11.12520.1682659047093834244 for ; Thu, 27 Apr 2023 22:17:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=ehHfoJ/h; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id D16C7CD1F6C2 for ; Fri, 28 Apr 2023 13:17:22 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1682659042; bh=Mng+XUcbuQjclUnSK6OcXDghNrKK04oycSTDYs2yJuA=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=ehHfoJ/hzS+jC0mHbxnaXwOXxruaviu2ZYWTTIX/NH9y+8e5Xmr3XUBHJsFQXLYYa OYTBcUmahCrf2oXzi1Ke+cj5oeFMW5/tOIF+OJCj9ZJ/IbYdO8DtMT1nJTucikAI1Z xyaT2087dS7yhmvLgJyZrAC0mhYm/rMgyWXMGJAk= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id CDA84CD1F6B7 for ; Fri, 28 Apr 2023 13:17:22 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 9D86BCD1F65E for ; Fri, 28 Apr 2023 13:17:22 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 3578DCD1F679 for ; Fri, 28 Apr 2023 13:17:19 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 28 Apr 2023 13:17:08 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Tinh Nguyen'" , Cc: , , , References: <20230428035940.1765700-1-tinhnguyen@os.amperecomputing.com> <20230428035940.1765700-2-tinhnguyen@os.amperecomputing.com> In-Reply-To: <20230428035940.1765700-2-tinhnguyen@os.amperecomputing.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggMS8yXSBNZGVQa2cvSW5kdXN0cnlTdGFuZGFyZDogQWRkcyBkZWZpbml0aW9ucyBmb3IgSVBNSSBTU0lG?= Date: Fri, 28 Apr 2023 13:17:12 +0800 Message-ID: <060f01d97990$b0ca9be0$125fd3a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIGqEaGrVJUancjNnmTUp/GZig9XAH8qj9ZrtXrJXA= Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn 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.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Tinh Nguyen > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA4=D4=C228=C8=D5 12:00 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: patches@amperecomputing.com; michael.d.kinney@intel.com; > gaoliming@byosoft.com.cn; zhiguang.liu@intel.com; abner.chang@amd.com; > Tinh Nguyen > =D6=F7=CC=E2: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions = for IPMI SSIF >=20 > Specification reference: > https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ip > mi-second-gen-interface-spec-v2-rev1-1.html >=20 > Signed-off-by: Tinh Nguyen > --- > MdePkg/MdePkg.dec | 26 ++++++ > MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 ++++++++++++++++++++ > 2 files changed, 124 insertions(+) >=20 > 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.
> # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
> # Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
> +# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule] > # @Prompt IPMI KCS Interface I/O Base Address >=20 > gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x000 > 00031 >=20 > + ## 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.
> + 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 =3D 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