diff options
author | Ye Li <ye.li@nxp.com> | 2018-04-10 19:33:53 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2020-04-26 19:08:40 -0700 |
commit | 2fc767c4ba1ed5f2e784fe77aca155cb93d6b0b1 (patch) | |
tree | 50364f6812ac8316ff00466eaf5643fc9831ebf9 /arch/arm/mach-imx/imx8m/soc.c | |
parent | e822c2dd25ecc7bdd8558b519733c85819002b36 (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.
This is only needed when power domain driver is disabled
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 20e8f5ab5e18fa578283ad232e500a47e71fdd28)
(cherry picked from commit 9eb9b42c0acc42f46deba696da63582a4a32a9fb)
Diffstat (limited to 'arch/arm/mach-imx/imx8m/soc.c')
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index ea2c1045a1..5d1ead9a9c 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -488,3 +488,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 |