PCI桥支持32/64首选项/无首选项:
pci_bus 0000:00: root bus resource [bus 00-ff]
pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
pci_bus 0000:00: root bus resource [mem 0x1000000000-0x10ffffffff] (bus address [0x00000000-0xffffffff])
pci_bus 0000:00: root bus resource [mem 0x1100000000-0x11ffffffff pref] (bus address [0x00000000-0xffffffff])
pci_bus 0000:00: root bus resource [mem 0x2000000000-0x2fffffffff] (bus address [0x00000000-0xfffffffff])
pci_bus 0000:00: root bus resource [mem 0x3000000000-0x3fffffffff pref] (bus address [0x00000000-0xfffffffff])
扫描具有2条BAR的端点:
pci 0000:01:00.0: BAR 2: assigned [mem 0x2100000000-0x211fffffff 64bit pref]
pci 0000:01:00.0: BAR 0: assigned [mem 0x1000000000-0x100007ffff]
桥显示了窗口:
pci 0000:00:00.0: PCI bridge to [bus 01]
pci 0000:00:00.0: bridge window [mem 0x1000000000-0x10000fffff]
pci 0000:00:00.0: bridge window [mem 0x2100000000-0x211fffffff 64bit pref]
端点总结了BAR:
endpoint: BAR 0 addr = 0x1000000000, size = 524287
endpoint: BAR 1 addr = 0x2100000000, size = 536870911
BAR1的高32位将被编程为什么?我预期为0x21,但找到0x1。
这是因为pcibios_bus_to_resource / pcibios_resource_to_bus。它标识了3个窗口偏移:
window->res->start = 1000000000 window->offset = 1000000000 window->res->end = 10FFFFFFFF
window->res->start = 1100000000 window->offset = 1100000000 window->res->end = 11FFFFFFFF
window->res->start = 2000000000 window->offset = 2000000000 window->res->end = 2FFFFFFFFF
当显示上面的地址时,它会增加偏移量,而在端点中对BAR寄存器进行编程时,则将其减去。因此0x2100000000变为0x100000000。
使用64位地址和32位BAR可能会有意义,但是为什么使用64位BAR会正确呢?
慕森卡