> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 外设接口概述

Qualcomm® Linux® 接口指南介绍了片上系统（SoC）中使用的低速和高速输入/输出（I/O）外设接口子系统。

* 低速 I/O 接口的工作频率低于 SoC 中的高速接口。Qualcomm 通用外设（QUP）v3 串行引擎是一个硬件核心，支持以下低速外设接口：

  * 通用异步收发器（[UART](https://dragonwingdocs.qualcomm.com/System/Interfaces/uart)）
  * 串行外设接口（[SPI](https://dragonwingdocs.qualcomm.com/System/Interfaces/spi)）
  * 集成电路间总线（[I2C](https://dragonwingdocs.qualcomm.com/System/Interfaces/i2c)）
  * 改进型集成电路间总线（[I3C](https://dragonwingdocs.qualcomm.com/System/Interfaces/i3c)）

  这些低速接口与低速外设通信，例如传感器接口设备、Bluetooth® 无线技术设备、显示或触摸接口设备。

* 高速 I/O 接口包括以下外设接口：

  * 外设组件互连高速总线（[PCIe](https://dragonwingdocs.qualcomm.com/System/Interfaces/pcie)）
  * 通用串行总线（[USB](https://dragonwingdocs.qualcomm.com/System/Interfaces/usb)）

  高速 I/O 接口用于连接高速设备，例如固态硬盘、网卡、外置显卡。

## 外设接口软件栈

下图展示了外设接口的软件栈。

<img src="https://mintcdn.com/qualcomm-staging/uWQLnBcS9sxlZhgB/System/Interfaces/images/software_stack_for_peripheral_interfaces.png?fit=max&auto=format&n=uWQLnBcS9sxlZhgB&q=85&s=4fbd395072d029ddc2fdd400d4696649" alt="外设接口软件栈高层视图" width="916" height="379" data-path="System/Interfaces/images/software_stack_for_peripheral_interfaces.png" />

**图：外设接口软件栈高层（高层视图）**

**从应用程序到 QUP GENI 硬件（高层 Linux 流程）**

在 Linux 中，应用程序通过内核提供的标准用户空间接口（例如 `/dev` 节点或子系统 API）与外设通信。流程如下：

1. 应用层
   * 应用程序使用标准用户空间接口发出请求。
   * 请求通过系统调用进入内核。

2. 内核核心框架
   * 内核将请求路由到相关子系统，例如：
     * I2C
     * SPI
     * I3C
     * TTY
   * 子系统执行以下功能：
     * 提供协议感知的抽象
     * 管理同步和并发
     * 集成电源管理钩子
     * 为客户端提供统一的编程接口

3. 协议控制器驱动程序
   * 核心框架调用协议控制器驱动程序。
   * 驱动程序将框架级操作转换为特定于硬件的命令。

4. QUPv3 GENI 串行引擎（Qualcomm 平台）
   * 控制器驱动程序对 QUPv3 GENI 串行引擎进行编程。
   * GENI 使用以下内容实现所选协议（I2C、SPI、I3C 或 UART）：
     * 已配置的传输模式
     * 协议固件

5. GENI 硬件执行
   * 执行寄存器级操作。
   * 在系统与外部设备之间移动数据。

在整个过程中，内核框架保持对以下方面的控制：

* 驱动程序和设备生命周期管理
* 并发处理
* 整个软件栈中的电源状态协调

下图展示了从应用程序到 QUP-GENI 硬件的 Linux 流程。

<img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-staging/zh/System/Interfaces/images/linux_flow_app_to_QUP-GENI.png" alt="从应用程序到 QUP-GENI 硬件的 Linux 流程" />

**图：外设接口软件栈高层（低层视图）**

## QUP v3

Qualcomm 使用 QUP v3——一种高度灵活且可编程的硬件，以支持广泛的串行接口。有关 QUP v3 的更多信息，请参阅以下资源：

* [QUP v3 overview](https://dragonwingdocs.qualcomm.com/System/Interfaces/references#qup-v3-overview)
* [Supported transfer modes in QUP v3](https://dragonwingdocs.qualcomm.com/System/Interfaces/references#supported-transfer-modes-in-qup-v3)
* [QUP v3 access control customization](https://dragonwingdocs.qualcomm.com/System/Interfaces/references#qup-v3-access-control-customization)
* [QUP v3 firmware status verification](https://dragonwingdocs.qualcomm.com/System/Interfaces/references#qup-v3-firmware-status-verification)

<Note>
  **注意**

  * boot 和 aDSP 子系统的源代码可供拥有授权访问权限的获许可开发者使用。
  * 请参阅 Qualcomm Linux 支持的[硬件 SoC](https://dragonwingdocs.qualcomm.com/)。
</Note>

本指南是您了解如何启用低速和高速 I/O 接口以及进行配置更改的主要资源。

<Note>
  **注意**

  在本指南中，`<chipset>` 指 QCS6490、QCS5430、Qualcomm Dragonwing™ IQ-9075、Qualcomm Dragonwing™ IQ-8275、Qualcomm Dragonwing™ IQ-615、Qualcomm Dragonwing™ IQ-X7181、Qualcomm Dragonwing™ IQ-X5121、Qualcomm Dragonwing™ Shikra 或 Qualcomm Dragonwing™ IQ10 Nord。对应的设备树源码如下所示：

  * QCS6490/QCS5430：[qcs6490-rb3gen2.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts)
  * IQ-9075：[lemans-evk.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/lemans-evk.dts)
  * IQ-615：[talos-evk.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/talos-evk.dts)
  * IQ-X7181：[hamoa-iot-evk.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts)
  * IQ-X5121：[purwa-iot-evk.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/purwa-iot-evk.dts)
  * Shikra：[shikra-iqs-evk.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts)、[shikra-cqm-evk.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts)
</Note>
