[PATCH v2 3/4] usb: support 64-bit pci bars

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Mon Apr 27 18:02:32 AEST 2015


With the addition of 64-bit bar ranges (commit: 9fbfed08 - pci: use
64bit bar ranges), the usb-setup-hcidev needs to handle 64-bit
addresses.

For example, QEMU provided NEC USB XHCI device requests 64-bit memory
address. Added code to check the memory type before address
translation.

Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
 slof/fs/devices/pci-class_0c.fs | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/slof/fs/devices/pci-class_0c.fs b/slof/fs/devices/pci-class_0c.fs
index 9c47325..39453fb 100644
--- a/slof/fs/devices/pci-class_0c.fs
+++ b/slof/fs/devices/pci-class_0c.fs
@@ -25,8 +25,14 @@ CONSTANT /hci-dev
 
 : usb-setup-hcidev ( num hci-dev -- )
     >r
-    10 config-l@ translate-my-address
-    3 not AND
+    10 config-l@ F AND case
+	0 OF 10 config-l@ translate-my-address ENDOF       \ 32-bit memory space
+	4 OF                                               \ 64-bit memory space
+	    14 config-l@ 20 lshift                         \ Read two bars
+	    10 config-l@ OR translate-my-address
+	ENDOF
+    ENDCASE
+    F not AND
     ( io-base ) r@ hcd>base !
     08 config-l@ 8 rshift  0000000F0 AND 4 rshift
     ( usb-type ) r@ hcd>type !
-- 
1.8.3.1



More information about the Linuxppc-dev mailing list