From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::242; helo=mail-pl0-x242.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (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 EDE40210E2DD8 for ; Wed, 8 Aug 2018 20:59:42 -0700 (PDT) Received: by mail-pl0-x242.google.com with SMTP id t17-v6so1944243ply.13 for ; Wed, 08 Aug 2018 20:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=MF8VJqEDRJjGGTzfa75mGeuhrqtcEEnlK+cQ4z/QeLw=; b=GqJmzlsKh1tnWvrmL1mgrQVWY/i+/0/Dvf2Fr+8498ulE8ZUS3B8u1duYrvxPPtsCs sxFD8z+gEltc9B+LSGjYs8OaI0I8DzH/RLkVR2yVdLzUDIYLXhK4D2SCWl7PKgnM+y6x csA/HMfHhLCpVGsMF8pjatDTSZ1adxmHZiAPE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=MF8VJqEDRJjGGTzfa75mGeuhrqtcEEnlK+cQ4z/QeLw=; b=XmkRUqnZubuRvkP6Dp4aE6MUW3XB6pevHx02Acv28JNPMy6fnzs9+9FUl2tXMmZoEt vEJ2vEpVp6fbWtEwhhT9G/oMUwFe5/MZSML04hiSnerwTlex8CoDCxNNvOsp2IoyTBSo CaPjIWwIgR3QrJXtmDxtJVQnopyaHfjZ0mAm0YehHW2UFEF+6FQCk63ZQmLwM1sbLrE/ L5D9twPE9iJ5sx1FufrVHaRWyxYkytAx6d3N0Q3gzJGK2M/WUi9+UQjm8E9WVRN0qLQl ay+P8MefR2dX+DlJ2zeAdhrTxcGQU8Y7YxZh5FX2vYW/XkoKumZGVxhg2BU8fWE8+XK7 Jzgw== X-Gm-Message-State: AOUpUlFNVPMLkWcDOkzY347KgJQfBtJWjHPafQL1VW/kQfbyFXaeslPR JGErzVp2wZgie2WZhJqLQmorKA== X-Google-Smtp-Source: AA+uWPyBEzL4SUNOD+uDf7qvlRjr+dG0JgdtF4gMC333IoBFrZjkE1SsToWfQEA6nWwyI5wSkoBKoQ== X-Received: by 2002:a17:902:6a83:: with SMTP id n3-v6mr457163plk.246.1533787182073; Wed, 08 Aug 2018 20:59:42 -0700 (PDT) Received: from [10.199.0.182] ([64.64.108.224]) by smtp.gmail.com with ESMTPSA id d81-v6sm10383333pfj.122.2018.08.08.20.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 20:59:41 -0700 (PDT) To: Leif Lindholm Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org, ard.biesheuvel@linaro.org, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org, shaochangliang , Heyi Guo References: <20180724070922.63362-1-ming.huang@linaro.org> <20180724070922.63362-17-ming.huang@linaro.org> <20180803132809.c75xwhyp4mtdms42@bivouac.eciton.net> From: Ming Message-ID: <11c81198-cf31-ff8e-3bf3-7bff65d1aea5@linaro.org> Date: Thu, 9 Aug 2018 11:59:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180803132809.c75xwhyp4mtdms42@bivouac.eciton.net> Subject: Re: [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: , X-List-Received-Date: Thu, 09 Aug 2018 03:59:43 -0000 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit ÔÚ 8/3/2018 9:28 PM, Leif Lindholm дµÀ: > On Tue, Jul 24, 2018 at 03:09:00PM +0800, Ming Huang wrote: >> From: shaochangliang >> >> Because I2C Port5 salve device connect under 95545 device, > > salve -> slave > What is 95545? > 95545 should be 9545, a I2C extender. >> 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 == I2CTx) { >> ulFifo = I2C_GetTxStatus (Socket,Port); >> while (ulFifo != 0) { >> - I2C_Delay(2); >> + if (Port == 5) { > > What is special about 5? > Can it be given a descriptive #define? > I need to check document for Ports. Modify it in v2. >> + I2C_Delay(1000); > > Please add a comment on why this special treatment is needed. > Space before '(' > . >> + } else { >> + I2C_Delay(2); > > Space before '(' > >> + } >> if (++ulTimes > I2C_READ_TIMEOUT) { >> (VOID)I2C_Disable (Socket, Port); >> return EFI_TIMEOUT; >> @@ -259,7 +263,11 @@ CheckI2CTimeOut ( >> else { >> ulFifo = I2C_GetRxStatus (Socket,Port); >> while (ulFifo == 0) { >> - I2C_Delay(2); >> + if (Port == 5) { >> + I2C_Delay(1000); >> + } else { >> + I2C_Delay(2); >> + } > > All the same comments as for previous instance. > >> 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 = I2C_GetTxStatus(I2cInfo->Socket,I2cInfo->Port); >> while(ulFifo > I2C_TXRX_THRESHOLD) >> { >> - I2C_Delay(2); >> + I2C_Delay(1000); > > Space before '('. All comments will apply in v2. Thanks. > > / > Leif > >> if(++ulTimes > I2C_READ_TIMEOUT) >> { >> (VOID)I2C_Disable(I2cInfo->Socket, I2cInfo->Port); >> -- >> 2.17.0 >>