rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

[DM/Feature] Basic PCI/PCIe (Peripheral Component Interconnect Express) bus

Open GuEe-GUI opened this issue 1 year ago • 2 comments

[ PCI/PCIe have better performance and more devices support, such as NVMe, GPU, Powerful NIC (Like RDMA). PCI/PCIe can access control by IOMMU that the virtualiztion and userspace driver will more safety. PCI/PCIe device could hot plugging, no design modifications SoC required. PCI/PCIe on Embedded SoC is popular now. We make a simple framework to support them.

Feature Lists:

  1. PCI INTx: the INT[A-D] pin IRQ for legacy PCI, work with platform PIC.
  2. MSI/MSI-X: the message write IRQ for PCIe, work with platform's PIC.
  3. PME: we only support the D0, D1, D2, D3HOT, D3COLD init by framework.
  4. Endpoint: a simple EP framework for PCI FPGA or NTB function.
  5. OFW: we only support work on OFW SoC, ACPI support in the future maybe.

Host controller:

  1. Common PCI host controller on ECAM.
  2. Generic PCI host controller on ECAM.

To support this feature, we extended more function:

  1. RT_FIELD_PREP: prepare a bitfield element.
  2. RT_FIELD_GET: extract a bitfield element.
  3. rt_offsetof: member offset of a struct
  4. rt_upper_32_bits: high 32 bits of value.
  5. rt_lower_32_bits: lower 32 bits of value.
  6. rt_upper_16_bits: high 16 bits of value.
  7. rt_lower_16_bits: lower 16 bits of value.
  8. rt_max_t: fix type of max(...).
  9. rt_ilog2: integer logarithm base 2.

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • [ ] 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • [x] 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • [x] 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • [x] 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • [x] 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • [x] 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • [x] 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • [x] 代码是高质量的 Code in this PR is of high quality
  • [x] 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

GuEe-GUI avatar May 30 '24 10:05 GuEe-GUI

RK3568/88的PCIe网卡可以驱动吗?

BernardXiong avatar Jun 03 '24 16:06 BernardXiong

RK3568/88的PCIe网卡可以驱动吗?

网卡部分涉及到 PHY 框架改进还没完成,在当前 PCI 框架下,对 ROCK 3A RK3568 上尝试 NVME on PCI + MSI 中断方式驱动可以工作。

GuEe-GUI avatar Aug 27 '24 04:08 GuEe-GUI