The USB peripheral is configured using
the CONTROL_USBOTGHS_CONTROL register.
AM261x does not support USB OTG (On-The-Go). The operating mode - host or device - is
determined in software at the device boot by sampling the SOP pins. The
CONTROL_USBOTGHS_CONTROL register is software-configured to drive the UTMI+ (USB
Transceiver Macrocell Interface) signals.
Inputs to the USB controller, driven by the control module include:
- CONTROL_USBOTGHS.CONTROL_AVALID. This bitfield indicates whether the
USB VBUS is above the A-Device session valid threshold. The threshold
voltage, Vth is between 0.8V and 2.0V. The bitfield is set to 0
if the USB VBUS voltage is below VA_SESS_VLD. The bitfield is set to 1 if
the VBUS voltage is above VA_SESS_VLD.
- CONTROL_USBOTGHS.VBUSVALID. This bitfield indicates if the USB VBUS
is above the threshold for normal operation. The threshold voltage
Vth us between 4.4V and 4.75V.
- CONTROL_USBOTGHS.SESSEND. This bitfield indicates if the VBUS is
below the B-Device session valid threshold. The threshold voltage,
Vth is between 0.8V and 2.0V. The bitfield is set to 0 if the
USB VBUS voltage is above VB_SESS_END. The bitfield is set to 1 if the USB
VBUS is below VB_SESS_END.
- CONTROL_USBOTGHS.IDDIG. This bitfield indicates the value of the
USB_ID pin on the USB receptacle. The bitfield is set to 0 if the ID pin is
grounded, indicating that the USB controller is in host mode. The
bitfield is set to 1 if the ID pin is high-impedance, indicating that the
USB controller is in device mode.
Outputs of the USB controller, readable in the control module include:
- CONTROL_USBOTGHS.IDPULLUP. This read-only bitfield enables sampling
of the USB_ID pin on the USB receptacle. The bitfield reads 0 if the
transceiver does not apply a pull-up to the USB_ID pin. The bitfield reads 1
if the transceiver applies a pull-up to the USB_ID pin.
- CONTROL_USBOTGHS.DRVVBUS. This read-only bitfield controls the drive
of the 5V power on the USB VBUS. The bitfield reads 0 if the transceiver
does not drive the USB VBUS. The bitfield reads 1 if the transciever drives
the USB VBUS.
- CONTROL_USBOTGHS.CHRGVBUS. This read-only bitfield controls the
charging of the USB VBUS for initiating SRP (Session Request Protocol). The
bitfield reads 0 if the transceiver does not charge the USB VBUS. The
bitfield reads 1 if the transceiver charges the USB VBUS.
- CONTROL_USBOTGHS.DISCHRGVBUS. This read-only bitfield controls the
discharging of the USB VBUS for completing SRP. The bitfield reads 0 if the
transceiver does not discharge the USB VBUS. The bitfield reads 1 if the
transceiver discharges the USB VBUS.
The CTRL_USB_CTRL0 register is used to control the wake-up and power down of the USB
PHY.
USB2PHY is a physical layer transceiver (PHY) that connects a USB controller to
external USB physical lines. The USB2PHY power down signal, USB2PHY.PD is an OR of
the eFuse disable USB2_DISABLE and the bit CTRL_USB_CTRL0.CM_PWRDN, which is
set to 1 if the PHY is powered down, and is set to 0 if the PHY is operating in
normal mode.
The USB_SLAVE_CONTROL is used to control the USB peripheral requests.
The USB PHY wake-up interface provides a mechanism to generate a trigger to the MCU
core logic when a change is detected on the USB_DP and USB_DM pins. A typical
use-case for this interface is when the USB PHY is powered up and waiting to be
connected.
- The MCU control logic asserts a wake-up enable
USB_SLAVE_CONTROL.USBSS_PHY_WAKEUP_WUIN, and pulses the wake-up
clock USB_SLAVE_CONTROL.USBSS_PHY_WAKEUP_WUCLKIN. This latches the
values of the USB_DP and USB_DM pins to the USB PHYs wake-up logic and shuts
off the PHY supply voltage.
- When a change is seen in the USB_DP and USB_DM pin states, a wake-up out
signal USB_SLAVE_CONTROL.USBSS_PHY_WAKEUP_WOUT pulse is generated,
which goes out as an interrupt to the MCU and to the device power management
module. This restores the supply voltage to the PHY.