
My PCIE device had allocated PCI IO Space with BAR0/2/3/4/5. According from the Freescale document,
the PCIE io space is start from 0x01f0_0000 to 0x01f8_0000. I had used devmem2 to read memory
0x01f0_0000 + 0x1020 or 0x01f8_0000 + 0x1020. The devmem2 will always report "BUS error".
How should I do to read the PCIE IO Space ?
Kernel message about PCIE:
dw_pcie_host_init: io_base: 1f80000
dw_pcie_host_init: io_mod_base: 1f80000
dw_pcie_host_init: config.mem_bus_addr: 1000000
dw_pcie_host_init: config.mem_mod_base: 1000000
imx6q-pcie 1ffc000.pcie: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io 0x1000-0x10000]
pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
pci_bus 0000:00: root bus resource [bus 00-ff]
pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
pci 0000:00:00.0: supports D1
pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
PCI: bus0: Fast back to back transfers disabled
pci 0000:01:00.0: [1c29:1104] type 00 class 0x070005
pci 0000:01:00.0: reg 0x10: [io 0x0000-0x000f]
pci 0000:01:00.0: reg 0x14: [mem 0x00000000-0x0000000f]
pci 0000:01:00.0: reg 0x18: [io 0x0000-0x001f]
pci 0000:01:00.0: reg 0x1c: [io 0x0000-0x001f]
pci 0000:01:00.0: reg 0x20: [io 0x0000-0x001f]
pci 0000:01:00.0: reg 0x24: [io 0x0000-0x001f]
pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
PCI: bus1: Fast back to back transfers disabled
pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
pci 0000:00:00.0: BAR 0: assigned [mem 0x01000000-0x010fffff]
pci 0000:00:00.0: BAR 8: assigned [mem 0x01100000-0x011fffff]
pci 0000:00:00.0: BAR 6: assigned [mem 0x01200000-0x0120ffff pref]
pci 0000:00:00.0: BAR 7: assigned [io 0x1000-0x1fff]
pci 0000:01:00.0: BAR 2: assigned [io 0x1000-0x101f]
pci 0000:01:00.0: BAR 3: assigned [io 0x1020-0x103f]
pci 0000:01:00.0: BAR 4: assigned [io 0x1040-0x105f]
pci 0000:01:00.0: BAR 5: assigned [io 0x1060-0x107f]
pci 0000:01:00.0: BAR 0: assigned [io 0x1080-0x108f]
pci 0000:01:00.0: BAR 1: assigned [mem 0x01100000-0x0110000f]
pci 0000:00:00.0: PCI bridge to [bus 01]
pci 0000:00:00.0: bridge window [io 0x1000-0x1fff]
pci 0000:00:00.0: bridge window [mem 0x01100000-0x011fffff]
pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
aer 0000:00:00.0:pcie02: service driver aer loaded
devmem2
root@imx6qsabresd:~/ddd/freescale/data# ./devmem2 0x01f01020 b
/dev/mem opened.Unhandled fault: external abort on non-linefetch (0x1018) at 0x76f32020
Memory mapped at address 0x76f32000.
Bus error
root@imx6qsabresd:~/ddd/freescale/data# ./devmem2 0x01f81020 b
/dev/mem opened.Unhandled fault: external abort on non-linefetch (0x1018) at 0x76f24020
Memory mapped at address 0x76f24000.
Bus error
root@imx6qsabresd:~/ddd/freescale/data#