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: 10289661 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 79741601A0 for ; Fri, 16 Mar 2018 17:32:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6629A28FED for ; Fri, 16 Mar 2018 17:32:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A96028FEF; Fri, 16 Mar 2018 17:32:17 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 738B528FED for ; Fri, 16 Mar 2018 17:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=erONN/aIG/NUCAlGZYtfvUF/8HC4h/rVLwmChJad7QQ=; b=DUDMonvlzS0JSh ZvJreKwq78zTr7w/EIpWkS0+wwv8KVRiKzaXB0l5rOEYqv32MAld4RVgBpJXdJRgIdPneiIYSARLU 6e+sG5vjo/AWKAlPsbXAC8lY4iWg7dkejTGnwj7OwGtZmKRM53wIEI75Vw6zkj0aXJoZQgPzMptr1 KbuRE2Kn4bkA907AKURyQQGsMbUYHhw2dFp+bLq3QrJAqQFuS/f977kitNUv3UuYP0o0Xgel+h1EF 5o4pet3dVf0w3pVqBgtwtOkrZBwkmSdplmXe35vhQYnAvNHb34UMT5isJHKk/6ieAicHkFu/R+GCE 8bhpK8BkKS8ANXcWGHvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewtDB-0002Em-4f; Fri, 16 Mar 2018 17:32:13 +0000 Received: from mail-ua0-x242.google.com ([2607:f8b0:400c:c08::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewsyP-0006uw-9j for linux-rockchip@lists.infradead.org; Fri, 16 Mar 2018 17:17:00 +0000 Received: by mail-ua0-x242.google.com with SMTP id f5so7062697uam.5 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=BsLeqYAAqfxZVOfGf4xGrYeteRmb01std+ph/UQaKGrRRZCGdY+6xriv5oyU9GthiZ rpsOi+rzIDTpD7Gfv0yAPGYiSTPNws/d+Bp/BKCMU7cP0tvoYaO7K4paXYfPVtnsXEZp A3RDRCMOmFMeRH2be4KxxGMZjf18ysoAe03HGNg4sY/0GQwdVfjs8Fl1rP1mX85fVM7t P0Jhxk+y1/21PS65s64Glnio/Zr8/bjN4xZIO6l/niguHaH46kw0a+wqAAyq1Bmdy1fJ yH00Oag30dbKxSpH3Zpndl89DP/OJgNyhjgzu/bk8VQ0Dz/Yhn2KuCbqHg4UUSCJQfXx NcWQ== X-Gm-Message-State: AElRT7FQDFFvdglGW/8/gGp1RAw3iPSuW7yW9i1pFQcm5UbQF+QJbEZL +TjSdTu0zY3XApGIpclk9r9bd5eNeOOtLRZ61kaMOg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180316_101657_701090_B79979B2 X-CRM114-Status: GOOD ( 21.40 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Basehore , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Shawn Lin , Brian Norris , "open list:ARM/Rockchip SoC..." , diander@chromium.org, linux-clk Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.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

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";
+