Commit 767ffd28 authored by Ye Li's avatar Ye Li Committed by Jason Liu

MLK-16198-2 usb: xhci-imx8: Add clock init interface

Introduce a clock init interface for xhci-imx8 to initialize its clocks
in SoC level. Also implement it for i.MX8QM/QXP.
Signed-off-by: default avatarYe Li <ye.li@nxp.com>
Reviewed-by: default avatarPeng Fan <peng@nxp.com>
parent 391dcf21
......@@ -212,6 +212,32 @@ void enable_usboh3_clk(unsigned char enable)
return;
}
void init_clk_usb3(int index)
{
sc_err_t err;
sc_ipc_t ipc;
ipc = gd->arch.ipc_channel_handle;
err = sc_pm_clock_enable(ipc, SC_R_USB_2, SC_PM_CLK_MISC, true, false);
if (err != SC_ERR_NONE)
printf("USB3 set clock failed!, line=%d (error = %d)\n",
__LINE__, err);
err = sc_pm_clock_enable(ipc, SC_R_USB_2, SC_PM_CLK_MST_BUS, true, false);
if (err != SC_ERR_NONE)
printf("USB3 set clock failed!, line=%d (error = %d)\n",
__LINE__, err);
err = sc_pm_clock_enable(ipc, SC_R_USB_2, SC_PM_CLK_PER, true, false);
if (err != SC_ERR_NONE)
printf("USB3 set clock failed!, line=%d (error = %d)\n",
__LINE__, err);
return;
}
void init_clk_usdhc(u32 index)
{
#ifdef CONFIG_IMX8QM
......
......@@ -33,5 +33,6 @@ int set_clk_qspi(void);
u32 imx_get_fecclk(void);
void init_clk_usdhc(u32 index);
void init_clk_gpmi_nand(void);
void init_clk_usb3(int index);
#endif /* __ASM_ARCH_CLOCK_H__ */
......@@ -16,6 +16,7 @@
#include <usb/imx8_usb3_reg_def.h>
#include <dm.h>
#include <power-domain.h>
#include <asm/arch/clock.h>
/* Declare global data pointer */
DECLARE_GLOBAL_DATA_PTR;
......@@ -181,6 +182,8 @@ static int xhci_imx8_probe(struct udevice *dev)
return ret;
}
init_clk_usb3(dev->seq);
imx8_xhci_init();
hccr = (struct xhci_hccr *)HCIVERSION_CAPLENGTH;
......@@ -228,6 +231,8 @@ int xhci_hcd_init(int index, struct xhci_hccr **ret_hccr,
return ret;
}
init_clk_usb3(index);
imx8_xhci_init();
hccr = (struct xhci_hccr *)HCIVERSION_CAPLENGTH;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment