aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-08-11 14:34:22 -0600
committerJohn Rigby <john.rigby@linaro.org>2011-08-15 15:24:24 -0600
commitefa39c5cda0afc3fa8c403f023afce8dd51ecac5 (patch)
tree1508904e3bef21ad429650d492e87619f7d067ed
parent81d9f1023f80bf58316fdb9740dbd943aa9a9166 (diff)
OMAP4 Panda: clock config for USB
Turn on some clocks that were formerly configured by x-loader Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--arch/arm/cpu/armv7/omap4/clocks.c13
-rw-r--r--board/ti/panda/panda.c19
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap4/clocks.c b/arch/arm/cpu/armv7/omap4/clocks.c
index eda960ca7..bbc1f599c 100644
--- a/arch/arm/cpu/armv7/omap4/clocks.c
+++ b/arch/arm/cpu/armv7/omap4/clocks.c
@@ -247,6 +247,15 @@ static inline void wait_for_lock(u32 *const base)
}
}
+static void force_on(u32 *const reg, u32 val)
+{
+ u32 temp;
+
+ temp = readl(reg);
+ temp |= val;
+ writel(temp, reg);
+}
+
static void do_setup_dpll(u32 *const base, const struct dpll_params *params,
u8 lock)
{
@@ -440,6 +449,10 @@ static void setup_non_essential_dplls(void)
/* Now setup the dpll with the regular function */
do_setup_dpll(&prcm->cm_clkmode_dpll_usb, params, DPLL_LOCK);
+ /* Force on these two clocks */
+ force_on(&prcm->cm_div_m2_dpll_usb, 1 << 8);
+ force_on(&prcm->cm_clkdcoldo_dpll_usb, 1 << 8);
+
#ifdef CONFIG_SYS_OMAP4_ABE_SYSCK
params = &abe_dpll_params_sysclk_196608khz[sysclk_ind];
abe_ref_clk = CM_ABE_PLL_REF_CLKSEL_CLKSEL_SYSCLK;
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c
index 6e6cffae6..5fe01b176 100644
--- a/board/ti/panda/panda.c
+++ b/board/ti/panda/panda.c
@@ -85,6 +85,25 @@ int misc_init_r(void)
void set_muxconf_regs_non_essential(void)
{
+ /*
+ * Enable USB phy ref clock before reconfiguring pins because
+ * the phy seems to get in a bad state otherwise.
+ */
+#define OMAP44XX_SCRM_BASE 0x4a30a000
+#define OMAP44XX_SCRM_ALTCLKSRC (OMAP44XX_SCRM_BASE + 0x110)
+#define OMAP44XX_SCRM_AUXCLK1 (OMAP44XX_SCRM_BASE + 0x314)
+#define OMAP44XX_SCRM_AUXCLK3 (OMAP44XX_SCRM_BASE + 0x31c)
+ /* enable software ioreq */
+ sr32(OMAP44XX_SCRM_AUXCLK3, 8, 1, 0x1);
+ /* set for sys_clk (38.4MHz) */
+ sr32(OMAP44XX_SCRM_AUXCLK3, 1, 2, 0x0);
+ /* set divisor to 2 */
+ sr32(OMAP44XX_SCRM_AUXCLK3, 16, 4, 0x1);
+ /* set the clock source to active */
+ sr32(OMAP44XX_SCRM_ALTCLKSRC, 0, 1, 0x1);
+ /* enable clocks */
+ sr32(OMAP44XX_SCRM_ALTCLKSRC, 2, 2, 0x3);
+
do_set_mux(CONTROL_PADCONF_CORE, core_padconf_array_non_essential,
sizeof(core_padconf_array_non_essential) /
sizeof(struct pad_conf_entry));