Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3FF9C433F5 for ; Tue, 21 Sep 2021 04:13:36 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B81506112D for ; Tue, 21 Sep 2021 04:13:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B81506112D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42BA982DB7; Tue, 21 Sep 2021 06:13:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632197612; bh=CbwxcX9cbqLp+ZCpHEwbhnrd5w41Jr70xDiCKoRvl0A=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To:From; b=j4ELPulPMlviuLeykpDcvayAVwOMR+LVqLtpJIEm3vW+ETzNAzmg/fJC+u3LGCtvX ySYvvPOyBKy5KzBXy4WLsUjLB7GosyFWC0c3PFgW1goCa5iuXXXMBIC7i3HSOV/pi6 XJvw4wKaaAWT/TwZ4LGJGlYcfueph30v8Inf6wGi7RO5wREvn8FO4V40ZUQA+svQWu DDu1smn8z5p+Oxukvn0BgH5jG/r1gjlIuEQZAIDrtPcHPHOq/9HWgqVgx5FEILDYyr lmj66wQ+Jcl+EKXPb2uiRDgCDl3jhTE0ahNsAXucVaBsRduHpPiMxm7PjH7K7S9lj4 r1+3vRPMtdI8g== Received: from [192.168.1.107] (87-97-107-232.pool.digikabel.hu [87.97.107.232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: hs@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 2E43182D74; Tue, 21 Sep 2021 06:13:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632197610; bh=CbwxcX9cbqLp+ZCpHEwbhnrd5w41Jr70xDiCKoRvl0A=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jwNTniXB9MzcMf0YA6jUG8I/pRHqjhtlkLHcAuKLAMMfMronGKThynP68Edcievvh bgxHE8Nq3HecyTQPTh+aqPuPnNv8iPA67t4yRh53Gf6p6GEy9iK7NzlPcD7TjuY+tC M7gOo/33irNYqFadFUGvJhM6c/MAsKyxoJfKIddSxzCxGyHFYumu3+ffjbKt+amtBB 8WGFGhIrGgV8c9JM1UggWVgKDAmCngSvaUeBDlKDvn/5hNJ75/afKDLD4sfkDEbaY3 2QLhVb5Qo9TCgMUHV3GrxzayBhyseMCdz1NnwfI4dHGbEqg3Uw5aWqtftIDYf8fA7E ICO89m+7XIa8w== Subject: Re: [PATCH] i2c: rcar_i2c: Enable configuring SCL rise and fall times To: Adam Ford , U-Boot Mailing List Cc: Biju Das , Marek Vasut References: <20210824141031.53770-1-aford173@gmail.com> From: Heiko Schocher Message-ID: <08bd1443-0e7c-98ff-b6ea-ecab5fdc243c@denx.de> Date: Tue, 21 Sep 2021 06:13:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: hs@denx.de Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hello Adam, On 20.09.21 14:21, Adam Ford wrote: > On Tue, Aug 24, 2021 at 9:10 AM Adam Ford wrote: >> >> The Linux i2c driver supports i2c-scl-rising-time-ns, >> and i2c-scl-falling-time-ns, but U-Boot uses hard-coded values >> for these values. >> >> Update the calculation by fetching them from the device tree if >> present and use the previous values as the default if they are >> missing. >> >> Signed-off-by: Adam Ford >> > Do I have the right people in copy? I was hoping to get some feedback > on this. My boards use the i2c-scl-rising-time-ns to help properly > set the i2c clocking. No, I think all fine, for me the patch is okay, so: Reviewed-by: Heiko Schocher Ah, I see, in patchwork the patch is assigned to Marek... added Marek to cc. @Marek: Is it okay for you, if I pickup the patch, when new u-boot version is out? Else you can pick it up. Thanks! bye, Heiko > > thanks > adam > >> diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c >> index 14bb6603d5..d9ece5e3a8 100644 >> --- a/drivers/i2c/rcar_i2c.c >> +++ b/drivers/i2c/rcar_i2c.c >> @@ -64,6 +64,8 @@ enum rcar_i2c_type { >> struct rcar_i2c_priv { >> void __iomem *base; >> struct clk clk; >> + u32 fall_ns; >> + u32 rise_ns; >> u32 intdelay; >> u32 icccr; >> enum rcar_i2c_type type; >> @@ -278,7 +280,7 @@ static int rcar_i2c_set_speed(struct udevice *dev, uint bus_freq_hz) >> * = F[sum * ick / 1000000000] >> * = F[(ick / 1000000) * sum / 1000] >> */ >> - sum = 35 + 200 + priv->intdelay; >> + sum = priv->fall_ns + priv->rise_ns + priv->intdelay; >> round = (ick + 500000) / 1000000 * sum; >> round = (round + 500) / 1000; >> >> @@ -323,6 +325,10 @@ static int rcar_i2c_probe(struct udevice *dev) >> int ret; >> >> priv->base = dev_read_addr_ptr(dev); >> + priv->rise_ns = dev_read_u32_default(dev, >> + "i2c-scl-rising-time-ns", 200); >> + priv->fall_ns = dev_read_u32_default(dev, >> + "i2c-scl-falling-time-ns", 35); >> priv->intdelay = dev_read_u32_default(dev, >> "i2c-scl-internal-delay-ns", 5); >> priv->type = dev_get_driver_data(dev); >> -- >> 2.25.1 >> -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs@denx.de