From patchwork Fri Mar 16 17:16:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10289551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3ED15602C2 for ; Fri, 16 Mar 2018 17:16:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E04028784 for ; Fri, 16 Mar 2018 17:16:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 223AC28807; Fri, 16 Mar 2018 17:16:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E80128784 for ; Fri, 16 Mar 2018 17:16:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932469AbeCPRQt (ORCPT ); Fri, 16 Mar 2018 13:16:49 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:37247 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbeCPRQq (ORCPT ); Fri, 16 Mar 2018 13:16:46 -0400 Received: by mail-ua0-f194.google.com with SMTP id q12so7064659uae.4 for ; Fri, 16 Mar 2018 10:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=uCkaV8tNh7UXdEWmy4AS8neKxL82VuNJxjwcJ0kTflY=; b=P5XRHm7mezB/3BxKQUrItS1QADvsQ29J3+ySyk+tfy192kLQtMwzGYZKxk1QnvB9iv hhSMYalHo+/rUWwYtoVwVByQ9MJH6ciEJyyMdHThQqhn/oZgsPlx6BV6osCNsNKP8xop dYiJw3s2DTwW2rphClpXDk2q9L+aqy0u2pBhtYfQ5uyN9X0swKKUB/vM2ogMC28eS2Yz hwX4d9M/1O0PznG7JkmiTO+rI92yIYvJ4RE60avhy5D703DCmq64FUs8+OVF0/mCNaUf xgeHuNR9K34RBm1bJtlxKB2XF3Uuz04MHQ8PDZYFzjtKFnMBgUY7v4yoVDitvueZZF+S cvaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=uCkaV8tNh7UXdEWmy4AS8neKxL82VuNJxjwcJ0kTflY=; b=CsTpoxpBg6I2g5NYOGF/96S48l6DRdIOPsdy9OvnE1wEAEJnqp2vtC6RKC/jNGyV4R 63UJetwbxyHZgsupA2+CIzqmyd+ZZQTIO04Yv8ss4nLL7o6Jv/ISnloX078JzN7Am4Vt O1bqE5DRyHIecqEY8nUNOUhcVfPHnrc0Rc7Xw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=uCkaV8tNh7UXdEWmy4AS8neKxL82VuNJxjwcJ0kTflY=; b=F58RgXwRuwgia4TaF5yaJbCHg37v9x7RGNZrCtMkX59bXcyVK9CObKdEuWKpXrEYqD jEWo6V4oCp29UmJXaAH6LgUBxEhjFMhDr1AOE8K8RmTSt39F4YRyUvs+8WnAC73wsXJ9 1/unwRF29nKrKEu5qDGFyOjEIawNnV0hba7EK1++Xx3z3js0TYkR2sZHuuB6lro94Czb e8NT8qijc5+mQHezr0xvxFLXErW+VYacW32F1c30pbs93a3xy6sitBe/73XLJXn/Q+CL lIkkgrb1vqnLBE7Yrz1E0zXdpfO9n13QAsqwP7wHi47D2HDl0YOaeQT76MwgVe8pySF8 sShA== X-Gm-Message-State: AElRT7EqBB3sbKBhB3YsET/fNPHPELj0jf2/JPVQHT5PsWFhCVhP5iBZ lhOMi42q5FYcUXMGjElURpe+kwYKFdrsqSdFGFnhSQ== X-Google-Smtp-Source: AG47ELu+gqZpVqLLeGnjQtZHFiJqHu3xuKPvHg25/d1UzRSEIlryRwDyKvcBxR4IV4WniZh1hFhtYeFh4MlUvmdVQis= X-Received: by 10.176.22.201 with SMTP id g9mr1875962uaf.62.1521220605020; Fri, 16 Mar 2018 10:16:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.180.195 with HTTP; Fri, 16 Mar 2018 10:16:43 -0700 (PDT) In-Reply-To: <1521169348-8552-2-git-send-email-hl@rock-chips.com> References: <1521169348-8552-1-git-send-email-hl@rock-chips.com> <1521169348-8552-2-git-send-email-hl@rock-chips.com> From: Doug Anderson Date: Fri, 16 Mar 2018 10:16:43 -0700 X-Google-Sender-Auth: h9LvJGizjZHoQrD-zoaXQdWOf3A Message-ID: Subject: Re: [PATCH v2 2/2] arm64: dts: rockchip: assign clock rate for some cpll child clock To: Lin Huang Cc: =?UTF-8?Q?Heiko_St=C3=BCbner?= , Derek Basehore , Shawn Lin , Brian Norris , "open list:ARM/Rockchip SoC..." , diander@chromium.org, linux-clk Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On Thu, Mar 15, 2018 at 8:02 PM, Lin Huang wrote: > These clocks do not assign default clock frequency, and use the > default cru register value to get frequency, so if cpll increase > frequency, these clocks also increase their frequency, that may > exceed their signed off frequency. So assign default clock for > them to avoid it. > > Change-Id: If79368aeda5c51dbf2a3b6659f17052a2ae4a401 > Signed-off-by: Lin Huang > --- > arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 8 +++++++- > arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 ++++++++++++-- > 2 files changed, 19 insertions(+), 3 deletions(-) This seems fine to me. For the previous similar change I liked the idea of explaining in the commit message why it's a good idea to include these rates in the CRU node even though the same CRU node explicitly sets the CPLL to 800 MHz. AKA, you could add to the commit message: NOTE: on none of the boards currently in mainline do we expect CPLL to be anything other than 800 MHz, but some future boards might have it. It's still good to be explicit about the clock rates to make diffing against future boards easier and also to rely less on BIOS muxing. > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi > index 4550c0f..b358533 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi > @@ -315,6 +315,8 @@ > clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, > <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; > clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; > + assigned-clocks = <&cru HCLK_SD>; > + assigned-clock-rates = <200000000>; To make things symmetric I'd probably also add a similar setting for hclk_sdio unless there's a reason that 200 MHz isn't the right rate there. Oh, actually, the clock tree isn't very symmetric here anyway, is it? For SDIO the clocks all come straight from "hclk_perilp1". I guess you could explicitly set "hclk_sdio", and "hclk_sdio_noc" (and "hclk_sdioaudio_noc"?) to 200 MHz. In any case, since it's not symmetric then I won't push for it being in this patch. Certainly the change in CPLL won't affect them since they're parented off hclk_peripl1 and we already have that taken care of... Reviewed-by: Douglas Anderson

