WCN中的PCIE介绍

WCN中的PCIE介绍PCIE 技术介绍 PCI 使用了树形拓扑 树根和处理器桥接 各种 IO 外设成为叶子节点挂在树上 中间节点为 PCI PCI 桥 支持即插即用 PCIE 拓补图如下 Root complex RC Connects the CPU to the PCIe topology Switch

大家好,我是讯享网,很高兴认识大家。

PCIE技术介绍


讯享网

PCI使用了树形拓扑,树根和处理器桥接,各种IO外设成为叶子节点挂在树上,中间节点为PCI-PCI桥,支持即插即用。

PCIE拓补图如下:

Root complex (RC) – Connects the CPU to the PCIe topology

Switch – Connects more than two ports and acts as a packet router

Bridge – Connects different buses, for example, PCIe to PCIe, or PCIe to peripheral component interconnect (PCI)

Endpoint (EP) – Resides at the bottom of the PCIe topology tree structure and has only an upstream port

Legacy EP – Uses older PCI bus operations to support backward compatibility

The following are a few of the common PCIe terms:

Lane – Serial send and receive path that consists of four wires; two each for differential Tx and Rx

Link – Connects two devices; can have up to 32 lanes

Link width – Number of lanes contained in a link

PCIE实现

仅从wifi部分来看,qcom的cnss使用了mhi的其中一个节点RC0,RC1、RC2未启用。 

PCIE枚举过程

当系统启动时,AP侧的系统软件仅仅知道bus 0 的存在,并不知道bus0下边接入了多少个EP和legacy EP。所以需要一个漫长的枚举过程确定设备数量。

下图时一个例子,架设bus0下接入了很长的树状节点,那么需要一个长时间的扫描才知道bus1 - bus6存在。

 QCOM平台扫描bus、添加pci设备如下:

Pcie时序

WCN中的PCIE

Pcie注册软件时序

  1. Pci driver跟随内核启动,注册bus到设备集合中
  2. Pci driver被cnss注册,调用bus的probe方法后回调cnss实现的pci driver probe方法
  3. Probe回调过后,cnss解析dts中无线相关配置,配置pci设备
  4. PCI扫描RC0下所有的设备节点,监控所有EP controller之间的信息交换
  5. PCI suspend和resume通过直接读写寄存器的形式发送通知跟wcn芯片

关于Probe方法

Probe的回调机制总是让人感觉有些里不顺,究竟是driver直接回调probe函数,还是先调用设备的probe方法后再回调自身的probe函数。

 driver_register                           -->注册driver

-> bus_add_driver                     -->添加driver结构体到系统中

  ->driver_attach                     -->调用bus的match函数指针,匹配设备

    ->driver_probe_device             

      -> really_probe                 -->判断立刻调用probe还是异步延后

        ->dev->bus->probe            -->如果bus实现了probe,调用bus的

        ->drv->probe                 -->否则调用driver自身的

  • 总结

PCIE在qcom平台上广泛使用,主要作为BP和AP的桥梁。PCIE模块影响着性能、功耗、稳定性以及整机硬件表现。

本文档仅介绍高通平台中WCN对于PCIE的应用。MTK使用总线为AXI,为ARM制定的规范。

小讯
上一篇 2025-02-26 09:47
下一篇 2025-03-27 18:52

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/41675.html