Skip to main content
Before you begin, set up your infrastructure as described in the Qualcomm Linux Build Guide. Interface workflow

Figure : Interface workflow

Identify the interface status

The default interface status indicates the status of the interfaces during bootup. To identify the interface status, successfully register the interfaces and obtain the list of enabled interfaces.

Obtain the bootup logs

To obtain the bootup logs of the device, do the following:
  1. 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.
  2. Obtain the logs of the enabled interfaces by running the following command.
    Output:
  3. Connect the UART serial port to log in to the console. USB Connector

List enabled interfaces on devices

To obtain the list of the enabled interfaces, do the following:
  • For UART, run the following command.
    Output:
  • For I2C, run the following command.
    The following output is displayed.
  • By default, SPI isn’t enabled. To enable SPI, see SPI software device tree configuration. To verify if SPI is enabled, run the following command.
    The following output is displayed.
  • For PCIe, obtain the enumeration log. For more information about PCIe probe logs, see PCIe-related configurations and QPS615 switch support.

Load QUP v3 serial engine firmware using Linux kernel

This document explains the QUP v3 serial engine firmware loading mechanism using the Linux kernel. It describes the transition from a TrustZone-based architecture—which had fixed protocol assignments and limited flexibility—to a Linux-based approach that enables dynamic protocol assignment, easier debugging, and simplified development through device tree configuration. QUP v3 contains multiple serial engines that can be configured as follows:
  • I2C
  • SPI
  • UART

Default configuration

The default configuration for each serial engine, including the selected mode of data transmission and ownership, is in the _/TZ.XF.5.0/core.tz/2.0/settings/buses/qup\_accesscontrol/qupv3/config/lemans/QUPAC\_Access.c_ file. In the default configuration, Linux owns all the serial engines.

Load firmware

The firmware files are at /lib/firmware/qcom/<target-name>/qupv3fw.elf.
  1. Enable CONFIG_QUP_FW_LOAD in the following files:
    • CONFIG_QCOM_QUP_FW_LOAD=y in arch/arm64/configs/qcom_defconfig
    • CONFIG_QCOM_QUP_FW_LOAD=m in arch/arm64/configs/qcom_vm_defconfig
  2. Identify available serial engines by checking the platform device tree for serial engine nodes. Typical SE numbering: SE0, SE1, SE2, …, SE15 (varies by platform).
    NoteYou can choose the required protocol based on your interface requirements.
    • I2C: Sensors, EEPROMs, PMICs
    • SPI: Displays, flash memory, ADCs
    • UART: Console, GPS, Bluetooth
  3. Configure device tree by adding or modifying serial engine nodes to the device tree file.
    • Sample I2C configuration:
    • Sample SPI configuration:
    • Sample UART configuration:
      Optional: Enable GSI DMA for high-throughput devices.
  4. Switch the serial engine protocol. For example, I2C to SPI.
    1. Original I2C configuration:
    2. New configuration (SPI)
    NoteReboot device for changes to take effect.
For more information about the patch series, see the following resources: Table : Device tree properties
PropertyTypeDescriptionRequired
statusstringEnable/disable SE (okay/disabled)Yes
qcom,enable-gsi-dmabooleanEnable GSI DMA modeNo
clock-frequencyu32I2C clock frequency (Hz)No
spi-max-frequencyu32SPI max frequency (Hz)No
pinctrl-namesstring arrayPin control state namesRecommended
pinctrl-0phandleDefault pin configurationRecommended
Common clock frequencies
  • I2C
    • Standard mode: 100 kHz
    • Fast mode: 400 kHz
    • Fast mode plus: 1 MHz
  • SPI
    • Low speed: 1–10 MHz
    • Medium speed: 10–50 MHz
    • High speed: 50–100 MHz

Data transfer modes

