Skip to content
Commit 803fbdfd authored by Jonas Karlman's avatar Jonas Karlman Committed by Kever Yang
Browse files

phy: rockchip-inno-usb2: Write to correct GRF



On RK3399 the USB2PHY regs are located in the common GRF, remaining SoCs
that is supported by this driver have the USB2PHY regs in a different
GRF.

When support for RK356x, RK3588 and RK3328 was added this driver was
never updated to use correct GRF and have instead incorrectly written
to wrong GRF for these SoCs.

The default reset values for the USB2PHY have made USB mostly working
even when wrong GRF was used, however, following have been observed:

  scanning bus usb@fd840000 for devices...
  ERROR:  USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or did
  not provide a handshake (OUT) (5)
  ERROR: USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or did
  not provide a handshake (OUT) (5)
  unable to get device descriptor (error=-1)

Fix this by using a regmap from rockchip,usbgrf prop and fall back to
getting a regmap for parent udevice instead of always getting the
common GRF.

Also protect against accidental clear of bit 0 in a reg with offset 0,
only bind driver to enabled otg/host-ports and remove unused headers.

Fixes: 3da15f0b ("phy: rockchip-inno-usb2: Add USB2 PHY for rk3568")
Fixes: cdf9010f ("phy: rockchip-inno-usb2: add initial support for rk3588 PHY")
Fixes: 9aa93d84 ("phy: rockchip-inno-usb2: Add USB2 PHY for RK3328")
Signed-off-by: default avatarJonas Karlman <jonas@kwiboo.se>
Reviewed-by: default avatarKever Yang <kever.yang@rock-chips.com>
parent 6d8cdfd1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment