Skip to contentSkip to conversation

allwinner usb phy driver

DISCUSSION qianfan 2 participants 2 messages May 9, 2023 – May 24, 2023 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore

qianfan

author
#0 lore raw

Hi:

All of the usb phys run sun4i_usb_phy_write to set some private tp register, but based on allwinner R40's bsp code, sun4i_usb_phy_write only work for ehci0/ohci0.

And I had changed PHY_TX_AMPLITUDE_TUNE's value to 0x17 from 0x14, when the usb enter TEST_J mode, only the ehci0's amplitude is changed.

sun4i_usb_phy_write is as same as USBC_Phy_TpWrite in allwinner bsp code, it is used for change otg's tp values. the backtrace is:

sunxi_udc_bsp_init -> open_usb_clock -> UsbPhyInit(0) -> USBC_Phy_TpWrite.

The other ehci/ohci device should use usb_phyx_tp_write instead. The backtrace is:

open_ehci_clock -> open_clock -> usb_phyx_tp_write