Mainline:Broadcom Kona/USB PHY (HSOTGCTRL)
HSOTGCTRL is the USB2 PHY used in Broadcom Kona chips.
MDIO
MDIO most likely stands for Management Data Input/Output, a PHY management interface used primarily for Ethernet PHYs. While there is a standard for Ethernet MDIO registers, the USB MDIO does not appear to follow it, instead using its own values. Like the Ethernet MDIO, however, both the addresses and values are 16-bit.
MDIO read/write registers are located in CHIPREGS. There is a single read and write register - which internal MDIO device/address to read is selected by first writing the ID/address to the upper bits of the write register (TODO: write down full sequence). USB MDIO has an ID of 9, and 6 registers are written in downstream (docs taken mostly from arch/arm/plat-kona/bcm_hsotgctrl.c
in Rhea downstream):
- MDIO0 - current reference adjustment ("afe_pll_tst lower 16 bits")
- MDIO1 - voltage reference adjustment ("afe_pll_tst upper 16 bits")
- MDIO2 - ???; not set in Rhea driver, set to 0x0000 in Hawaii driver
- MDIO3 - transmitter current; valid values are documented in Hawaii driver. Set to 0x2600 on most devices, 0x0400 on Garnet board; TX current value has mask
0x07e0
, what the upper bit does is unknown. - MDIO4 - USB PHY receiver sensitivity/squelch (valid values are documented in aforementioned Rhea driver and Hawaii driver).
- MDIO5 - ???; only set in Hawaii driver, set to 0x0000 on all devices. Might have been included by mistake.
On at least the Samsung Galaxy Grand Neo, the correct MDIO values are already written by the bootloader.
USB PHY regs
Main offset: 0x????
USBOTGCONTROL (0x00
)
Called OTGCTL
in mainline driver. Controls various settings related to USB handling.
Name | Bit | Description |
---|---|---|
OTGSTAT2, OTGSTAT1 | 31:30 | ???; mainline driver clears these bits when powering on. |
REG_OTGSTAT2, REG_OTGSTAT1 | 29:28 | Controls VBUS valid state; a value of 1 indicates VBUS on, a value of 0 indicates VBUS off. (bcm_hsotgctrl_phy_set_vbus_stat in downstream)
|