From nobody Mon Feb 9 21:20:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1532416605726104.16473580971308; Tue, 24 Jul 2018 00:16:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A3F0F210C1244; Tue, 24 Jul 2018 00:16:35 -0700 (PDT) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D22B1210C123B for ; Tue, 24 Jul 2018 00:16:34 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id g2-v6so2221897pgs.6 for ; Tue, 24 Jul 2018 00:16:34 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id t14-v6sm11449788pgu.0.2018.07.24.00.16.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:16:33 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gIAb9y5XO6mpsIRqCfpnDvQUI7eTFDKG4e9oV4pTl9k=; b=LO1qI5nY9GdbTGLL7JwSseBj+hrCrO6TJhOj8BDXOaQZnbwFrYEvAxlUwjqZn0NwyQ nk8kdhmoHeMNeHssjV2nHOX4ZBjNhJM8FECJMC6mxbFGGBGPmvCDsgXqQf44bmi/dl4y U/cUndbKfduOIdlEJ9LK6ZmcdJbvbPRN3Y58w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gIAb9y5XO6mpsIRqCfpnDvQUI7eTFDKG4e9oV4pTl9k=; b=uOPkpqykyx7VVkc0K14y4TznMaise5nHXYjau1M9QIAwznz3jnEXgAKTcYKoDxIdo+ 6WYGvDhEK5KVOEHEc9C6LnfHxfQMWmY3wlixJRq7QiGGeXdUfq8S0lLCHFQIv0ewzFzy 6LW54XzYkRSLo038JZljIVaBl7mUKa8SvGafzRlN08vYAnbDiyA8oZI68CYmv+IDDnE6 zsDmDPxTH2P0MSGOC/NHL8GcKM9OdZ6arPaWqJD3eelWPbHDy5PvjpQAiZmGYDN6el37 iHUiAEDLav42UNiSaJM0rJs+nY+q4xRKk6GMqwhzjh8WhHlrDBGEKZadS8ptR/Fpep5/ UMKA== X-Gm-Message-State: AOUpUlENx/F332jViDvSKQw5VajEy0nN2Q9ro2ecFFr9rKO2QSnCvgTe 9elIgFye6u0uDv83EiyXRZWQ+g== X-Google-Smtp-Source: AAOMgpdSICLxZZyy3/HUP4gMvT5yNoRGUzI2pVx9Ukgcin/C3l/oWWvjvCiYVr0AQ9+qnxlfFrdb3w== X-Received: by 2002:a62:e106:: with SMTP id q6-v6mr16685105pfh.75.1532416594566; Tue, 24 Jul 2018 00:16:34 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Tue, 24 Jul 2018 15:09:00 +0800 Message-Id: <20180724070922.63362-17-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180724070922.63362-1-ming.huang@linaro.org> References: <20180724070922.63362-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 16/38] Silicon/Hisilicon/D06: Add I2C delay for HNS auto config X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, shaochangliang , huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: shaochangliang Because I2C Port5 salve device connect under 95545 device, it will cost more time to access I2C slave device, so add delay time for HNS auto config. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shaochangliang Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c b/Silicon/Hisilicon/= Library/I2CLib/I2CLib.c index 16636987a6..fa8c510f36 100644 --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c @@ -248,7 +248,11 @@ CheckI2CTimeOut ( if (Transfer =3D=3D I2CTx) { ulFifo =3D I2C_GetTxStatus (Socket,Port); while (ulFifo !=3D 0) { - I2C_Delay(2); + if (Port =3D=3D 5) { + I2C_Delay(1000); + } else { + I2C_Delay(2); + } if (++ulTimes > I2C_READ_TIMEOUT) { (VOID)I2C_Disable (Socket, Port); return EFI_TIMEOUT; @@ -259,7 +263,11 @@ CheckI2CTimeOut ( else { ulFifo =3D I2C_GetRxStatus (Socket,Port); while (ulFifo =3D=3D 0) { - I2C_Delay(2); + if (Port =3D=3D 5) { + I2C_Delay(1000); + } else { + I2C_Delay(2); + } if (++ulTimes > I2C_READ_TIMEOUT) { (VOID)I2C_Disable (Socket, Port); return EFI_TIMEOUT; @@ -359,7 +367,7 @@ I2CWrite(I2C_DEVICE *I2cInfo, UINT16 InfoOffset, UINT32= ulLength, UINT8 *pBuf) ulFifo =3D I2C_GetTxStatus(I2cInfo->Socket,I2cInfo->Port); while(ulFifo > I2C_TXRX_THRESHOLD) { - I2C_Delay(2); + I2C_Delay(1000); if(++ulTimes > I2C_READ_TIMEOUT) { (VOID)I2C_Disable(I2cInfo->Socket, I2cInfo->Port); --=20 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel