mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX5 clock: add clock provider support
@ 2018-08-24 12:38 Michael Grzeschik
  2018-08-25 21:01 ` Andrey Smirnov
  2018-11-12 16:20 ` Lucas Stach
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Grzeschik @ 2018-08-24 12:38 UTC (permalink / raw)
  To: barebox

Currently it is impossible to get clks with clk_get(&clk, "name");
on the mx5 platform. Change that by adding clk-imx5 as clk_provider.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/clk/imx/clk-imx5.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/clk/imx/clk-imx5.c b/drivers/clk/imx/clk-imx5.c
index edebd25a38..3840122419 100644
--- a/drivers/clk/imx/clk-imx5.c
+++ b/drivers/clk/imx/clk-imx5.c
@@ -60,6 +60,7 @@
 #define CCM_CMEOR	0x84
 
 static struct clk *clks[IMX5_CLK_END];
+static struct clk_onecell_data clk_data;
 
 /* This is used multiple times */
 static const char *standard_pll_sel[] = {
@@ -411,6 +412,10 @@ static int imx51_ccm_probe(struct device_d *dev)
 
 	mx51_clocks_init(dev, regs);
 
+	clk_data.clks = clks;
+	clk_data.clk_num = IMX5_CLK_END;
+	of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, &clk_data);
+
 	return 0;
 }
 
@@ -503,6 +508,10 @@ static int imx53_ccm_probe(struct device_d *dev)
 
 	mx53_clocks_init(dev, regs);
 
+	clk_data.clks = clks;
+	clk_data.clk_num = IMX5_CLK_END;
+	of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, &clk_data);
+
 	return 0;
 }
 
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: i.MX5 clock: add clock provider support
  2018-08-24 12:38 [PATCH] ARM: i.MX5 clock: add clock provider support Michael Grzeschik
@ 2018-08-25 21:01 ` Andrey Smirnov
  2018-11-12 16:20 ` Lucas Stach
  1 sibling, 0 replies; 4+ messages in thread
From: Andrey Smirnov @ 2018-08-25 21:01 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: Barebox List

On Fri, Aug 24, 2018 at 7:59 AM Michael Grzeschik
<m.grzeschik@pengutronix.de> wrote:
>
> Currently it is impossible to get clks with clk_get(&clk, "name");
> on the mx5 platform. Change that by adding clk-imx5 as clk_provider.
>

I had to come up with a fix for this exact problem a week or so ago,
and I went a little bit further than this patch and ported Linux clock
code for i.MX51/53 which already has code to create a clock provider.
I'll post the series shortly and we can compare notes and pick a way
to go forward. I am obviously biased toward having the same (almost)
code as Linux does, but this patch is less invasive, so I'll be happy
to pick it up if that's the direction we decide to go.

Thanks,
Andrey Smirnov

> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  drivers/clk/imx/clk-imx5.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/clk/imx/clk-imx5.c b/drivers/clk/imx/clk-imx5.c
> index edebd25a38..3840122419 100644
> --- a/drivers/clk/imx/clk-imx5.c
> +++ b/drivers/clk/imx/clk-imx5.c
> @@ -60,6 +60,7 @@
>  #define CCM_CMEOR      0x84
>
>  static struct clk *clks[IMX5_CLK_END];
> +static struct clk_onecell_data clk_data;
>
>  /* This is used multiple times */
>  static const char *standard_pll_sel[] = {
> @@ -411,6 +412,10 @@ static int imx51_ccm_probe(struct device_d *dev)
>
>         mx51_clocks_init(dev, regs);
>
> +       clk_data.clks = clks;
> +       clk_data.clk_num = IMX5_CLK_END;
> +       of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, &clk_data);
> +
>         return 0;
>  }
>
> @@ -503,6 +508,10 @@ static int imx53_ccm_probe(struct device_d *dev)
>
>         mx53_clocks_init(dev, regs);
>
> +       clk_data.clks = clks;
> +       clk_data.clk_num = IMX5_CLK_END;
> +       of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, &clk_data);
> +
>         return 0;
>  }
>
> --
> 2.18.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: i.MX5 clock: add clock provider support
  2018-08-24 12:38 [PATCH] ARM: i.MX5 clock: add clock provider support Michael Grzeschik
  2018-08-25 21:01 ` Andrey Smirnov
@ 2018-11-12 16:20 ` Lucas Stach
  2018-11-14  8:58   ` Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2018-11-12 16:20 UTC (permalink / raw)
  To: Michael Grzeschik, barebox

Am Freitag, den 24.08.2018, 14:38 +0200 schrieb Michael Grzeschik:
> Currently it is impossible to get clks with clk_get(&clk, "name");
> on the mx5 platform. Change that by adding clk-imx5 as clk_provider.

It seems this patch has been forgotten. As Sascha didn't apply the
patch reworking the while MX51 clock stuff to the kernel
implementation, I think it would be good to at least pull this patch
in.

Regards,
Lucas

> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  drivers/clk/imx/clk-imx5.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/clk/imx/clk-imx5.c b/drivers/clk/imx/clk-imx5.c
> index edebd25a38..3840122419 100644
> --- a/drivers/clk/imx/clk-imx5.c
> +++ b/drivers/clk/imx/clk-imx5.c
> @@ -60,6 +60,7 @@
> >  #define CCM_CMEOR	0x84
>  
>  static struct clk *clks[IMX5_CLK_END];
> +static struct clk_onecell_data clk_data;
>  
>  /* This is used multiple times */
>  static const char *standard_pll_sel[] = {
> @@ -411,6 +412,10 @@ static int imx51_ccm_probe(struct device_d *dev)
>  
> >  	mx51_clocks_init(dev, regs);
>  
> > +	clk_data.clks = clks;
> > +	clk_data.clk_num = IMX5_CLK_END;
> > +	of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, &clk_data);
> +
> >  	return 0;
>  }
>  
> @@ -503,6 +508,10 @@ static int imx53_ccm_probe(struct device_d *dev)
>  
> >  	mx53_clocks_init(dev, regs);
>  
> > +	clk_data.clks = clks;
> > +	clk_data.clk_num = IMX5_CLK_END;
> > +	of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, &clk_data);
> +
> >  	return 0;
>  }
>  

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: i.MX5 clock: add clock provider support
  2018-11-12 16:20 ` Lucas Stach
@ 2018-11-14  8:58   ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-11-14  8:58 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon, Nov 12, 2018 at 05:20:28PM +0100, Lucas Stach wrote:
> Am Freitag, den 24.08.2018, 14:38 +0200 schrieb Michael Grzeschik:
> > Currently it is impossible to get clks with clk_get(&clk, "name");
> > on the mx5 platform. Change that by adding clk-imx5 as clk_provider.
> 
> It seems this patch has been forgotten. As Sascha didn't apply the
> patch reworking the while MX51 clock stuff to the kernel
> implementation, I think it would be good to at least pull this patch
> in.

Just did that.

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-14  8:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-24 12:38 [PATCH] ARM: i.MX5 clock: add clock provider support Michael Grzeschik
2018-08-25 21:01 ` Andrey Smirnov
2018-11-12 16:20 ` Lucas Stach
2018-11-14  8:58   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox