public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg/Include: Add IPMI KCS definitions
@ 2023-03-03  2:31 Chang, Abner
  2023-03-03  2:59 ` Michael D Kinney
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Chang, Abner @ 2023-03-03  2:31 UTC (permalink / raw)
  To: devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Nickle Wang,
	Igor Kulchytskyy, Isaac Oram, Abdul Lateef Attar

From: Abner Chang <abner.chang@amd.com>

BZ #4354
This change adds definitions for IPMI KCS.

Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
---
 MdePkg/MdePkg.dec                         |  5 ++
 MdePkg/Include/IndustryStandard/IpmiKcs.h | 72 +++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 3d08f20d15b..0ed033983bf 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -9,6 +9,7 @@
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP<BR>
 # 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>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -2332,6 +2333,10 @@
   # @Prompt Memory Address of GuidedExtractHandler Table.
   gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000000|UINT64|0x30001015
 
+  ## 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|0x00000031
+
 [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..2a51698b126
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
@@ -0,0 +1,72 @@
+/** @file
+  IPMI KCS Register Definitions
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#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 = 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;
+  UINT8    CompletionCode;
+} IPMI_KCS_RESPONSE_HEADER;
+#endif
-- 
2.37.1.windows.1


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

* Re: [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-03  2:31 [PATCH] MdePkg/Include: Add IPMI KCS definitions Chang, Abner
@ 2023-03-03  2:59 ` Michael D Kinney
  2023-03-03  3:03   ` Chang, Abner
  2023-03-07  7:50 ` Tinh Nguyen
  2023-03-23  1:36 ` 回复: " gaoliming
  2 siblings, 1 reply; 11+ messages in thread
From: Michael D Kinney @ 2023-03-03  2:59 UTC (permalink / raw)
  To: abner.chang@amd.com, devel@edk2.groups.io
  Cc: Gao, Liming, Liu, Zhiguang, Nickle Wang, Igor Kulchytskyy,
	Oram, Isaac W, Abdul Lateef Attar, Kinney, Michael D

Hi Abner,

Can you add a link/reference to the spec used in the INF and commit message?

Thanks,

Mike

> -----Original Message-----
> From: abner.chang@amd.com <abner.chang@amd.com>
> Sent: Thursday, March 2, 2023 6:32 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> Subject: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> 
> From: Abner Chang <abner.chang@amd.com>
> 
> BZ #4354
> This change adds definitions for IPMI KCS.
> 
> Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> ---
>  MdePkg/MdePkg.dec                         |  5 ++
>  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72 +++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
>  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 3d08f20d15b..0ed033983bf 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -9,6 +9,7 @@
>  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP<BR>
>  # 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>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -2332,6 +2333,10 @@
>    # @Prompt Memory Address of GuidedExtractHandler Table.
>    gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000000|UINT64|0x30001015
> 
> +  ## 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|0x00000031
> +
>  [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..2a51698b126
> --- /dev/null
> +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> @@ -0,0 +1,72 @@
> +/** @file
> +  IPMI KCS Register Definitions
> +
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#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 = 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;
> +  UINT8    CompletionCode;
> +} IPMI_KCS_RESPONSE_HEADER;
> +#endif
> --
> 2.37.1.windows.1


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

* Re: [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-03  2:59 ` Michael D Kinney
@ 2023-03-03  3:03   ` Chang, Abner
  2023-03-03  3:05     ` [edk2-devel] " Michael D Kinney
  0 siblings, 1 reply; 11+ messages in thread
From: Chang, Abner @ 2023-03-03  3:03 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Gao, Liming, Liu, Zhiguang, Nickle Wang, Igor Kulchytskyy,
	Oram, Isaac W, Attar, AbdulLateef (Abdul Lateef)

[AMD Official Use Only - General]

Ok, that would be the patch set for edk2-platform I am going to send later,  will update these two edk2 industry standard definition patches (KCS and MCTP) after edk2-platforms one.

