From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.44]) by mx.groups.io with SMTP id smtpd.web10.14757.1677813452080288542 for ; Thu, 02 Mar 2023 19:17:32 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=AHmek2lR; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.220.44, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qrb6LaG18nqqaJVic+PXUH/lBq3Yb0AKyEAMN95ozh5CfiEfSAlx/s+g7xscDUzwlbzv5PHad3t+8XaZfBd30GO40WtvaWmRszLr+4jv16uHefLixEpgWgXol/IId9I/383odLOqkBNiHlZRjjE9A2snMNb1+HsZ5iwR/51sFp7snB5Qi+HOHh1RJqH7hsfvYBF/a/zAuJzoAlVesgf5+wC0AzcZM5/QdTuyULHu0uRazd8/i0WrM/Q7LFUM6wa96cJML2YoqPJ0lF8tPnMy5KIFd3wRyNxwNFJJgFkHCeyUff/01BsK1cW0JMfx5DHcCMyG9OfB3LFi7srVMgdENQ== 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=Niwsns9VRMVn4VZGdP3tMD+vhJI4xVZUK95B/plo7+c=; b=bAA/11K9FMsss1oxItK1Gy6A7Ng/mavKyF5FYVY+aza7/wIO5Ptgt4tGEqIzy7ZujDA58NY2gA34px2FMUS1Uu4IIG6eqJLjqvtwvHBom1i60lzLjDqgnuirqA9w7AwaZ+c1R2sblFKUHl6uQTbzFAcMec02cFUwj4GJ8DUQGWwOVNg/XTrHgS8M9/vYl3Au5Fs73ul4h+SDry3Bpb/PwbbPARv1GhYfIUuhzf7XUe/LK+U4KkxERSI4yHft6S4drmOFBxTdWZkLTFJnkasmtRjRqtSI11SV7T7kawSA8I2liaJGI8wOBaRJUQ7tZZgxR5+l3jwjX05mGrjgIAvYJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Niwsns9VRMVn4VZGdP3tMD+vhJI4xVZUK95B/plo7+c=; b=AHmek2lRWM3TYMTyk9xKKWQ5j+KLsuZ23EyoZDs9Z5ewzuwUZW+KxTIXIFFnU62brTjsya3/6MNqGW27SrCbCe62OsR5Rh6uu+dgV+AuRc9Les+0Gc5LdFRP+xRufqcA7fXXDHvNN3gJ3cjWDrgzcaqz2TyOjzLAY95Q7SEpkdE= Received: from DM5PR08CA0059.namprd08.prod.outlook.com (2603:10b6:4:60::48) by MW4PR12MB6731.namprd12.prod.outlook.com (2603:10b6:303:1eb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19; Fri, 3 Mar 2023 03:17:30 +0000 Received: from DM6NAM11FT072.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::61) by DM5PR08CA0059.outlook.office365.com (2603:10b6:4:60::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19 via Frontend Transport; Fri, 3 Mar 2023 03:17:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT072.mail.protection.outlook.com (10.13.173.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.20 via Frontend Transport; Fri, 3 Mar 2023 03:17:29 +0000 Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 2 Mar 2023 21:17:26 -0600 From: "Chang, Abner" To: CC: Michael D Kinney , Liming Gao , Zhiguang Liu , "Nickle Wang" , Igor Kulchytskyy , Isaac Oram , Abdul Lateef Attar Subject: [PATCH V2] MdePkg/Include: Add IPMI KCS definitions Date: Fri, 3 Mar 2023 11:17:09 +0800 Message-ID: <20230303031709.1481-1-abner.chang@amd.com> X-Mailer: git-send-email 2.37.1.windows.1 MIME-Version: 1.0 Return-Path: Abner.Chang@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT072:EE_|MW4PR12MB6731:EE_ X-MS-Office365-Filtering-Correlation-Id: 37b4312a-91ee-4948-cc16-08db1b95d266 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SFY2Z3EJNCVXSSboTJZRYi6ld31jQmdxK+q6kH5167KlotYkO8suPbT6wHxHhaNsqkLWEmSxUYrTXBc8t41tniIhUTSJqwRL87zC2g23LGstDa685ZINGO9dTZDZYSKZqa2TlWoB6lwb16W43SmpM0+4WeA57aGs2JRG/E9B5jRe6TBWUYSP2ak4MoJytfNRwLpnyrRsOgMbc8CSlt5e11H20EKoG2kTcZZJU+0WJHe93DtHKYEiMUQhPI+xQ3f1tNhh+D1DJKaNti/5YTjIUvf/fzxGJs0ALnkWdggocCXdGqX/3dPW508IbDYwO319jLPVEqwTBEv4sEFg3lZPsYMYhP2NKwcJv00kIZAkljLlaJux8bPlYUVomx/KqXGnjdgghGe2wTq7IDf0/eHXBq4C/DwFQ4kn01g2a5bX6ekoZIbc4mWvzjMGocL9vnI+61iEJFNqOQL91k5zrwT7g0I6EyXGovjr23VCrh+x5+CmYzuFerlKLk+Q88fe7oErQfAlUnzcV6KzXhgpKL7VzTExAPs4i5Am74Hzq68XwrJrGTXCIyudItVn9FKYLE3tksVtElwFg1x99fqcAmkI3mphYwoD7hHhlQszERlzmsB64K7s0NNmpsbhPyd6OaraN5il8dOvQid+WQbVVSQIOTdnqYBrSMsndLjq9EdQYRWPtHVblcU2S1QTPAo2ZUQ+e1pkNbTuif7hK3jwoPI1XZCZ8TGRaiT5wf4tpGc8xsQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199018)(40470700004)(46966006)(36840700001)(426003)(36860700001)(83380400001)(6666004)(47076005)(40460700003)(36756003)(478600001)(5660300002)(82740400003)(8936002)(81166007)(86362001)(356005)(40480700001)(82310400005)(26005)(186003)(2616005)(16526019)(336012)(966005)(2876002)(1076003)(70206006)(70586007)(2906002)(7696005)(316002)(41300700001)(8676002)(6916009)(4326008)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2023 03:17:29.6305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37b4312a-91ee-4948-cc16-08db1b95d266 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT072.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6731 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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-sec= ond-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 --- MdePkg/MdePkg.dec | 5 ++ MdePkg/Include/IndustryStandard/IpmiKcs.h | 77 +++++++++++++++++++++++ 2 files changed, 82 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
# 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 # @@ -2332,6 +2333,10 @@ # @Prompt Memory Address of GuidedExtractHandler Table. gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000000|U= INT64|0x30001015 =20 + ## This value is the IPMI KCS Interface I/O base address used to transmi= t 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/Ind= ustryStandard/IpmiKcs.h new file mode 100644 index 00000000000..6533135dcde --- /dev/null +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h @@ -0,0 +1,77 @@ +/** @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 =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; + UINT8 CompletionCode; +} IPMI_KCS_RESPONSE_HEADER; +#endif --=20 2.37.1.windows.1