From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.100]) by mx.groups.io with SMTP id smtpd.web10.80345.1679593168415032478 for ; Thu, 23 Mar 2023 10:39:28 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="no key for verify" header.i=@amperemail.onmicrosoft.com header.s=selector1-amperemail-onmicrosoft-com header.b=Ely5qVV6; spf=pass (domain: os.amperecomputing.com, ip: 40.107.236.100, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YIcxz0CGzkbYUiav6QxvCr5WChH17U9Nyc2bsAz3InLg30R/lqAV+DzJW23fm438RDnid1oMzni6w0G7whrFiJ6/Tt5ffXc8fuJQqrAVfz/UEA8C/YoIcTjOk17UoMVd2UHI4rYblYLXAA8teL6HbUMBCwYR6PI0DOq9+yT17ZERsEpLzbISPZWQm9fIEMRApnWZk9XukIV80sryZn0H+q1YajdB0EKAY/MZrG2GT1VYNbUyMYgqZ1XZ8CTks7qNUIg/qDCrJ3RchEmfm6wy0hLHPeF5j7/lBfrs2SKAQ9iQquG4DB0gHZ0prHfJ7NwOfuICj3AazsYPNG+nmO86nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BJ7e9acD96PtZyLjYWtD/YaxjwIVrFP0QF9Y4JloJao=; b=Xhmr96jLBNIyA8Z4u40zfHfqLBF/JMD4Gxj9j/H6DwzrLNN1oIF7mQKWs6zl1an+vmjYO5RDMJ7+cGRSbgdaXBOHJbwFKjWFhEIz8s1rsOjev6sEgsamevNzA+ZZ2gqviuu998bSQXi4zWkNgrSI8OVoBIVD4EK77eOcUK9chNZ0/hgluLoDlefhEZhqWF76WNQLT2EYCachWtvuIYmTFgaxKG1lp6oxM5tidyO7AxiDdwh6co28XsSEDfqpIMgMPgbYL8z8CNO/4p2kFFVhAipnrxnJJq6dlKB/HI6/Rsl3j4+kyUOBy46sAU2kyyouRpoX8tUBctHiW8k53piawQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-amperemail-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BJ7e9acD96PtZyLjYWtD/YaxjwIVrFP0QF9Y4JloJao=; b=Ely5qVV6jmGp+MjsTAGgT4wOPAl2FxMxPGwMtXSvOlwLe4Q9Ldb023V6gMDrESoMPtu3f20jHnnPzZzlgwwtQWYQGyOlNPYAQ7Vfz1IkPKuuwvNp8MHzNcqj+Sfg+9/kELqfVVlnYCGqbkxsjB/ma1YUALNs8WwllbxyHPx3cAU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from MWHPR0101MB2942.prod.exchangelabs.com (2603:10b6:301:2e::14) by BL0PR01MB4580.prod.exchangelabs.com (2603:10b6:208:85::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.26; Thu, 23 Mar 2023 17:39:24 +0000 Received: from MWHPR0101MB2942.prod.exchangelabs.com ([fe80::1d06:a51a:ca3d:c2f6]) by MWHPR0101MB2942.prod.exchangelabs.com ([fe80::1d06:a51a:ca3d:c2f6%4]) with mapi id 15.20.6178.024; Thu, 23 Mar 2023 17:39:24 +0000 Message-ID: <991455c1-d47c-8a6b-fe97-539f2a4a24af@amperemail.onmicrosoft.com> Date: Fri, 24 Mar 2023 00:39:16 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [edk2-devel] [PATCH v3] MdePkg/Include: Add IPMI KCS definitions To: devel@edk2.groups.io, abner.chang@amd.com Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Nickle Wang , Igor Kulchytskyy , Isaac Oram , Abdul Lateef Attar References: <20230323135737.1473-1-abner.chang@amd.com> From: "Tinh Nguyen" In-Reply-To: <20230323135737.1473-1-abner.chang@amd.com> X-ClientProxiedBy: SI2PR04CA0011.apcprd04.prod.outlook.com (2603:1096:4:197::10) To MWHPR0101MB2942.prod.exchangelabs.com (2603:10b6:301:2e::14) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR0101MB2942:EE_|BL0PR01MB4580:EE_ X-MS-Office365-Filtering-Correlation-Id: e56bbd7c-3075-498e-7c4c-08db2bc58abd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Af9pOn1chWbzlqrfxshMswwrQd0wT94Ila543MdHux8NzjFckLy30TEVC8igiLQX5B5nPvva3AhCfiaFcZ8kP5MxQIPObAAgmrFCqvxMOyQbZM0hu6G1bXyWYIT8DBqHiH2Mi9SgfT5y5LsorA+ltNKkKRaBGdAk3eQ8vWVuJKb+SU5CYFnAx8dDMKsAmhxTtdSFWKNC4X+7/ve4YIlmafN/5H5cIMJ5qupY8QEKjhPEO3Ov2vQXwBYjZKFJCtnsi7XCl1m16FeLgN/XhBUW6ROs3Rl5+5ljRJzhbdikK+XXXT7pauIJZT7wvPdd38VC2RR3te6FjjOh3dxzPmsZ8hGvWXXXAfm59pUVuagFLIVtb0ZGNxi1VweYpdbP3NNe5CzNJynMT44mH7ZtTynctvJ2Yx/noAdtaekJyb9lH10I2uWjRisviKIpBVKVKOMg530S5T7zy8exDrAAV2VTAti9Q0mc7bVC8X+BrEx0vHFGy/WZBJ9InkEptpDIxW+DHwO+JmY0bOvxlEYUUAl8UbsiVP9zT3Z1JWbL2fdPlz7kJ5OU/0gApy8oj057hhdkGecVRuy+AGfCr2nG1G9pb7tDjYwh4qayPx0IAkHVT/X1ikpmiuVZr0Kg1jVpodi/wb1fskJl6V00fY8N9epSa4kZhqfHM6O6BLOH3pzbMeZRah/rxKD2IUMMCZ4IcvLC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR0101MB2942.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(396003)(346002)(39850400004)(366004)(451199018)(31686004)(41300700001)(66946007)(8676002)(66476007)(66556008)(4326008)(5660300002)(8936002)(2906002)(38100700002)(31696002)(83170400001)(53546011)(966005)(6512007)(6486002)(186003)(316002)(6506007)(6666004)(26005)(54906003)(83380400001)(478600001)(42882007)(2616005)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MEh0d2NOcVBpblJGdlpiaWNMdmhKT0NrWlorMktyMU15UkpZUUNGUjdIOEZX?= =?utf-8?B?STl0c0pSRS9FMjRCbWszVDdXelF1NUF0Uk03VjJwT1JrVk4wWlFHdHlyTm9I?= =?utf-8?B?YkRncFk4RFV6ZVBKN2h0UTFXdFZIOHhKRXA2QW5BU251QjhmR25EYnVodFpX?= =?utf-8?B?RUJTc2l5NmUyd00zdEY4ZU95SnVKTy80R2poNHFRaUc4MS9aSVFFVlhJVThO?= =?utf-8?B?WnVNdzA0QmpoWU92R20vdi85Y28yNkJlOTltYWl4NEdaTEo3UlZGTmdPNXRs?= =?utf-8?B?RHBrSXp3Q0h6Y0dDYXY3U0xpREtSd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B?YW1hcHF4UHI3dkF1clRyK1U1NWVQOGgxbHF3ZFI4K2pYOHl4OGZlZjdkTlN0?= =?utf-8?Q?msijLOvP2VRc6vSWTpfhTxM+7sWhV2ShJ3c3dDP/T6uS?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e56bbd7c-3075-498e-7c4c-08db2bc58abd X-MS-Exchange-CrossTenant-AuthSource: MWHPR0101MB2942.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 17:39:24.3657 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S9IZFnzTGXLvGpqLkqnVV0HmEZHfS/W/Wd0rwZm5Phi7tXbsMZ0dtgZvPAFVJQCfMJ8Pu545HdYijcIgc3aT0hJYLm1AAHdZCsTGxQoZNNPpJhalLF88EWw5DDQDe4za X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR01MB4580 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Abner, On 3/23/2023 8:57 PM, Chang, Abner via groups.io wrote: > From: Abner Chang > > BZ #4354 > This change adds definitions for IPMI KCS. > > Spec ref: > https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html > > 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 | 6 ++ > MdePkg/Include/IndustryStandard/IpmiKcs.h | 76 +++++++++++++++++++++++ > 2 files changed, 82 insertions(+) > create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 2d643bede1d..5cf04bc0cb6 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 > # > @@ -2342,6 +2343,11 @@ > # @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. > + # The value of 0xca2 is the default I/O base address defined in IPMI specification. > + # @Prompt IPMI KCS Interface I/O Base Address > + gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|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..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/ipmi-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 = 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; That definition is fine, but I'm curious why you don't use bit field to separate NetFun and Lun > + UINT8 Command; > + UINT8 Data[0]; > +} IPMI_KCS_RESQUEST_HEADER; It should be REQUEST? > + > +/// > +/// IPMI KCS Interface Response Format > +/// > +typedef struct { > + UINT8 NetFunc; > + UINT8 Command; > +} IPMI_KCS_RESPONSE_HEADER; > +#endif