aboutsummaryrefslogtreecommitdiff
path: root/slof/fs
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-05-15 13:45:32 +0200
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2017-05-16 12:46:42 +0530
commitfcd31d3e672a013d0a02005c053955100c426ff6 (patch)
tree52ed648df7d1aeb4f3fb5c87f1e0ee33aa7c607e /slof/fs
parent38c7e29976d315b354a4d1eaf7e56d942e5422dd (diff)
downloadSLOF-fcd31d3e672a013d0a02005c053955100c426ff6.zip
SLOF-fcd31d3e672a013d0a02005c053955100c426ff6.tar.gz
SLOF-fcd31d3e672a013d0a02005c053955100c426ff6.tar.bz2
pci: Reserve free space at the end of bridge windows instead of at the beginning
This reverts commit e53c2541784fba7951c8aa6ccdbe4412fb03fca6 ("pci-scan: reserve memory for pci-bridge without devices"). That commit reserved some free space on PCI bridges at the beginning of the bridges' memory windows (by adjusting the pci-next-[mem|mmio|io] variables during the pci-bridge-set-[mem|mmio|io]-base functions). While this was basically a good idea, this way also had two drawbacks: 1) There also might be free space at the end of the window (since the base of the next bridge window has to be aligned, too), so the free space on the bridge is non-contiguous. 2) As soon as there was at least one device on the bridge that uses at least some few byte in the I/O space, SLOF reserved at least 8k of I/O space on the bridge - which is a *lot* in the scarce I/O space, so that for example it was not possible anymore to next 8 PCI bridges with devices attached to them (see the buglink below for details). It's better to reserve the free space at the end of the memory windows instead (in the pci-bridge-set-[mem|mmio|io]-limit functions), and with regards to the scarce I/O space, we should also reserve less I/O memory on each bridge, so we use a limit of 2k (plus alignment) here now. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1443433 Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof/fs')
-rw-r--r--slof/fs/pci-scan.fs15
1 files changed, 9 insertions, 6 deletions
diff --git a/slof/fs/pci-scan.fs b/slof/fs/pci-scan.fs
index bd8cc0d..8a419d9 100644
--- a/slof/fs/pci-scan.fs
+++ b/slof/fs/pci-scan.fs
@@ -88,7 +88,7 @@ here 100 allot CONSTANT pci-device-vec
\ needed for scanning possible devices behind the bridge
: pci-bridge-set-mmio-base ( addr -- )
pci-next-mmio @ 100000 #aligned \ read the current Value and align to 1MB boundary
- dup 100000 + pci-next-mmio ! \ and write back with 1MB for bridge
+ dup pci-next-mmio ! \ and write it back
10 rshift \ mmio-base reg is only the upper 16 bits
pci-max-mmio @ 1- FFFF0000 and or \ and Insert mmio Limit (set it to max)
swap 20 + rtas-config-l! \ and write it into the bridge
@@ -98,7 +98,8 @@ here 100 allot CONSTANT pci-device-vec
\ The Limit Value is one less then the upper boundary
\ If the limit is less than the base the mmio is disabled
: pci-bridge-set-mmio-limit ( addr -- )
- pci-next-mmio @ 100000 #aligned \ fetch current value and align to 1MB
+ pci-next-mmio @ 100000 + \ add space for hot-plugging
+ 100000 #aligned \ align to 1MB boundary
dup pci-next-mmio ! \ and write it back
1- FFFF0000 and \ make it one less and keep upper 16 bits
over 20 + rtas-config-l@ 0000FFFF and \ fetch original value
@@ -110,7 +111,7 @@ here 100 allot CONSTANT pci-device-vec
\ needed for scanning possible devices behind the bridge
: pci-bridge-set-mem-base ( addr -- )
pci-next-mem @ 100000 #aligned \ read the current Value and align to 1MB boundary
- dup 100000 + pci-next-mem ! \ and write back with 1MB for bridge
+ dup pci-next-mem ! \ and write it back
over 24 + rtas-config-w@ \ check if 64bit support
1 and IF \ IF 64 bit support
pci-next-mem64 @ 100000000 #aligned \ | read the current Value of 64-bit and align to 4GB boundary
@@ -130,7 +131,8 @@ here 100 allot CONSTANT pci-device-vec
\ The Limit Value is one less then the upper boundary
\ If the limit is less than the base the mem is disabled
: pci-bridge-set-mem-limit ( addr -- )
- pci-next-mem @ 100000 #aligned \ read the current Value and align to 1MB boundary
+ pci-next-mem @ 100000 + \ add space for hot-plugging
+ 100000 #aligned \ align to 1MB boundary
dup pci-next-mem ! \ and write it back
1- \ make limit one less than boundary
over 24 + rtas-config-w@ \ check if 64bit support
@@ -152,7 +154,7 @@ here 100 allot CONSTANT pci-device-vec
\ needed for scanning possible devices behind the bridge
: pci-bridge-set-io-base ( addr -- )
pci-next-io @ 1000 #aligned \ read the current Value and align to 4KB boundary
- dup 1000 + pci-next-io ! \ and write back with 4K for bridge
+ dup pci-next-io ! \ and write it back
over 1C + rtas-config-l@ \ check if 32bit support
1 and IF \ IF 32 bit support
2dup 10 rshift \ | keep upper 16 bits
@@ -169,7 +171,8 @@ here 100 allot CONSTANT pci-device-vec
\ The Limit Value is one less then the upper boundary
\ If the limit is less than the base the io is disabled
: pci-bridge-set-io-limit ( addr -- )
- pci-next-io @ 1000 #aligned \ read the current Value and align to 4KB boundary
+ pci-next-io @ 800 + \ add space for hot-plugging
+ 1000 #aligned \ align to 4KB boundary
dup pci-next-io ! \ and write it back
1- \ make limit one less than boundary
over 1D + rtas-config-b@ \ check if 32bit support