All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mike Turquette <mturquette@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	YH Chen <yh.chen@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Henry Chen <henryc.chen@mediatek.com>,
	linux-mediatek@lists.infradead.org,
	=Sascha Hauer <kernel@pengutronix.de>,
	Yingjoe Chen <Yingjoe.Chen@mediatek.com>,
	Eddie Huang <eddie.huang@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	James Liao <jamesjj.liao@mediatek.com>
Subject: Re: [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135.
Date: Tue, 5 May 2015 18:11:12 +0200	[thread overview]
Message-ID: <20150505161112.GC6325@pengutronix.de> (raw)
In-Reply-To: <CABuKBeLfJKMR5uyQ7vQrzv0wW-F+wc6n3AsOVqH3Yy=7M6dH1g@mail.gmail.com>

On Tue, May 05, 2015 at 05:51:33PM +0200, Matthias Brugger wrote:
> 2015-04-23 10:35 GMT+02:00 Sascha Hauer <s.hauer@pengutronix.de>:
> > From: James Liao <jamesjj.liao@mediatek.com>
> >
> > 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 |

WARNING: multiple messages have this Message-ID (diff)
From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Mike Turquette
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	YH Chen <yh.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Henry Chen <henryc.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	=Sascha Hauer <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Yingjoe Chen
	<Yingjoe.Chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Eddie Huang <eddie.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135.
Date: Tue, 5 May 2015 18:11:12 +0200	[thread overview]
Message-ID: <20150505161112.GC6325@pengutronix.de> (raw)
In-Reply-To: <CABuKBeLfJKMR5uyQ7vQrzv0wW-F+wc6n3AsOVqH3Yy=7M6dH1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, May 05, 2015 at 05:51:33PM +0200, Matthias Brugger wrote:
> 2015-04-23 10:35 GMT+02:00 Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
> > From: James Liao <jamesjj.liao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> >
> > 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 |

WARNING: multiple messages have this Message-ID (diff)
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135.
Date: Tue, 5 May 2015 18:11:12 +0200	[thread overview]
Message-ID: <20150505161112.GC6325@pengutronix.de> (raw)
In-Reply-To: <CABuKBeLfJKMR5uyQ7vQrzv0wW-F+wc6n3AsOVqH3Yy=7M6dH1g@mail.gmail.com>

On Tue, May 05, 2015 at 05:51:33PM +0200, Matthias Brugger wrote:
> 2015-04-23 10:35 GMT+02:00 Sascha Hauer <s.hauer@pengutronix.de>:
> > From: James Liao <jamesjj.liao@mediatek.com>
> >
> > 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 |

  reply	other threads:[~2015-05-05 16:17 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23  8:35 [PATCH v12] clk: Add common clock support for Mediatek MT8135 and MT8173 Sascha Hauer
2015-04-23  8:35 ` Sascha Hauer
2015-04-23  8:35 ` Sascha Hauer
2015-04-23  8:35 ` [PATCH 1/6] clk: make strings in parent name arrays const Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-04-23  8:48   ` Uwe Kleine-König
2015-04-23  8:48     ` Uwe Kleine-König
2015-04-23  8:35 ` [PATCH 2/6] clk: mediatek: Add initial common clock support for Mediatek SoCs Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-04-23  8:35 ` [PATCH 3/6] clk: mediatek: Add reset controller support Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-04-23  8:35 ` [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135 Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-05-05 15:51   ` Matthias Brugger
2015-05-05 15:51     ` Matthias Brugger
2015-05-05 15:51     ` Matthias Brugger
2015-05-05 16:11     ` Sascha Hauer [this message]
2015-05-05 16:11       ` Sascha Hauer
2015-05-05 16:11       ` Sascha Hauer
2015-04-23  8:35 ` [PATCH 5/6] clk: mediatek: Add basic clocks for Mediatek MT8173 Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-04-23  8:35 ` [PATCH 6/6] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock/reset controllers Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-04-23  8:35   ` Sascha Hauer
2015-05-01  1:20   ` Stephen Boyd
2015-05-01  1:20     ` Stephen Boyd
2015-05-01  1:20     ` Stephen Boyd
2015-05-04  8:38     ` Sascha Hauer
2015-05-04  8:38       ` Sascha Hauer
2015-05-04  8:38       ` Sascha Hauer
2015-05-06  5:53       ` Stephen Boyd
2015-05-06  5:53         ` Stephen Boyd
2015-05-06  5:53         ` Stephen Boyd
2015-05-06  5:54 ` [PATCH v12] clk: Add common clock support for Mediatek MT8135 and MT8173 Stephen Boyd
2015-05-06  5:54   ` Stephen Boyd
2015-05-07  8:15   ` Sascha Hauer
2015-05-07  8:15     ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2015-03-31 18:16 [PATCH v11]: " Sascha Hauer
2015-03-31 18:16 ` [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135 Sascha Hauer
2015-03-31 18:16   ` Sascha Hauer
2015-04-09 17:05   ` Matthias Brugger
2015-04-09 17:05     ` Matthias Brugger
2015-04-09 17:05     ` Matthias Brugger
2015-04-13  9:53     ` Sascha Hauer
2015-04-13  9:53       ` Sascha Hauer
2015-04-13  9:53       ` Sascha Hauer
2015-03-30 17:40 [PATCH v10]: clk: Add common clock support for Mediatek MT8135 and MT8173 Sascha Hauer
2015-03-30 17:40 ` [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135 Sascha Hauer
2015-03-30 17:40   ` Sascha Hauer
2015-03-27  9:18 [PATCH v9]: clk: Add common clock support for Mediatek MT8135 and MT8173 Sascha Hauer
2015-03-27  9:18 ` [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135 Sascha Hauer
2015-03-27  9:18   ` Sascha Hauer
2015-03-19  8:42 [PATCH v8]: clk: Add common clock support for Mediatek MT8135 and MT8173 Sascha Hauer
2015-03-19  8:42 ` [PATCH 4/6] clk: mediatek: Add basic clocks for Mediatek MT8135 Sascha Hauer
2015-03-19  8:42   ` Sascha Hauer
2015-03-27  7:39   ` Stephen Boyd
2015-03-27  7:39     ` Stephen Boyd
2015-03-27  9:21     ` Sascha Hauer
2015-03-27  9:21       ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150505161112.GC6325@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=Yingjoe.Chen@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=henryc.chen@mediatek.com \
    --cc=jamesjj.liao@mediatek.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    --cc=yh.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.