diff options
author | Ye Li <ye.li@nxp.com> | 2018-04-10 19:33:53 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-04-27 02:32:14 -0700 |
commit | 20e8f5ab5e18fa578283ad232e500a47e71fdd28 (patch) | |
tree | b2221b9b7040fd928c41aad0f449550c3f3cffdd | |
parent | ac64f460533f734ac5b2659f8e8ba9fbdd56e539 (diff) |
MLK-17210 usb: imx8m: Add PU power on/off to USB
ATF will power off all PUs at default, so for USB, we enable
its PU power for both host and device modes in board_usb_init and
disable the power when usb is stop in board_usb_cleanup.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Li Jun <jun.li@nxp.com>
-rw-r--r-- | arch/arm/include/asm/arch-imx8m/sys_proto.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-imx8m/sys_proto.h b/arch/arm/include/asm/arch-imx8m/sys_proto.h index 8bf9ac6697f..cdf268f99b7 100644 --- a/arch/arm/include/asm/arch-imx8m/sys_proto.h +++ b/arch/arm/include/asm/arch-imx8m/sys_proto.h @@ -12,6 +12,7 @@ void set_wdog_reset(struct wdog_regs *wdog); void enable_tzc380(void); void restore_boot_params(void); +int imx8m_usb_power(int usb_id, bool on); extern unsigned long rom_pointer[]; enum boot_device get_boot_device(void); bool is_usb_boot(void); diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 94413b95576..e7d8dbb9c22 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -320,3 +320,22 @@ int arch_misc_init(void) return 0; } #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) +{ + unsigned long ret; + + if (usb_id > 1) + return -EINVAL; + + ret = call_imx_sip(FSL_SIP_GPC, + FSL_SIP_CONFIG_GPC_PM_DOMAIN, 2 + usb_id, on, 0); + if (ret) + return -EPERM; + + return 0; +} +#endif |