summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorSammy He <r62914@freescale.com>2010-11-17 00:39:08 +0800
committerSammy He <r62914@freescale.com>2010-11-18 00:57:49 +0800
commit7496154e2fdc3efccd5d5b8acf160082f1b95c2d (patch)
tree0522cedde956e6c6d8aed4e1def5a9940eafb10e /cpu
parent5c13c889739565b7a0409048ef4ac3eaedf3ff09 (diff)
downloadu-boot-imx-7496154e2fdc3efccd5d5b8acf160082f1b95c2d.zip
u-boot-imx-7496154e2fdc3efccd5d5b8acf160082f1b95c2d.tar.gz
u-boot-imx-7496154e2fdc3efccd5d5b8acf160082f1b95c2d.tar.bz2
ENGR00133551-1 Add freescale usb udc support for i.mx51 platform.
Add imx_udc for usb gadget on i.mx51 platform. Signed-off-by: Hu Hui <b29976@freescale.com> Signed-off-by: Sammy He <r62914@freescale.com>
Diffstat (limited to 'cpu')
-rw-r--r--cpu/arm_cortexa8/mx51/generic.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/cpu/arm_cortexa8/mx51/generic.c b/cpu/arm_cortexa8/mx51/generic.c
index d854988..7013645 100644
--- a/cpu/arm_cortexa8/mx51/generic.c
+++ b/cpu/arm_cortexa8/mx51/generic.c
@@ -928,3 +928,55 @@ int arch_cpu_init(void)
return 0;
}
#endif
+
+void set_usboh3_clk(void)
+{
+ unsigned int reg;
+
+ reg = readl(MXC_CCM_CSCMR1);
+ reg |= 1 << 22;
+ writel(reg, MXC_CCM_CSCMR1);
+ reg = readl(MXC_CCM_CSCDR1);
+ reg &= ~MXC_CCM_CSCDR1_USBOH3_CLK_PODF_MASK;
+ reg &= ~MXC_CCM_CSCDR1_USBOH3_CLK_PRED_MASK;
+ reg |= 4 << MXC_CCM_CSCDR1_USBOH3_CLK_PRED_OFFSET;
+ reg |= 1 << MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET;
+
+ writel(reg, MXC_CCM_CSCDR1);
+}
+
+void set_usb_phy1_clk(void)
+{
+ unsigned int reg;
+
+ reg = readl(MXC_CCM_CSCMR1);
+ reg &= ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL;
+ writel(reg, MXC_CCM_CSCMR1);
+}
+
+void enable_usboh3_clk(unsigned char enable)
+{
+ unsigned int reg;
+
+ reg = readl(MXC_CCM_CCGR2);
+ if (enable)
+ reg |= 1 << 14;
+ else
+ reg &= ~(1 << 14);
+ writel(reg, MXC_CCM_CCGR2);
+}
+
+void enable_usb_phy1_clk(unsigned char enable)
+{
+
+ unsigned int reg;
+
+ reg = readl(MXC_CCM_CCGR2);
+
+ if (enable)
+ reg |= 1 << 0;
+ else
+ reg &= ~(1<<0);
+ writel(reg, MXC_CCM_CCGR2);
+}
+