From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 52CF9210FBF19 for ; Wed, 22 Aug 2018 08:16:43 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id j8-v6so1123782pff.6 for ; Wed, 22 Aug 2018 08:16:43 -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-language:content-transfer-encoding; bh=/nrx9XUV1cpdsXOdw+Yjd4dfakV0sVwBILiX+0pg0WU=; b=MXmUIK9+ugV9Gs46CKyxlYs2Rr9VUdq85TdH3hupHmQs5UN0YXpnwOf3FfVEX7Viuf DZfIGtv6qqAturD6zsekozDqLttpNmdqZeYD0H3vFHgEi7EfYknFFO+V93CKdHmvBcj+ Qt0yiPU8CNOin6ruQ9Akk9gCiNC2nuPcZVFuQ= 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-language :content-transfer-encoding; bh=/nrx9XUV1cpdsXOdw+Yjd4dfakV0sVwBILiX+0pg0WU=; b=TKugQ91hZrDpCeVuxt4bh1FbmSO2sFSHiKysbne77IldybedThMOzjGZUr2dzgSLMv iKwj+RcsTLaNDJc9cbhXWb10t5v7nPnUtaje88dcKuj9sB0YqAvmf/p3yY9r+1ys6wan djFFSeo0+IKx+0ti9jZe7qg2XZnSHp101CmKSqHSNaeATiSQrOVMgcL+8mjgHhtKXcok oQy5EwF2DbZ3Rn37jMGhOhWIPHx+rtPUutcNLVShwxE2h56LGr2dA2u6Gt87MmjbaWsV ogmqNWhsW6hJYzKyrMciAVRA64lntaAVuCSNHRamxoo+Q2AAZuMueK/bAn7wbOKacNpj AAPQ== X-Gm-Message-State: APzg51DYb05RIDdt4w2jGrm3UcnIg3zdjNU/FK7FuF4/jf7tb7sYqo1K 8B5TYm3vZsofAGj07RDE6bmPVw== X-Google-Smtp-Source: ANB0Vda05gUlVOuMk9CzTZeAtQTmP0e2lQHA7UcGb8Ouj9nYYE1Y5nPTus0V91kAbCHDtC0W2wiIbw== X-Received: by 2002:a62:e412:: with SMTP id r18-v6mr1228567pfh.25.1534951003640; Wed, 22 Aug 2018 08:16:43 -0700 (PDT) Received: from [10.84.0.214] ([64.64.108.140]) by smtp.gmail.com with ESMTPSA id e190-v6sm4145844pfc.81.2018.08.22.08.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 08:16:43 -0700 (PDT) To: Leif Lindholm Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org, ard.biesheuvel@linaro.org, michael.d.kinney@intel.com, lersek@redhat.com, guoheyi@huawei.com, wanghuiqiang@huawei.com, huangming23@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, john.garry@huawei.com, xinliang.liu@linaro.org References: <20180814080903.50466-1-ming.huang@linaro.org> <20180814080903.50466-24-ming.huang@linaro.org> <20180822142718.bouajgji4hhu7zqm@bivouac.eciton.net> From: Ming Message-ID: <92661354-2ea7-4e8a-76d1-603b0d59f1c4@linaro.org> Date: Wed, 22 Aug 2018 23:16:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180822142718.bouajgji4hhu7zqm@bivouac.eciton.net> Subject: Re: [PATCH edk2-platforms v2 23/43] Silicon/Hisilicon/D06: Add I2C delay for HNS auto config X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2018 15:16:44 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 8/22/2018 10:27 PM, Leif Lindholm wrote: > On Tue, Aug 14, 2018 at 04:08:43PM +0800, Ming Huang wrote: >> Because I2C Port5 salve device connect under I2C extender >> (9545 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: Ming Huang >> --- >> Silicon/Hisilicon/Library/I2CLib/I2CHw.h | 3 +++ >> Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 21 +++++++++++++++----- >> 2 files changed, 19 insertions(+), 5 deletions(-) > > Like previous patch, please change subject line - this affects d03, > d05, d06. > > Silicon/Hisilicon: Add I2CLib delay for HNS auto config Should this patch reorder before the first D06 patch ? > >> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h >> index fa954c7937..d77aea509e 100644 >> --- a/Silicon/Hisilicon/Library/I2CLib/I2CHw.h >> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CHw.h >> @@ -19,6 +19,9 @@ >> #include >> #include >> >> +// The HNS I2C port 5 is under I2C extender >> +#define I2C_EXTENDER_PORT_HNS 5 >> + >> #define I2C_READ_TIMEOUT 500 >> #define I2C_DRV_ONCE_WRITE_BYTES_NUM 8 >> #define I2C_DRV_ONCE_READ_BYTES_NUM 8 >> diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c >> index d67ddc7f9b..59633106ce 100644 >> --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c >> +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c >> @@ -258,8 +258,13 @@ CheckI2CTimeOut ( >> if (Transfer == I2CTx) { >> Fifo = I2C_GetTxStatus (Socket, Port); >> while (Fifo != 0) { >> - // This is a empirical value for I2C delay. MemoryFance is no need here. >> - I2C_Delay (2); >> + if (Port == I2C_EXTENDER_PORT_HNS) { >> + // This is a empirical value for I2C delay. MemoryFance is no need here. > > MemoryFance -> > MemoryFence > > (You may want to search and replace that on the whole set.) > > With that: > Reviewed-by: Leif Lindholm Replace they in v4. Thanks. > > / > Leif > >> + I2C_Delay (1000); >> + } else { >> + // This is a empirical value for I2C delay. MemoryFance is no need here. >> + I2C_Delay (2); >> + } >> if (++Times > I2C_READ_TIMEOUT) { >> (VOID)I2C_Disable (Socket, Port); >> return EFI_TIMEOUT; >> @@ -269,8 +274,13 @@ CheckI2CTimeOut ( >> } else { >> Fifo = I2C_GetRxStatus (Socket, Port); >> while (Fifo == 0) { >> - // This is a empirical value for I2C delay. MemoryFance is no need here. >> - I2C_Delay (2); >> + if (Port == I2C_EXTENDER_PORT_HNS) { >> + // This is a empirical value for I2C delay. MemoryFance is no need here. >> + I2C_Delay (1000); >> + } else { >> + // This is a empirical value for I2C delay. MemoryFance is no need here. >> + I2C_Delay (2); >> + } >> if (++Times > I2C_READ_TIMEOUT) { >> (VOID)I2C_Disable (Socket, Port); >> return EFI_TIMEOUT; >> @@ -369,7 +379,8 @@ I2CWrite( >> Times = 0; >> Fifo = I2C_GetTxStatus (I2cInfo->Socket, I2cInfo->Port); >> while (Fifo > I2C_TXRX_THRESHOLD) { >> - I2C_Delay (2); >> + // This is a empirical value for I2C delay. MemoryFance is no need here. >> + I2C_Delay (1000); >> if (++Times > I2C_READ_TIMEOUT) { >> (VOID)I2C_Disable (I2cInfo->Socket, I2cInfo->Port); >> return EFI_TIMEOUT; >> -- >> 2.17.0 >>