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.web10.62870.1679535329310558368 for ; Wed, 22 Mar 2023 18:35:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=rPn3FQdK; 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 4CE9FCD1F6E6 for ; Thu, 23 Mar 2023 09:35:26 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1679535326; bh=ktCEsUUNGQMSJsWakZNgGFuuhRNloXTsHC4+wheFBdg=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=rPn3FQdKjYa+DzZ2gwmwGPzAZ/lxlyMATFynYNPTZ0X9ZFkvep7JlZQt/ju/3dOB0 2hFjKcNwOx494p1fgxzEtVsvPEV9b+amdBk62q2W/7ijsiVQKG81pW/Wjzx7wQ7ToO H26eENCvRfNNpmJ9be1e4s8seX0eGkhO1+ObcTtQ= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 4647FCD1F6DB for ; Thu, 23 Mar 2023 09:35:26 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 142A3CD1F694 for ; Thu, 23 Mar 2023 09:35:26 +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 8D7F6CD1F689 for ; Thu, 23 Mar 2023 09:35:22 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 23 Mar 2023 09:35:10 +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: , Cc: "'Michael D Kinney'" , "'Zhiguang Liu'" , "'Nickle Wang'" , "'Igor Kulchytskyy'" , "'Isaac Oram'" , "'Abdul Lateef Attar'" References: <20230308144653.733-1-abner.chang@amd.com> In-Reply-To: <20230308144653.733-1-abner.chang@amd.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggVjJdIE1kZVBrZy9JbmNsdWRlOiBBZGQgSVBNSSBLQ1MgZGVmaW5pdGlvbnM=?= Date: Thu, 23 Mar 2023 09:35:12 +0800 Message-ID: <000901d95d27$b69cd720$23d68560$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGqxCpDTNi6R85rgat50elAGNBVm69kxxCQ Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: abner.chang@amd.com > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA3=D4=C28=C8=D5 22:47 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Michael D Kinney ; Liming = Gao > ; Zhiguang Liu ; = Nickle > Wang ; Igor Kulchytskyy ; Isaac > Oram ; Abdul Lateef Attar > > =D6=F7=CC=E2: [PATCH V2] MdePkg/Include: Add IPMI KCS definitions >=20 > From: Abner Chang >=20 > BZ #4354 > This change adds definitions for IPMI KCS. >=20 > Spec ref: > 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: Abner Chang > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Nickle Wang > Cc: Igor Kulchytskyy > Cc: Isaac Oram > Cc: Abdul Lateef Attar > Acked-by: Isaac Oram > --- > MdePkg/MdePkg.dec | 5 ++ > MdePkg/Include/IndustryStandard/IpmiKcs.h | 76 > +++++++++++++++++++++++ > 2 files changed, 81 insertions(+) > create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h >=20 > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 80b65590531..808c487bb49 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -9,6 +9,7 @@ > # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development > LP
> # 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.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -2339,6 +2340,10 @@ > # @Prompt Memory Address of GuidedExtractHandler Table. >=20 > gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x10000 > 00|UINT64|0x30001015 >=20 > + ## This value is the IPMI KCS Interface I/O base address used to transmit > IPMI commands. > + # @Prompt IPMI KCS Interface I/O Base Address > + > gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress|0xca2|UINT16|0x0000 > 0031 > + > [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/IpmiKcs.h > b/MdePkg/Include/IndustryStandard/IpmiKcs.h > new file mode 100644 > index 00000000000..c3baf80bd76 > --- /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.
> + 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_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 { > + IPMI_KCS_IDLE_STATE =3D 0, > + IPMI_KCS_READ_STATE, > + IPMI_KCS_WRITE_STATE, > + IPMI_KCS_ERROR_STATE > +} IPMI_KCS_STATE; > + > +/// > +/// IPMI KCS Interface Request Format > +/// > +typedef struct { > + UINT8 NetFunc; > + UINT8 Command; > + UINT8 Data[0]; > +} IPMI_KCS_RESQUEST_HEADER; > + > +/// > +/// IPMI KCS Interface Response Format > +/// > +typedef struct { > + UINT8 NetFunc; > + UINT8 Command; > +} IPMI_KCS_RESPONSE_HEADER; > +#endif > -- > 2.37.1.windows.1