Thanks
Abner

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, March 3, 2023 11:00 AM
> To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Subject: RE: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> Can you add a link/reference to the spec used in the INF and commit
> message?
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: abner.chang@amd.com <abner.chang@amd.com>
> > Sent: Thursday, March 2, 2023 6:32 PM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> > Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> > Oram, Isaac W <isaac.w.oram@intel.com>; Abdul Lateef Attar
> > <AbdulLateef.Attar@amd.com>
> > Subject: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> >
> > From: Abner Chang <abner.chang@amd.com>
> >
> > BZ #4354
> > This change adds definitions for IPMI KCS.
> >
> > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > ---
> >  MdePkg/MdePkg.dec                         |  5 ++
> >  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> > +++++++++++++++++++++++
> >  2 files changed, 77 insertions(+)
> >  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > 3d08f20d15b..0ed033983bf 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -9,6 +9,7 @@
> >  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> > LP<BR>  # 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>
> >  #
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6 +2333,10
> > @@
> >    # @Prompt Memory Address of GuidedExtractHandler Table.
> >
> >
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> 000
> > |UINT64|0x30001015
> >
> > +  ## 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
> 00
> > + 31
> > +
> >  [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..2a51698b126
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > @@ -0,0 +1,72 @@
> > +/** @file
> > +  IPMI KCS Register Definitions
> > +
> > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > +reserved.<BR>
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > +
> > +#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 = 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;
> > +  UINT8    CompletionCode;
> > +} IPMI_KCS_RESPONSE_HEADER;
> > +#endif
> > --
> > 2.37.1.windows.1

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

* Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-03  3:03   ` Chang, Abner
@ 2023-03-03  3:05     ` Michael D Kinney
  2023-03-03  3:10       ` Chang, Abner
  0 siblings, 1 reply; 11+ messages in thread
From: Michael D Kinney @ 2023-03-03  3:05 UTC (permalink / raw)
  To: devel@edk2.groups.io, abner.chang@amd.com
  Cc: Gao, Liming, Liu, Zhiguang, Nickle Wang, Igor Kulchytskyy,
	Oram, Isaac W, Attar, AbdulLateef (Abdul Lateef),
	Kinney, Michael D

I meant in the MdePkg/Include/IndustryStandard/IpmiKcs.h file 
and the commit message in this patch that adds that file.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang, Abner via groups.io
> Sent: Thursday, March 2, 2023 7:03 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>; Attar, AbdulLateef (Abdul Lateef)
> <AbdulLateef.Attar@amd.com>
> Subject: Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS definitions
> 
> [AMD Official Use Only - General]
> 
> Ok, that would be the patch set for edk2-platform I am going to send later,  will update these two edk2 industry standard
> definition patches (KCS and MCTP) after edk2-platforms one.
> 
> Thanks
> Abner
> 
> > -----Original Message-----
> > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > Sent: Friday, March 3, 2023 11:00 AM
> > To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io
> > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> > Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> > Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Kinney,
> > Michael D <michael.d.kinney@intel.com>
> > Subject: RE: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Hi Abner,
> >
> > Can you add a link/reference to the spec used in the INF and commit
> > message?
> >
> > Thanks,
> >
> > Mike
> >
> > > -----Original Message-----
> > > From: abner.chang@amd.com <abner.chang@amd.com>
> > > Sent: Thursday, March 2, 2023 6:32 PM
> > > To: devel@edk2.groups.io
> > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > > <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> > > Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> > > Oram, Isaac W <isaac.w.oram@intel.com>; Abdul Lateef Attar
> > > <AbdulLateef.Attar@amd.com>
> > > Subject: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> > >
> > > From: Abner Chang <abner.chang@amd.com>
> > >
> > > BZ #4354
> > > This change adds definitions for IPMI KCS.
> > >
> > > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > > Cc: Igor Kulchytskyy <igork@ami.com>
> > > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > > ---
> > >  MdePkg/MdePkg.dec                         |  5 ++
> > >  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> > > +++++++++++++++++++++++
> > >  2 files changed, 77 insertions(+)
> > >  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> > >
> > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > > 3d08f20d15b..0ed033983bf 100644
> > > --- a/MdePkg/MdePkg.dec
> > > +++ b/MdePkg/MdePkg.dec
> > > @@ -9,6 +9,7 @@
> > >  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> > > LP<BR>  # 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>
> > >  #
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6 +2333,10
> > > @@
> > >    # @Prompt Memory Address of GuidedExtractHandler Table.
> > >
> > >
> > gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> > 000
> > > |UINT64|0x30001015
> > >
> > > +  ## 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
> > 00
> > > + 31
> > > +
> > >  [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..2a51698b126
> > > --- /dev/null
> > > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > > @@ -0,0 +1,72 @@
> > > +/** @file
> > > +  IPMI KCS Register Definitions
> > > +
> > > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > > +reserved.<BR>
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > > +
> > > +#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 = 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;
> > > +  UINT8    CompletionCode;
> > > +} IPMI_KCS_RESPONSE_HEADER;
> > > +#endif
> > > --
> > > 2.37.1.windows.1
> 
> 
> 
> 


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

* Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-03  3:05     ` [edk2-devel] " Michael D Kinney
@ 2023-03-03  3:10       ` Chang, Abner
  0 siblings, 0 replies; 11+ messages in thread
From: Chang, Abner @ 2023-03-03  3:10 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Gao, Liming, Liu, Zhiguang, Nickle Wang, Igor Kulchytskyy,
	Oram, Isaac W, Attar, AbdulLateef (Abdul Lateef)

[AMD Official Use Only - General]

Ah got you. will send out the V2 for the link to spec.

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, March 3, 2023 11:05 AM
> To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS
> definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> I meant in the MdePkg/Include/IndustryStandard/IpmiKcs.h file and the
> commit message in this patch that adds that file.
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Chang,
> > Abner via groups.io
> > Sent: Thursday, March 2, 2023 7:03 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > devel@edk2.groups.io
> > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> > Kulchytskyy <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> > Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
> > Subject: Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS
> > definitions
> >
> > [AMD Official Use Only - General]
> >
> > Ok, that would be the patch set for edk2-platform I am going to send
> > later,  will update these two edk2 industry standard definition patches (KCS
> and MCTP) after edk2-platforms one.
> >
> > Thanks
> > Abner
> >
> > > -----Original Message-----
> > > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > > Sent: Friday, March 3, 2023 11:00 AM
> > > To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io
> > > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> > > <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> > > Kulchytskyy <igork@ami.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>;
> > > Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>;
> > > Kinney, Michael D <michael.d.kinney@intel.com>
> > > Subject: RE: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Abner,
> > >
> > > Can you add a link/reference to the spec used in the INF and commit
> > > message?
> > >
> > > Thanks,
> > >
> > > Mike
> > >
> > > > -----Original Message-----
> > > > From: abner.chang@amd.com <abner.chang@amd.com>
> > > > Sent: Thursday, March 2, 2023 6:32 PM
> > > > To: devel@edk2.groups.io
> > > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > > > <gaoliming@byosoft.com.cn>; Liu, Zhiguang
> > > > <zhiguang.liu@intel.com>; Nickle Wang <nicklew@nvidia.com>; Igor
> > > > Kulchytskyy <igork@ami.com>; Oram, Isaac W
> > > > <isaac.w.oram@intel.com>; Abdul Lateef Attar
> > > > <AbdulLateef.Attar@amd.com>
> > > > Subject: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> > > >
> > > > From: Abner Chang <abner.chang@amd.com>
> > > >
> > > > BZ #4354
> > > > This change adds definitions for IPMI KCS.
> > > >
> > > > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > > > Cc: Igor Kulchytskyy <igork@ami.com>
> > > > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > > > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > > > ---
> > > >  MdePkg/MdePkg.dec                         |  5 ++
> > > >  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> > > > +++++++++++++++++++++++
> > > >  2 files changed, 77 insertions(+)  create mode 100644
> > > > MdePkg/Include/IndustryStandard/IpmiKcs.h
> > > >
> > > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > > > 3d08f20d15b..0ed033983bf 100644
> > > > --- a/MdePkg/MdePkg.dec
> > > > +++ b/MdePkg/MdePkg.dec
> > > > @@ -9,6 +9,7 @@
> > > >  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise
> > > > Development LP<BR>  # 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>
> > > >  #
> > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6
> > > > +2333,10 @@
> > > >    # @Prompt Memory Address of GuidedExtractHandler Table.
> > > >
> > > >
> > >
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> > > 000
> > > > |UINT64|0x30001015
> > > >
> > > > +  ## 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
> > > 00
> > > > + 31
> > > > +
> > > >  [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..2a51698b126
> > > > --- /dev/null
> > > > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > > > @@ -0,0 +1,72 @@
> > > > +/** @file
> > > > +  IPMI KCS Register Definitions
> > > > +
> > > > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > > > +reserved.<BR>
> > > > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > > > +
> > > > +#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 = 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;
> > > > +  UINT8    CompletionCode;
> > > > +} IPMI_KCS_RESPONSE_HEADER;
> > > > +#endif
> > > > --
> > > > 2.37.1.windows.1
> >
> >
> > 
> >

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

* Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-03  2:31 [PATCH] MdePkg/Include: Add IPMI KCS definitions Chang, Abner
  2023-03-03  2:59 ` Michael D Kinney
@ 2023-03-07  7:50 ` Tinh Nguyen
  2023-03-07  9:31   ` Chang, Abner
  2023-03-23  1:36 ` 回复: " gaoliming
  2 siblings, 1 reply; 11+ messages in thread
From: Tinh Nguyen @ 2023-03-07  7:50 UTC (permalink / raw)
  To: devel, abner.chang

Hi Abner,

Any plan to support SMBUS system interface (ssif)?

- Tinh

On 03/03/2023 09:31, Chang, Abner via groups.io wrote:
> From: Abner Chang <abner.chang@amd.com>
>
> BZ #4354
> This change adds definitions for IPMI KCS.
>
> Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> ---
>   MdePkg/MdePkg.dec                         |  5 ++
>   MdePkg/Include/IndustryStandard/IpmiKcs.h | 72 +++++++++++++++++++++++
>   2 files changed, 77 insertions(+)
>   create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
>
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 3d08f20d15b..0ed033983bf 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -9,6 +9,7 @@
>   # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP<BR>
>   # 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>
>   #
>   # SPDX-License-Identifier: BSD-2-Clause-Patent
>   #
> @@ -2332,6 +2333,10 @@
>     # @Prompt Memory Address of GuidedExtractHandler Table.
>     gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000000|UINT64|0x30001015
>   
> +  ## 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|0x00000031
> +
>   [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..2a51698b126
> --- /dev/null
> +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> @@ -0,0 +1,72 @@
> +/** @file
> +  IPMI KCS Register Definitions
> +
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#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 = 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;
> +  UINT8    CompletionCode;
> +} IPMI_KCS_RESPONSE_HEADER;
> +#endif

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

* Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-07  7:50 ` Tinh Nguyen
@ 2023-03-07  9:31   ` Chang, Abner
  0 siblings, 0 replies; 11+ messages in thread
From: Chang, Abner @ 2023-03-07  9:31 UTC (permalink / raw)
  To: Tinh Nguyen, devel@edk2.groups.io

[AMD Official Use Only - General]

Hi Tinh,
That depends on if AMD platform enables SSIF as host-bmc transport interface, otherwise I may not work on that because I have no platform to test.
Thanks
Abner

> -----Original Message-----
> From: Tinh Nguyen <tinhnguyen@amperemail.onmicrosoft.com>
> Sent: Tuesday, March 7, 2023 3:51 PM
> To: devel@edk2.groups.io; Chang, Abner <Abner.Chang@amd.com>
> Subject: Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS
> definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> Any plan to support SMBUS system interface (ssif)?
> 
> - Tinh
> 
> On 03/03/2023 09:31, Chang, Abner via groups.io wrote:
> > From: Abner Chang <abner.chang@amd.com>
> >
> > BZ #4354
> > This change adds definitions for IPMI KCS.
> >
> > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > ---
> >   MdePkg/MdePkg.dec                         |  5 ++
> >   MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> +++++++++++++++++++++++
> >   2 files changed, 77 insertions(+)
> >   create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > 3d08f20d15b..0ed033983bf 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -9,6 +9,7 @@
> >   # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> LP<BR>
> >   # 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>
> >   #
> >   # SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #
> > @@ -2332,6 +2333,10 @@
> >     # @Prompt Memory Address of GuidedExtractHandler Table.
> >
> >
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> 000
> > |UINT64|0x30001015
> >
> > +  ## 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
> 00
> > + 31
> > +
> >   [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..2a51698b126
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > @@ -0,0 +1,72 @@
> > +/** @file
> > +  IPMI KCS Register Definitions
> > +
> > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > +reserved.<BR>
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > +
> > +#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 = 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;
> > +  UINT8    CompletionCode;
> > +} IPMI_KCS_RESPONSE_HEADER;
> > +#endif

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

* 回复: [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-03  2:31 [PATCH] MdePkg/Include: Add IPMI KCS definitions Chang, Abner
  2023-03-03  2:59 ` Michael D Kinney
  2023-03-07  7:50 ` Tinh Nguyen
@ 2023-03-23  1:36 ` gaoliming
  2023-03-23  2:18   ` [edk2-devel] " Michael D Kinney
  2023-03-23  3:17   ` Chang, Abner
  2 siblings, 2 replies; 11+ messages in thread
From: gaoliming @ 2023-03-23  1:36 UTC (permalink / raw)
  To: abner.chang, devel
  Cc: 'Michael D Kinney', 'Zhiguang Liu',
	'Nickle Wang', 'Igor Kulchytskyy',
	'Isaac Oram', 'Abdul Lateef Attar'

Abner:
  This patch also adds one PCD PcdIpmiKcsBaseAddress. I see its default
value is 0xca2. Can you add comments for this default value?

Thanks
Liming
> -----邮件原件-----
> 发件人: abner.chang@amd.com <abner.chang@amd.com>
> 发送时间: 2023年3月3日 10:32
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Nickle
> Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Isaac
> Oram <isaac.w.oram@intel.com>; Abdul Lateef Attar
> <AbdulLateef.Attar@amd.com>
> 主题: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> 
> From: Abner Chang <abner.chang@amd.com>
> 
> BZ #4354
> This change adds definitions for IPMI KCS.
> 
> Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Isaac Oram <isaac.w.oram@intel.com>
> Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> ---
>  MdePkg/MdePkg.dec                         |  5 ++
>  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> +++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
>  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 3d08f20d15b..0ed033983bf 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -9,6 +9,7 @@
>  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> LP<BR>
>  # 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>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -2332,6 +2333,10 @@
>    # @Prompt Memory Address of GuidedExtractHandler Table.
> 
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x10000
> 00|UINT64|0x30001015
> 
> +  ## 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..2a51698b126
> --- /dev/null
> +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> @@ -0,0 +1,72 @@
> +/** @file
> +  IPMI KCS Register Definitions
> +
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#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 = 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;
> +  UINT8    CompletionCode;
> +} IPMI_KCS_RESPONSE_HEADER;
> +#endif
> --
> 2.37.1.windows.1




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

* Re: [edk2-devel] 回复: [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-23  1:36 ` 回复: " gaoliming
@ 2023-03-23  2:18   ` Michael D Kinney
  2023-03-23  3:21     ` Chang, Abner
  2023-03-23  3:17   ` Chang, Abner
  1 sibling, 1 reply; 11+ messages in thread
From: Michael D Kinney @ 2023-03-23  2:18 UTC (permalink / raw)
  To: devel@edk2.groups.io, Gao, Liming, abner.chang@amd.com
  Cc: Liu, Zhiguang, 'Nickle Wang', 'Igor Kulchytskyy',
	Oram, Isaac W, 'Abdul Lateef Attar', Kinney, Michael D

Is that an I/O Port address or an MMIO address?  Can it be either?

If it must be I/O Port address, then the PCD name should convey that.

If it can be either, then need another PCD to specify the type so the
Code can do the access with the correct IoLib APIs.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming via groups.io
> Sent: Wednesday, March 22, 2023 6:37 PM
> To: abner.chang@amd.com; devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>; 'Nickle Wang' <nicklew@nvidia.com>;
> 'Igor Kulchytskyy' <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>; 'Abdul Lateef Attar' <AbdulLateef.Attar@amd.com>
> Subject: [edk2-devel] 回复: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> 
> Abner:
>   This patch also adds one PCD PcdIpmiKcsBaseAddress. I see its default
> value is 0xca2. Can you add comments for this default value?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: abner.chang@amd.com <abner.chang@amd.com>
> > 发送时间: 2023年3月3日 10:32
> > 收件人: devel@edk2.groups.io
> > 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Nickle
> > Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>; Isaac
> > Oram <isaac.w.oram@intel.com>; Abdul Lateef Attar
> > <AbdulLateef.Attar@amd.com>
> > 主题: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> >
> > From: Abner Chang <abner.chang@amd.com>
> >
> > BZ #4354
> > This change adds definitions for IPMI KCS.
> >
> > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > ---
> >  MdePkg/MdePkg.dec                         |  5 ++
> >  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> > +++++++++++++++++++++++
> >  2 files changed, 77 insertions(+)
> >  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> > index 3d08f20d15b..0ed033983bf 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -9,6 +9,7 @@
> >  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> > LP<BR>
> >  # 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>
> >  #
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> >  #
> > @@ -2332,6 +2333,10 @@
> >    # @Prompt Memory Address of GuidedExtractHandler Table.
> >
> > gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x10000
> > 00|UINT64|0x30001015
> >
> > +  ## 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..2a51698b126
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > @@ -0,0 +1,72 @@
> > +/** @file
> > +  IPMI KCS Register Definitions
> > +
> > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> reserved.<BR>
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +**/
> > +
> > +#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 = 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;
> > +  UINT8    CompletionCode;
> > +} IPMI_KCS_RESPONSE_HEADER;
> > +#endif
> > --
> > 2.37.1.windows.1
> 
> 
> 
> 
> 
> 
> 


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

