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-16 18:24:48 +0100 |
commit | 55de83d3ee54b0ac25bbb47f990e5fdf3d43150b (patch) | |
tree | f806062234f8423ce22a5d77e60db99f16daa276 | |
parent | 93c014802d74cc4c7e9f4c87193e89d44555594c (diff) |
warp7: usb: Enable the various USB clockslinaro-20180716-001
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 9cd50f63..77cd2241 100644 --- a/plat/nxp/imx7/warp7/warp7_bl2_el3_setup.c +++ b/plat/nxp/imx7/warp7/warp7_bl2_el3_setup.c @@ -38,6 +38,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; @@ -184,6 +187,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 @@ -206,6 +219,7 @@ void bl2_el3_early_platform_setup(u_register_t arg1, u_register_t arg2, clock_enable_mmc(mmc_clock_sel, MMC_CLK_SELECT); warp7_setup_system_counter(); warp7_setup_wdog_clocks(); + warp7_setup_usb_clocks(); /* Setup pin-muxes */ warp7_setup_pinmux(); |