本帖最后由 kft91lx 于 2019-7-10 16:54 编辑
pci2: pcie@ffe0a000 {
cell-index = <2>;
compatible = "fsl,mpc8548-pcie";
device_type = "pci";
#interrupt-cells = <1>;
#size-cells = <2>;//表示几个cell,表示长度
#address-cells = <3>;//表示几个cell,表示地址
reg = <0xffe0a000 0x1000>;
bus-range = <0 255>;
ranges = <0x2000000 0x0 0xc0000000 0xc0000000 0x0 0x20000000 0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>;
clock-frequency = <33333333>;
interrupt-parent = <&mpic>;
interrupts = <27 2>;
interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
interrupt-map = < /* IDSEL 0x0 */ 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0000 0x0 0x0 0x4 &mpic 0x3 0x1 >;
pcie@0 {
reg = <0x0 0x0 0x0 0x0 0x0>;
#size-cells = <2>;
#address-cells = <3>;
device_type = "pci";
ranges = <0x2000000 0x0 0xc0000000 0x2000000 0x0 0xc0000000 0x0 0x20000000 0x1000000 0x0 0x0 0x1000000 0x0 0x0 0x0 0x100000>
;
现在对这个地址分配还是有点不明白 首先pci控制器地址是ffe0a000 range映射地址是pci地址c0000000映射到cpu地址c0000000 那我要访问控制器的话 地址是c0000000+ffe0a000吗?可是range映射的长度只有20000000啊?还有我想问这个设备树里的cpu地址是虚拟地址还是物理地址?我要在应用层访问这个地址需要mmap吗? 求解!
|