Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 11/27/2024
Public
Document Table of Contents

5.7.5.4.4.1. USB Transactions

In device mode, the MAC decodes and checks the integrity of all token packets. For valid OUT or SETUP tokens, the following DATA packet is also checked. If the received token is a valid OUT or SETUP token, the MAC performs the following steps:
  1. Waits and checks the PID of the following data packet, then writes the data to the receive FIFO buffer when it is available
  2. Checks the data integrity
  3. Sends the appropriate handshake when required to the host
  4. Writes the transaction status to the receiving status queue

If the OUT token is received and the receive FIFO buffer is not available, the MAC sends the host a NAK handshake.

For IN tokens, if data is available in the transmit FIFO buffer, the MAC performs the following steps:
  1. Reads the data from the FIFO buffer
  2. Forms the data packet
  3. Transmits the packet to the host
  4. Waits for a handshake packet, if any, from the host
  5. Updates the transaction status to the PFC

If an IN token is received and the data is not available in the FIFO, the MAC sends the host a NAK handshake.

In host mode, the MAC receives a token request from the AIU. The MAC performs the following steps:

  1. Builds the token packet
  2. Sends the packet to the device

For OUT or SETUP transactions, the MAC also performs the following steps:

  1. Reads the data from the transmit FIFO buffer
  2. Assembles the data packet
  3. Sends the packet to the device
  4. Waits for a handshake packet, if any, from the device. Then, updates the transaction status to the AIU.

The response from the device causes the MAC to send a status update to the AIU.

For IN or PING transactions, the MAC waits for the data or handshake response from the device. For data responses, the MAC performs the following steps:

  1. Waits for data or handshake packet from the device
  2. Validates the data according to the correct PID
  3. Writes the data into the receiver FIFO
  4. Checks the data's integrity
  5. Sends a handshake packet, if required
  6. Updates the status to the application unit control