aboutsummaryrefslogtreecommitdiff
path: root/slof
diff options
context:
space:
mode:
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