From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 BC18AC433E0 for ; Mon, 1 Jun 2020 20:09:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E5F32074B for ; Mon, 1 Jun 2020 20:09:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LLPui1Gj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E5F32074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JP9xNZlWeUFS/k25DtpVjKmJGl8hayhFwqo1yEAC0Ws=; b=LLPui1GjjP9llr 4/YwrSutaSI0cItoOwf/ScANSBnmDz5h7Ui/mxEOzvxxo8YfFZTn+xehtbOwHwV+QPoHZybNjava1 Py6hYka2RCx5G4LeYY/LNLEyLSDixxFH8z6WOc/SWWDQejUhiAOwKEiJDAiN1hmxGLW7ize6ERFXZ hu/WXnkd5QHWChcjPxNhtm0CbrS+hMYQ3iPwATzASasd6pqt+95ACvomi5mTxQwP2xJK22Idkt/fY 08XQKCYx9V/khzl7NPiPeFXUW6rh6j8a+TXd36BGiG/G9O9aswf0cmATnJPsxOJRUpJmhtUWgAJFB QHcqs8/kjEx4AF6B/Jgw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfqkd-0006m3-0J; Mon, 01 Jun 2020 20:09:39 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfqkZ-0006kl-0c; Mon, 01 Jun 2020 20:09:36 +0000 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jfqkQ-0004eb-4t; Mon, 01 Jun 2020 22:09:26 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: =?ISO-8859-1?Q?Myl=E8ne?= Josserand Subject: Re: [PATCH v3 1/1] clk: rockchip: rk3288: Handle clock tree for rk3288w Date: Mon, 01 Jun 2020 22:09:25 +0200 Message-ID: <8288442.SvGebX2C5V@diego> In-Reply-To: <20200601151442.156184-2-mylene.josserand@collabora.com> References: <20200601151442.156184-1-mylene.josserand@collabora.com> <20200601151442.156184-2-mylene.josserand@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200601_130935_053718_6D81DBF2 X-CRM114-Status: GOOD ( 16.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, kever.yang@rock-chips.com, linux-rockchip@lists.infradead.org, geert@linux-m68k.org, kernel@collabora.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Myl=E8ne, Am Montag, 1. Juni 2020, 17:14:42 CEST schrieb Myl=E8ne Josserand: > The revision rk3288w has a different clock tree about "hclk_vio" > clock, according to the BSP kernel code. > = > This patch handles this difference by detecting which device-tree > we are using. If it is a "rockchip,rk3288-cru", let's register > the clock tree as it was before. If the compatible is > "rockchip,rk3288w-cru", we will apply the difference according to this > version of this SoC. > = > Noticed that this new device-tree compatible must be handled by > bootloader. > = > Signed-off-by: Myl=E8ne Josserand approach looks good, but you should also update the clock-controller dt-binding for the new compatible. Style nits below. > --- > drivers/clk/rockchip/clk-rk3288.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > = > diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk= -rk3288.c > index cc2a177bbdbf..5018d2f1e54c 100644 > --- a/drivers/clk/rockchip/clk-rk3288.c > +++ b/drivers/clk/rockchip/clk-rk3288.c > @@ -425,8 +425,6 @@ static struct rockchip_clk_branch rk3288_clk_branches= [] __initdata =3D { > COMPOSITE(0, "aclk_vio0", mux_pll_src_cpll_gpll_usb480m_p, CLK_IGNORE_U= NUSED, > RK3288_CLKSEL_CON(31), 6, 2, MFLAGS, 0, 5, DFLAGS, > RK3288_CLKGATE_CON(3), 0, GFLAGS), > - DIV(0, "hclk_vio", "aclk_vio0", 0, > - RK3288_CLKSEL_CON(28), 8, 5, DFLAGS), > COMPOSITE(0, "aclk_vio1", mux_pll_src_cpll_gpll_usb480m_p, CLK_IGNORE_U= NUSED, > RK3288_CLKSEL_CON(31), 14, 2, MFLAGS, 8, 5, DFLAGS, > RK3288_CLKGATE_CON(3), 2, GFLAGS), > @@ -819,6 +817,16 @@ static struct rockchip_clk_branch rk3288_clk_branche= s[] __initdata =3D { > INVERTER(0, "pclk_isp", "pclk_isp_in", RK3288_CLKSEL_CON(29), 3, IFLAGS= ), > }; > = > +static struct rockchip_clk_branch rk3288w_hclkvio_branch[] __initdata = =3D { > + DIV(0, "hclk_vio", "aclk_vio1", 0, > + RK3288_CLKSEL_CON(28), 8, 5, DFLAGS), please keep indentations as they were, the sub-lines starting where they are is actually intentional :-) > +}; > + > +static struct rockchip_clk_branch rk3288_hclkvio_branch[] __initdata =3D= { > + DIV(0, "hclk_vio", "aclk_vio0", 0, > + RK3288_CLKSEL_CON(28), 8, 5, DFLAGS), same here > +}; > + > static const char *const rk3288_critical_clocks[] __initconst =3D { > "aclk_cpu", > "aclk_peri", > @@ -936,6 +944,14 @@ static void __init rk3288_clk_init(struct device_nod= e *np) > RK3288_GRF_SOC_STATUS1); > rockchip_clk_register_branches(ctx, rk3288_clk_branches, > ARRAY_SIZE(rk3288_clk_branches)); > + > + if (of_device_is_compatible(np, "rockchip,rk3288w-cru")) > + rockchip_clk_register_branches(ctx, rk3288w_hclkvio_branch, > + ARRAY_SIZE(rk3288w_hclkvio_branch)); > + else > + rockchip_clk_register_branches(ctx, rk3288_hclkvio_branch, > + ARRAY_SIZE(rk3288_hclkvio_branch)); > + > rockchip_clk_protect_critical(rk3288_critical_clocks, > ARRAY_SIZE(rk3288_critical_clocks)); > = > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel