This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5716: USB FS mode configuration

Part Number: AM5716

Hi.

my customer has been checking USB program in SDK of AM5716. It seems the code in SDK is high speed mode. They would like to change to full speed mode.

Could you please tell us how to set the registers for full speed mode? And could you please tell us which status registers for high or full speed flag we should see?

Best Regards,

M.Ohhashi

  

  • Hi,

    Is this Linux or RTOS?

  • Hi,

    They are trying it on both Linux and RTOS. So They would like to know it on Linux and RTOS.

    Best Regards,

    M.Ohhashi

  • Hi,

    In RTOS, the USB speed is set by Device Configuration Register: DCFG, bit field 2-0:

    Device Speed (DevSpd)
    Indicates the speed at which the application requires the core to connect, or the maximum speed the application can support. However, the actual bus speed is determined only after the chirp sequence is completed, and is based on the speed of the USB host to which the core is connected.
    ¡3fb100: SuperSpeed (USB 3.0 PHY clock is 125 MHz or 250 MHz)
    ¡3fb000: High-speed (USB 2.0 PHY clock is 30 MHz or 60 MHz)
    ¡3fb001: Full-speed (USB 2.0 PHY clock is 30 MHz or 60 MHz)

    Code snippet:

    #define DWC_USB_DCFG (0xC700u)
    #define DWC_USB_DCTL (0xC704u)
    #define DWC_USB_DEVTEN (0xC708u)
    #define DWC_USB_DSTS (0xC70Cu)

    /* Connect as high speed device */
    HW_WR_FIELD32(dwc3->baseAddr + DWC_USB_DCFG, DWC_USB_DCFG_DEVSPD,
    DWC_USB_DCFG_DEVSPD_HS);

    For the actual speed you got, this is read from device Status Register (DSTS), bit field 2:0

    Connected Speed (ConnectSpd)
    Indicates the speed at which the DWC_usb3 core has come up after speed detection through a chirp sequence.
    ¡3fb100: SuperSpeed (PHY clock is running at 125 or 250 MHz)
    ¡3fb000: High-speed (PHY clock is running at 30 or 60 MHz)
    ¡3fb001: Full-speed (PHY clock is running at 30 or 60 MHz)
    ¡3fb010: Low-speed (PHY clock is running at 6 MHz)
    ¡3fb011: Full-speed (PHY clock is running at 48 MHz)
    ¡Low-speed is not supported for devices using a UTMI+ PHY.

    RTOS code doesn't query USB speed.

    The Linux should use the same registers. But I defer to Linux team to comment.

    Regards, Eric 

  • Hi,

    Is the AM5716 USB in host mode or peripheral mode?

  • Eric-san,

    Thank you for your reply.

    Bin-san,

    They would like to check it in both host mode and peripheral mode.

    Best Regards,

    M.Ohhashi

  • Hi,

    In Linux it is impossible to limit the USB enumeration to full-speed mode in software when AM57xx USB is in host mode, unless you use a full-speed USB hub. But you can do so if AM57xx USB is in peripheral mode, please search for 'maximum-speed' in arch/arm/boot/dts/dra7.dtsi, you can override it in your board dts file.

  • Hi,

    Thank you for your reply.

    I will check it.

    Best Regards,

    M.Ohhashi