From patchwork Tue Aug 14 08:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 144133 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4049960ljj; Tue, 14 Aug 2018 01:11:41 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxRAAkyHwV67j5sWmNLbynYwNL5dv4EHSXr1XW7+j0mvjw1+ZjhjCp50mSfjlbhQ6U8n7aQ X-Received: by 2002:a63:e0b:: with SMTP id d11-v6mr20297902pgl.134.1534234301504; Tue, 14 Aug 2018 01:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534234301; cv=none; d=google.com; s=arc-20160816; b=VIbZH6K56DlbdzSB+9QrRdtbS/h/Hapk7LmzAfFTvchWnxDHtI1gNzvibI1nk7/OEB eMDuMHgKTfE/7+toqJN/l0hRoN9UVftegWAff8cUFoYO465fGhyS5TEEBWmgnezAnKf6 TQF5mYkeguNtNHixBz2RLWpXi/iNZUgv0fmPNWLu3md3IubOfj4WhtkcXsO1c+6Yl8k1 D9GWmJI7GYDE23b8amVV5Gka6Er0SA3hDCM72fkMU1TR4RonobfLfJBmgvMB27kyJKt5 2g/BL5e8wOxRctBc4Po4H6cRGcvHSR+8Z2XSfPetDddRfGyE+wGARVD21S8EBmjxmE8m q4ZQ== 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=NfswRd+R/VYQkG0vaJbu3qIUhef4QAppQbzPibzU4oM=; b=pUtCmHfIUXhpNo8rcGLb79AbcvW+p4ESI8XKS8csRQ9WioOI7MmAWiUTbHWTSpQv4E xR+fFizrdVscnXcAaPT7h1Z/4vTQJldl0p54kT7WtHujN8v3YAfB6mFZXtyG1YinecHw qyDqCEW2+Aolf36OsBXrpVde5Q9nbuOxLtmFV3YaCcpGP0PyolbE+hZnrw21hPeYWlnV oA1eMtZMqe4Xg7i5FJTh67t1UX7x3J+ww9mmQvL7Ysm6K1hKpsmcvmvysuQ2heYhp5IO SxGqNWWXIIh4ENSbLnSBhB+3wJbSoG+YCRBOPW9pSM6BixRKlMSzcdK87gk6UnJGoPMh Pwbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="jqD40N/o"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id a84-v6si20845133pfj.300.2018.08.14.01.11.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Aug 2018 01:11:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="jqD40N/o"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 391D7210F16D9; Tue, 14 Aug 2018 01:10:54 -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:4864:20::429; helo=mail-pf1-x429.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (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 94E7E210F155C for ; Tue, 14 Aug 2018 01:10:52 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id b11-v6so8931332pfo.3 for ; Tue, 14 Aug 2018 01:10:52 -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=GFiQQuBo8lBEEkD+bKLEw2KMvKmV79SbnO6NaTUyI4w=; b=jqD40N/o6eT8g9BW3b4YW36eSbdnR0Hwa0PKu5pUjc4r4BrY+Y1DwGxddFzq5NsKdl PtPVzC9H1ctsvflqG+tuAOYkNSR/tcxrNsjITA5qOA8BmPRLm0PjtO6il8VMY4yBsetp Nhwv0jNkA6LgdpVYNxI26ch+iaymZTi8Shw3I= 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=GFiQQuBo8lBEEkD+bKLEw2KMvKmV79SbnO6NaTUyI4w=; b=Bf/vuya77G6bI7m3sZDz9CyigTSNqMoIKCwCfAAMrxm3eV9KvCwrkJ9CkE+yEUVQ9i 77LEjXcsec6g89ezegoeKfeMtz41QScYeBeqKQ8EPrsRiHwLJFqu/1JnJoRYvJRy09oV lfr7l2+P84RYWE8TZylT3h89wopJ5Lthrl1KF2kKz3jeu9Prn9qbqOZwCiPLYmAaOTvm 7XISJUxnxyOoOIyJFKtQTd5eqF1ohPG/3tfXuIe5HIGUniAtCrLHw7G8TkFswf2vNojS LMQnKfOGUwoPeG+N61qW6S098Q81Oma8IvDPnOg6JuJpKZSKGrnaMFw5qkaTHBTneX5h L7/A== X-Gm-Message-State: AOUpUlFTHqynF3coOhta95x4n13lKqbzdurBdr3t2G2U08Qh/IDUqHY6 QJ9u4sSsrOvvbLehEfc+lBRRfg== X-Received: by 2002:a63:9b19:: with SMTP id r25-v6mr20079297pgd.44.1534234252265; Tue, 14 Aug 2018 01:10:52 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id h130-v6sm72905670pgc.88.2018.08.14.01.10.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Aug 2018 01:10:51 -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, 14 Aug 2018 16:08:45 +0800 Message-Id: <20180814080903.50466-26-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180814080903.50466-1-ming.huang@linaro.org> References: <20180814080903.50466-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v2 25/43] 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, guoheyi@huawei.com, shaochangliang , huangdaode@hisilicon.com, michael.d.kinney@intel.com, lersek@redhat.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: Ming Huang --- Silicon/Hisilicon/Library/I2CLib/I2CLib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Silicon/Hisilicon/Library/I2CLib/I2CLib.c b/Silicon/Hisilicon/Library/I2CLib/I2CLib.c index ed44ac204f..55c030a3af 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 Count @@ -158,7 +161,11 @@ I2CInit ( I2C_REG_READ (Base + I2C_CON_OFFSET, I2cControlReg.Val32); I2cControlReg.bits.master = 1; - I2cControlReg.bits.Speed = 0x1; + if(SpeedMode == Normal) { + I2cControlReg.bits.Speed = I2C_100KB_SPEED; + } else { + I2cControlReg.bits.Speed = I2C_400KB_SPEED; + } I2cControlReg.bits.restart_en = 1; I2cControlReg.bits.slave_disable = 1; I2C_REG_WRITE (Base + I2C_CON_OFFSET, I2cControlReg.Val32);