Commit d4f12cd9 authored by Ye Li's avatar Ye Li

MLK-18290-3 imx8mm: Add SOC level support for OTG USB

Enable the OTG power on, add clock fuction and USB base address.
Signed-off-by: 's avatarYe Li <ye.li@nxp.com>
parent 67699e88
......@@ -761,6 +761,22 @@ u32 imx_get_fecclk(void)
return get_root_clk(ENET_AXI_CLK_ROOT);
}
void enable_usboh3_clk(unsigned char enable)
{
if (enable) {
clock_enable(CCGR_USB_MSCALE_PL301, 0);
/* 500M */
clock_set_target_val(USB_BUS_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1));
/* 100M */
clock_set_target_val(USB_CORE_REF_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1));
/* 100M */
clock_set_target_val(USB_PHY_REF_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1));
clock_enable(CCGR_USB_MSCALE_PL301, 1);
} else {
clock_enable(CCGR_USB_MSCALE_PL301, 0);
}
}
/*
* Dump some clockes.
*/
......
......@@ -596,7 +596,6 @@ int arch_misc_init(void)
}
#endif
#ifdef CONFIG_USB_XHCI_IMX8M
#define FSL_SIP_GPC 0xC2000000
#define FSL_SIP_CONFIG_GPC_PM_DOMAIN 0x03
int imx8m_usb_power(int usb_id, bool on)
......@@ -613,4 +612,3 @@ int imx8m_usb_power(int usb_id, bool on)
return 0;
}
#endif
......@@ -823,4 +823,5 @@ int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
int set_clk_enet(enum enet_freq type);
#endif
void hab_caam_clock_enable(unsigned char enable);
void enable_usboh3_clk(unsigned char enable);
#endif
......@@ -104,6 +104,8 @@
#define MXS_GPMI_BASE 0x33002000
#define MXS_BCH_BASE 0x33004000
#define USB_BASE_ADDR USB1_BASE_ADDR
#define IOMUXC_GPR0 (IOMUXC_GPR_BASE_ADDR + 0x00)
#define IOMUXC_GPR1 (IOMUXC_GPR_BASE_ADDR + 0x04)
#define IOMUXC_GPR2 (IOMUXC_GPR_BASE_ADDR + 0x08)
......
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