diff options
author | Ye Li <ye.li@nxp.com> | 2018-04-10 19:33:53 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2022-04-06 14:31:06 +0800 |
commit | 3cac26bf9ae20b647e9638a593b7bb6ad11e2c9b (patch) | |
tree | 662bef371cadeb0860e2e3515c1e87e70020f8a9 | |
parent | a74d47821c4f988a67168c0f586eca4bb6fa93db (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)
(cherry picked from commit fdae2f2356d10927513ae42a5aa73635e549c1f0)
(cherry picked from commit eb0b9a7102c00ba7b9145f11ede259a4c8615b6f)
-rw-r--r-- | arch/arm/include/asm/arch-imx8m/sys_proto.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 15 |
2 files changed, 16 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 d328542ece2..3e54f9b6764 100644 --- a/arch/arm/include/asm/arch-imx8m/sys_proto.h +++ b/arch/arm/include/asm/arch-imx8m/sys_proto.h @@ -11,6 +11,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 17efe37447e..fe12fe0f44d 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1225,6 +1225,21 @@ int arch_misc_init(void) } #endif +int imx8m_usb_power(int usb_id, bool on) +{ + struct arm_smccc_res res; + + if (usb_id > 1) + return -EINVAL; + + arm_smccc_smc(IMX_SIP_GPC, IMX_SIP_GPC_PM_DOMAIN, + 2 + usb_id, on, 0, 0, 0, 0, &res); + if (res.a0) + return -EPERM; + + return 0; +} + void imx_tmu_arch_init(void *reg_base) { if (is_imx8mm() || is_imx8mn()) { |