mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/7] add i2c clock support
@ 2012-02-21  0:27 Eric Bénard
  2012-02-21  0:27 ` [PATCH 2/7] mfd: add mc34708 driver Eric Bénard
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Eric Bénard @ 2012-02-21  0:27 UTC (permalink / raw)
  To: barebox

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/mach-imx/speed-imx53.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/speed-imx53.c b/arch/arm/mach-imx/speed-imx53.c
index 0d6ac24..a2385fa 100644
--- a/arch/arm/mach-imx/speed-imx53.c
+++ b/arch/arm/mach-imx/speed-imx53.c
@@ -169,6 +169,31 @@ unsigned long imx_get_fecclk(void)
 	return imx_get_ipgclk();
 }
 
+static unsigned long imx_get_ipg_perclk(void)
+{
+	u32 reg;
+
+	reg = ccm_readl(MX5_CCM_CBCDR);
+	if (!(reg & MX5_CCM_CBCDR_PERIPH_CLK_SEL))
+		return pll2_sw_get_rate();
+	reg = ccm_readl(MX5_CCM_CBCMR);
+	switch ((reg & MX5_CCM_CBCMR_PERIPH_CLK_SEL_MASK) >>
+		MX5_CCM_CBCMR_PERIPH_CLK_SEL_OFFSET) {
+	case 0:
+		return pll1_main_get_rate();
+	case 1:
+		return pll3_sw_get_rate();
+	/* case 2:
+		TODO : LP_APM */
+	}
+	return 0;
+}
+
+unsigned long imx_get_i2cclk(void)
+{
+	return imx_get_ipg_perclk();
+}
+
 unsigned long imx_get_mmcclk(void)
 {
 	u32 reg, prediv, podf, rate;
@@ -201,4 +226,5 @@ void imx_dump_clocks(void)
 	printf("ipg:  %ld\n", imx_get_ipgclk());
 	printf("fec:  %ld\n", imx_get_fecclk());
 	printf("gpt:  %ld\n", imx_get_gptclk());
+	printf("i2c:  %ld\n", imx_get_i2cclk());
 }
-- 
1.7.7.6


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

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

end of thread, other threads:[~2012-02-27 18:59 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-21  0:27 [PATCH 1/7] add i2c clock support Eric Bénard
2012-02-21  0:27 ` [PATCH 2/7] mfd: add mc34708 driver Eric Bénard
2012-02-21  3:48   ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-21  7:03     ` Eric Bénard
2012-02-21 13:03       ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-21 13:22         ` Eric Bénard
2012-02-21 14:10           ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-21 15:35             ` Eric Bénard
2012-02-21 15:38               ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-21 20:45                 ` Sascha Hauer
2012-02-21 21:09                   ` Marc Reilly
2012-02-21  0:27 ` [PATCH 3/7] i.MX53: add silicn revision functions Eric Bénard
2012-02-22  7:33   ` Sascha Hauer
2012-02-27  8:20     ` [PATCH v2 1/7] add i2c clock support Eric Bénard
2012-02-27  8:20       ` [PATCH v2 2/7] mfd: add mc34708 driver Eric Bénard
2012-02-27  8:20       ` [PATCH v2 3/7] i.MX53: add silicon revision functions Eric Bénard
2012-02-27  8:20       ` [PATCH v2 4/7] i.MX53: enable pull up on I2C0 pins Eric Bénard
2012-02-27  8:20       ` [PATCH v2 5/7] mx53-loco: add i2c support Eric Bénard
2012-02-27  8:20       ` [PATCH v2 6/7] mx53-loco: add board revision support Eric Bénard
2012-02-27 15:40         ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-27 18:58           ` Sascha Hauer
2012-02-27  8:20       ` [PATCH v2 7/7] mx53-loco: update defconfig Eric Bénard
2012-02-27 18:59       ` [PATCH v2 1/7] add i2c clock support Sascha Hauer
2012-02-21  0:27 ` [PATCH 4/7] i.MX53: enable pull up on I2C0 pins Eric Bénard
2012-02-21  0:27 ` [PATCH 5/7] mx53-loco: add i2c support Eric Bénard
2012-02-21  0:27 ` [PATCH 6/7] mx53-loco: add board revision support Eric Bénard
2012-02-21  3:50   ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-21  0:27 ` [PATCH 7/7] mx53-loco: update defconfig Eric Bénard

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