- USB controllers
- The primary controller is a Synopsys DesignWare Core SuperSpeed USB 3.x controller (Gen1/Gen2).
- Two instances of Qualcomm multipurpose PHY (QMP) for USB SuperSpeed and DisplayPort.
- Synopsys PHY for high-speed USB.
- The secondary controller is a Synopsys DesignWare Core high-speed USB 2.0 controller.
- Synopsys PHY for high-speed USB
- The tertiary controller is a Synopsys DesignWare Core high-speed USB 2.0 controller.
- Synopsys PHY for high-speed USB.
- Dragonwing IQ-9075 has three USB controllers (primary USB 3.2, secondary USB 3.2, tertiary USB 2.0)
- The primary controller is a Synopsys DesignWare Core SuperSpeed USB 3.x controller (Gen1/Gen2).
- Synopsys DesignWare core SuperSpeed USB 3.x controller features
- Synopsys DesignWare Core SuperSpeed USB 3.x controller is a USB SuperSpeed-compliant controller, which can be configured in one of the following ways:
- Peripheral-only configuration
- Host-only configuration
- Dual-role configuration
- Supports all transfer types (control, bulk, interrupt, and isochronous)
- Supports SuperSpeed bulk streams
- Compliant with the eXtensible host controller interface (xHCI) specification
- Host mode supports SuperSpeed (5 Gbps), high-speed (480 Mbps), full-speed (12 Mbps), and low-speed (1.5 Mbps) operations.
- Device mode supports SuperSpeed (5 Gbps), high-speed (480 Mbps), and full-speed (12 Mbps) operations, and up to 16 bidirectional endpoints (including the control pipe
ep0). - Link power management
- Synopsys DesignWare Core SuperSpeed USB 3.x controller is a USB SuperSpeed-compliant controller, which can be configured in one of the following ways:
- USB PHY access method
- Register-level interface through AHB2PHY for performing PHY-related operations.
- USB Type-C
- Supports USB Type-C and power delivery using the PM7325B PD controller.
- Fully compliant with the USB Type-C 3.0 power delivery specifications.
- Supports the PM7325B software driver updates according to the UCSI framework after the delivery controller determines the Type‑C orientation, role, and mode of the connected link partner.
- Used only for the primary USB controller.
Clocks
The following tables list the clocks and operating frequencies required for the USB controller, and the high speed and SuperSpeed PHYs to function. Table : USB controller clocks| Clock name | Operating frequency | Description |
|---|---|---|
gcc_usb30_prim_master_clk “core_clk” |
| Asynchronous to the bus clock; clock rates defined within the device tree node |
gcc_cfg_noc_usb3_prim_axi_clk “iface_clk” |
| Auxiliary bus controller unit clock. |
gcc_aggre_usb3_prim_axi_clk “bus_aggr_clk” |
| Clock that feeds into the aggregator2 module, which controls data flow from the USB AXI to the NoC |
gcc_usb30_prim_mock_utmi_clk “utmi_clk” | 19.2 MHz | The internal controller ref_clk used for generating the ITP counter when the USB transceiver macrocell interface (UTMI)/UTMI+ Low Pin interface (ULPI) is suspended |
gcc_usb30_prim_sleep_clk “sleep_clk” | 32 kHz | Sleep clock |
gcc_usb3_sec_clkref_clk_en “xo” | 19.2 MHz | External reference clock source to the HS-PHY (PMIC) |
rpmh_cxo_clk “ref_clk_src” | 19.2 MHz | Reference clock source to the HS-PHY |
gcc_usb_phy_cfg_ahb2phy_clk “cfg_ahb_clk” | 100 MHz | Clock required for the AHB2PHY block (frequency based off PNoC frequency). |
| Clock name | Operating Frequency | Description |
|---|---|---|
rpmh_cxo_clk “ref_clk_src” | 19.2 MHz | Reference clock source to the HS-PHY |
gcc_usb_phy_cfg_ahb2phy_clk “cfg_ahb_clk” | 100 MHz | Clock required for the AHB2PHY block (frequency based off PNoC frequency) |
| Clock name | Operating Frequency | Description |
|---|---|---|
gcc_usb3_prim_phy_aux_clk "aux_clk” | 19.2 MHz | PHY interface to PCI express (PIPE) auxiliary clock for power states |
gcc_usb3_prim_phy_pipe_clk “pipe_clk” | 125 MHz | Input source for the PIPE, which allows for data transfers between PHY and controller |
rpmh_cxo_clk "ref_clk_src" | 19.2 MHz | Parent clock for ref_clk |
gcc_usb3_prim_clkref_clk "ref_clk" | 19.2 MHz | Reference clock source to the SS-PHY |
gcc_usb3_prim_phy_com_aux_clk "com_aux_clk" | 19.2 MHz | – |
Voltage rails
The following table lists the required voltage rails for the HighSpeed and SuperSpeed PHYs. Table : USB voltage rails| Voltage rails | Voltage levels (MAX/NOM/MIN) | Device mode | Description | ||
|---|---|---|---|---|---|
| VREG L1C | 1.8 | 1.7 | 0 | Primary and secondary HS-PHY | 1.8 V regulator used by both HS-PHYs in the system |
| VREG L2B | 3.3 | 3.05 | 0 | Primary and secondary HS-PHY | 3.3 V regulator used by both HS-PHYs in the system |
| VREG L1B | 0.912 | 0.912 | 0 | SS-PHY | SS-PHY VDD core |
| VREG L10C | 0.880 | 0.880 | 0 | Primary and secondary HS‑PHY, and SS‑PHY | HS-PHY/SS‑PHY VDD core |
- HS PHY: L7A (0.88 V), L6C (1.8 V), L9A (3.3 V)
- SS PHY: L1C, L7A
Interrupts
The following table lists the various interrupts used by the USB controller to notify events. Table : USB controller interrupts| Interrupt name | QCS6490 /QCS5430 interrupts | Dragonwing IQ-9075 interrupts | Dragonwing IQ-8275 interrupts | Dragonwing IQ-615 interrupts | Interrupt events PDC wake-up kernel handling | Description | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
dp_hs_phy_irq | 14 | PDC14 | PDC8 | PDC10 | PDC14 | PDC10 | 9 | 10 | D+ changes | – | Only used when the system is in VDD min/XO shutdown |
dm_hs_phy_irq | 15 | PDC15 | PDC7 | PDC9 | PDC15 | PDC9 | 8 | 11 | D-changes | – | Only used when the system is in VDD min/XO shutdown |
ss_phy_irq | 17 | PDC12 | PDC13 | – | PDC12 | – | 6 | – | LFPS detection | – | Only used when the system is in VDD min/XO shutdown |
pwr_event_irq | 130 | 287 | 352 | 444 | 131 | 444 | 130 | 663 | – | USB PHY power state changes Exit/enter P3/L2 | Used as the main controller wake-up handle when the system isn’t in power collapse |
core irq | 133 | 292 | 349 | 442 | 292 | 442 | 133 | 664 | – |
| Main USB interrupt that handles all USB controller events |
Interconnect
The following table lists the various interconnects used by the USB controller. Table : USB interconnects| Interconnect name | Controller | Target | Interconnect path bandwidths in MBps |
|---|---|---|---|
| USB-DDR |
| SLAVE_EBI1 |
|
| APPS-USB | MASTER_APPSS_PROC |
|
|
USB controller reset using clock control
The following table lists the reset methods used for the USB controller and PHY. Table : USB clock reset methods| Clock name | Reset control | Description |
|---|---|---|
GCC_USB3_DP_PHY_PRIM_BCR "global_phy_reset" | SS-PHY | Resets the SS-PHY control and status registers |
GCC_USB3_PHY_PRIM_BCR "phy_reset" | SS-PHY | Resets the SS-PHY |
GCC_QUSB2PHY_PRIM_BCR "phy_reset" | HS-PHY | Resets the HS-PHY |
GCC_USB30_PRIM_BCR "core_reset" | USB controller | Clock controller output to reset the USB controller |
USB controller software reset using register
The following table lists the register options to reset the USB controller. Table : USB controller resets| USB controller register | USB register bit field | Reset control | Description |
|---|---|---|---|
| DWC3_DCTL | CSFTRST [Bit 30] | USB controller | Resets the USB controller device stack. |
| DWC3_GCTL | CORESOFTRESET [Bit 11] | - | Global reset for the DWC3 controller |
- HS: GCC_USB2_PHY_PRIM_BCR
- SS: GCC_USB3_PHY_PRIM_BCR/ GCC_USB3PHY_PHY_PRIM_BCR
- GCC_USB3_PHY_TERT_BCR
- USB30_PRIM_GDSC
- USB30_SEC_GDSC
- USB20_PRIM_GDSC
- GCC_USB20_SEC_BCR
- GCC_QUSB2PHY_SEC_BCR
- GCC_USB2_PHY_SEC_BCR
USB controller and SoC integration
The intellectual property and PHYs of the USB controller are integrated into the SoC as shown in the following figure. Figure : USB controller PHYs and SoC integrationUSB 3.xcontrollerSoCType-C connectorAHB 2PHYDisplay port controllerSS0_1DPPHY (QMP)SS0_0DPPHY (QMP)EUDHS0PHY(SNPS)PipeUTMISSHS The Synopsys DesignWare Core SuperSpeed USB 3.0 intellectual property controls only the core functionality and not the device specifications, such as clocks, interconnects, regulators, and GDSCs. The Synopsys DesignWare Core intellectual property is embedded inside aQscratch wrapper (intellectual property and software driver), which takes up the responsibility of managing the required resources (clocks, interconnects, interrupts, GDSC, and regulators) during the probe, suspends, or resume state. Both these drivers coexist to ensure the USB functionality.
For information about the USB Qscratch wrapper driver, see https://github.com/torvalds/linux/blob/master/drivers/usb/dwc3/dwc3-qcom.c. For information about the controller core driver, see https://github.com/torvalds/linux/blob/master/drivers/usb/dwc3/core.c.
xHCI support
The xHCI specification describes the register-level host controller interface for USB 2.0 and later. The USB controller is compliant with xHCI specifications, and in host mode it supports SuperSpeed (5 Gbps), high-speed (480 Mbps), full-speed (12 Mbps), and low-speed (1.5 Mbps) operations. Linux standard xHCI drivers are used to operate the USB controller in host mode.USB Type-C connector system software interface (UCSI)
NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support USB Type-C feature.- The USB Type-C connector system software interface is available in the Linux kernel as a library. It defines a set of registers and data structures, which are used to interface with the USB Type-C connectors on a system. The USB Type-C connectors on the platform are referred to as the platform policy manager (PPM) and the system software component is referred to as the OS policy manager (OPM).
- Qualcomm reference design uses the UCSI
Glinkdriver to handle the communication between the OPM on the application processor and the PPM, which is the charger firmware running on the remote subsystem (aDSP) using PMIC GLINK. - The USB Type-C DisplayPort alternate mode adds the capabilities of supporting additional cable details, such as DPAM version and signaling of cable. The Qualcomm reference design supports DisplayPort using Type-C and concurrent support of USB SuperSpeed and DisplayPort with a maximum of two lanes for DisplayPort (two lanes for USB SuperSpeed and two lanes for DisplayPort).
- The USB Type-C power delivery is supported by the PM7325B PD controller, fully compliant with the USB PD 3.0 specification. Using the UCSI interface, USB data-role swap and power-role swap are supported. NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support data and power role swapping through Type-C connectors.
- Following are the references of the drivers involved:
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/typec/ucsi/ucsi.c?h=v6.6.2
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/typec/ucsi/ucsi_glink.c?h=v6.6.2
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/typec/ucsi/displayport.c?h=v6.6.2
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/phy/qualcomm/phy-qcom-qmp-combo.c?h=v6.6.2
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/dwc3/dwc3-qcom.c?h=v6.6.2
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/soc/qcom/pmic_glink.c?h=v6.6.2
- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/soc/qcom/pmic_glink_altmode.c?h=v6.6.2
USB features
Qualcomm chip hardware SoCs allow working in the dual-role device (DRD) mode. DRD enables both device and host roles. The device dynamically detects the role to move to and programs the controller accordingly. The autosuspend capability is supported to shut down the USB controller when the cable is removed. Function interfaces, such as video, audio, tethering, file transfer, media transfer, and charging are supported. Table : USB features: Linux| Feature | Description |
|---|---|
| USB_DWC3 controller | Synopsys DesignWare Core is supported by default in the Linux kernel. |
| USB_DWC3_QCOM | Qscratch wrapper using the Synopsys DesignWare Core for the USB functionality. |
| Runtime power management (RPM) | Linux supports RPM with the software driver file dwc3-qcom, for low-power mode operations. |
| Low-power mode (LPM) | LPM provides power-saving options from both HS/SS-PHY as well as the controller. |
| DRD | Dual-role device detection allows USB to work in both host and device mode. |
Runtime power management
The Runtime power management feature can be enabled according to the your requirements. LPM support is added as part of https://lore.kernel.org/all/20231017131851.8299-1-quic_kriskura@quicinc.com/. NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support runtime power management for USB Type-A ports. By default, USB-suspend and resume in runtime are disabled. To enable these features, run the following command:sysfs command:
xhci-hcd.X.auto value, where X = 0, 1, 2. It indicates the number of devices connected to the USB. The connected devices are listed at /sys/bus/platform/devices/xhci-hcd.X.auto/usb1/<node number>. The<node number> value depends on the number of devices connected to the USB port.
To enable the remote wake up for an LS optical mouse, run the following commands:
Software features
The following USB features are supported in software. Table : USB software features| Feature | Description |
|---|---|
| Peripheral ADB | ADB functionality is integrated over functionFS (FFS) |
| Peripheral mass storage | Generic Mass_storage functionality |
| Peripheral diag | Diag functionality is integrated over FFS |
| Peripheral RNDIS | Standard RNDIS protocol according to Linux kernel |
| Peripheral network control modem (NCM) | Standard NCM protocol according to Linux kernel |
| Host USB 3.0 driver (xHCI) | Both USB controllers support the xHCI architecture |
| Host high-speed USB | High-speed USB detection in host mode |
| Host HID/MS/hub driver | Class driver detection in host mode |
| Host video driver | UVC verified on limited webcam models |
| Host link power management | USB host mode LPM implementation |
| Peripheral USB link power management | USB device mode LPM implementation |
| DRD | Dual-role device support is possible (host/device mode support) |
| USB Type-C | Supported by PM7325B; supports current charging, CC logic, and SuperSpeed USB switch selection, all performed in the embedded controller |
| USB Type-C display port | Supports SuperSpeed USB + DisplayPort operating concurrently (2 DisplayPort lanes) |
| USB PD 2.0/3.0 charging | PD support depends on the PM7325B solution used. Fully compliant with PD 3.0 |
| USB 3.1 Gen1 | The USB controller supports USB 3.x Gen1 (5 Gbps). |
USB architecture
The Qualcomm USB software architecture is loosely made up of two components, one is based on pure upstream, and the other is a sandbox where some of the pending feature-related changes are present. The pure upstream is directly picked from the latest stable kernel long-term support (LTS) 6.6.2. The architecture uses a Yocto (release 4.0) recipe for creating the binaries. Figure : USB software architecture/dev/ffs-xxx//dev/ffs-xxx//dev/ffs-xxx//sys/kernel/config/usb_gadget/…/sys/bus/usb/…Function driverFunction driverGadget frameworkconfigfs, UDC coreDevice controller driverClassdriverClassdriverUSB coreHost controller driverdwc3-qcomDWC3 core driversFemto phy driverQMP phy driverUCSIPMIC GLINKPM7325BaDSP corecharger firmwareVBUS, CC, D+,D-HSSS/sys/class/typec/port0/…Dual-role class driverType-C role swapdiag-routerport-bridgeadbd.serviceUSB peripheral mode configurationRuntime power management controlUser-space servicesVFSKernel-spaceType-C connector The sandbox is implemented with the following Qualcomm-specific features.- USB_DWC3_QCOM: The primary glue driver is responsible for the USB functionality on both host and device modes, depending on what’s connected. The device tree entry for the glue driver consists of resources, such as clocks, power rails, and interrupts. This feature uses the DWC3 core driver as a library, which controls the actual functionality of the DWC3 controller. For more details, see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/dwc3/dwc3-qcom.c?h=v6.6.2.
- Synopsys femto PHY: Qualcomm Synopsys femto PHY is the high-speed USB PHY responsible for controlling D+/D- lines, and facilitates data transfers along with charger detection. For more details, see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c?h=v6.6.2.
- QMP DisplayPort combo PHY: Qualcomm multipurpose PHY (QMP) display port combo PHY is designed for generic usage. A sample use case for USB would be the SuperSpeed and SuperSpeed-plus functionality as part of which the Rx+/Rx- and Tx+/Tx- can be used for data transfer. The PHY supports the display alternate mode when the display can claim a pair of lanes for the mirroring functionality while USB works in SuperSpeed. For more details, see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/phy/qualcomm/phy-qcom-qmp-combo.c?h=v6.6.2.
USB interfaces
USB supports multiple interfaces to transfer audio, video, debug information, and tethering. Each of the following USB interface communication protocol is different and has its own protocols in addition to the standard USB protocol.- Android debug bridge (ADB)
- The USB ADB is a debug interface, providing access to the system through the USB connection. For more information about ADB, see https://developer.android.com/tools/adb.
- The filenames are the virtual
epsnames of thedevnode. For more information aboutf_fs.c, see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/gadget/function/f_fs.c?h=v6.6.2. - User space service: The user space daemon
adbd.serviceoperates ADB and is responsible for establishing the connection between the underlying kernel driver and the host PC.
- Diagnostics (diag)
- Diag is a diagnostics framework used for collecting log data from various subsystems, and debugging. The diag data is transmitted through USB to the host PC.
- Kernel driver: Diag uses
f_fs.cto expose the/dev/ffs-diagnode, which is operated by a user space service for various operations. Thedevnode has the following three files:ep0: control operationsep1: read operationsep2: write operations These filenames are the virtualepsnames of thedevnode. For more information aboutf_fs.c, see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/gadget/function/f_fs.c?h=v6.6.2.
- Mass storage
- A generic interface driver with mass storage driver is available for the device to act as a generic storage device.
- Kernel driver: The
mass_storagefunctionality is regulated by thef_mass_storage.cdriver. This driver exposesdev node[revisit], which is controlled by the host PC. For more information about mass storage, see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/gadget/function/f_mass_storage.c?h=v6.6.2.
- Remote network driver interface specification (RNDIS)
- RNDIS is a specification developed by Microsoft for network devices on dynamic plug and play I/O buses such as USB.
- Kernel driver: It uses a
f_rndisdriver, which is present in the upstream Linux kernel and directly communicates with the network interfaces or stack.
- Network control model (NCM)
- NCM is a protocol designed to offer advanced features and capabilities compared to RNDIS.
- It’s commonly found in applications where USB devices must handle demanding networking tasks.
- USB audio class 2 (UAC2)
- UAC2 is a standard governing the communication between USB audio devices and computers.
- UAC2 supports higher audio data transfer rates, resulting in improved audio quality and reduced latency.
- USB video class (UVC)
- UVC is a standard that defines how video streaming devices, such as webcams, should communicate with computers using USB.
- UVC facilitates the plug-and-play functionality for video devices.
USB tools
A few commonly used USB tools are listed in the following table. Table : USB tool and download details| USB tools | Download link |
|---|---|
| Platform tools (adb/fastboot) | https://developer.android.com/tools/releases/platform-tools |
| USB video class (UVC) | LibUVC |
| UVC gadget | https://github.com/wlhe/uvc-gadget |
| UVC streamer | https://github.com/bsapundzhiev/uvc-streamer |
| UVC Video4Linux | v4l2-utils: https://linuxtv.org/downloads/v4l-dvb-apis/driver-api/v4l2-core.html |
Configure USB boot loader
The device tree parameters for tuning the high-speed and SuperSpeed USB signal quality in the boot loader can be modified using the Qualcomm DeviceTree editor (QDTE) tool. QDTE tool is used to configure the device tree binary blob by editing the xbl_config.elf file, as shown in the following figure. For more information about how to configure the device tree blobs, see the QDTE section. The device tree file path at the Linux host machine is /boot_images/boot/Settings/Soc/<Chipset>/Core/WiredConnectivity/USB/usb.dtsi. Figure : Device tree layout The following table lists the properties for tuning the HS-USB PHY and SS USB PHY signal quality. Table : USB configuration properties| Property name | Property description | Data type | Possible values and value range | Device behavior |
|---|---|---|---|---|
path=/soc/usb0/hs_phy_cfg | Tunes the USB signal quality for the primary USB controller HS-PHY. | UINT32-array |
| Improved USB signal quality for the primary USB HS-PHY. |
path=/soc/usb0/ss_phy_cfg | Improves signal quality for primary USB controller SS-PHY. | UINT32-array |
| Improved signal quality for the primary USB SS-PHY. |
path=/soc/usb1/hs_phy_cfg | Improves the USB signal quality for the secondary USB controller HS-PHY. | UINT32-array |
| Improved signal quality for secondary USB HS-PHY. |
Path = /sw/usb_config/fastboot_core_num | Select the USB core number for Fastboot (primary=0/secondary=1) | UINT32 | 0 or 1 | The Fastboot device is enumerated at either USB core0 or core1 according to the selected property. |
Configure USB camera
The Qualcomm Linux devices provide driver support for USB web cameras that adhere to the USB video class (UVC) standard. Theuvcvideo driver of the Linux kernel supports cameras. For more information about the uvcvideo driver, see https://www.kernel.org/doc/html/v4.19/media/v4l-drivers/uvcvideo.html.
The uvcvideo driver exposes these cameras as V4L2 video devices, which can be accessed through the character device nodes such as /dev/videoX.
In the user space, applications can manage USB cameras using the v4l2src GStreamer plug-in, which comes bundled with the Qualcomm Intelligent Multimedia SDK (IM SDK). Alternatively, programs such as Yavta (yet another V4L2 test application) directly interact with the V4L2 (Video4Linux2) interface to test and control camera devices.
The current release doesn’t include the Yavta program by default. To obtain and cross-compile Yavta on the host device, do the following:
- The cross-compilation environment can be established using any of the following methods.
- Method 1: To set up the cross-compilation environment, run the following command.
- Method 2: To set up the cross-compilation environment, run the following commands:
- Download the cross-compiler.
- Extract the cross-compiler.
- Set up the environment for cross-compilation by running the following command.
- Download the cross-compiler.
- Method 1: To set up the cross-compilation environment, run the following command.
- Clone the Yavta repository and change the directory.
- Cross-compile the tool.
- To push Yavta to the Qualcomm Linux hardware SoCs, do the following:
- Open the SSH shell in permissive mode or use the ADB shell. For more information about how to run SSH, see the Use SSH section.
- Mount the file system.
- Transfer files using SCP or similar tools.
For example,
scp yavta root@10.92.162.185:/usr/bin - Assign permission to execute in Yavta.
Prerequisite: Obtain image format and size
To configure the USB camera either through Yavta or GStreamer, the following steps are mandatory.- To know the enumeration details, plug in the USB camera and run the following command.
The following output is displayed.
- Identify the USB camera video node created as /dev/videoX from the serial console.
NoteThe
1-1/1-1:1.0value varies according to the USB device connected. The following output is displayed. - To view the supported output formats and sizes using Yavta, run the following command:
where
Xvalue is based on the node. For example:The following output is displayed. - Select the required image format and size from step 3.
Configure USB camera using Yavta
Prerequisite: Ensure that Yavta is cross-compiled, and the output format, size are identified.- To select MJPEG format of 1280x720 output size and 30 fps, capture 10 frames under /tmp/ with filename testmjpeg-00000*.bin, run the following command.
The following output is displayed.
- To select YUV format of 1280x960 output size, 30 fps, capture 10 frames under /tmp/, the generated filename is testyuv-00000*.bin, run the following command.
NoteEnable the Permissive mode using command
#setenforce 0. The following output is displayed.
Configure USB camera using GStreamer in Qualcomm IM SDK
Qualcomm IM SDK uses GStreamer, an open-source multimedia framework to expose easy APIs and plugins in both the multimedia and machine learning domains. For information about installing the Qualcomm IM SDK, see the Getting Started section. The Qualcomm IM SDK includes thev4l2src plug-in, which allows input from USB cameras with a selected format. The waylandsink plug-in is responsible for rendering the video output on a Wayland display.
NotePrerequisites:
- Ensure that Yavta is cross-compiled, and the output format and size are identified.
- To download or update the firmware, see Download PCIe to USB controller firmware.
- To set the environment variables for the Wayland display, run the following command in the serial console.
- Use GStreamer commands to stream video from the camera to the UI. Ensure that you set the appropriate device ID (
/dev/videoX) and select the correct format based on the USB camera detection. NoteIn GStreamer, the YUYV color format is referred to as YUY2. Hence, you must specify the YUYV format while setting up a pipeline and use YUY2 in the caps filter.- For 720p, run the following command:
The following output is displayed.
- For 1080p, run the following command:
- For 720p, run the following command:
Customize USB device
This section describes the requirements for various configurations and customizations in the USB software.Example shell script for a USB composition with diag and ADB interfaces
Change USB composition through QUSB service
usb.service starts the QUSB service at /usr/bin/qusb to provide users the flexibility to configure the USB gadgets. It completely removes the hassle of manually executing commands to initialize USB from configfs.
Prerequisite: Enable SELinux by running the following command.
Enable and configure UVC use case
The USB video device class (also USB video class or UVC) is a USB device class that describes devices capable of streaming video, such as webcams, digital camcorders, transcoders, analog video converters, and still-image cameras. The latest revision of the USB video class specification is v1.5. The USB implementers forum describes both the basic protocol and the different payload formats in v1.5. NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support the UVC use case. The tools and procedures to test the UVC are as follows:- UVC gadget (device side): It’s a sample application to test the
f_uvcfunctional driver. It opens the video node created byuvc_gadgetand sends MJPEG frames at a specified frame rate. This application is cross-compiled for the DUT. NoteEnsure that the packages and tools required for cross-compiling a 64‑bit Arm® technology compiler are installed on the host machine.- The cross-compilation environment can be established using any of the following options.
- Option A: Run the following command.
- Option B: To set up the cross-compilation environment, run the following commands:
- Download the cross-compiler.
- Extract the cross-compiler.
- Set up the environment for cross-compilation by running the following command.
- Download the cross-compiler.
- Option A: Run the following command.
- To build the UVC gadget tool, do the following.
- Clone the
uvc-gadgetrepository. - Modify
Makefilefor a static build. - Cross-compile for
arm64to generate theuvc‑gadgetexecutable.
- Clone the
- The cross-compilation environment can be established using any of the following options.
- UVC viewer (host side): To receive the UVC data, open any USB webcam application on the computer.
- To validate, push the UVC gadget application and sample image files to the device, do the following:
- Open the SSH shell in permissive mode or use the ADB shell. For more information about how to run SSH, see the Use SSH section.
- Mount the file system.
- Transfer files using SCP or similar tools.
For example,
scp uvc-gadget root@10.92.175.138:/usr/bin - Assign permission to execute.
- Change to any UVC composition (90DF or 90CB). For example,
- To validate, push the UVC gadget application and sample image files to the device, do the following:
uvc_gadget application through a console (serial console or SSH shell or use the ADB shell).
- YUYV
- Push the
image-720.yuvimage file to/rootor/etc. - Verify the
image-720.yuvimage with theuvc-gadgettool.- Where
Xindicates the new video node created after the composition switch - Where
-fis format with the following values:0= V4L2_PIX_FMT_YUYV1= V4L2_PIX_FMT_MJPEG
- Where
- Push the
- MJPEG
- Push the
image-720.jpgimage file to/rootor/etc. - Verify the
image-720.jpgimage with theuvc-gadgettool.- Where
Xindicates the new video node created after the composition switch - Where
-fis <format> with the following values:0= V4L2_PIX_FMT_YUYV1= V4L2_PIX_FMT_MJPEG
- Where
- Push the
- For information about usage, run the following command.
The following output is displayed.
UAC use cases
USB audio uses isochronous, interrupt, and control transfers. All audio data is transferred using isochronous transfers. The interrupt transfers are used to relay information regarding the availability of audio clocks and control transfers are used to set volume, request sample rates. NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support the UAC use case. To verify, select a USB composition with a UAC function.tinyutils applications such as tinyplay/tinycap available in the rootfs. The application opens the PCM nodes created in /dev/snd/ when the UAC driver binds are successful.
The following are a few sample commands.
- List the sound card on the Linux host machine.
- Play back the audio file.
- To play the audio from device to host, push the
file.wavfile with the matching audio configuration. The following is an example of a sample configuration.Output:Output:Output:Output:Output:Output:NoteTo modify the audio configuration, adjust the preceding parameters before establishing the USB composition to 90CA. - Run the following command on the SSH shell or use the ADB shell.
The following output is displayed.
- Run the following command on a Linux host machine with an application such as
arecordto capture the audio.
- To play the audio from device to host, push the
- Record an audio file.
- Run the following command on a Linux host machine with an application such as
aplayto play the audio. - Run the following command on the SSH shell of the device or use the ADB shell.
The following output is displayed.
- Run the following command on a Linux host machine with an application such as
Data role swapping in USB power delivery
Data role swap (DR_SWAP) is the exchange of DFP (host) and UFP (device) roles between port partners using a USB Type-C connector. Power role swap (PR_SWAP) exchanges the source and sink roles between the port partners. NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support data and power role swapping using Type-C connectors.- Data role
- To swap data roles from host to device, run the following commands:
The following output is displayed.The following output is displayed.
- To swap data roles from device to host, run the following commands:
The following output is displayed.The following output is displayed.
- To swap data roles from host to device, run the following commands:
- Power role
- To swap power roles from sink to source, run the following commands:
The following output is displayed.The following output is displayed.
- To swap power role from source to sink, run the following commands:
The following output is displayed.The following output is displayed.
- To swap power roles from sink to source, run the following commands:
Customize with configfs
Theconfigfs file system provides the converse of the sysfs functionality. A number of interfaces can configure Linux USB gadgets, with each interface representing a USB function.
The qusb executable configures the configfs USB gadget using the following commands.
- Create
configfsand mountfunctionfs. - Start
adbd/diagservices. - Bind
configfswith the USB gadget application. - Stop or unbind the USB gadget application.
- Set diag and ADB composition.
- List the available USB compositions.
The USB compositions are as follows.
A4A1 NCM4EE7 ADB900E DIAG901C DIAG + UAC2901D DIAG + ADB9015 MASS_STORAGE + ADB9024 RNDIS + ADB902A RNDIS + MASS_STORAGE902B RNDIS + ADB + MASS_STORAGE902C RNDIS + DIAG902D RNDIS + DIAG + ADB902F RNDIS + DIAG + MASS_STORAGE9060 DIAG + QDSS + ADB908C NCM + ADB90CA DIAG + UAC2 + ADB90CB DIAG + UVC + ADB90CC DIAG + UAC2 + UVC + ADB90DF DIAG + UVC90E0 DIAG + UAC2 + UVCF000 MASS_STORAGEF00E RNDIS
Verify USB device
The following table lists the various methods to verify the USB device and host modes. Table : USB device and host mode verification| USB mode | Feature | Description |
|---|---|---|
| USB device mode | ADB | By default, USB is enumerated in the ADB-only composition. |
| Diag | See Example shell script for a USB composition with diag and ADB interfaces and Change USB composition through QUSB service. | |
| Mass storage | Change the USB composition (see Change USB composition through QUSB service) and select the mass_storage composition. | |
| Composition switch | See Example shell script for a USB composition with diag and ADB interfaces and Change USB composition through QUSB service. | |
| USB LPM with cable connects and disconnects | Disconnect USB manually so that the dwc3-qcom module changes to low-power mode. | |
| Network control modem (NCM) | Change the USB composition (Change USB composition through QUSB service) and select the NCM composition. | |
| USB host mode | Host human interface device (HID) class | Switch to host mode by connecting the HID class device directly to the device under test. |
| Host mass storage (MS) class | Switch to host mode by connecting the MS class device directly to the device under test. | |
| Host hub class | Switch to host mode by connecting the hub class device directly to the device under test. | |
| Host power management | Peripherals support the host-mode suspend (headsets) state when the dwc3-qcom module changes to low-power mode in host mode. | |
| USB LPM with peripheral connect and disconnect | Peripherals support the host mode suspend (headsets) when the dwc3-qcom module changes to low-power mode in host mode. | |
| USB L1 LPM with high speed | High-speed peripherals support host mode suspend (headsets) when the dwc3-qcom module changes to low-power mode in host mode. | |
| USB camera | See Configure USB camera. |
Debug USB issues
This section provides information on the various methods to obtain debugging logs. The debugging methods includeregdumps, debug ftraces, configfs nodes. The logs provide visibility into the event and controller state details when debugging issues with low-power mode entry-exit, SMMU faults, unclocked accesses.
NoteDragonwing IQ-9075 and Dragonwing IQ-8275 don’t support USB Type-C feature.
Trace USB
Thedebugfs tracing provides a deeper view into each transaction over the USB line. To view the list of traces, run the following command.
debugfs is mounted. If not mounted, run the following command to mount debugfs.
USB regdump
The USBdebugfs provides the following information.
NoteThe a600000.usb address varies depending the chipset.
- Mode of operation.
Sample output:
- State and transfer ring buffer (TRB) queues to all endpoints in device mode.
- Current link state.
Sample output.
- List processor (LSP) dump.
Sample output:
regdump command provides the current state of the register space for the following registers:
- Device mode registers, such as DCTL, DSTS, and DCFG
- Global registers, such as GCTL and GSTS

