RK3399_PCIe_Host驱动分析_地址映射
文章目录
参考资料:
- 《PCI Express Technology 3.0》,Mike Jackson, Ravi Budruk; MindShare, Inc.
- 《PCIe扫盲系列博文》,作者Felix,这是对《PCI Express Technology》的理解与翻译
- 《PCI EXPRESS体系结构导读 (王齐)》
- 《PCI Express_ Base Specification Revision 4.0 Version 0.3 ( PDFDrive )》
- 《NCB-PCI_Express_Base_5.0r1.0-2019-05-22》
- SOC中AXI总线是如何连接的
- AXI总线整理总结
- PCIe中MSI和MSI-X中断机制
开发板资料:
分析的文件:
linux-4.4_rk3399\drivers\pci\host\pcie-rockchip.c
一、 PCI驱动框架

二、 Host驱动程序速览
怎么找到驱动?
-
在内核目录下根据芯片名字找到文件:
drivers\pci\host\pcie-rockchip.c-
看到如下代码:
static const struct of_device_id rockchip_pcie_of_match[] = { { .compatible = "rockchip,rk3399-pcie", }, { } };
-
-
在内核
arch/arm64/boot/dts下搜:grep "rockchip,rk3399-pcie" * -nr-
找到设备树文件:
arch/arm64/boot/dts/rk3399.dtsi,代码如下:pcie0: pcie@f8000000 { compatible = "rockchip,rk3399-pcie"; #address-cells = <3>; #size-cells = <2>; aspm-no-l0s; clocks = <&cru ACLK_PCIE>, <&cru ACLK_PERF_PCIE>, <&cru PCLK_PCIE>, <&cru SCLK_PCIE_PM>; clock-names = "aclk", "aclk-perf", "hclk", "pm"; bus-range = <0x0 0x1f>; max-link-speed = <1>; linux,pci-domain = <0>; msi-map = <0x0 &its 0x0 0x1000>; interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH 0>, <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH 0>, <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH 0>; interrupt-names = "sys", "legacy", "client"; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &pcie0_intc 0>, <0 0 0 2 &pcie0_intc 1>, <0 0 0 3 &pcie0_intc 2>, <0 0 0 4 &pcie0_intc 3>; phys = &l
-

文章详细介绍了RK3399PCIeHost驱动的分析,包括PCI驱动框架、Host驱动程序的概述、设备树文件的解析以及设备树相关驱动程序的分析。重点讨论了地址映射,如Region0和寄存器地址、CPU/PCI地址空间的确定及映射建立。此外,还涉及了中断信息和资源记录。
最低0.47元/天 解锁文章
5105





