From patchwork Tue Jul 24 07:09:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142721 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6934868ljj; Tue, 24 Jul 2018 00:17:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfFl107kpBc/jz+UeFtmsNZLVJi2YtNjBEtaaJZprmBM9Oay8hApaJFuERDgl5fWEMHobn8 X-Received: by 2002:a63:1c13:: with SMTP id c19-v6mr15288194pgc.332.1532416622238; Tue, 24 Jul 2018 00:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532416622; cv=none; d=google.com; s=arc-20160816; b=VBwA/uACHBNShfUJXnoNEGCLsqRi5q/4cC8pHBSPoUZS0ZuotToVHG8Qh3KWlltbDC OH/G+uG2UL40+pUSNcXyUwW2ZnguJnaFh3OZKX3e2/JE/Suw+oUTBoNGI4XyY4Lz6L+E B9aNVLQr/v58jToTqNiyZL4RR4gdxfT5KIgFg91LmBjPigGsEpJ2IcGpQZdTkmtiM/76 46X+U9dWbGdIzONaR/+UIzqzU6Po9k69D8XpHA9v9cObME9mjMtvtTueyTIy0Eommxvk f+p5/fYgcUBXHFwqBDMtarP08Lln49ohhzYDqvG2VitdLszib+B9rMuVBH6pp3y93Pe5 vftQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=7DPAp1c2yJpOGC0BC6vb6ZhYpLaKLDZ+BVXKVSVlgmE=; b=cWTz+Qpu68ol33oIzX8HHuWtI4KugSVHnhqVLYjSkYmaYDyKyE011EgUe02QeWoOtV +DFNyWv3EDoRmmDPYdXnocMdHNKRy/+ZZq3m1h2tSxj/GG8TaYFjytna4jkYimduWUWi JYXlene/VmcdDRt6UVFhCq+i2ooJHMAxJFdjutAkybu4xN8C2LvYDVOqh1pRJ1t73enD 5gcnGK24YknazO1HhmdM9uQ3iEBldsIV7IcfP+ScWKELgMWNH/BXqmKwPAFxTmG4Hmf7 v6X0BOntg8chTbB+8HVBqWGoc9l7i4E+DwThJVipoABq2qanfpexixpdmyKT8B4yKNsr rtAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TjqC8yrT; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id q65-v6si11271305pfb.9.2018.07.24.00.17.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 00:17:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TjqC8yrT; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DB5A1210C1246; Tue, 24 Jul 2018 00:17:01 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c01::244; helo=mail-pl0-x244.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x244.google.com (mail-pl0-x244.google.com [IPv6:2607:f8b0:400e:c01::244]) (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 EA8FF210C123B for ; Tue, 24 Jul 2018 00:17:00 -0700 (PDT) Received: by mail-pl0-x244.google.com with SMTP id s17-v6so1350688plp.7 for ; Tue, 24 Jul 2018 00:17:00 -0700 (PDT) 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=lK2Q9CE/KgaqCA5H4T3EyKrjOcssDRTJqo47gLGAQ5I=; b=TjqC8yrT2ciM9s8T9ibEV4uJm3KKTefDfPStf4wj0vBnn2qwBlRpm1uEmEc9V0AuxG M9Wq3N1Y7EPcJlq0+jdWRJ92yk/Lp3lveCZBcgF6V0is3PxziSJ4JIhUfe20ya7RGsYe hEzU8NbZGcXdI8xVp1+dyqy3ouddBlArqdQbc= 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=lK2Q9CE/KgaqCA5H4T3EyKrjOcssDRTJqo47gLGAQ5I=; b=pfESvspHgZNun86Z1b1Tg2Jw90GxFn634R2m59fsjyBdufq/bvnvUOCpB4yB2bJlZ3 6qFLlrv1CBvr15dCeCo4Caw6s6etdOdDJxLeck6aIwMb+H5wPWinolXhwiAAMan1rSDP KZYvFz70VXyLEGqKkw6lhVG2jteGNwyWLnhlmYh+BHrokRHOKgyL/7xstoR4oAy6aRKI p/0DMH9h33EnTWQ/t/S3OSDCgvSUG44ZJjel1FsTlsuKS1PAO3v3IIu+lv7ck4HKMxP4 WumDD68ItQB5DQUJQMK9OF4OPeA18Ck/qqo9odn156rlt1a4dT53aDsaGvOWu8wWZNXh +/ug== X-Gm-Message-State: AOUpUlGmGn4kgslpf6mEotTcFRNgqLZq/yLzDWa+HoNc5jkYDo3PJx4z QaHcUk2zcMUvuDbzy0SkgAk00Q== X-Received: by 2002:a17:902:d692:: with SMTP id v18-v6mr16046255ply.59.1532416620652; Tue, 24 Jul 2018 00:17:00 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jul 2018 00:17:00 -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:01 +0800 Message-Id: <20180724070922.63362-18-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 17/38] Silicon/Hisilicon/D06: Optimize HNS config CDR post time 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 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: shaochangliang Use I2C 400KB speed for config CDR 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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c index fa8c510f36..8d87336375 100644 --- a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c +++ b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c @@ -28,6 +28,9 @@ #include "I2CLibInternal.h" #include "I2CHw.h" +#define I2C_100KB_SPEED 0x1 +#define I2C_400KB_SPEED 0x2 + VOID I2C_Delay(UINT32 ulCount) { MicroSecondDelay(ulCount); @@ -149,7 +152,14 @@ I2CInit(UINT32 Socket, UINT32 Port, SPEED_MODE SpeedMode) I2C_REG_READ(Base + I2C_CON_OFFSET, I2cControlReg.Val32); I2cControlReg.bits.master = 1; - I2cControlReg.bits.spedd = 0x1; + if(Normal == SpeedMode) + { + I2cControlReg.bits.spedd = I2C_100KB_SPEED; + } + else + { + I2cControlReg.bits.spedd = I2C_400KB_SPEED; + } I2cControlReg.bits.restart_en = 1; I2cControlReg.bits.slave_disable = 1; I2C_REG_WRITE(Base + I2C_CON_OFFSET,I2cControlReg.Val32);