PCI initilization / configuration on non-x86 platforms
Posted: Mon May 01, 2017 9:57 pm
In x86 you have things like 0xCF8 and 0xCFC ports and the help from BIOS, but in QEMU aarch64 for example you only have memory maps and emulated ACPI, the memory maps are as follows:
PCI I/O ports
PCI memory IO
An ECAM window
How do you look for PCI devices and initialize em in such a platform? I see that the QEMU firmware gives different memory address to the PCI devices for example, it's doing something that resets these devices and make em respond to certain memory address, how can I achieve the same thing? I have tried looking into the EDK code but it's quite convoluted and disorganized so it's hard to read.
The memory address map is below in case it might help you:
Thanks!
PCI I/O ports
PCI memory IO
An ECAM window
How do you look for PCI devices and initialize em in such a platform? I see that the QEMU firmware gives different memory address to the PCI devices for example, it's doing something that resets these devices and make em respond to certain memory address, how can I achieve the same thing? I have tried looking into the EDK code but it's quite convoluted and disorganized so it's hard to read.
The memory address map is below in case it might help you:
Code: Select all
address-space: memory
0000000000000000-ffffffffffffffff (prio 0, RW): system
0000000000000000-0000000003ffffff (prio 0, R-): virt.flash0
0000000004000000-0000000007ffffff (prio 0, R-): virt.flash1
0000000008000000-0000000008000fff (prio 0, RW): gic_dist
0000000008010000-0000000008011fff (prio 0, RW): gic_cpu
0000000008020000-0000000008020fff (prio 0, RW): gicv2m
0000000009000000-0000000009000fff (prio 0, RW): pl011
0000000009010000-0000000009010fff (prio 0, RW): pl031
0000000009020000-0000000009020007 (prio 0, RW): fwcfg.data
0000000009020008-0000000009020009 (prio 0, RW): fwcfg.ctl
0000000009020010-0000000009020017 (prio 0, RW): fwcfg.dma
0000000009030000-0000000009030fff (prio 0, RW): pl061
000000000a000000-000000000a0001ff (prio 0, RW): virtio-mmio
000000000a000200-000000000a0003ff (prio 0, RW): virtio-mmio
000000000a000400-000000000a0005ff (prio 0, RW): virtio-mmio
000000000a000600-000000000a0007ff (prio 0, RW): virtio-mmio
000000000a000800-000000000a0009ff (prio 0, RW): virtio-mmio
000000000a000a00-000000000a000bff (prio 0, RW): virtio-mmio
000000000a000c00-000000000a000dff (prio 0, RW): virtio-mmio
000000000a000e00-000000000a000fff (prio 0, RW): virtio-mmio
000000000a001000-000000000a0011ff (prio 0, RW): virtio-mmio
000000000a001200-000000000a0013ff (prio 0, RW): virtio-mmio
000000000a001400-000000000a0015ff (prio 0, RW): virtio-mmio
000000000a001600-000000000a0017ff (prio 0, RW): virtio-mmio
000000000a001800-000000000a0019ff (prio 0, RW): virtio-mmio
000000000a001a00-000000000a001bff (prio 0, RW): virtio-mmio
000000000a001c00-000000000a001dff (prio 0, RW): virtio-mmio
000000000a001e00-000000000a001fff (prio 0, RW): virtio-mmio
000000000a002000-000000000a0021ff (prio 0, RW): virtio-mmio
000000000a002200-000000000a0023ff (prio 0, RW): virtio-mmio
000000000a002400-000000000a0025ff (prio 0, RW): virtio-mmio
000000000a002600-000000000a0027ff (prio 0, RW): virtio-mmio
000000000a002800-000000000a0029ff (prio 0, RW): virtio-mmio
000000000a002a00-000000000a002bff (prio 0, RW): virtio-mmio
000000000a002c00-000000000a002dff (prio 0, RW): virtio-mmio
000000000a002e00-000000000a002fff (prio 0, RW): virtio-mmio
000000000a003000-000000000a0031ff (prio 0, RW): virtio-mmio
000000000a003200-000000000a0033ff (prio 0, RW): virtio-mmio
000000000a003400-000000000a0035ff (prio 0, RW): virtio-mmio
000000000a003600-000000000a0037ff (prio 0, RW): virtio-mmio
000000000a003800-000000000a0039ff (prio 0, RW): virtio-mmio
000000000a003a00-000000000a003bff (prio 0, RW): virtio-mmio
000000000a003c00-000000000a003dff (prio 0, RW): virtio-mmio
000000000a003e00-000000000a003fff (prio 0, RW): virtio-mmio
000000000c000000-000000000dffffff (prio 0, RW): platform bus
0000000010000000-000000003efeffff (prio 0, RW): alias pcie-mmio @gpex_mmio 0000000010000000-000000003efeffff
000000003eff0000-000000003effffff (prio 0, RW): gpex_ioport
000000003f000000-000000003fffffff (prio 0, RW): alias pcie-ecam @pcie-mmcfg-mmio 0000000000000000-0000000000ffffff
0000000040000000-0000000047ffffff (prio 0, RW): mach-virt.ram
0000008000000000-000000ffffffffff (prio 0, RW): alias pcie-mmio-high @gpex_mmio 0000008000000000-000000ffffffffff
address-space: I/O
0000000000000000-000000000000ffff (prio 0, RW): io
address-space: cpu-memory
0000000000000000-ffffffffffffffff (prio 0, RW): system
0000000000000000-0000000003ffffff (prio 0, R-): virt.flash0
0000000004000000-0000000007ffffff (prio 0, R-): virt.flash1
0000000008000000-0000000008000fff (prio 0, RW): gic_dist
0000000008010000-0000000008011fff (prio 0, RW): gic_cpu
0000000008020000-0000000008020fff (prio 0, RW): gicv2m
0000000009000000-0000000009000fff (prio 0, RW): pl011
0000000009010000-0000000009010fff (prio 0, RW): pl031
0000000009020000-0000000009020007 (prio 0, RW): fwcfg.data
0000000009020008-0000000009020009 (prio 0, RW): fwcfg.ctl
0000000009020010-0000000009020017 (prio 0, RW): fwcfg.dma
0000000009030000-0000000009030fff (prio 0, RW): pl061
000000000a000000-000000000a0001ff (prio 0, RW): virtio-mmio
000000000a000200-000000000a0003ff (prio 0, RW): virtio-mmio
000000000a000400-000000000a0005ff (prio 0, RW): virtio-mmio
000000000a000600-000000000a0007ff (prio 0, RW): virtio-mmio
000000000a000800-000000000a0009ff (prio 0, RW): virtio-mmio
000000000a000a00-000000000a000bff (prio 0, RW): virtio-mmio
000000000a000c00-000000000a000dff (prio 0, RW): virtio-mmio
000000000a000e00-000000000a000fff (prio 0, RW): virtio-mmio
000000000a001000-000000000a0011ff (prio 0, RW): virtio-mmio
000000000a001200-000000000a0013ff (prio 0, RW): virtio-mmio
000000000a001400-000000000a0015ff (prio 0, RW): virtio-mmio
000000000a001600-000000000a0017ff (prio 0, RW): virtio-mmio
000000000a001800-000000000a0019ff (prio 0, RW): virtio-mmio
000000000a001a00-000000000a001bff (prio 0, RW): virtio-mmio
000000000a001c00-000000000a001dff (prio 0, RW): virtio-mmio
000000000a001e00-000000000a001fff (prio 0, RW): virtio-mmio
000000000a002000-000000000a0021ff (prio 0, RW): virtio-mmio
000000000a002200-000000000a0023ff (prio 0, RW): virtio-mmio
000000000a002400-000000000a0025ff (prio 0, RW): virtio-mmio
000000000a002600-000000000a0027ff (prio 0, RW): virtio-mmio
000000000a002800-000000000a0029ff (prio 0, RW): virtio-mmio
000000000a002a00-000000000a002bff (prio 0, RW): virtio-mmio
000000000a002c00-000000000a002dff (prio 0, RW): virtio-mmio
000000000a002e00-000000000a002fff (prio 0, RW): virtio-mmio
000000000a003000-000000000a0031ff (prio 0, RW): virtio-mmio
000000000a003200-000000000a0033ff (prio 0, RW): virtio-mmio
000000000a003400-000000000a0035ff (prio 0, RW): virtio-mmio
000000000a003600-000000000a0037ff (prio 0, RW): virtio-mmio
000000000a003800-000000000a0039ff (prio 0, RW): virtio-mmio
000000000a003a00-000000000a003bff (prio 0, RW): virtio-mmio
000000000a003c00-000000000a003dff (prio 0, RW): virtio-mmio
000000000a003e00-000000000a003fff (prio 0, RW): virtio-mmio
000000000c000000-000000000dffffff (prio 0, RW): platform bus
0000000010000000-000000003efeffff (prio 0, RW): alias pcie-mmio @gpex_mmio 0000000010000000-000000003efeffff
000000003eff0000-000000003effffff (prio 0, RW): gpex_ioport
000000003f000000-000000003fffffff (prio 0, RW): alias pcie-ecam @pcie-mmcfg-mmio 0000000000000000-0000000000ffffff
0000000040000000-0000000047ffffff (prio 0, RW): mach-virt.ram
0000008000000000-000000ffffffffff (prio 0, RW): alias pcie-mmio-high @gpex_mmio 0000008000000000-000000ffffffffff
address-space: virtio-pci-cfg-as
0000000000000000-0000000000003fff (prio 0, RW): alias virtio-pci-cfg @virtio-pci 0000000000000000-0000000000003fff
address-space: gpex-root
0000000000000000-ffffffffffffffff (prio 0, RW): alias bus master @system 0000000000000000-ffffffffffffffff [disabled]
address-space: virtio-net-pci
0000000000000000-ffffffffffffffff (prio 0, RW): alias bus master @system 0000000000000000-ffffffffffffffff [disabled]
memory-region: gpex_mmio
0000000000000000-ffffffffffffffff (prio 0, RW): gpex_mmio
memory-region: pcie-mmcfg-mmio
0000000000000000-000000000fffffff (prio 0, RW): pcie-mmcfg-mmio
memory-region: virtio-pci
0000000000000000-0000000000003fff (prio 0, RW): virtio-pci
0000000000000000-0000000000000fff (prio 0, RW): virtio-pci-common
0000000000001000-0000000000001fff (prio 0, RW): virtio-pci-isr
0000000000002000-0000000000002fff (prio 0, RW): virtio-pci-device
0000000000003000-0000000000003fff (prio 0, RW): virtio-pci-notify
memory-region: system
0000000000000000-ffffffffffffffff (prio 0, RW): system
0000000000000000-0000000003ffffff (prio 0, R-): virt.flash0
0000000004000000-0000000007ffffff (prio 0, R-): virt.flash1
0000000008000000-0000000008000fff (prio 0, RW): gic_dist
0000000008010000-0000000008011fff (prio 0, RW): gic_cpu
0000000008020000-0000000008020fff (prio 0, RW): gicv2m
0000000009000000-0000000009000fff (prio 0, RW): pl011
0000000009010000-0000000009010fff (prio 0, RW): pl031
0000000009020000-0000000009020007 (prio 0, RW): fwcfg.data
0000000009020008-0000000009020009 (prio 0, RW): fwcfg.ctl
0000000009020010-0000000009020017 (prio 0, RW): fwcfg.dma
0000000009030000-0000000009030fff (prio 0, RW): pl061
000000000a000000-000000000a0001ff (prio 0, RW): virtio-mmio
000000000a000200-000000000a0003ff (prio 0, RW): virtio-mmio
000000000a000400-000000000a0005ff (prio 0, RW): virtio-mmio
000000000a000600-000000000a0007ff (prio 0, RW): virtio-mmio
000000000a000800-000000000a0009ff (prio 0, RW): virtio-mmio
000000000a000a00-000000000a000bff (prio 0, RW): virtio-mmio
000000000a000c00-000000000a000dff (prio 0, RW): virtio-mmio
000000000a000e00-000000000a000fff (prio 0, RW): virtio-mmio
000000000a001000-000000000a0011ff (prio 0, RW): virtio-mmio
000000000a001200-000000000a0013ff (prio 0, RW): virtio-mmio
000000000a001400-000000000a0015ff (prio 0, RW): virtio-mmio
000000000a001600-000000000a0017ff (prio 0, RW): virtio-mmio
000000000a001800-000000000a0019ff (prio 0, RW): virtio-mmio
000000000a001a00-000000000a001bff (prio 0, RW): virtio-mmio
000000000a001c00-000000000a001dff (prio 0, RW): virtio-mmio
000000000a001e00-000000000a001fff (prio 0, RW): virtio-mmio
000000000a002000-000000000a0021ff (prio 0, RW): virtio-mmio
000000000a002200-000000000a0023ff (prio 0, RW): virtio-mmio
000000000a002400-000000000a0025ff (prio 0, RW): virtio-mmio
000000000a002600-000000000a0027ff (prio 0, RW): virtio-mmio
000000000a002800-000000000a0029ff (prio 0, RW): virtio-mmio
000000000a002a00-000000000a002bff (prio 0, RW): virtio-mmio
000000000a002c00-000000000a002dff (prio 0, RW): virtio-mmio
000000000a002e00-000000000a002fff (prio 0, RW): virtio-mmio
000000000a003000-000000000a0031ff (prio 0, RW): virtio-mmio
000000000a003200-000000000a0033ff (prio 0, RW): virtio-mmio
000000000a003400-000000000a0035ff (prio 0, RW): virtio-mmio
000000000a003600-000000000a0037ff (prio 0, RW): virtio-mmio
000000000a003800-000000000a0039ff (prio 0, RW): virtio-mmio
000000000a003a00-000000000a003bff (prio 0, RW): virtio-mmio
000000000a003c00-000000000a003dff (prio 0, RW): virtio-mmio
000000000a003e00-000000000a003fff (prio 0, RW): virtio-mmio
000000000c000000-000000000dffffff (prio 0, RW): platform bus
0000000010000000-000000003efeffff (prio 0, RW): alias pcie-mmio @gpex_mmio 0000000010000000-000000003efeffff
000000003eff0000-000000003effffff (prio 0, RW): gpex_ioport
000000003f000000-000000003fffffff (prio 0, RW): alias pcie-ecam @pcie-mmcfg-mmio 0000000000000000-0000000000ffffff
0000000040000000-0000000047ffffff (prio 0, RW): mach-virt.ram
0000008000000000-000000ffffffffff (prio 0, RW): alias pcie-mmio-high @gpex_mmio 0000008000000000-000000ffffffffff