From patchwork Mon Jun 22 13:17:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 1314363 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CdBTWcnc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r91z5B92z9sQx for ; Mon, 22 Jun 2020 23:17:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 875C681DAB; Mon, 22 Jun 2020 15:17:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CdBTWcnc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1FDCA81D51; Mon, 22 Jun 2020 15:17:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7885B81D2B for ; Mon, 22 Jun 2020 15:17:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=al.kochet@gmail.com Received: by mail-lj1-x244.google.com with SMTP id c17so19214005lji.11 for ; Mon, 22 Jun 2020 06:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9yM0bDsUub/J2+Tqn8ZtbGzO+v4tfhwZ5f7RR81s9hM=; b=CdBTWcnc8kbD+LNt4r52NLArD0I+Y/bbIe5nV6bjkM7oR0TM+vq7cVyvfHADgn1RE/ zW4ojeYNAqeRZcWzwo07tXCUCAYC2q6eh0ydvpfPp0b4kn0IbQYqJ7jTsisipTVa2viY /pfiOZz/addW1p5pCDwToAVWZKIzXzZN6GzbrkCTpCW8RW6+VzwtEOpHoD/4NB/VdHZS ATCpedrPps4fJDJEO4xHZLPRbYTclTwEa6utkr3WtFHrzLX+nxPpTANkB877oqpFAys0 wL/Deskwrvysk0cicbydDrt9Rf+2orFcREsHiPCsXP/3LXcUkM6gVibfYO1QxZ6TQ16+ SOzg== 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=9yM0bDsUub/J2+Tqn8ZtbGzO+v4tfhwZ5f7RR81s9hM=; b=tbu8bu7Y1cEwKh1MTvUR1PkcrCDIe36BEcYz4uWF2wMmU6VEXrhxAL8KiIo/ZsVFQe 7rIyQp6qy9opozv30yxoS+AaDGA8hfWhphpF+9Tv34NJLw3fT/d93g5sLlbvOyhP/tEk UlqTfx9sCg7Av8RUMG43Po0t4HLvIBq83QyNv2CSW34zJ44iYnMl5Q9j4sRajrRbPVAY ggN4Npfp/S1RH1BtrKYS0Pkbkc462FfOQSBgFDPjG03r6MQp7mtZGXWh9epWK+xVEOVJ so/8D7pFBqHCZ0gdJjaZjZL/Rtni9xC0UcCC0RXjMBSiE0Uy+koVY08MMs9KUUZUr4cf 6WBQ== X-Gm-Message-State: AOAM530+GU8w6IZUmV5zJHWJyB40GKo4LzbQ90CmGz4NfsjzxINQekTD JZQcZ7PbpBUk4E3F9R/x6ao= X-Google-Smtp-Source: ABdhPJziEudKoaGZDeWaCjllX2hT0M3M6oxHDP7KwIyTHfapotkmSw7F95HViNOs151loFeoqFsPEw== X-Received: by 2002:a2e:b5d0:: with SMTP id g16mr8258166ljn.246.1592831836957; Mon, 22 Jun 2020 06:17:16 -0700 (PDT) Received: from localhost.localdomain ([89.22.145.64]) by smtp.gmail.com with ESMTPSA id 23sm1956280lff.91.2020.06.22.06.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 06:17:16 -0700 (PDT) From: Alexander Kochetkov To: Simon Glass , Philipp Tomsich , Kever Yang , Lukasz Majewski , u-boot@lists.denx.de Cc: Alexander Kochetkov Subject: [PATCH 2/2] rockchip: clk: rk3188: enable bwadj for rk3188 DPLL Date: Mon, 22 Jun 2020 16:17:10 +0300 Message-Id: <20200622131710.31168-3-al.kochet@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200622131710.31168-1-al.kochet@gmail.com> References: <20200622131710.31168-1-al.kochet@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Empirically, I found that DPLL on rk3188 has bwadj registers. Configuring DPLL with bwadj increase DPLL stability. Because of DPLL provide clock for ethernet, enabling bwaj reduces the number of errors on the ethernet. Signed-off-by: Alexander Kochetkov --- drivers/clk/rockchip/clk_rk3188.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/rockchip/clk_rk3188.c b/drivers/clk/rockchip/clk_rk3188.c index 4fc5c78563..ee5782d25d 100644 --- a/drivers/clk/rockchip/clk_rk3188.c +++ b/drivers/clk/rockchip/clk_rk3188.c @@ -117,7 +117,7 @@ static int rkclk_set_pll(struct rk3188_cru *cru, enum rk_clk_id clk_id, } static int rkclk_configure_ddr(struct rk3188_cru *cru, struct rk3188_grf *grf, - unsigned int hz, bool has_bwadj) + unsigned int hz) { static const struct pll_div dpll_cfg[] = { {.nf = 75, .nr = 1, .no = 6}, @@ -149,7 +149,8 @@ static int rkclk_configure_ddr(struct rk3188_cru *cru, struct rk3188_grf *grf, rk_clrsetreg(&cru->cru_mode_con, DPLL_MODE_MASK << DPLL_MODE_SHIFT, DPLL_MODE_SLOW << DPLL_MODE_SHIFT); - rkclk_set_pll(cru, CLK_DDR, &dpll_cfg[cfg], has_bwadj); + /* rk3188 and rk3188a DPLL has bwadj */ + rkclk_set_pll(cru, CLK_DDR, &dpll_cfg[cfg], 1); /* wait for pll lock */ while (!(readl(&grf->soc_status0) & SOCSTS_DPLL_LOCK)) @@ -504,8 +505,7 @@ static ulong rk3188_clk_set_rate(struct clk *clk, ulong rate) priv->has_bwadj); break; case CLK_DDR: - new_rate = rkclk_configure_ddr(priv->cru, priv->grf, rate, - priv->has_bwadj); + new_rate = rkclk_configure_ddr(priv->cru, priv->grf, rate); break; case HCLK_EMMC: case HCLK_SDMMC: