summaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2015-05-18 10:56:24 +0200
committerStefano Babic <sbabic@denx.de>2015-05-26 14:16:54 +0200
commit21a26940f9048e668f9a79f64b802406b2e8d18c (patch)
tree69ad60b6af602381609ecfc3760755757031dc20 /arch/arm/cpu
parentab87fc6bbd80f4e702e7dde102b1c74f0f4678b3 (diff)
downloadu-boot-imx-21a26940f9048e668f9a79f64b802406b2e8d18c.zip
u-boot-imx-21a26940f9048e668f9a79f64b802406b2e8d18c.tar.gz
u-boot-imx-21a26940f9048e668f9a79f64b802406b2e8d18c.tar.bz2
arm, imx6, i2c: add I2C4 for MX6DL
add I2C4 modul for MX6DL based boards. Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv7/mx6/clock.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 055f44e..ae99945 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -140,23 +140,34 @@ int enable_usdhc_clk(unsigned char enable, unsigned bus_num)
#endif
#ifdef CONFIG_SYS_I2C_MXC
-/* i2c_num can be from 0 - 2 */
+/* i2c_num can be from 0 - 3 */
int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
{
u32 reg;
u32 mask;
- if (i2c_num > 2)
+ if (i2c_num > 3)
return -EINVAL;
-
- mask = MXC_CCM_CCGR_CG_MASK
- << (MXC_CCM_CCGR2_I2C1_SERIAL_OFFSET + (i2c_num << 1));
- reg = __raw_readl(&imx_ccm->CCGR2);
- if (enable)
- reg |= mask;
- else
- reg &= ~mask;
- __raw_writel(reg, &imx_ccm->CCGR2);
+ if (i2c_num < 3) {
+ mask = MXC_CCM_CCGR_CG_MASK
+ << (MXC_CCM_CCGR2_I2C1_SERIAL_OFFSET
+ + (i2c_num << 1));
+ reg = __raw_readl(&imx_ccm->CCGR2);
+ if (enable)
+ reg |= mask;
+ else
+ reg &= ~mask;
+ __raw_writel(reg, &imx_ccm->CCGR2);
+ } else {
+ mask = MXC_CCM_CCGR_CG_MASK
+ << (MXC_CCM_CCGR1_I2C4_SERIAL_OFFSET);
+ reg = __raw_readl(&imx_ccm->CCGR1);
+ if (enable)
+ reg |= mask;
+ else
+ reg &= ~mask;
+ __raw_writel(reg, &imx_ccm->CCGR1);
+ }
return 0;
}
#endif