[PATCH 06/11] speed-imx35: the gptclk is connected to the ipgclk

Marc Kleine-Budde mkl at pengutronix.de
Mon Nov 23 07:06:18 EST 2009


The gpt clock on MX35 is connected to the ipg clock. But the
implementation uses the ipg_per clock.

This patch lets the gpt use the ipg clock and introduces the
ipg_per clock.

Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
---
 arch/arm/mach-imx/speed-imx35.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c
index 8d1614f..655b38b 100644
--- a/arch/arm/mach-imx/speed-imx35.c
+++ b/arch/arm/mach-imx/speed-imx35.c
@@ -93,7 +93,7 @@ static unsigned long get_3_3_div(unsigned long in)
 	return (((in >> 3) & 0x7) + 1) * ((in & 0x7) + 1);
 }
 
-unsigned long imx_get_gptclk(void)
+unsigned long imx_get_ipg_perclk(void)
 {
 	ulong pdr0 = readl(IMX_CCM_BASE + CCM_PDR0);
 	ulong pdr4 = readl(IMX_CCM_BASE + CCM_PDR4);
@@ -107,12 +107,17 @@ unsigned long imx_get_gptclk(void)
 	} else {
 		/* perclk from AHB divided clock */
 		fref = imx_get_ahbclk();
-		div = ((pdr0 >> 12) & 0x7) + 1;	//FIXME check datasheet 111 -> 7 ?
+		div = ((pdr0 >> 12) & 0x7) + 1;
 	}
 
 	return fref / div;
 }
 
+unsigned long imx_get_gptclk(void)
+{
+	return imx_get_ipgclk();
+}
+
 unsigned long imx_get_uartclk(void)
 {
 	unsigned long pdr3 = readl(IMX_CCM_BASE + CCM_PDR3);
@@ -137,6 +142,7 @@ void imx_dump_clocks(void)
 	printf("gpt:     %10d Hz\n", imx_get_gptclk());
 	printf("ahb:     %10d Hz\n", imx_get_ahbclk());
 	printf("ipg:     %10d Hz\n", imx_get_ipgclk());
+	printf("ipg_per: %10d Hz\n", imx_get_ipg_perclk());
 	printf("uart:	 %10d Hz\n", imx_get_uartclk());
 }
 
-- 
1.6.5.2





More information about the barebox mailing list