From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760561AbbEEQR3 (ORCPT ); Tue, 5 May 2015 12:17:29 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:44712 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753109AbbEEQLP (ORCPT ); Tue, 5 May 2015 12:11:15 -0400 Date: Tue, 5 May 2015 18:11:12 +0200 From: Sascha Hauer To: Matthias Brugger Cc: Mike Turquette , Stephen Boyd , YH Chen , "linux-kernel@vger.kernel.org" , Henry Chen , linux-mediatek@lists.infradead.org, =Sascha Hauer , Yingjoe Chen , Eddie Huang , "linux-arm-kernel@lists.infradead.org" , James Liao Subject: Re: [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135. Message-ID: <20150505161112.GC6325@pengutronix.de> References: <1429778143-2074-1-git-send-email-s.hauer@pengutronix.de> <1429778143-2074-5-git-send-email-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 17:55:08 up 50 days, 3:47, 84 users, load average: 0.47, 0.23, 0.19 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 05, 2015 at 05:51:33PM +0200, Matthias Brugger wrote: > 2015-04-23 10:35 GMT+02:00 Sascha Hauer : > > From: James Liao > > > > This patch adds basic clocks for MT8135, including TOPCKGEN, PLLs, > > INFRA and PERI clocks. > > > > + > > +static void __init mtk_infrasys_init(struct device_node *node) > > +{ > > + struct clk_onecell_data *clk_data; > > + int r; > > + > > + clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); > > + > > + mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks), > > + clk_data); > > + > > + clk_prepare_enable(clk_data->clks[CLK_INFRA_M4U]); > > + > > + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > > + if (r) > > + pr_err("%s(): could not register clock provider: %d\n", > > + __func__, r); > > + > > + mtk_register_reset_controller(node, 2, 0x30); > > +} > > +CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt8135-infracfg", mtk_infrasys_init); > > + > > +static void __init mtk_pericfg_init(struct device_node *node) > > +{ > > + struct clk_onecell_data *clk_data; > > + int r; > > + void __iomem *base; > > + > > + base = of_iomap(node, 0); > > + if (!base) { > > + pr_err("%s(): ioremap failed\n", __func__); > > + return; > > + } > > + > > + clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK); > > + > > + mtk_clk_register_gates(node, peri_gates, ARRAY_SIZE(peri_gates), > > + clk_data); > > + mtk_clk_register_composites(peri_clks, ARRAY_SIZE(peri_clks), base, > > + &mt8135_clk_lock, clk_data); > > Composite clocks in pericfg should use regmap. I would, but there is no regmap support for composite clocks. I have looked into it and came to the conclusion that it's a significant amount of work to add regmap support to all the basic clk types. Adding this would delay this series probably even further (due to work time and the necessary review/resend cycles) and I must say that after v12 I'm really losing motivation to further work on this series (I will because it's my job, but otherwise I would have run far away by now). So yes, you're right, regmap should be used, but I have verified that the registers used by the clk code are completely orthogonal to the ones used in the reset controller, thus it should be safe to use readl/writel here. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sascha Hauer Subject: Re: [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135. Date: Tue, 5 May 2015 18:11:12 +0200 Message-ID: <20150505161112.GC6325@pengutronix.de> References: <1429778143-2074-1-git-send-email-s.hauer@pengutronix.de> <1429778143-2074-5-git-send-email-s.hauer@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+glpam-linux-mediatek=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Matthias Brugger Cc: James Liao , Mike Turquette , YH Chen , Stephen Boyd , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Henry Chen , linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, =Sascha Hauer , Yingjoe Chen , Eddie Huang , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: linux-mediatek@lists.infradead.org On Tue, May 05, 2015 at 05:51:33PM +0200, Matthias Brugger wrote: > 2015-04-23 10:35 GMT+02:00 Sascha Hauer : > > From: James Liao > > > > This patch adds basic clocks for MT8135, including TOPCKGEN, PLLs, > > INFRA and PERI clocks. > > > > + > > +static void __init mtk_infrasys_init(struct device_node *node) > > +{ > > + struct clk_onecell_data *clk_data; > > + int r; > > + > > + clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); > > + > > + mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks), > > + clk_data); > > + > > + clk_prepare_enable(clk_data->clks[CLK_INFRA_M4U]); > > + > > + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > > + if (r) > > + pr_err("%s(): could not register clock provider: %d\n", > > + __func__, r); > > + > > + mtk_register_reset_controller(node, 2, 0x30); > > +} > > +CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt8135-infracfg", mtk_infrasys_init); > > + > > +static void __init mtk_pericfg_init(struct device_node *node) > > +{ > > + struct clk_onecell_data *clk_data; > > + int r; > > + void __iomem *base; > > + > > + base = of_iomap(node, 0); > > + if (!base) { > > + pr_err("%s(): ioremap failed\n", __func__); > > + return; > > + } > > + > > + clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK); > > + > > + mtk_clk_register_gates(node, peri_gates, ARRAY_SIZE(peri_gates), > > + clk_data); > > + mtk_clk_register_composites(peri_clks, ARRAY_SIZE(peri_clks), base, > > + &mt8135_clk_lock, clk_data); > > Composite clocks in pericfg should use regmap. I would, but there is no regmap support for composite clocks. I have looked into it and came to the conclusion that it's a significant amount of work to add regmap support to all the basic clk types. Adding this would delay this series probably even further (due to work time and the necessary review/resend cycles) and I must say that after v12 I'm really losing motivation to further work on this series (I will because it's my job, but otherwise I would have run far away by now). So yes, you're right, regmap should be used, but I have verified that the registers used by the clk code are completely orthogonal to the ones used in the reset controller, thus it should be safe to use readl/writel here. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | From mboxrd@z Thu Jan 1 00:00:00 1970 From: s.hauer@pengutronix.de (Sascha Hauer) Date: Tue, 5 May 2015 18:11:12 +0200 Subject: [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135. In-Reply-To: References: <1429778143-2074-1-git-send-email-s.hauer@pengutronix.de> <1429778143-2074-5-git-send-email-s.hauer@pengutronix.de> Message-ID: <20150505161112.GC6325@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, May 05, 2015 at 05:51:33PM +0200, Matthias Brugger wrote: > 2015-04-23 10:35 GMT+02:00 Sascha Hauer : > > From: James Liao > > > > This patch adds basic clocks for MT8135, including TOPCKGEN, PLLs, > > INFRA and PERI clocks. > > > > + > > +static void __init mtk_infrasys_init(struct device_node *node) > > +{ > > + struct clk_onecell_data *clk_data; > > + int r; > > + > > + clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); > > + > > + mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks), > > + clk_data); > > + > > + clk_prepare_enable(clk_data->clks[CLK_INFRA_M4U]); > > + > > + r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); > > + if (r) > > + pr_err("%s(): could not register clock provider: %d\n", > > + __func__, r); > > + > > + mtk_register_reset_controller(node, 2, 0x30); > > +} > > +CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt8135-infracfg", mtk_infrasys_init); > > + > > +static void __init mtk_pericfg_init(struct device_node *node) > > +{ > > + struct clk_onecell_data *clk_data; > > + int r; > > + void __iomem *base; > > + > > + base = of_iomap(node, 0); > > + if (!base) { > > + pr_err("%s(): ioremap failed\n", __func__); > > + return; > > + } > > + > > + clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK); > > + > > + mtk_clk_register_gates(node, peri_gates, ARRAY_SIZE(peri_gates), > > + clk_data); > > + mtk_clk_register_composites(peri_clks, ARRAY_SIZE(peri_clks), base, > > + &mt8135_clk_lock, clk_data); > > Composite clocks in pericfg should use regmap. I would, but there is no regmap support for composite clocks. I have looked into it and came to the conclusion that it's a significant amount of work to add regmap support to all the basic clk types. Adding this would delay this series probably even further (due to work time and the necessary review/resend cycles) and I must say that after v12 I'm really losing motivation to further work on this series (I will because it's my job, but otherwise I would have run far away by now). So yes, you're right, regmap should be used, but I have verified that the registers used by the clk code are completely orthogonal to the ones used in the reset controller, thus it should be safe to use readl/writel here. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |