summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/mx5
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2012-07-19 08:18:25 (GMT)
committerHeiko Schocher <hs@denx.de>2012-07-31 06:00:57 (GMT)
commitcc54a0f7cccf976d350801d39c406e75465ebdd1 (patch)
treec28139c6518e37fd16786cd011bbb5b5f0556a0b /arch/arm/cpu/armv7/mx5
parentdf369dcdb05729304761748856a2513d9ddac272 (diff)
downloadu-boot-fsl-qoriq-cc54a0f7cccf976d350801d39c406e75465ebdd1.tar.xz
imx-common: add i2c.c for bus recovery support
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Diffstat (limited to 'arch/arm/cpu/armv7/mx5')
-rw-r--r--arch/arm/cpu/armv7/mx5/clock.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index 64862b3..c67c3cf 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -117,6 +117,26 @@ void enable_usboh3_clk(unsigned char enable)
writel(reg, &mxc_ccm->CCGR2);
}
+#ifdef CONFIG_I2C_MXC
+/* i2c_num can be from 0 - 2 */
+int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
+{
+ u32 reg;
+ u32 mask;
+
+ if (i2c_num > 2)
+ return -EINVAL;
+ mask = MXC_CCM_CCGR_CG_MASK << ((i2c_num + 9) << 1);
+ reg = __raw_readl(&mxc_ccm->CCGR1);
+ if (enable)
+ reg |= mask;
+ else
+ reg &= ~mask;
+ __raw_writel(reg, &mxc_ccm->CCGR1);
+ return 0;
+}
+#endif
+
void set_usb_phy1_clk(void)
{
unsigned int reg;