linux/drivers/phy
William Wu d8db0c1fa4 phy: rockchip: inno-usb2: fix phy reset during power on for rk3588
The RK3588 USB2 PHY provides CLK12MOHCI and CLK48MOHCI to
OHCI controllers, and the two clocks are turned off upon
PHY reset, therefore it shouldn't access OHCI Controller
if USB2 PHY in reset. However, during the system PM resume,
the current USB2 PHY power on sequence with PHY reset
operation has potential risk that reset PHY accidentally
when OHCI platform resume access OHCI Controller, and
cause system hung.

The reason is EHCI/OHCI controllers resume ordering on
RK3588. In outline form, the hcd_bus_resume() of EHCI
and the ohci_resume() of OHCI operating concurrently on
different CPUs perform the following actions:

CPU 0                                   CPU 1
----------------------------            ---------------------------------
async_resume()
  usb_resume()
    hcd_bus_resume() -- EHCI
      usb_phy_roothub_resume()
        phy_power_on()
          rockchip_usb2phy_power_on()   ohci_platform_resume()
            rockchip_usb2phy_reset()      ohci_resume()
              assert phy reset              ...
                udelay(10);                 ohci_readl or ohci_writel

This patch fixes USB2 PHY reset during power on for RK3588,
only do USB2 PHY reset for RK3588 USB OTG0 and OTG1, because
their 'common_on_n' bit can be set to 1'b1 (aka REFCLK_LOGIC,
Bias, and PLL blocks are powered down) in PM runtime process.
And keep the 'common_on_n' to 1'b0 for RK3588 USB2 HOST0 and
HOST1, thus we don't need to do PHY reset during power on for
them.

This patch doesn't increase the USB2 PHY power consumption,
because the USB2 HOST0 and HOST1 don't support PM runtime
management, so actually the PHY PLL blocks of USB2 HOST0 and
HOST1 are always powered on.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ia0121a7c49bef4f0f3a1fb11a810e4ef95b29982
2022-10-12 14:10:15 +08:00
..
allwinner
amlogic
broadcom phy: usb: Leave some clocks running during suspend 2022-02-23 12:01:05 +01:00
cadence
freescale
hisilicon
intel
lantiq
marvell
mediatek
motorola
mscc
qualcomm phy: qcom-snps: Correct the FSEL_MASK 2021-11-18 14:04:20 +01:00
ralink
renesas
rockchip phy: rockchip: inno-usb2: fix phy reset during power on for rk3588 2022-10-12 14:10:15 +08:00
samsung
socionext phy: uniphier-usb3ss: fix unintended writing zeros to PHY register 2022-01-27 10:54:08 +01:00
st
tegra
ti phy: ti: Fix missing sentinel for clk_div_table 2022-02-16 12:54:30 +01:00
xilinx phy: xilinx: zynqmp: Fix bus width setting for SGMII 2022-02-16 12:54:23 +01:00
Kconfig
Makefile
phy-core-mipi-dphy.c phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) 2022-04-08 14:40:24 +02:00
phy-core.c
phy-lgm-usb.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c