mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM pcm043: Check silicon revision to set up cpu freq correct
@ 2011-08-23 12:30 Teresa Gámez
  2011-08-23 12:45 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Teresa Gámez @ 2011-08-23 12:30 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox

Some older pcm043 only work correct when cpu frequency is set up
to 399MHz. All modules with revision >= 1315.4 are equipped
with a i.MX35 TO2.1 and do run with 532MHz.

Check the silicon revision and set up the frequency accordingly.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/pcm043/lowlevel.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
index bbe586b..e488681 100644
--- a/arch/arm/boards/pcm043/lowlevel.c
+++ b/arch/arm/boards/pcm043/lowlevel.c
@@ -37,6 +37,11 @@
 #define MPCTL_PARAM_532     ((1 << 31) | IMX_PLL_PD(0) | IMX_PLL_MFD(11) | IMX_PLL_MFI(11) | IMX_PLL_MFN(1))
 #define PPCTL_PARAM_300     (IMX_PLL_PD(0) | IMX_PLL_MFD(3) | IMX_PLL_MFI(6) | IMX_PLL_MFN(1))
 
+#define IMX35_CHIP_REVISION_2_1		0x11
+
+#define CCM_PDR0_399	0x00011000
+#define CCM_PDR0_532	0x00001000
+
 #ifdef CONFIG_NAND_IMX_BOOT
 static void __bare_init __naked insdram(void)
 {
@@ -111,7 +116,13 @@ void __bare_init __naked board_init_lowlevel(void)
 	writel(MPCTL_PARAM_532, ccm_base + CCM_MPCTL);
 
 	writel(PPCTL_PARAM_300, ccm_base + CCM_PPCTL);
-	writel(0x00001000, ccm_base + CCM_PDR0);
+
+	/* Check silicon revision and use 532MHz if >=2.1 */
+	r = readl(IMX_IIM_BASE + 0x24);
+	if (r >= IMX35_CHIP_REVISION_2_1)
+		writel(CCM_PDR0_532, ccm_base + CCM_PDR0);
+	else
+		writel(CCM_PDR0_399, ccm_base + CCM_PDR0);
 
 	r = readl(ccm_base + CCM_CGR0);
 	r |= 0x00300000;
-- 
1.7.0.4


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

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

* Re: [PATCH] ARM pcm043: Check silicon revision to set up cpu freq correct
  2011-08-23 12:30 [PATCH] ARM pcm043: Check silicon revision to set up cpu freq correct Teresa Gámez
@ 2011-08-23 12:45 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2011-08-23 12:45 UTC (permalink / raw)
  To: Teresa Gámez; +Cc: barebox

On Tue, Aug 23, 2011 at 02:30:27PM +0200, Teresa Gámez wrote:
> Some older pcm043 only work correct when cpu frequency is set up
> to 399MHz. All modules with revision >= 1315.4 are equipped
> with a i.MX35 TO2.1 and do run with 532MHz.

Applied to master.

Sascha

> 
> Check the silicon revision and set up the frequency accordingly.
> 
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
>  arch/arm/boards/pcm043/lowlevel.c |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
> index bbe586b..e488681 100644
> --- a/arch/arm/boards/pcm043/lowlevel.c
> +++ b/arch/arm/boards/pcm043/lowlevel.c
> @@ -37,6 +37,11 @@
>  #define MPCTL_PARAM_532     ((1 << 31) | IMX_PLL_PD(0) | IMX_PLL_MFD(11) | IMX_PLL_MFI(11) | IMX_PLL_MFN(1))
>  #define PPCTL_PARAM_300     (IMX_PLL_PD(0) | IMX_PLL_MFD(3) | IMX_PLL_MFI(6) | IMX_PLL_MFN(1))
>  
> +#define IMX35_CHIP_REVISION_2_1		0x11
> +
> +#define CCM_PDR0_399	0x00011000
> +#define CCM_PDR0_532	0x00001000
> +
>  #ifdef CONFIG_NAND_IMX_BOOT
>  static void __bare_init __naked insdram(void)
>  {
> @@ -111,7 +116,13 @@ void __bare_init __naked board_init_lowlevel(void)
>  	writel(MPCTL_PARAM_532, ccm_base + CCM_MPCTL);
>  
>  	writel(PPCTL_PARAM_300, ccm_base + CCM_PPCTL);
> -	writel(0x00001000, ccm_base + CCM_PDR0);
> +
> +	/* Check silicon revision and use 532MHz if >=2.1 */
> +	r = readl(IMX_IIM_BASE + 0x24);
> +	if (r >= IMX35_CHIP_REVISION_2_1)
> +		writel(CCM_PDR0_532, ccm_base + CCM_PDR0);
> +	else
> +		writel(CCM_PDR0_399, ccm_base + CCM_PDR0);
>  
>  	r = readl(ccm_base + CCM_CGR0);
>  	r |= 0x00300000;
> -- 
> 1.7.0.4
> 
> 

-- 
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] 2+ messages in thread

end of thread, other threads:[~2011-08-23 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 12:30 [PATCH] ARM pcm043: Check silicon revision to set up cpu freq correct Teresa Gámez
2011-08-23 12:45 ` Sascha Hauer

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