From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.137]) by mx.groups.io with SMTP id smtpd.web11.11790.1682654579297698638 for ; Thu, 27 Apr 2023 21:02:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@os.amperecomputing.com header.s=selector2 header.b=DnVfVD8L; spf=pass (domain: os.amperecomputing.com, ip: 40.107.223.137, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WzhEBcSE+gZ95y03Q5kV2D+1FMty9TK7V2SIFZOwzxx0ajFitGLWbhm6yfVJ3EFiRQI5Np0oG4yJDN4lX+q4h4J0rjc14SkBZILWjCpyBskrS44+msj5tqf01UpCGfJXszgtLxoCJDlXNB0NO3eODgyL7MDQjoMITi19yF9UR3vnX6KmIKK1bg/PzamO+rMp1vaWngJ7irLo7Pj6Yzc0adkoradUrQoo2Rf7hSicthAAzgqz4NmWlcUNTUzR2JzY+OAdSMUgKvoQyuvdJG6GtzEkXJmhHeDIpmTC/MqKvCR7eJXFW4QVCCRp8HZoxjyAw6P7Px54UaDdJV8J25FBXw== 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=27YwTtktCUgHtuVk9c23Yk8LC7WJ3kZn8JENgWK59N4=; b=dsExcLebIPdkNZWDvZbES0XLJHLXpWksB9s1OvPUgg9D+taWs2e8Wl4j2Hq0FQs8P2/xe8aFqOQGYdYNZ5LNfO/6HNQsfX5T4NonzwSz7ZXWZip464M5nOY5L75mljL1lBG0R6V1SATuyk5cD9lZkJyVWFiCQYRQNccxqng/mrszk75MfFBi+JfaqUfwVaVTCB90n+wrJonzPMByMnQZHvAdqqPzMBlpkAB8BmFef4z4f9ZQMHhLyRlVwufwH5Ke45bbNB34PMA5gm2C/YNH/2FOQnLOOJuOhzoacqORDl2BeeyWGH+sKQQVwiqnHVH1z/NXKHMxK73JFJsHwvSdnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=27YwTtktCUgHtuVk9c23Yk8LC7WJ3kZn8JENgWK59N4=; b=DnVfVD8LOfH8IV4maRXM3W7+Ma/TRYRRx13OxPuo8ANkVJeTyDuwHvkMo29smvliQ929xh2m29LBnkqJejIf+KtzP77yilTrmFXfR94nNVmq7kzteBHIOgUKN4be487yLzvF6KGjpLTRS11emh8EtLVKJUtWAtVW2AAiqhfHEtk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM5PR0102MB3336.prod.exchangelabs.com (2603:10b6:4:9f::11) by SJ0PR01MB6223.prod.exchangelabs.com (2603:10b6:a03:2a2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.23; Fri, 28 Apr 2023 04:02:57 +0000 Received: from DM5PR0102MB3336.prod.exchangelabs.com ([fe80::bb9e:46d1:ae4b:caf2]) by DM5PR0102MB3336.prod.exchangelabs.com ([fe80::bb9e:46d1:ae4b:caf2%7]) with mapi id 15.20.6340.020; Fri, 28 Apr 2023 04:02:57 +0000 From: "Tinh Nguyen" To: devel@edk2.groups.io CC: patches@amperecomputing.com, michael.d.kinney@intel.com, gaoliming@byosoft.com.cn, zhiguang.liu@intel.com, abner.chang@amd.com, Tinh Nguyen Subject: [PATCH 1/2] MdePkg/IndustryStandard: Adds definitions for IPMI SSIF Date: Fri, 28 Apr 2023 10:59:39 +0700 Message-ID: <20230428035940.1765700-2-tinhnguyen@os.amperecomputing.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230428035940.1765700-1-tinhnguyen@os.amperecomputing.com> References: <20230428035940.1765700-1-tinhnguyen@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:54::21) To DM5PR0102MB3336.prod.exchangelabs.com (2603:10b6:4:9f::11) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3336:EE_|SJ0PR01MB6223:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d32a30b-be30-4fea-67d1-08db479d72ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 77e0wr4BkB2I15vdab28TXpNLiz2FUlC+5qI2Rc9KEIPh303uTx5Aro9yf7qkYLRCYSKdVMhKIX1yxK5RvI5j7yR4Q0kP1NzVTmJ/Tg1vQgqfNHLKYdZFs1f8czYPRVLczuRfCTaINPrHpRUrEcmJGly+3OnMPHXKrkcRO2vYjRmsqiuD9gOmKpy1oykER8fRHJexLvRajgC0r1kINNFr7UdK0NMr3Ooj9uTdqWhy5VrpMRA/+SA7XGIzpL5kAHwPnIfx9DBE/H61lloVy8iA5Ka/8ZPJ5nm6e4UHPpIljajWyD5qf/CBEM68GTzzJITmKYOTD9hRAnp55fK8YZsEVNG4HrFNSZG6LUbCvwPF9u3SvKLasOXCC/QByGVFRt5jXUN1s6EmSJ0LAWEscLnoA4rm70FlRgwCFq06qOZDCIcNafEpObQ7N0/jSZw4r5O+HiTRhy2OqbSui1O6r/YAcq210foJ9RXJXgPe7YcflLqX1Zk95PNbEryG+fqbrJLd6SPE5HUN3QFKnNV+4lq2fkTbAcCCL7wfriiRB79P0Tq4yBI5OrlZDznY1C8lSh33twRrsNpLNtaTr1BYEaMv0UEkXQdkhueL20bm9wwa1c= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3336.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(136003)(346002)(39850400004)(396003)(451199021)(86362001)(478600001)(38100700002)(83380400001)(966005)(186003)(6486002)(107886003)(6512007)(26005)(1076003)(6506007)(52116002)(2616005)(6666004)(38350700002)(316002)(8676002)(41300700001)(2906002)(8936002)(4326008)(66556008)(5660300002)(66946007)(6916009)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fPKkthp/7VL0hF4FbxnA+cc8wSlYsd6xCzlH3ycM1K5mtBx8t4fOZvBYJZQt?= =?us-ascii?Q?+1c/13cQ+lEoSxANc5E6ZRS5SGdKAMASt1J3HB+M4xLBrFhprNf4HRDjihqx?= =?us-ascii?Q?5RK68WaxaDLGWmZbGUIOPSnCPyqJeZINfnhWODZqKvkFL46pKbI8be8/xFhv?= =?us-ascii?Q?+WMzhVmopoAc1TKRg8O4zBfBc91TRiz5oVIZKRHhf5XIJtGBjBfpGpW8Tj70?= =?us-ascii?Q?vc25Rcz3BFC/Caw34yWXROE1tpABLGmygp4MDSLsWYU0/pYWhC+0vUOvh47/?= =?us-ascii?Q?N81ie1QsBWUWwo5XdnRLZqi6HlF26m6r+FY8/WMRa7og2S7mvyGFLbIJWe9J?= =?us-ascii?Q?GirzIC6Y/LmPTurEy19+R/v7rXPAIVWDk9O9z/gsWQmGKBRYRt5MXDRfDoIl?= =?us-ascii?Q?cL3aRYXw7CYNEFTvGfKjow1jrwQ4R9m8fXxW22fhYmyp3P+PxQNdUJbdU1nL?=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XyJNV5SmHiNdCLg0XkiX6?= =?us-ascii?Q?T/5ZAezQzFULXKtVkHuvqjO3CEc6uItlT/w4rPBiebxe3E3JwO8n8UsvDa4t?= =?us-ascii?Q?DOaKxWxTPHFyIPG8C1Y3DDtSEZQ/zlbyFvKjPlpVVJoVDueFBk+8R6i1O51h?= =?us-ascii?Q?cNMr93wyZUUm/0t0EJEtiDaIMDgqNnkELw/Mf8LZk053INLSfrBcvG6qNzx9?= =?us-ascii?Q?nbIFirqG5vxIGN9HTKg69fx3VEMCTVkllC+aLn4i9U0Fhx2YTQ1wz+rD65PG?= =?us-ascii?Q?izTT/EF6/V+0RPPWSfpVcX550SPd2UszZgyubfzjhDy7?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d32a30b-be30-4fea-67d1-08db479d72ff X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3336.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2023 04:02:57.0233 (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: 6EPxS9Qd4H2kL4AIRvcvWQKT7L8oOBlOq0ENSnmj9oOLDi4uDpZqui3Y4GMID7ubhgCEPgwaDQmq+XiohNUlZ+7k74UwsMP73JkgKbjzL4HQjFzWRWfrN/D7uO62fXrj X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6223 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Specification reference: 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: Tinh Nguyen --- MdePkg/MdePkg.dec | 26 ++++++ MdePkg/Include/IndustryStandard/IpmiSsif.h | 98 ++++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 7488ccda7a00..518e4200e9af 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -10,6 +10,7 @@ # 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.
+# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -2353,6 +2354,31 @@ [PcdsFixedAtBuild,PcdsPatchableInModule] # @Prompt IPMI KCS Interface I/O Base Address gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00000031 =20 + ## This is SMBus slave address for the SSIF to the BMC. + # The recommended value defined by IPMI specification is 0x20 (section = 12.12). + # @Prompt IPMI SSIF SMBus slave address + gEfiMdePkgTokenSpaceGuid.PcdIpmiSmbusSlaveAddr|0x20|UINT8|0x00000032 + + ## This is the maximum number of IPMI SSIF request retries. + # The IPMI specification specified min value is 5 (section 12.17). + # @Prompt Number of IPMI SSIF request retries. + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0x00000= 033 + + ## This is the required interval for each IPMI request retry. + # The IPMI specification specified a time range of 60ms to 250ms (secti= on 12.17). + # The default setting is min. + # @Prompt Time between IPMI SSIF request retries. + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryInterval|60000|UINT32|0x= 00000034 + + ## This value is the maximum retries of an IPMI SSIF response + # @Prompt Number of IPMI SSIF response retries. + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0x00000= 035 + + ## This is the required interval for each IPMI response retry. + # The IPMI specification specified min value is 60ms (section 12.17). + # @Prompt Time-out for a response, internal + gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryInterval|60000|UINT32|0= x00000036 + [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/IpmiSsif.h b/MdePkg/Include/In= dustryStandard/IpmiSsif.h new file mode 100644 index 000000000000..4a97438109a9 --- /dev/null +++ b/MdePkg/Include/IndustryStandard/IpmiSsif.h @@ -0,0 +1,98 @@ +/** @file + IPMI SSIF Definitions + + Copyright (c) 2023, Ampere Computing LLC. 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_SSIF_H_ +#define IPMI_SSIF_H_ + +/// +/// Definitions for SMBUS Commands for SSIF +/// Table 12 - Summary of SMBUS Commands for SSIF +/// + +// Write block +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE 0x02 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START 0x06 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_MIDDLE 0x07 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_END 0x08 + +// Read block +#define IPMI_SSIF_SMBUS_CMD_SINGLE_PART_READ 0x03 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_START 0x03 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_MIDDLE 0x09 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_END 0x09 +#define IPMI_SSIF_SMBUS_CMD_MULTI_PART_READ_RETRY 0x0A + +/// +/// Definitions for Multi-Part Read Transactions +/// Section 12.5 +/// +#define IPMI_SSIF_MULTI_PART_READ_START_SIZE 0x1E +#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN1 0x00 +#define IPMI_SSIF_MULTI_PART_READ_START_PATTERN2 0x01 +#define IPMI_SSIF_MULTI_PART_READ_END_PATTERN 0xFF + +/// +/// IPMI SSIF maximum message size +/// +#define IPMI_SSIF_INPUT_MESSAGE_SIZE_MAX 0xFF +#define IPMI_SSIF_OUTPUT_MESSAGE_SIZE_MAX 0xFF + +/// +/// IPMI SMBus system interface maximum packet size in byte +/// +#define IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES 0x20 + +typedef enum { + IpmiSsifPacketStart =3D 0, + IpmiSsifPacketMiddle, + IpmiSsifPacketEnd, + IpmiSsifPacketSingle, + IpmiSsifPacketMax +} IPMI_SSIF_PACKET_ATTRIBUTE; + +#pragma pack (1) +/// +/// IPMI SSIF Interface Request Format +/// Section 12.2 and 12.3 +/// +typedef struct { + UINT8 NetFunc; + UINT8 Command; +} IPMI_SSIF_REQUEST_HEADER; + +/// +/// IPMI SSIF Interface Response Format +/// Section 12.4 and 12.5 +/// +typedef struct { + UINT8 StartPattern[2]; + UINT8 NetFunc; + UINT8 Command; +} IPMI_SSIF_RESPONSE_PACKET_START; + +typedef struct { + UINT8 BlockNumber; +} IPMI_SSIF_RESPONSE_PACKET_MIDDLE; + +typedef struct { + UINT8 EndPattern; +} IPMI_SSIF_RESPONSE_PACKET_END; + +typedef struct { + UINT8 NetFunc; + UINT8 Command; +} IPMI_SSIF_RESPONSE_SINGLE_PACKET; + +#pragma pack () + +#endif /* IPMI_SSIF_H_ */ --=20 2.40.0