aboutsummaryrefslogtreecommitdiff
path: root/slof
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-11-19 14:06:26 +0530
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-12-03 16:08:37 +0530
commit112cdf93751b5090b344d3b3f3062fcdcda8c31d (patch)
treee20a65217a3cc7d1b7e5e93e67966635d46aa595 /slof
parenta70dbda2e21f6e438b3617c44ff180c3418dc30f (diff)
downloadSLOF-112cdf93751b5090b344d3b3f3062fcdcda8c31d.zip
SLOF-112cdf93751b5090b344d3b3f3062fcdcda8c31d.tar.gz
SLOF-112cdf93751b5090b344d3b3f3062fcdcda8c31d.tar.bz2
pci: use 64bit bar ranges
Add support for the new ranges property for 64bit BARs. This will enable devices with higher BAR requirements. Currently, the device could not get more than 256MB, as the 512MB memory range passed by Qemu was divided between prefetchable and non-prefetchable MMIO range. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'slof')
-rw-r--r--slof/fs/pci-properties.fs13
-rw-r--r--slof/fs/pci-scan.fs2
2 files changed, 12 insertions, 3 deletions
diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
index da1d4fc..a19c651 100644
--- a/slof/fs/pci-properties.fs
+++ b/slof/fs/pci-properties.fs
@@ -39,7 +39,6 @@
FFFFFFFF and \ keep lower 32 bits
;
-
\ calc 64 bit MEM BAR size
: pci-bar-size-mem64 ( bar-addr -- bar-size )
dup pci-bar-size \ fetch raw size lower 32 bits
@@ -127,7 +126,11 @@
\ Setup a prefetchable 64bit BAR and return its size
: assign-mem64-bar ( bar-addr -- 8 )
dup pci-bar-size-mem64 \ fetch size
- pci-next-mem \ var to change
+ pci-next-mem64 @ 0 = IF \ Check if we have 64-bit memory range
+ pci-next-mem
+ ELSE
+ pci-next-mem64
+ THEN
assign-bar-value64 \ and set it all
;
@@ -141,7 +144,11 @@
\ Setup a non-prefetchable 64bit BAR and return its size
: assign-mmio64-bar ( bar-addr -- 8 )
dup pci-bar-size-mem64 \ fetch size
- pci-next-mmio \ var to change
+ pci-next-mem64 @ 0 = IF \ Check if we have 64-bit memory range
+ pci-next-mmio
+ ELSE
+ pci-next-mem64 \ for board-qemu we will use same range
+ THEN
assign-bar-value64 \ and set it all
;
diff --git a/slof/fs/pci-scan.fs b/slof/fs/pci-scan.fs
index 8ab8cad..15d0c8e 100644
--- a/slof/fs/pci-scan.fs
+++ b/slof/fs/pci-scan.fs
@@ -21,6 +21,8 @@ VARIABLE pci-next-mmio \ non-prefetchable memory
VARIABLE pci-max-mmio
VARIABLE pci-next-io \ I/O space
VARIABLE pci-max-io
+VARIABLE pci-next-mem64 \ prefetchable 64-bit memory mapped
+VARIABLE pci-max-mem64
\ Counter of busses found
0 VALUE pci-bus-number