* Re: [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-23  1:36 ` 回复: " gaoliming
  2023-03-23  2:18   ` [edk2-devel] " Michael D Kinney
@ 2023-03-23  3:17   ` Chang, Abner
  1 sibling, 0 replies; 11+ messages in thread
From: Chang, Abner @ 2023-03-23  3:17 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io
  Cc: 'Michael D Kinney', 'Zhiguang Liu',
	'Nickle Wang', 'Igor Kulchytskyy',
	'Isaac Oram', Attar, AbdulLateef (Abdul Lateef)

[AMD Official Use Only - General]

Yes, good suggestion. I will add it.
Thanks
Abner

> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Thursday, March 23, 2023 9:37 AM
> To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io
> Cc: 'Michael D Kinney' <michael.d.kinney@intel.com>; 'Zhiguang Liu'
> <zhiguang.liu@intel.com>; 'Nickle Wang' <nicklew@nvidia.com>; 'Igor
> Kulchytskyy' <igork@ami.com>; 'Isaac Oram' <isaac.w.oram@intel.com>;
> Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
> Subject: 回复: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Abner:
>   This patch also adds one PCD PcdIpmiKcsBaseAddress. I see its default value
> is 0xca2. Can you add comments for this default value?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: abner.chang@amd.com <abner.chang@amd.com>
> > 发送时间: 2023年3月3日 10:32
> > 收件人: devel@edk2.groups.io
> > 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>;
> > Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> > Isaac Oram <isaac.w.oram@intel.com>; Abdul Lateef Attar
> > <AbdulLateef.Attar@amd.com>
> > 主题: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> >
> > From: Abner Chang <abner.chang@amd.com>
> >
> > BZ #4354
> > This change adds definitions for IPMI KCS.
> >
> > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > ---
> >  MdePkg/MdePkg.dec                         |  5 ++
> >  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> > +++++++++++++++++++++++
> >  2 files changed, 77 insertions(+)
> >  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > 3d08f20d15b..0ed033983bf 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -9,6 +9,7 @@
> >  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> > LP<BR>  # 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>
> >  #
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6 +2333,10
> > @@
> >    # @Prompt Memory Address of GuidedExtractHandler Table.
> >
> >
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> 0
> > 00|UINT64|0x30001015
> >
> > +  ## 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..2a51698b126
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > @@ -0,0 +1,72 @@
> > +/** @file
> > +  IPMI KCS Register Definitions
> > +
> > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> reserved.<BR>
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > +
> > +#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 = 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;
> > +  UINT8    CompletionCode;
> > +} IPMI_KCS_RESPONSE_HEADER;
> > +#endif
> > --
> > 2.37.1.windows.1
> 
> 

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

* Re: [edk2-devel] 回复: [PATCH] MdePkg/Include: Add IPMI KCS definitions
  2023-03-23  2:18   ` [edk2-devel] " Michael D Kinney
@ 2023-03-23  3:21     ` Chang, Abner
  0 siblings, 0 replies; 11+ messages in thread
From: Chang, Abner @ 2023-03-23  3:21 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io, Gao, Liming
  Cc: Liu, Zhiguang, 'Nickle Wang', 'Igor Kulchytskyy',
	Oram, Isaac W, Attar, AbdulLateef (Abdul Lateef)

[AMD Official Use Only - General]

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, March 23, 2023 10:19 AM
> To: devel@edk2.groups.io; Gao, Liming <gaoliming@byosoft.com.cn>; Chang,
> Abner <Abner.Chang@amd.com>
> Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; 'Nickle Wang'
> <nicklew@nvidia.com>; 'Igor Kulchytskyy' <igork@ami.com>; Oram, Isaac W
> <isaac.w.oram@intel.com>; Attar, AbdulLateef (Abdul Lateef)
> <AbdulLateef.Attar@amd.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] 回复: [PATCH] MdePkg/Include: Add IPMI KCS
> definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Is that an I/O Port address or an MMIO address?  Can it be either?
In IPMI spec, KCS register base address is defined as I/O mapped 0xca2.
For MCTP over KCS, KCS register base address could be either I/O mapped or memory mapped.

> 
> If it must be I/O Port address, then the PCD name should convey that.
Sounds good. I will update the PCD name.

> 
> If it can be either, then need another PCD to specify the type so the Code
> can do the access with the correct IoLib APIs.
We do have a PCD for KCS access type, but that was defined in the Manageability package and leverage by both IPMI driver, MCTP driver and KCS manageability transport library.

Thanks
Abner
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > gaoliming via groups.io
> > Sent: Wednesday, March 22, 2023 6:37 PM
> > To: abner.chang@amd.com; devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>; 'Nickle Wang' <nicklew@nvidia.com>; 'Igor
> > Kulchytskyy' <igork@ami.com>; Oram, Isaac W <isaac.w.oram@intel.com>;
> > 'Abdul Lateef Attar' <AbdulLateef.Attar@amd.com>
> > Subject: [edk2-devel] 回复: [PATCH] MdePkg/Include: Add IPMI KCS
> > definitions
> >
> > Abner:
> >   This patch also adds one PCD PcdIpmiKcsBaseAddress. I see its
> > default value is 0xca2. Can you add comments for this default value?
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: abner.chang@amd.com <abner.chang@amd.com>
> > > 发送时间: 2023年3月3日 10:32
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> > > <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>;
> > > Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>;
> > > Isaac Oram <isaac.w.oram@intel.com>; Abdul Lateef Attar
> > > <AbdulLateef.Attar@amd.com>
> > > 主题: [PATCH] MdePkg/Include: Add IPMI KCS definitions
> > >
> > > From: Abner Chang <abner.chang@amd.com>
> > >
> > > BZ #4354
> > > This change adds definitions for IPMI KCS.
> > >
> > > Signed-off-by: Abner Chang <abner.chang@amd.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: Nickle Wang <nicklew@nvidia.com>
> > > Cc: Igor Kulchytskyy <igork@ami.com>
> > > Cc: Isaac Oram <isaac.w.oram@intel.com>
> > > Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> > > ---
> > >  MdePkg/MdePkg.dec                         |  5 ++
> > >  MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> > > +++++++++++++++++++++++
> > >  2 files changed, 77 insertions(+)
> > >  create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> > >
> > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > > 3d08f20d15b..0ed033983bf 100644
> > > --- a/MdePkg/MdePkg.dec
> > > +++ b/MdePkg/MdePkg.dec
> > > @@ -9,6 +9,7 @@
> > >  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> > > LP<BR>  # 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>
> > >  #
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6
> > > +2333,10 @@
> > >    # @Prompt Memory Address of GuidedExtractHandler Table.
> > >
> > >
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> 0
> > > 00|UINT64|0x30001015
> > >
> > > +  ## 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..2a51698b126
> > > --- /dev/null
> > > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > > @@ -0,0 +1,72 @@
> > > +/** @file
> > > +  IPMI KCS Register Definitions
> > > +
> > > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > reserved.<BR>
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > > +
> > > +#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 = 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;
> > > +  UINT8    CompletionCode;
> > > +} IPMI_KCS_RESPONSE_HEADER;
> > > +#endif
> > > --
> > > 2.37.1.windows.1
> >
> >
> >
> >
> >
> > 
> >

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

end of thread, other threads:[~2023-03-23  3:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-03  2:31 [PATCH] MdePkg/Include: Add IPMI KCS definitions Chang, Abner
2023-03-03  2:59 ` Michael D Kinney
2023-03-03  3:03   ` Chang, Abner
2023-03-03  3:05     ` [edk2-devel] " Michael D Kinney
2023-03-03  3:10       ` Chang, Abner
2023-03-07  7:50 ` Tinh Nguyen
2023-03-07  9:31   ` Chang, Abner
2023-03-23  1:36 ` 回复: " gaoliming
2023-03-23  2:18   ` [edk2-devel] " Michael D Kinney
2023-03-23  3:21     ` Chang, Abner
2023-03-23  3:17   ` Chang, Abner

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