mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] [ARM] imx1: add #define to configure frequency for the clk32
@ 2013-03-13  8:58 Gwenhael Goavec-Merou
  2013-03-15 15:13 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Gwenhael Goavec-Merou @ 2013-03-13  8:58 UTC (permalink / raw)
  To: barebox; +Cc: gwenhael

From: gwenhael <gwenhael.goavec-merou@armadeus.com>

i.MX1 allows to use a 32kHz or a 32.768kHz quartz for the 32kHz clock source
(MC9328MXLRM p.177).
This patch adds the ability for the developer to change the default value for
the 32kHz clock source.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
 arch/arm/mach-imx/clk-imx1.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 0d04a92..b779ab2 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -26,6 +26,10 @@
 
 #include "clk.h"
 
+#ifndef MX1_CLK32_FREQ
+#define MX1_CLK32_FREQ 32000
+#endif
+
 #define CCM_CSCR	0x0
 #define CCM_MPCTL0	0x4
 #define CCM_SPCTL0	0xc
@@ -91,7 +95,7 @@ static int imx1_ccm_probe(struct device_d *dev)
 
 	regs = dev_request_mem_region(dev, 0);
 
-	mx1_clocks_init(regs, 32000);
+	mx1_clocks_init(regs, MX1_CLK32_FREQ);
 
 	return 0;
 }
-- 
1.7.10.4


_______________________________________________
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] imx1: add #define to configure frequency for the clk32
  2013-03-13  8:58 [PATCH] [ARM] imx1: add #define to configure frequency for the clk32 Gwenhael Goavec-Merou
@ 2013-03-15 15:13 ` Sascha Hauer
  2013-03-25 11:14   ` gwenhael.goavec
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2013-03-15 15:13 UTC (permalink / raw)
  To: Gwenhael Goavec-Merou; +Cc: barebox

On Wed, Mar 13, 2013 at 09:58:58AM +0100, Gwenhael Goavec-Merou wrote:
> From: gwenhael <gwenhael.goavec-merou@armadeus.com>
> 
> i.MX1 allows to use a 32kHz or a 32.768kHz quartz for the 32kHz clock source
> (MC9328MXLRM p.177).
> This patch adds the ability for the developer to change the default value for
> the 32kHz clock source.

Ok, I see we have to do something here as there are systems out there
which have different clock frequencies. This also happens on other i.MX
SoCs.

I don't really like the solution, although I can't currently think of a
better one (at least not as long devicetrees are not available
everywhere). Using board specific defines which propagate to generic
drivers is not a very good design. However, is it ok for you when we
apply it along with the first user? This way we do not have this dead
define in the code.

Sascha


> 
> Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
> ---
>  arch/arm/mach-imx/clk-imx1.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
> index 0d04a92..b779ab2 100644
> --- a/arch/arm/mach-imx/clk-imx1.c
> +++ b/arch/arm/mach-imx/clk-imx1.c
> @@ -26,6 +26,10 @@
>  
>  #include "clk.h"
>  
> +#ifndef MX1_CLK32_FREQ
> +#define MX1_CLK32_FREQ 32000
> +#endif
> +
>  #define CCM_CSCR	0x0
>  #define CCM_MPCTL0	0x4
>  #define CCM_SPCTL0	0xc
> @@ -91,7 +95,7 @@ static int imx1_ccm_probe(struct device_d *dev)
>  
>  	regs = dev_request_mem_region(dev, 0);
>  
> -	mx1_clocks_init(regs, 32000);
> +	mx1_clocks_init(regs, MX1_CLK32_FREQ);
>  
>  	return 0;
>  }
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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

* Re: [PATCH] [ARM] imx1: add #define to configure frequency for the clk32
  2013-03-15 15:13 ` Sascha Hauer
@ 2013-03-25 11:14   ` gwenhael.goavec
  2013-03-25 12:43     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: gwenhael.goavec @ 2013-03-25 11:14 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,
What do you mean by "first user" ?

Gwenhael

On Fri, 15 Mar 2013 16:13:12 +0100
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> On Wed, Mar 13, 2013 at 09:58:58AM +0100, Gwenhael Goavec-Merou wrote:
> > From: gwenhael <gwenhael.goavec-merou@armadeus.com>
> > 
> > i.MX1 allows to use a 32kHz or a 32.768kHz quartz for the 32kHz clock source
> > (MC9328MXLRM p.177).
> > This patch adds the ability for the developer to change the default value for
> > the 32kHz clock source.
> 
> Ok, I see we have to do something here as there are systems out there
> which have different clock frequencies. This also happens on other i.MX
> SoCs.
> 
> I don't really like the solution, although I can't currently think of a
> better one (at least not as long devicetrees are not available
> everywhere). Using board specific defines which propagate to generic
> drivers is not a very good design. However, is it ok for you when we
> apply it along with the first user? This way we do not have this dead
> define in the code.
> 
> Sascha
> 
> 
> > 
> > Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
> > ---
> >  arch/arm/mach-imx/clk-imx1.c |    6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
> > index 0d04a92..b779ab2 100644
> > --- a/arch/arm/mach-imx/clk-imx1.c
> > +++ b/arch/arm/mach-imx/clk-imx1.c
> > @@ -26,6 +26,10 @@
> >  
> >  #include "clk.h"
> >  
> > +#ifndef MX1_CLK32_FREQ
> > +#define MX1_CLK32_FREQ 32000
> > +#endif
> > +
> >  #define CCM_CSCR	0x0
> >  #define CCM_MPCTL0	0x4
> >  #define CCM_SPCTL0	0xc
> > @@ -91,7 +95,7 @@ static int imx1_ccm_probe(struct device_d *dev)
> >  
> >  	regs = dev_request_mem_region(dev, 0);
> >  
> > -	mx1_clocks_init(regs, 32000);
> > +	mx1_clocks_init(regs, MX1_CLK32_FREQ);
> >  
> >  	return 0;
> >  }
> > -- 
> > 1.7.10.4
> > 
> > 
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> > 
> 
> -- 
> 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

_______________________________________________
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] imx1: add #define to configure frequency for the clk32
  2013-03-25 11:14   ` gwenhael.goavec
@ 2013-03-25 12:43     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-03-25 12:43 UTC (permalink / raw)
  To: gwenhael.goavec; +Cc: barebox

On Mon, Mar 25, 2013 at 12:14:34PM +0100, gwenhael.goavec wrote:
> Hi,
> What do you mean by "first user" ?

A patch which adds a board which makes use of this.

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:[~2013-03-25 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13  8:58 [PATCH] [ARM] imx1: add #define to configure frequency for the clk32 Gwenhael Goavec-Merou
2013-03-15 15:13 ` Sascha Hauer
2013-03-25 11:14   ` gwenhael.goavec
2013-03-25 12:43     ` Sascha Hauer

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