diff options
author | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2018-07-16 18:24:48 +0100 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2018-07-26 16:35:38 +0100 |
commit | 8087cb988e18a93ad357948fa90cb4a5d5650a0c (patch) | |
tree | 7a2d48f098c53450593d6c9f8b7e75c1bdc768ac | |
parent | 59218827dcf013f3f618cb6aecc239d4028695da (diff) |
warp7: usb: Enable the various USB clockswarp7-fix-linux-boot
Given we are using SKIP_LOWLEVEL_INIT in the bl33 version of u-boot it is
necessary to setup the USB clocks in ATF or OPTEE.
We already do a bunch of clock setup in ATF so, it makes sense to add USB
into the clock stack.
This patch sets-up the controller, main USB clock and PHY clocks, without
which reading/writing the USB control registers will stall in Linux.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
-rw-r--r-- | plat/imx/imx7/warp7/warp7_bl2_el3_setup.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c b/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c index 85984cd8..00b4e543 100644 --- a/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c +++ b/plat/imx/imx7/warp7/warp7_bl2_el3_setup.c @@ -39,6 +39,9 @@ #define WDOG_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\ CCM_TRGT_MUX_WDOG_CLK_ROOT_OSC_24M) +#define USB_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\ + CCM_TRGT_MUX_USB_HSIC_CLK_ROOT_SYS_PLL) + uintptr_t plat_get_ns_image_entrypoint(void) { return WARP7_UBOOT_BASE; @@ -196,6 +199,16 @@ static void warp7_setup_wdog_clocks(void) clock_enable_wdog(3); } +static void warp7_setup_usb_clocks(void) +{ + uint32_t usb_en_bits = (uint32_t)USB_CLK_SELECT; + + clock_set_usb_clk_root_bits(usb_en_bits); + clock_enable_usb(CCM_CCGR_ID_USB_IPG); + clock_enable_usb(CCM_CCGR_ID_USB_PHY_480MCLK); + clock_enable_usb(CCM_CCGR_ID_USB_OTG1_PHY); + clock_enable_usb(CCM_CCGR_ID_USB_OTG2_PHY); +} /* * bl2_early_platform_setup() * MMU off @@ -218,6 +231,7 @@ void bl2_el3_early_platform_setup(u_register_t arg1, u_register_t arg2, clock_enable_usdhc(usdhc_clock_sel, USDHC_CLK_SELECT); warp7_setup_system_counter(); warp7_setup_wdog_clocks(); + warp7_setup_usb_clocks(); /* Setup pin-muxes */ warp7_setup_pinmux(); |