sparc/PCI: Use correct bus address to resource offset
After we add 64bit mmio parsing, we got some "no compatible bridge window"
warning on anther new model that support 64bit resource.
It turns out that we can not use mem_space.start as 64bit mem space
offset, aka mem_space.start != offset.
Use child_phys_addr to calculate exact offset and recorder offset in
pbm. Still assume all mem have same offset, otherwise panic early.
After patch we get correct offset.
/pci@305: PCI IO [io 0x2007e00000000-0x2007e0fffffff] offset
2007e00000000
/pci@305: PCI MEM [mem 0x2000000100000-0x200007effffff] offset
2000000000000
/pci@305: PCI MEM64 [mem 0x2000100000000-0x2000dffffffff] offset
2000000000000
...
pci_sun4v
f02ae7f8: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io 0x2007e00000000-0x2007e0fffffff] (bus address [0x0000-0xfffffff])
pci_bus 0000:00: root bus resource [mem 0x2000000100000-0x200007effffff] (bus address [0x00100000-0x7effffff])
pci_bus 0000:00: root bus resource [mem 0x2000100000000-0x2000dffffffff] (bus address [0x100000000-0xdffffffff])
-v2: to make is simple, do not add mem64_offset, and assume
mem64_offset == mem_offset, otherwise would make
pci_mmap_resource() path too complicated.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Orabug:
21826746
Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
(cherry picked from commit
5c2485097a4ab217507c26893e0f489567e9a866)