summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
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);
+}
+