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. Identify available serial engines by checking the platform device tree for serial engine nodes. Serial engine names and numbering vary by platform. Use the node labels defined by the platform; for example:
    NoteYou can choose the required protocol based on your interface requirements.
    • I2C: Sensors, EEPROMs, PMICs
    • SPI: Displays, flash memory, ADCs
    • UART: Console, GPS, Bluetooth
  2. 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.
  3. Switch the serial engine protocol. For example, I2C to SPI.
    1. Original I2C configuration:
    2. New configuration (SPI)
      Disable the original I2C node before enabling SPI because a serial engine can use only one protocol at a time.
    NoteRebuild and deploy the software image with the updated device tree, then boot the device with the updated image.
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: QUP instance names and serial engine assignments vary by platform. Refer to the platform device tree for the correct node labels.
  • 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 failed
  • qcom-geni-se: firmware request failed
  1. Verify that the firmware file exists: ls -la /lib/firmware/qcom/<target-name>/qupv3fw.elf.
  2. Verify the firmware path used by the driver.
  3. Check the kernel log for additional firmware-loading errors: dmesg | grep -i firmware.
Serial engine not probing
  • No device node created
  • Driver not loading
  1. Check the device-tree status: status = “okay”;.
  2. Verify that the compatible string matches the driver.
  3. Check the kernel log: dmesg | grep -i qup and dmesg | grep -i geni.
Protocol conflict
  • qcom-geni-se: serial engine is already in use
Ensure that only one protocol is enabled for each serial engine.
DMA allocation failed
  • qcom-geni-se: GSI DMA allocation failed
  1. Check the available DMA channels.
  2. Remove qcom,enable-gsi-dma; from one or more serial-engine nodes.
  3. Use FIFO mode for less critical devices.
Pin multiplexing conflict
  • Communication failures
  • No response from devices
  1. Verify the pin configuration: cat /sys/kernel/debug/pinctrl/*/pinmux-pins.
  2. Check for pin conflicts with other peripherals.
  3. Ensure that the correct function is 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.