AXI USB gadget driver


Table of Contents

Introduction

The AXI USB device IP is an USB device controller IP. It has no support for HOST or OTG mode. This IP can be instantiated on FPGA or Zynq /Ultrascale plus PL. This page describes the usage of the AXI USB device IP linux driver.

HW/IP Features

  • Compliant with the USB 2.0 Specification
  • Supports High Speed, Full Speed and Low speed

Features supported by driver

  • All the HW/IP features are supported by the driver

Missing Features and Known Issues/Limitations in Driver

  • The driver is supported/validated for mass storage gadget only on Zynq and ZU+.


Kernel Configuration

  1. Enable the AXI USB linux driver in kernel configuration
    Device Drivers -> USB Support -> USB Gadget Support -> USB Peripheral Controller -> Xilinx USB driver
  2. Enable Mass storage gadget
    Device Drivers -> USB Support -> USB Gadget Support -> Mass Storage Gadget
    Device Drivers -> USB Support -> USB Gadget Support -> USB Gadget Drivers -> USB functions configurable through configfs

Devicetree

Example Device tree node:
       axi-usb2-device@42e00000 {
            compatible = "xlnx,usb2-device-4.00.a";
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 0x39 0x1>;
            xlnx,include-dma;
            reg = <0x42e00000 0x1000>;
       }

Performance

Host used: Dell Precision Tower 7910
ReadWrite
15.0 MB/sec22.9 MB/sec

Test Procedure


Images:

  1. compile the kernel and modules. Copy kernel Image and compiled modules to SD card.
  2. Copy following to SD card: BOOT.bin which has PL bitstream with AXI USB device IP, FSBL and U-Boot. dtb, uramdisk.img (All are provided in the attachment).
  3. Boot ZC702 with SD card.
  4. Follow these steps on the board after linux boots :

    dd if=/dev/zero of=/tmp/mydev count=5 bs=1M
    insmod xilinx_udc.ko
    insmod configfs.ko //NOTE: configfs.ko is generated under fs/configfs/ in linux source
    insmod libcomposite.ko
    insmod usb_f_mass_storage.ko
    insmod g_mass_storage.ko file=/tmp/mydev removable=1

  1. Connect the usb cable to host PC(windows/linux). Host shows the gadget as a mass storage device with 5MB capacity.

Mainline Status

The current driver available in the Xilinx Linux git is in sync with the open-source 6.1 kernel driver except for the following:

Change Log

2023.2

  • None

2023.1

  • Kernel upgrade to 6.1
  • Fixed udc compilation error with upgrade kernel 

2022.2

  • Fixed udc complication error

2022.1

  • Kernel upgrade to 5.15

2021.2

  • None

2021.1

  • Kernel upgrade to 5.10

2020.2

  • None

2020.1

  • None


Related Links

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy