diff options
author | Thomas Huth <thuth@redhat.com> | 2017-07-14 11:45:54 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-07-21 15:03:29 +1000 |
commit | c4dd5b62f0d027dc653888f6e049bbb77f832cc4 (patch) | |
tree | e62734f4d30d25503c3e79824d1c3d524d356ea8 /board-qemu | |
parent | 206cff5fc88231d06ec2465873814da1f85e2b00 (diff) | |
download | SLOF-c4dd5b62f0d027dc653888f6e049bbb77f832cc4.zip SLOF-c4dd5b62f0d027dc653888f6e049bbb77f832cc4.tar.gz SLOF-c4dd5b62f0d027dc653888f6e049bbb77f832cc4.tar.bz2 |
pci: Avoid 32-bit prefetchable memory area if possible
PCI bridges can only have one prefetchable memory area. If we are
already using 64-bit prefetchable memory regions, we can not use
a dedicated 32-bit prefetchable memory region anymore. In that
case the 32-bit BARs should all be located in the 32-bit non-
prefetchable memory space instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'board-qemu')
-rw-r--r-- | board-qemu/slof/pci-phb.fs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs index 195c833..06729bc 100644 --- a/board-qemu/slof/pci-phb.fs +++ b/board-qemu/slof/pci-phb.fs @@ -253,12 +253,9 @@ setup-puid THEN ENDOF 2000000 OF \ 32-bit memory space? - decode-64 pci-next-mem ! \ Decode mem base address + decode-64 dup >r pci-next-mmio ! \ Decode base address decode-64 drop \ Forget the parent address - decode-64 2 / dup >r \ Decode and calc size/2 - pci-next-mem @ + dup pci-max-mem ! \ and calc max mem address - dup pci-next-mmio ! \ which is the same as MMIO base - r> + pci-max-mmio ! \ calc max MMIO address + decode-64 r> + pci-max-mmio ! \ calc max MMIO address ENDOF 3000000 OF \ 64-bit memory space? decode-64 dup >r pci-next-mem64 ! @@ -270,6 +267,15 @@ setup-puid ( prop-addr prop-len ) 2drop + \ If we do not have 64-bit prefetchable memory, split the 32-bit space: + pci-next-mem64 @ 0= IF + pci-next-mmio @ pci-next-mem ! \ Start of 32-bit prefetchable + pci-max-mmio @ pci-next-mmio @ - 2 / \ Calculate new size + pci-next-mmio @ + \ The middle of the area + dup pci-max-mem ! + pci-next-mmio ! + THEN + phb-debug? IF pci-var-out THEN |