OMAP3+: Clock: Adding ehci clock enabling
authorGovindraj.R <govindraj.raja@ti.com>
Mon, 6 Feb 2012 03:55:35 +0000 (03:55 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sun, 12 Feb 2012 09:11:31 +0000 (10:11 +0100)
Adding ehci clock enabling mechanism part of clock framework.
When essential clocks are enabled during init phase usb host
clocks can also be enabled from clock framework.

Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Tested-by: Stefano Babic <sbabic@denx.de>
arch/arm/cpu/armv7/omap3/board.c
arch/arm/cpu/armv7/omap3/clock.c
arch/arm/cpu/armv7/omap4/clocks.c
arch/arm/include/asm/arch-omap3/sys_proto.h

index 871aa37df8d4d6de7d935d42cc02135b10dc4775..054e9c481cee5030fe20b34ebcb6c835fd81dda0 100644 (file)
@@ -228,6 +228,10 @@ void s_init(void)
 
        per_clocks_enable();
 
+#ifdef CONFIG_USB_EHCI_OMAP
+       ehci_clocks_enable();
+#endif
+
 #ifdef CONFIG_SPL_BUILD
        preloader_console_init();
 
index e0d65c7a4abca53006f58ca679fa6e657f82579e..567817e0ec3b062c3ee2a66c901b14ab1b44a8b2 100644 (file)
@@ -626,6 +626,26 @@ void prcm_init(void)
        sdelay(5000);
 }
 
+/*
+ * Enable usb ehci uhh, tll clocks
+ */
+void ehci_clocks_enable(void)
+{
+       struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+
+       /* Enable USBHOST_L3_ICLK (USBHOST_MICLK) */
+       sr32(&prcm_base->iclken_usbhost, 0, 1, 1);
+       /*
+        * Enable USBHOST_48M_FCLK (USBHOST_FCLK1)
+        * and USBHOST_120M_FCLK (USBHOST_FCLK2)
+        */
+       sr32(&prcm_base->fclken_usbhost, 0, 2, 3);
+       /* Enable USBTTL_ICLK */
+       sr32(&prcm_base->iclken3_core, 2, 1, 1);
+       /* Enable USBTTL_FCLK */
+       sr32(&prcm_base->fclken3_core, 2, 1, 1);
+}
+
 /******************************************************************************
  * peripheral_enable() - Enable the clks & power for perifs (GPT2, UART1,...)
  *****************************************************************************/
index 0886f92431ad87ace2cd2823196580b8cd3693e7..12e283af767b2d53ecb936d92065a5d26f5ad993 100644 (file)
@@ -342,6 +342,9 @@ void enable_basic_clocks(void)
                &prcm->cm_l4per_gpio4_clkctrl,
                &prcm->cm_l4per_gpio5_clkctrl,
                &prcm->cm_l4per_gpio6_clkctrl,
+               &prcm->cm_l3init_usbphy_clkctrl,
+               &prcm->cm_clksel_usb_60mhz,
+               &prcm->cm_l3init_hsusbtll_clkctrl,
                0
        };
 
@@ -352,6 +355,8 @@ void enable_basic_clocks(void)
                &prcm->cm_l4per_gptimer2_clkctrl,
                &prcm->cm_wkup_wdtimer2_clkctrl,
                &prcm->cm_l4per_uart3_clkctrl,
+               &prcm->cm_l3init_fsusb_clkctrl,
+               &prcm->cm_l3init_hsusbhost_clkctrl,
                0
        };
 
index e5031d5022ba3f07d919278c68166bf7e9f31ec1..2a89e56534073ff7d65a63e9d89e4e866e88266f 100644 (file)
@@ -34,6 +34,7 @@ struct emu_hal_params {
 
 void prcm_init(void);
 void per_clocks_enable(void);
+void ehci_clocks_enable(void);
 
 void memif_init(void);
 void sdrc_init(void);