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-23 16:33:22 +0100 |
commit | 6b900b4b233b061a0a8348e70cc3d436c5c07c39 (patch) | |
tree | f070490c66a88e9093f900461ea89543f148e0c2 | |
parent | 9c72493a9c9d3337d2e9abbbd459be759c066cbc (diff) |
warp7: usb: Enable the various USB clocksatf-master+linaro-warp7-pr12-usb
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/nxp/imx7/warp7/warp7_bl2_el3_setup.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plat/nxp/imx7/warp7/warp7_bl2_el3_setup.c b/plat/nxp/imx7/warp7/warp7_bl2_el3_setup.c index 85984cd8..00b4e543 100644 --- a/plat/nxp/imx7/warp7/warp7_bl2_el3_setup.c +++ b/plat/nxp/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(); |