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::52c; helo=mail-pg1-x52c.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (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 ABA98210F3D64 for ; Thu, 16 Aug 2018 05:14:06 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id y5-v6so1996939pgv.1 for ; Thu, 16 Aug 2018 05:14:06 -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=IW2R+I5ECDH6LSGVk2TH4ixBkt7p8TMhor/0/xwTRi5PzlhJuOyWZU0QSJhMrMrxyg aNKbfdNj24TVZ/Iw0p9BYNpBTGiRD3U9pZuSsRvy9oO+gRYF2ObsQbqjlej1/lPnAYiA YX7rfmpSVW0MJoR8GErgpzlO9ksQQqlV4miY8= 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=WW5QiWCvfNbLjE9MmZ8sAR7eKsc+BmAbkwsoPC/oRjGsKfeEQIW3pqufWkR8NxqiMD llPywgX6GfyzfTTwB+te+OxtdihS399EDeqJZCWvXRs6zP3QT71sEP8otWXavoXI6Hjz LVmuNWBI51DiSi+NzPdrkZTQvFww5rR9zNL0bmXboPTHNXCJ/EaxVOxi5AzBlBiQVxJH cJk3IH6oJEPeeir5NOHqP2KXxBg73jJxT4vedBMkfxCe58YggK35X0LTlhX3QS5lkFcC oeRS+utmyull/4PB0trTqzQlMpeYeWEW7O/f7porzHeJZiSxPV/Lu44YrAm79okF5/Sz yJ5g== X-Gm-Message-State: AOUpUlE5My55zFT9snB7vBNwIpR/+JmI/EDHQBnNPKCZm+vkTKekaHWL 2QdzaDzLxS224wYQ2yyqmzWHvQ== X-Google-Smtp-Source: AA+uWPx2DyAvmlge3GnHhPaoU9UGWMIG3XTkUZIUFXDAx0fdKgdE+K6B/ZUh0l4UxIagOPsAZa/Q5A== X-Received: by 2002:a63:8848:: with SMTP id l69-v6mr28283911pgd.377.1534421646137; Thu, 16 Aug 2018 05:14:06 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id j27-v6sm46736311pfj.91.2018.08.16.05.14.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 05:14:05 -0700 (PDT) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Cc: 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, shaochangliang , Ming Huang Date: Thu, 16 Aug 2018 20:12:21 +0800 Message-Id: <20180816121239.44129-19-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180816121239.44129-1-ming.huang@linaro.org> References: <20180816121239.44129-1-ming.huang@linaro.org> Subject: [PATCH edk2-platforms v3 18/36] 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: , X-List-Received-Date: Thu, 16 Aug 2018 12:14:06 -0000 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(-) 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); -- 2.17.0