QUP v3 serial engines support two main data transfer modes: FIFO mode and GSI DMA mode. FIFO mode is the default and is best suited for small, frequent transfers with minimal configuration. Generic software interface (GSI) DMA mode leverages DMA channels for bulk data transfers with additional configuration. The table below summarizes the key features and conditions for each mode. Table : FIFO and GSI DMA mode features
AttributeFIFO modeGSI DMA mode
Data pathUses internal FIFO buffersUses GSI DMA mode
Best forSmall, frequent transfers; simple device communicationLarge or bulk transfers; high-throughput devices (touchscreen, display)
OverheadLower overheadHigher setup overhead, but offloads CPU for large transfers
ConfigurationDefault mode; no special configuration neededRequires qcom,enable-gsi-dma; property in device tree
DMA channel useNot requiredRequires available DMA channels; limited by platform
PerformanceLower throughput for large data; low latencyHigher throughput for large data; CPU efficient
When to useWhen DMA channels are limited, or for low-latency/small transfersFor transfer size > 32 bytes, or for bulk/high-speed data
LimitationsNot optimal for large or high-speed transfersLimited by number of DMA channels; not all SEs may support GSI DMA
Device tree exampleOmit qcom,enable-gsi-dma; propertyAdd qcom,enable-gsi-dma; property
DebuggingStandard Linux debugging tools; kernel logsSimilar to FIFO, but also includes DMA allocation logs
Sample GSI mode configurations
  • I2C with GSI DMA mode
  • SPI with GSI DMA mode

Use cases

  • Multiple serial engines with different protocols
  • Multiple QUP instances:
    • qupv3_0 (QUP0): SE0-SE7
    • qupv3_1 (QUP1): SE8-SE15
  • Pin Multiplexing Ensure correct pin configuration:
  • Performance optimization Table : Mode selection
    ModeWhen to use
    GSI DMA mode (qcom,enable-gsi-dma;)Transfer sizes > 32 bytes regularly, High-throughput devices (touchscreens, displays), Bulk data transfers, CPU efficiency is critical
    FIFO modeSmall, frequent transfers, Low-latency requirements, Limited DMA channels available, Simple device communication

Troubleshooting

  • Debug commands
  • Kernel logs
  • Device tree verification
The following table lists the common issues noticed during troubleshooting. Table : Common issues and solutions
IssueSymptomsSolutions
Firmware Loading Failedqcom-geni-se: firmware request failed
  1. Verify firmware files exist. ls -la /lib/firmware/qcom/
  2. Check kernel config. CONFIG_FW_LOADER=y CONFIG_FW_LOADER_USER_HELPER=y
  3. Verify firmware path in driver.
Serial engine not probing
  • No device node created
  • Driver not loading
  1. Check device tree status. status = "okay";
  2. Verify compatible string matches driver.
  3. Check kernel logs. dmesg | grep -i qup dmesg | grep -i geni
Protocol conflictqcom-geni-se: serial engine is already in useEnsure only one protocol enabled per serial engine.
DMA allocation failedqcom-geni-se: GSI DMA allocation failed
  1. Check available DMA channels.
  2. Remove qcom,enable-gsi-dma; from some serial engine.
  3. Use FIFO mode for less critical devices.
Pin Mux conflict
  • Communication failures
  • No response from devices
  1. Verify pin configuration. cat /sys/kernel/debug/pinctrl/*/pinmux-pins
  2. Check for pin conflicts with other peripherals.
  3. Ensure correct function selected in pinctrl.

Enable required interfaces

To enable an interface, do the following:

Verify interface status

To verify the functioning of the different interfaces, do the following:
  • For UART, see the Verify UART interface section.
  • For SPI, see the SPI verification section.
  • For I2C, see the Verify I2C interface section.
  • For PCIe, verify the connected endpoint with the following command.
    The following output is displayed.
    NoteThe output may vary depending on the underlying hardware.
  • For USB, load the USB firmware to detect the device connection, and verify the device and host as follows:
    • Device: Connect the USB Type-C port and verify the enumerated log with the host PC.
      The following output is displayed.
    • Host: Connect a USB device such as a mouse, or a pen drive, and verify device detection with the following command.
      The following output is displayed.