From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.65]) by mx.groups.io with SMTP id smtpd.web10.93071.1679626022672901267 for ; Thu, 23 Mar 2023 19:47:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=FUyPwpeR; 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.102.65, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHnMliitgd7xSmohKpL9Y5F+JoG9j1ceQYTVccILs87+41B6mzij7pMwap79N7tfNMtQA9pzJsG1UdJCaDRD8470ULmArJf1aon780J/V5Q2LbEXghQkYAhACARJb/6AQ+HzWnW89BqRicO7DG/Um4fBRBCTJEIWwuO48mBP54YrECefFTMPOZEL/bEX4Hd1nLhFVDyEzYlBiuie49m25HM43OWjtzJB2iXbNue1/pGFqpkaQzoRCJVmntIFzjj0VNmvC0aaKwkevK2XcVxBP/1xDLKhx2aqln5EEZQQyocfy8tq/9sCRv3kqfJr+wIl3hzdW0MHw+kpJU7Gzb62hQ== 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=bJeF3CizK32BflvUAqwa3ceqh+w6XLmpQE9loq2LYGo=; b=IFF53uPxxqxlr91eT1zNTLBNiJ8mYZQce+5zDeOspVSpr88FmmI+MQuCh8hmwq++S4g0ZPhneviWz+UdT4iYfVm6HGWCSpbiqGWuXKVzCiUgJv/jcGboSQQXfQQxgo1/M+bJydC9HOHA1G3nYjCDWL5j/yeZzf7QEA1XVvyLH+PKJHRM1J1m8nooA9dLzFiV7qSVY5h6rqlNDnr8Qc/z2JKKN7aYup10L6p3LluPnnN5PqQntL0XH0RBER8MYfB7X1N/4GhsrrX2TszbQEptD9Nf+87PihvdPCYIXEgZzxX4yuxP4MMtlMI9pfZh/k26uUGvG35GGMd15S+PvcmnmQ== 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=bJeF3CizK32BflvUAqwa3ceqh+w6XLmpQE9loq2LYGo=; b=FUyPwpeR28VYHRj+dxUv0x06RO8xzji9Dcf1h8WCOloWqHaO6CHx+1DYBB6sE0B5lO285CK8zu5trC+NAXUC5DUoS2gRTgxTRtO9gMOlMs7g3HVwQbKyR/wuRMBvhRY0BtpxuuqACpQa3K2UJjgvnS8nFmOVDw54M8RrOF/VRDk= Received: from MW3PR06CA0029.namprd06.prod.outlook.com (2603:10b6:303:2a::34) by DM4PR12MB5746.namprd12.prod.outlook.com (2603:10b6:8:5d::16) 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 02:46:59 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2a:cafe::a0) by MW3PR06CA0029.outlook.office365.com (2603:10b6:303:2a::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38 via Frontend Transport; Fri, 24 Mar 2023 02:46:59 +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 CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6222.17 via Frontend Transport; Fri, 24 Mar 2023 02:46:59 +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, 23 Mar 2023 21:46:56 -0500 From: "Chang, Abner" To: CC: Michael D Kinney , Liming Gao , Zhiguang Liu , "Nickle Wang" , Igor Kulchytskyy , Isaac Oram , Abdul Lateef Attar Subject: [PATCH v4] MdePkg/Include: Add DMTF MCTP definitions Date: Fri, 24 Mar 2023 10:46:36 +0800 Message-ID: <20230324024636.669-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT053:EE_|DM4PR12MB5746:EE_ X-MS-Office365-Filtering-Correlation-Id: e145f994-9216-4e61-81e3-08db2c120a0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ngQsZSPtFJgwv1UozGS6Zr4orKBrdzPIYeZiw0jeK1nwwNDl23U9MXMKemXZepDcUKceZwOPKSkscPkFWtFgs49ONXQkxb3RqFRkt7UhhFpEBCWe8iPLFncj3rYew6vcifmfSJj8CaARq8U8gpVZ2In9xfS1OF7nV5K47EV/P5xVuEnUXHSNYxHMPfe2jkAAehLBM5K10GHe3TUgIzxlwDPJhQPK5yb47T51fcFrZmIIlJ/lAalo/nZ9gIwWYttfOOx76gd2Qnouo5mX7Ez+8dYqpbwiMcq43ZHmocihyn1Rfl5SNv6gF7RynlPhgnOw5nyBg9lBIjeDDk+jv5Nqh/2N1ryoAYXvB0VjsHVHFEhADuiiWi0Evjs7Fb8uHpV/mAZHBkeu8OtLpVveCj6ZLri7n2NRwKM+ey9vvgyksCqBGB3apBSd2ipJGMvla7k2UmwACKD55eelKjyLbkmRlGI4TRvYpYx6Qp192k5VCSHOSKWGvWH7I6kWAdGea+z7rjXJsW3dAhVP560JiKK5E0QmGp6NMfwps09oOVagMGmycWQeBhA2qvELJbBfPAtaiF3DwCzuU4zcPXIwytyEncX2YNxfy6rVoCyDSGW7qTuGsKKFPEyF51kP1HU2c15Wq/dA/pU5ckzr51evEgoCJHog2E8yXyFoFy+ONwQTxSwCW88aAY31obfIpD65C0p+0p/IpLAsj9UGt9g2kzJrC/FpduHJYtA/NSd//1U84sk= 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)(376002)(39860400002)(396003)(346002)(136003)(451199018)(46966006)(40470700004)(36840700001)(36756003)(186003)(478600001)(70206006)(8936002)(5660300002)(54906003)(7696005)(41300700001)(8676002)(4326008)(6916009)(40460700003)(86362001)(6666004)(16526019)(966005)(26005)(356005)(81166007)(1076003)(82740400003)(40480700001)(336012)(47076005)(426003)(83380400001)(2616005)(2906002)(316002)(70586007)(36860700001)(82310400005)(2876002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2023 02:46:59.1472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e145f994-9216-4e61-81e3-08db2c120a0f 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: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5746 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Abner Chang BZ #4355 This change adds definitions for DMTF MCTP base specification. Spec ref: https://www.dmtf.org/sites/default/files/standards/documents/DSP0236_1.3.1.= pdf 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/Include/IndustryStandard/Mctp.h | 139 +++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 MdePkg/Include/IndustryStandard/Mctp.h diff --git a/MdePkg/Include/IndustryStandard/Mctp.h b/MdePkg/Include/Indust= ryStandard/Mctp.h new file mode 100644 index 00000000000..81f99a38347 --- /dev/null +++ b/MdePkg/Include/IndustryStandard/Mctp.h @@ -0,0 +1,139 @@ +/** @file + + The definitions of DMTF Management Component Transport Protocol (MCTP) + Base Specification. + + Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Revision Reference: + DMTF Management Component Transport Protocol (MCTP) Base Specification + Version 1.3.1 + https://www.dmtf.org/sites/default/files/standards/documents/DSP0236_1.3= .1.pdf +**/ + +#ifndef MCTP_H_ +#define MCTP_H_ + +/// +/// Definitions of endpoint ID +/// +#define MCTP_NULL_DESTINATION_ENDPOINT_ID 0 +#define MCTP_NULL_SOURCE_ENDPOINT_ID 0 +#define MCTP_RESERVED_ENDPOINT_START_ID 1 +#define MCTP_RESERVED_ENDPOINT_END_ID 7 +#define MCTP_BROADCAST_ENDPOINT_ID 0xFF + +/// +/// MCTP Control Commands +/// +#define MCTP_CONTROL_RESERVED 0x00 +#define MCTP_CONTROL_SET_ENDPOINT_ID 0x01 +#define MCTP_CONTROL_GET_ENDPOINT_ID 0x02 +#define MCTP_CONTROL_GET_ENDPOINT_UUID 0x03 +#define MCTP_CONTROL_GET_MCTP_VERSION_SUPPORT 0x04 +#define MCTP_CONTROL_GET_MESSAGE_TYPE_SUPPORT 0x05 +#define MCTP_CONTROL_GET_VENDOR_DEFINED_MESSAGE_SUPPORT 0x06 +#define MCTP_CONTROL_RESOLVE_ENDPOINT_ID 0x07 +#define MCTP_CONTROL_ALLOCATE_ENDPOINT_IDS 0x08 +#define MCTP_CONTROL_ROUTING_INFORMATION_UPDATE 0x09 +#define MCTP_CONTROL_GET_ROUTINE_TABLE_ENTRIES 0x0A +#define MCTP_CONTROL_PREPARE_FOR_ENDPOINT_DISCOVERY 0x0B +#define MCTP_CONTROL_ENDPOINT_DISCOVERY 0x0C +#define MCTP_CONTROL_DISCOVERY_NOTIFY 0x0D +#define MCTP_CONTROL_GET_NETWORK_ID 0x0E +#define MCTP_CONTROL_QUERY_HOP 0x0F +#define MCTP_CONTROL_RESOLVE_UUID 0x10 +#define MCTP_CONTROL_QUERY_RATE_LIMIT 0x11 +#define MCTP_CONTROL_REQUEST_TX_RATE_LIMIT 0x12 +#define MCTP_CONTROL_UPDATE_RATE_LIMIT 0x13 +#define MCTP_CONTROL_QUERY_SUPPORTED_INTERFACES 0x14 +#define MCTP_CONTROL_TRANSPORT_SPECIFIC_START 0xF0 +#define MCTP_CONTROL_TRANSPORT_SPECIFIC_END 0xFF + +/// +/// MCTP Control Message Completion Codes +/// +#define MCTP_CONTROL_COMPLETION_CODES_SUCCESS 0x00 +#define MCTP_CONTROL_COMPLETION_CODES_ERROR 0x01 +#define MCTP_CONTROL_COMPLETION_CODES_ERROR_INVALID_DATA 0x02 +#define MCTP_CONTROL_COMPLETION_CODES_ERROR_INVALID_LENGTH 0x03 +#define MCTP_CONTROL_COMPLETION_CODES_ERROR_NOT_READY 0x04 +#define MCTP_CONTROL_COMPLETION_CODES_ERROR_UNSUPPORTED_CMD 0x05 +#define MCTP_CONTROL_COMPLETION_CODES_COMMAND_SPECIFIC_START 0x80 +#define MCTP_CONTROL_COMPLETION_CODES_COMMAND_SPECIFIC_END 0xFF + +/// +/// MCTP Control Message Types +/// +#define MCTP_MESSAGE_TYPE_CONTROL 0x00 +#define MCTP_MESSAGE_TYPE_PLDM 0x01 +#define MCTP_MESSAGE_TYPE_NCSI 0x02 +#define MCTP_MESSAGE_TYPE_ETHERNET 0x03 +#define MCTP_MESSAGE_TYPE_NVME 0x04 +#define MCTP_MESSAGE_TYPE_SPDM 0x05 +#define MCTP_MESSAGE_TYPE_SECURE_MESSAGE 0x06 +#define MCTP_MESSAGE_TYPE_CXL_FM_API 0x07 +#define MCTP_MESSAGE_TYPE_CXL_CCI 0x08 +#define MCTP_MESSAGE_TYPE_VENDOR_DEFINED_PCI 0x7E +#define MCTP_MESSAGE_TYPE_VENDOR_DEFINED_IANA 0x7F + +#define MCTP_ENDPOINT_ID_NULL 0 +#define MCTP_ENDPOINT_ID_RESERVED_START 1 +#define MCTP_ENDPOINT_ID_RESERVED_END 7 +#define MCTP_ENDPOINT_ID_BROADCAST 0xff +/// +/// MCTP Control Message Format +/// +typedef struct { + struct { + UINT32 MessageType : 7; ///< Message type. + UINT32 IntegrityCheck : 1; ///< Message integrity check. + UINT32 InstanceId : 5; ///< Instance ID. + UINT32 Reserved : 1; ///< Reserved bit. + UINT32 DatagramBit : 1; ///< Datagram bit. + UINT32 RequestBit : 1; ///< Request bit. + UINT32 CommandCode : 8; ///< Command code of request message. + UINT32 CompletionCode : 8; ///< Completion code in response message= . + } Bits; + UINT32 BodyHeader; +} MCTP_CONTROL_MESSAGE; + +/// Minimum transmission size is 64 bytes. +/// The value of 64 is defined in MCTP Base Specification. +#define MCTP_BASELINE_MINIMUM_UNIT_TRANSMISSION_SIZE 0x40 + +/// +/// The 32-bit Header of MCTP packet. +/// +typedef union { + struct { + UINT32 HeaderVersion : 4; ///< The version of header. + UINT32 Reserved : 4; ///< Reserved for future definiti= ons. + UINT32 DestinationEndpointId : 8; ///< Destination endpoint Id (EID= ). + UINT32 SourceEndpointIdId : 8; ///< Source endpoint Id (EID) + UINT32 MessageTag : 3; ///< Check the MCTP Base specific= ation for the + ///< usages. + UINT32 TagOwner : 1; ///< Tag owner identifies the mes= sage was + ///< originated by the source EID= or + ///< destination EID. + UINT32 PacketSequence : 2; ///< Sequence number increments M= odulo 4 on + ///< each packet. + UINT32 EndOfMessage : 1; ///< Indicates the last packet of= message. + UINT32 StartOfMessage : 1; ///< Indicates the first packet o= f message. + } Bits; + UINT32 Header; +} MCTP_TRANSPORT_HEADER; + +/// +/// The 8-bit Message Header of MCTP packet. +/// +typedef union { + struct { + UINT8 MessageType : 7; + UINT8 IntegrityCheck : 1; + } Bits; + UINT8 MessageHeader; +} MCTP_MESSAGE_HEADER; + +#endif --=20 2.37.1.windows.1