WCN中的PCIE介绍

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制定的规范。

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值