From 112cdf93751b5090b344d3b3f3062fcdcda8c31d Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Wed, 19 Nov 2014 14:06:26 +0530 Subject: 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 Reviewed-by: Thomas Huth --- slof/fs/pci-properties.fs | 13 ++++++++++--- slof/fs/pci-scan.fs | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'slof') 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 -- cgit v1.1