From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.67]) by mx.groups.io with SMTP id smtpd.web11.96416.1679649284463668976 for ; Fri, 24 Mar 2023 02:14:44 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=XmjC5xgG; 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.244.67, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ub0szFMMMF1GdMv594SOP2ENy2viHdR+m5ezQ5iaN3jJfbri5yCdbb395+yyuecZlBS7OtiOj020+w+XPVabEfSlbh1KtZ5UJbpZaDT/9mNm8j274bEkjqQjZaZlc6eF1H6zlci9DjAY1Hi9myi5OX3mixAX/kb5GwVnB0h2BxMiSRtTv5YslIrCkEQ0tMJfpIELFpHCzziXoMOqjKTNiukZRjwJL0sK39qfG2mba0tJ7anVEszn4jgBzRYFQGZTSmh6C+iX3dHMRBB/488x/8KoDxCXaGmtcqWQypJ71qnfNjrLzgmPRDGmOPkpRHCBnRx0rb3X5x/70KwggeZYkw== 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=rjl+g3ShUU0VTrhYodp7MLciSC5KWtfUDgmJwWCK8y4=; b=R1Qnw8wykTYHuOEVPHqQLfJ4Ty+x7XnP4uylmAglhAKivYuPt36M12QlQVg9gdwZ3XR0EYt3bUMhXfxvJk5xHYicAYeGJLMMme5LbN6xlgmlJ0I4LNTNl3X7e94gmtbzc4kCWea8UA6OFdAYPA6EQWlcFdCYXcj/ZDykYZ/Z4Dqb6iFgJJ+kRbAATzzQ07vUIK985Vx0mzmWY4mX1Ew5TdL+TjCc51bygShe3vh7vHSirFvuHA/WZ1rPR5v0E5Ar90wGXtRnT9N/IWTyichTKqJpNnynZKkOZjjmFVJtGxxSaspBztvXxNl20iD+6pFn48FgeToW+uXThyT+tJfoMA== 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=rjl+g3ShUU0VTrhYodp7MLciSC5KWtfUDgmJwWCK8y4=; b=XmjC5xgGafS86TM4kAGOg8srNQ0MElpc+x9PeV6V/gR8DEnnXUJQ6a2QbTfnJzjJo0m+dLXNhvrY133UDSfhfVQkCSEeJ4pbyk73YlYF3zztEk22b72JjnQrAsYKoKc6laKOcK9T3P5Znb2cPS9t/kO4bekl3mg/3N47wEKBtVg= Received: from DM6PR05CA0040.namprd05.prod.outlook.com (2603:10b6:5:335::9) by DM6PR12MB4042.namprd12.prod.outlook.com (2603:10b6:5:215::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Fri, 24 Mar 2023 09:14:42 +0000 Received: from DM6NAM11FT088.eop-nam11.prod.protection.outlook.com (2603:10b6:5:335:cafe::4d) by DM6PR05CA0040.outlook.office365.com (2603:10b6:5:335::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.9 via Frontend Transport; Fri, 24 Mar 2023 09:14:42 +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 DM6NAM11FT088.mail.protection.outlook.com (10.13.172.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.22 via Frontend Transport; Fri, 24 Mar 2023 09:14:41 +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; Fri, 24 Mar 2023 04:14:39 -0500 From: "Chang, Abner" To: CC: Michael D Kinney , Liming Gao , Zhiguang Liu , "Nickle Wang" , Igor Kulchytskyy , Isaac Oram , Abdul Lateef Attar Subject: [PATCH v5] MdePkg/Include: Add IPMI KCS definitions Date: Fri, 24 Mar 2023 17:14:18 +0800 Message-ID: <20230324091418.1095-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: DM6NAM11FT088:EE_|DM6PR12MB4042:EE_ X-MS-Office365-Filtering-Correlation-Id: ea83784c-d736-4331-2a02-08db2c4833bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s+EvVnsoBc6pu9cWhjlEweeo74+4nJxomf1q9W7itV3mjW7pgtTrtJWynGnaBQhFcKRN200zS5BfmhR0hOtNS50NkwZ6m/IKTYyr1Si5VFaESs8fbOckKTO2Y0zJvVhy0EiYGnYAnwuux+uPlF31dumwdGb5maZ4V5uHGeaIJVX3BQaLBZ5B5N+eTk/g7fEjB9ZS5aI4fViwpT03/U9ljE3lvCubq6U/uk2fpfXrtZkLLcYhsUtyxzK25lZPQprvQ7LVu5iVhSngHZnmzX3ywI4NwCvtybBgxP42y3h+CzHZJ987ZhTCkE8dseELsEppU7tIFqbliNS2cGCoijLtZrpZ6lHJuopx0B3RzqLjHRXFbN5PvuVr/aQ5k9iSSVOI1n8gt+icuDejdMOV9sPDYSQ5q7OeVQkwqbtD23Jvb/6piJ/6z8FstOd7pDih2ed/tQmyCkR32DBFs0UhTnZKw+69YKAVHlEiwxlETas4bAZEPUWLlFgbIHfEueljvThwa8uQF/n4RtggWqG839jVN53gDEg8WPXBQHYrTDpaKAMHbcSYSmTXsEwRNGHYYl+aWiDaqanPXShcFaMctuuLBuhZ6gKYTT3VCRDjuD1NIY0LPZK/5JFbzxPi36+PrUWiUus7/jbs1vCtNSsecJzTHL6CuxWPea3RZ7rf64MU0QQjZQjs+BsozpbzpgRSk6tMIADEfZtk50SbIZgkor1uZ+MBYmuDQajrbBlYMViEQ1g= 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)(39860400002)(396003)(376002)(136003)(346002)(451199018)(40470700004)(46966006)(36840700001)(70206006)(8936002)(70586007)(41300700001)(86362001)(6916009)(4326008)(8676002)(40460700003)(36756003)(1076003)(356005)(81166007)(26005)(36860700001)(40480700001)(2616005)(336012)(426003)(47076005)(83380400001)(6666004)(186003)(82310400005)(16526019)(478600001)(7696005)(966005)(54906003)(316002)(82740400003)(5660300002)(2906002)(2876002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2023 09:14:41.9512 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea83784c-d736-4331-2a02-08db2c4833bc 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: DM6NAM11FT088.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4042 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 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|U= INT64|0x30001015 =20 + ## This value is the IPMI KCS Interface I/O base address used to transmi= t IPMI commands. + # The value of 0xca2 is the default I/O base address defined in IPMI sp= ecification. + # @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/Ind= ustryStandard/IpmiKcs.h new file mode 100644 index 00000000000..7b3ba45bf9d --- /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 =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[]; +} IPMI_KCS_REQUEST_HEADER; + +/// +/// IPMI KCS Interface Response Format +/// +typedef struct { + UINT8 NetFunc; + UINT8 Command; +} IPMI_KCS_RESPONSE_HEADER; +#endif --=20 2.37.1.windows.1