On Thu, Mar 15, 2018 at 8:02 PM, Lin Huang <hl@rock-chips.com> wrote:
These clocks do not assign default clock frequency, and use the
default cru register value to get frequency, so if cpll increase
frequency, these clocks also increase their frequency, that may
exceed their signed off frequency. So assign default clock for
them to avoid it.

Change-Id: If79368aeda5c51dbf2a3b6659f17052a2ae4a401
Signed-off-by: Lin Huang <hl@rock-chips.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi |  8 +++++++-
 arch/arm64/boot/dts/rockchip/rk3399.dtsi     | 14 ++++++++++++--
 2 files changed, 19 insertions(+), 3 deletions(-)

 assigned-clocks = <&cru HCLK_SD>;
+               assigned-clock-rates = <200000000>;
                fifo-depth = <0x100>;
                power-domains = <&power RK3399_PD_SD>;
                resets = <&cru SRST_SDMMC>;
@@ -466,8 +468,10 @@
                clocks = <&cru SCLK_DP_CORE>, <&cru PCLK_DP_CTRL>,
                         <&cru SCLK_SPDIF_REC_DPTX>, <&cru PCLK_VIO_GRF>;
                clock-names = "core-clk", "pclk", "spdif", "grf";
-               phys = <&tcphy0_dp>, <&tcphy1_dp>;
+               assigned-clocks = <&cru SCLK_DP_CORE>, <&cru SCLK_SPDIF_REC_DPTX>;
+               assigned-clock-rates = <100000000>, <200000000>;
                power-domains = <&power RK3399_PD_HDCP>;
+               phys = <&tcphy0_dp>, <&tcphy1_dp>;
                resets = <&cru SRST_DPTX_SPDIF_REC>, <&cru SRST_P_UPHY0_DPTX>,
                         <&cru SRST_P_UPHY0_APB>, <&cru SRST_DP_CORE>;
                reset-names = "spdif", "dptx", "apb", "core";
@@ -1323,7 +1327,10 @@
                        <&cru ACLK_PERILP0>, <&cru HCLK_PERILP0>,
                        <&cru PCLK_PERILP0>, <&cru ACLK_CCI>,
                        <&cru HCLK_PERILP1>, <&cru PCLK_PERILP1>,
-                       <&cru ACLK_VIO>;
+                       <&cru ACLK_VIO>,
+                       <&cru ACLK_GIC_PRE>,
+                       <&cru PCLK_DDR>,
+                       <&cru ACLK_HDCP>;
                assigned-clock-rates =
                         <594000000>,  <800000000>,
                        <1000000000>,
@@ -1332,6 +1339,9 @@
                         <100000000>,  <100000000>,
                          <50000000>, <600000000>,
                         <100000000>,   <50000000>,
+                        <400000000>,
+                        <200000000>,
+                        <200000000>,
                         <400000000>;
        };

--
2.7.4


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

--- To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 18f546f..84e367b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -588,7 +588,10 @@
                <&cru ACLK_PERILP0>, <&cru HCLK_PERILP0>,
                <&cru PCLK_PERILP0>, <&cru ACLK_CCI>,
                <&cru HCLK_PERILP1>, <&cru PCLK_PERILP1>,
-               <&cru ACLK_VIO>;
+               <&cru ACLK_VIO>,
+               <&cru ACLK_GIC_PRE>,
+               <&cru PCLK_DDR>,
+               <&cru ACLK_HDCP>;
        assigned-clock-rates =
                <600000000>, <800000000>,
                <1000000000>,
@@ -597,6 +600,9 @@
                <100000000>, <100000000>,
                <50000000>, <800000000>,
                <100000000>, <50000000>,
+               <400000000>,
+               <200000000>,
+               <200000000>,
                <400000000>;
 };

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 4550c0f..b358533 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -315,6 +315,8 @@
                clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
                         <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
                clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+