From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0EB41D8019A for ; Wed, 7 Aug 2024 06:50:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qMzGOdsMNXPs0lRw2Q3b1gFsOqE9rcETY6U74w2JwmE=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1723013430; v=1; b=cfNY5bI9Ei0J2kZVQbrUWYsatJygoH1keE8Gu9iAf9YZxGmoMxNA0y33PYAnbJj2PfYazTxG /YqQXuZ9an8JY2i10KgDMu6fN4MK1+H508XjtQSmSvD7XIdz7JSeNvI+XuKvIjR+STdrQznhwN1 a9XkaEc7PfCiKgB8t7vSgugZJA9/Z8IVRk4pRvsLa7P5LGzgNLXQRpDyZ6v3AbRQySFWa5Z49Bk ROT/TXjO/qjeUyFiEPX0ECWMVeFiOb9Iy1UO+u0Az5Iuis/FNJctsHAtwg0Q4F7V2Wpf6PhZlA4 fSn4uniGPAhEd249vDec2Z4qoGiGQhMB0Hk9b0xq72s+A== X-Received: by 127.0.0.2 with SMTP id 5ubkYY7687511xzBrOqIj10s; Tue, 06 Aug 2024 23:50:29 -0700 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.109]) by mx.groups.io with SMTP id smtpd.web11.27783.1723013423685638964 for ; Tue, 06 Aug 2024 23:50:23 -0700 X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by DS7PR01MB7664.prod.exchangelabs.com (2603:10b6:8:7b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Wed, 7 Aug 2024 06:50:21 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f%3]) with mapi id 15.20.7807.026; Wed, 7 Aug 2024 06:50:21 +0000 From: "Nhi Pham via groups.io" To: devel@edk2.groups.io CC: quic_llindhol@quicinc.com, chuong@os.amperecomputing.com, rebecca@os.amperecomputing.com, nhi@os.amperecomputing.com Subject: [edk2-devel] [edk2-platforms][PATCH v2 1/5] AmpereAltraPkg/DwI2cLib: Add support for SMBUS+PEC operation Date: Wed, 7 Aug 2024 13:47:27 +0700 Message-ID: <20240807064731.4049764-2-nhi@os.amperecomputing.com> In-Reply-To: <20240807064731.4049764-1-nhi@os.amperecomputing.com> References: <20240807064731.4049764-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG3P274CA0010.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::22) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|DS7PR01MB7664:EE_ X-MS-Office365-Filtering-Correlation-Id: 972e0a99-47b4-498f-5212-08dcb6ad348f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Ae/6Y7UkDvBWhOCKiON52yTXO1dK4mROs2zePbw6jRCXxoQNPZrBz9f8YjF5?= =?us-ascii?Q?jbn77dwPxSBSUbzmlH8L8w9xxe3FxdjmfXjzhOrKPenHk7KHweSByKRTDM6L?= =?us-ascii?Q?8O6cjb31t2/3/uf9/723scLsxS9BFQDUDG1MVohf/NtmpkK4fWXB57QqT1e9?= =?us-ascii?Q?Rgrh5MuePrIKfF5QT4vdISpVo0wiZqemKGUu/0uD+Bwlj4RLG0pGVu/Sp92j?= =?us-ascii?Q?tQgYHugwUqHYG+VpQ850MXbrfHbqPbNOIP1qCmKKeQb6t6O6yHeKGiEpo5+n?= =?us-ascii?Q?toYKGk0s0iAFLN6xKWpp1EDxZBQ4U+qL+czuzRtPRml11j0so4aGXVX7qDrd?= =?us-ascii?Q?boRajB3cYjeZHvGiu8tg0YHjOrdSOI1EXt65UKVys2eXYvQfMVWmuKQ4pg33?= =?us-ascii?Q?CvJpebJHYmm+h7z7GYV3WZJ3pRBiWUI9LAuaE6SCMBPJaQrmxKlkS8QEJ//f?= =?us-ascii?Q?xav4cgCP5xCkGcxPfhwZU2YOCiQod4nK4agM0UX+m+Alhf3TsREbqMQ6VnpB?= =?us-ascii?Q?jUB0yxBnGxU5hz1TajC+DpZi4es3woEp3zlfv2On100NnOEIsQtU553p87ev?= =?us-ascii?Q?bvR3Xr3U/En24HWhWcPFWs04E9j7z9SF0yqMCUH5wQXuchRbjXGw9QW7aJCf?= =?us-ascii?Q?kVAW2t5jylEDHw4SoK6vrHkHeB+JEBSCWmkIQzYWldbWCJfaRMXOTjBA9hRP?= =?us-ascii?Q?wdJZRgKsYqimENCmS4aJBCQIP4HCoMO4g1IVmf2JYKcHL+7eJ2/OAaxqML31?= =?us-ascii?Q?2Yp2nP4kTqr/VuwC3NjeUZEgY4nIlpyzo5yQN2CaeMOVatfXpezkQnP1t+vx?= =?us-ascii?Q?fZCxRoPMTwUWvg2p9n9dEKzaiCZnCf60Ep9UV7jqX9b9iSPsTsbXm4CCWqlQ?= =?us-ascii?Q?H1nx577/uQr2DP+a57c2FC0/vIijVXwj6NF+HDGEk/uRTiqsBCS4eOtokfZz?= =?us-ascii?Q?77EieHC5rmfTiQdjSKhO2e3veYYKrmmcQP+P9i8Eo8Q1khisC3A46+ly5RxS?= =?us-ascii?Q?/wgINfmO12/fpsWRrmLY7srz09qSv8EqU/0vEdk5SlIoeC43tIzPdJwNfQSJ?= =?us-ascii?Q?ecqtTQAqRimXDRReh2V45egFbLSBSS8Kr8wYcF7LR58a8KSivtPqPD0QFqKk?= =?us-ascii?Q?ct9ihe8AKIcFOo8w3Nm+TyPdH5++GFLb+n+5ZNylWtaLhJQdoHqGSjW/JGlH?= =?us-ascii?Q?t12Pc7ZpVCjfn0sg01sLuqi7A+xYdkGgx0qazJ8sHKgLFkETmaZ1YDsma2xc?= =?us-ascii?Q?yCuQ49TTt4Zq7mkW335I+uDWBqS/OuJKagVS2r415uAi3jSmR+E2sCn3df+k?= =?us-ascii?Q?+DMqWOxE0Uc7WBA/wEdYrCsVQiQePmp9kXSbKqDvyfHJL60z+ipeQnmGh84b?= =?us-ascii?Q?EKNUIs6MYHLNI5t4uKtSxCIH8L9jE3b7fR/nDC6jmj74IKeA8w=3D=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5jLK8y9CKFaxaKB9DuI14BtEb1GXlHp/bURzIIqhzd/9pAtz/oAE1YweR59f?= =?us-ascii?Q?MRsQ0Zn/jMb88Fhv4psAqwf5/6yh5UFLxML1VnZOguuUiPaCvIYpZ2s8Hvoi?= =?us-ascii?Q?nw0kFpUEZD5PCICygZ/DC/I3YMXfV6poQuKfTeRwyvvB4Yed91x5BMVseV+B?= =?us-ascii?Q?Dfmd3I5vGGLRqkN3ybw5NPFWgiV8r3d/3m3KlD6M2Hu+A5Vha305OqfLQJmB?= =?us-ascii?Q?FYb31Hr4/OPdcP2E40cH72JKJW0zbpmjljde/jS+aY2f5b05uBPNP2HdwWa3?= =?us-ascii?Q?ZBTCovpoOvoNLzozxDHLX2XJskLNDDx+LtlUD2Yk0Re/WaHbom9VoNzHiYI0?= =?us-ascii?Q?ewQP+Ya7CQv4JgBeMU2RCZLMNHyZnhbreSSmKtIxRvOXKDNAUQRD2vYPoBc0?= =?us-ascii?Q?GS4z/15dpckHSr0Bxc0+nZuexqpIH92BX6q7E755oC6NJidBjx3H7lNtKmeY?= =?us-ascii?Q?0cdZwOp0dCT1E5iLj841uYhjYKRfxx6m/SFgvAPyuE2JS0f8ksF8rbX6VE9n?= =?us-ascii?Q?uegL5luiunf5A8KuN2RFN/nv2q5kU1Chal81X3OWH0hEXEZwz54sdFsE5PZ7?= =?us-ascii?Q?v5FxPm2j95GySEtyqVlYb1oB090FPI6RwSiCDBjAKyOzg4CM/D63OU5/jTr5?= =?us-ascii?Q?fBxrspHTdDbPv6Ona0GT4D/QPxnKZEixZS0ipmFkwHryuOXkMecRj4+payyB?= =?us-ascii?Q?6s9vP9iFZGh8L/pvvm1FxjZDIAZGluSf+Xu637YsZAsftKBD3GIP+s07wcck?= =?us-ascii?Q?n68gzkR6372ZKNGbbvn2PHN3EVG/Pf9SALoiD7vx+iXU0b0o8yoy3jriwaHf?= =?us-ascii?Q?xtMyezE71RpyutTA8DFXbFUbt+6raBdF250iBadqio2yehvy+/kBG+7qyeKG?= =?us-ascii?Q?h085Z1UBY9fCLaPUmPUQRMxG8C/o4qfHkF4uvUQrsO6XuPyBOu7yzs5j8oL1?= =?us-ascii?Q?28D4jV4v5QNFd5imvn+ynNFlsm6Cp3RB8IbNFsrgBz5CsdhoWjBlSv9fY9bs?= =?us-ascii?Q?jykNMo27/pW+HqL6oNavNrutVbgQzwvUTItUJtjQ3phEjvE4V3yQmVgUcLij?= =?us-ascii?Q?Jd7ztqudOW/vgPNSVVQw6PDWQN4f6tFdMeVThXVz0slbxaS/d5TKtQaAtARa?= =?us-ascii?Q?pK/eAtqT4vqmj9EWtt2ldsgTwgfoHxTTiiW39pkZXGFooU8/2juaFjhbrcSI?= =?us-ascii?Q?MXmLUD8BQHRwo9flDEIhEdhoXogib3bPi8+yFEwLl54hojvIR72KoXyS6t3s?= =?us-ascii?Q?tBlQwa55RT71Gp0Q13FB+Yf5zzHJxLu8T40bN/dmUT31fatbgDHKuCUZcUcv?= =?us-ascii?Q?qZ2to2/y3nKGpCpHOR1WwEGVyaOEgG6de67GsoDNiZPYhGld0VWuatc0TZMB?= =?us-ascii?Q?7UIxpS5KOgIpg656+cVEQISIj7GayecWtL/NejL3xWGkKrWEOImSpPulrl4c?= =?us-ascii?Q?oSOHdzgS4d7sm3DdVrCZpYIlhg4XF3HF+F18Qs6tRK+leF9O36tEaMwbPv0N?= =?us-ascii?Q?eXUV5RVWzc/bNZzOIZioIVrP552bCKX/nQ4tsMkjn4/l6EqZ902mKVydOZZM?= =?us-ascii?Q?/EtTjyRbt/TWALFjdpA+2SU4w3uyf4dxzyb7qNpLB+sxIvSVz1MF/PKwjzPN?= =?us-ascii?Q?TFpBKLVTChVK5mtu5CKjlTU=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 972e0a99-47b4-498f-5212-08dcb6ad348f X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 06:50:20.9831 (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: S5sZea7qBPY9SNi10y97jvAZvqxHxocE2uavOFuZzlqChJtsN6TziLMCsK8HE01qTDkkHKI1x4IP6nfrsvUP9NEiAXOv3gCHV4FVkd/oi24= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7664 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 06 Aug 2024 23:50:24 -0700 Resent-From: nhi@os.amperecomputing.com Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KayLgtfCsRy9UBImatvYe8ygx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=cfNY5bI9; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io This introduces two input parameters to the I2cProbe() and updates the InternalI2cRead() for the support of the SMBUS operation with optional PEC check, which will be used by the IPMI SSIF driver. Signed-off-by: Nhi Pham --- Silicon/Ampere/AmpereAltraPkg/Include/Library/I2cLib.h | 11 = +- Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.c | 6 = +- Silicon/Ampere/AmpereAltraPkg/Library/DwI2cLib/DwI2cLib.c | 129 = ++++++++++++++++++-- 3 files changed, 131 insertions(+), 15 deletions(-) diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/Library/I2cLib.h b/Silic= on/Ampere/AmpereAltraPkg/Include/Library/I2cLib.h index f13794171029..3a312f7b6aed 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Include/Library/I2cLib.h +++ b/Silicon/Ampere/AmpereAltraPkg/Include/Library/I2cLib.h @@ -1,7 +1,7 @@ /** @file Library implementation for the Designware I2C controller. =20 - Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. + Copyright (c) 2020 - 2024, Ampere Computing LLC. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -70,6 +70,9 @@ I2cRead ( =20 @param[in] Bus I2C bus Id. @param[in] BusSpeed I2C bus speed in Hz. + @param[in] IsSmbus Flag to indicate if the bus is used to execute an SM= Bus operation. + @param[in] PecCheck If Packet Error Code (PEC) checking is required for = the SMBUS operation + and is ignored when present in other operations. =20 @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER A parameter is invalid. @@ -78,8 +81,10 @@ I2cRead ( EFI_STATUS EFIAPI I2cProbe ( - IN UINT32 Bus, - IN UINTN BusSpeed + IN UINT32 Bus, + IN UINTN BusSpeed, + IN BOOLEAN IsSmbus, + IN BOOLEAN PecCheck ); =20 /** diff --git a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85= 063.c b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.c index bc886b530f3c..a9e7328381e6 100644 --- a/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.c +++ b/Platform/Ampere/JadePkg/Library/PCF85063RealTimeClockLib/PCF85063.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. + Copyright (c) 2020 - 2024, Ampere Computing LLC. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -104,7 +104,7 @@ RtcI2cRead ( return EFI_DEVICE_ERROR; } =20 - Status =3D I2cProbe (I2C_RTC_BUS_ADDRESS, I2C_RTC_BUS_SPEED); + Status =3D I2cProbe (I2C_RTC_BUS_ADDRESS, I2C_RTC_BUS_SPEED, FALSE, FALS= E); if (EFI_ERROR (Status)) { return EFI_DEVICE_ERROR; } @@ -148,7 +148,7 @@ RtcI2cWrite ( return EFI_INVALID_PARAMETER; } =20 - Status =3D I2cProbe (I2C_RTC_BUS_ADDRESS, I2C_RTC_BUS_SPEED); + Status =3D I2cProbe (I2C_RTC_BUS_ADDRESS, I2C_RTC_BUS_SPEED, FALSE, FALS= E); if (EFI_ERROR (Status)) { return EFI_DEVICE_ERROR; } diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/DwI2cLib/DwI2cLib.c b/Si= licon/Ampere/AmpereAltraPkg/Library/DwI2cLib/DwI2cLib.c index 669ba2ea98a4..a6631ea17d69 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Library/DwI2cLib/DwI2cLib.c +++ b/Silicon/Ampere/AmpereAltraPkg/Library/DwI2cLib/DwI2cLib.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved. + Copyright (c) 2020 - 2024, Ampere Computing LLC. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -31,12 +31,14 @@ // Private I2C bus data // typedef struct { - UINTN Base; - UINT32 BusSpeed; - UINT32 RxFifo; - UINT32 TxFifo; - UINT32 PollingTime; - UINT32 Enabled; + UINTN Base; + UINT32 BusSpeed; + UINT32 RxFifo; + UINT32 TxFifo; + UINT32 PollingTime; + UINT32 Enabled; + BOOLEAN IsSmbus; + BOOLEAN PecCheck; } DW_I2C_CONTEXT_T; =20 // @@ -337,6 +339,11 @@ I2cWaitTxData ( DEBUG ((DEBUG_ERROR, "%a: Timeout waiting for TX buffer available\n"= , __FUNCTION__)); return EFI_TIMEOUT; } + + if ((I2cCheckErrors (Bus) & DW_IC_INTR_TX_ABRT) !=3D 0) { + return EFI_ABORTED; + } + MicroSecondDelay (mI2cBusList[Bus].PollingTime); } =20 @@ -542,6 +549,72 @@ InternalI2cWrite ( return Status; } =20 +/** + This extracts the data length from the initial byte of the SMBUS transac= tion. This allows + the driver to accurately read the SMBUS response with the exact length, = rather than + consistently reading 32-byte block of data. + + @param[in] Bus I2C bus Id. + @param[out] BusSpeed Pointer to the buffer to store the read length. + + @retval EFI_SUCCESS The operation is successful. + @retval Others An error occurred. + +**/ +EFI_STATUS +InternalSmbusReadDataLength ( + UINT32 Bus, + UINT32 *Length + ) +{ + EFI_STATUS Status; + UINTN Base; + UINT32 CmdSend; + + Base =3D mI2cBusList[Bus].Base; + + CmdSend =3D DW_IC_DATA_CMD_CMD; + MmioWrite32 (Base + DW_IC_DATA_CMD, CmdSend); + I2cSync (); + + if (I2cCheckErrors (Bus) !=3D 0) { + DEBUG ((DEBUG_ERROR, "%a: Sending reading command error\n", __func__))= ; + return EFI_CRC_ERROR; + } + + Status =3D I2cWaitRxData (Bus); + if (EFI_ERROR (Status)) { + // + // If the SMBUS target is not ready to handle the request + // or is busy with preparing the response data, it will response + // NACK, and the error status TX_ABRT is triggered to indicate that + // the RX FIFO is not ready for reading. Thus, the following message + // serves more as verbose alert rather than an error. + // + DEBUG ((DEBUG_VERBOSE, + "%a: Reading Smbus data length failed to wait data\n", + __func__ + )); + + if (Status !=3D EFI_ABORTED) { + MmioWrite32 (Base + DW_IC_DATA_CMD, DW_IC_DATA_CMD_STOP); + I2cSync (); + } + + return Status; + } + + *Length =3D MmioRead32 (Base + DW_IC_DATA_CMD) & DW_IC_DATA_CMD_DAT_MASK= ; + I2cSync (); + + if (I2cCheckErrors (Bus) !=3D 0) { + DEBUG ((DEBUG_ERROR, "%a: Sending reading command error\n", __func__))= ; + return EFI_CRC_ERROR; + } + + return EFI_SUCCESS; +} + EFI_STATUS InternalI2cRead ( UINT32 Bus, @@ -559,6 +632,7 @@ InternalI2cRead ( UINTN Count; UINTN ReadCount; UINTN WriteCount; + UINT32 ResponseLen; =20 Status =3D EFI_SUCCESS; Base =3D mI2cBusList[Bus].Base; @@ -601,6 +675,35 @@ InternalI2cRead ( } =20 WriteCount =3D 0; + if (mI2cBusList[Bus].IsSmbus) { + // + // Read Smbus Data Length, first byte of the Smbus response data. + // + Status =3D InternalSmbusReadDataLength (Bus, &ResponseLen); + if (EFI_ERROR (Status)) { + goto Exit; + } + + WriteCount++; + Buf[ReadCount++] =3D ResponseLen; + + // + // Abort the transaction when the requested length is shorter than the= actual response data + // or if there is no response data when PEC disabled. + // + if ((*Length < (ResponseLen + 2)) || (!mI2cBusList[Bus].PecCheck && Re= sponseLen =3D=3D 0)) { + MmioWrite32 (Base + DW_IC_DATA_CMD, DW_IC_DATA_CMD_CMD | DW_IC_DATA_= CMD_STOP); + I2cSync (); + Status =3D EFI_INVALID_PARAMETER; + goto Exit; + } + + *Length =3D ResponseLen + 1; // Response Data Length + 8-bit Byte Coun= t field + if (mI2cBusList[Bus].PecCheck) { + *Length +=3D 1; // ++ 8-bit PEC field + } + } + while ((*Length - ReadCount) !=3D 0) { TxLimit =3D mI2cBusList[Bus].TxFifo - MmioRead32 (Base + DW_IC_TXFLR); RxLimit =3D mI2cBusList[Bus].RxFifo - MmioRead32 (Base + DW_IC_RXFLR); @@ -750,6 +853,9 @@ I2cRead ( =20 @param[in] Bus I2C bus Id. @param[in] BusSpeed I2C bus speed in Hz. + @param[in] IsSmbus Flag to indicate if the bus is used to execute an SM= Bus operation. + @param[in] PecCheck If Packet Error Code (PEC) checking is required for = the SMBUS operation + and is ignored when present in other operations. =20 @retval EFI_SUCCESS Success. @retval EFI_INVALID_PARAMETER A parameter is invalid. @@ -758,8 +864,10 @@ I2cRead ( EFI_STATUS EFIAPI I2cProbe ( - IN UINT32 Bus, - IN UINTN BusSpeed + IN UINT32 Bus, + IN UINTN BusSpeed, + IN BOOLEAN IsSmbus, + IN BOOLEAN PecCheck ) { if (Bus >=3D AC01_I2C_MAX_BUS_NUM @@ -768,6 +876,9 @@ I2cProbe ( return EFI_INVALID_PARAMETER; } =20 + mI2cBusList[Bus].IsSmbus =3D IsSmbus; + mI2cBusList[Bus].PecCheck =3D PecCheck; + return I2cInit (Bus, BusSpeed); } =20 --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120262): https://edk2.groups.io/g/devel/message/120262 Mute This Topic: https://groups.io/mt/107765353/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-