summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-06-02 10:54:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-06-03 10:03:34 +0200
commit6980fc752728ead45aee71340c242956cf15c590 (patch)
treefdb4b5d007f4809957eb4d1a2da99dd570cfb17c /drivers
parent7b80d502bdcaa39665db946e3c2591e4d3117450 (diff)
downloadbarebox-6980fc752728ead45aee71340c242956cf15c590.tar.gz
barebox-6980fc752728ead45aee71340c242956cf15c590.tar.xz
usb: xhci-hcd: replace opencoded non-atomic 64-bit MMIO with lo_hi helper
Commit 3c5317e9046 ("usb: xhci-hcd: Make use of lo_hi_readq/writeq()") had made use of lo_hi_readq/writeq() to implement xhci_read/write_64(), like Linux does, but this was removed in commit fddd1c7c51a8 ("usb: host: remove xhci driver"). Reinstate it to make code clearer. No functional change. [Note: Linux doesn't use any readq/writeq, but does two 32-bit access always, even on 64-bit systems] Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/xhci.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 1a3f7e7642..9ffbb103d5 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -18,6 +18,7 @@
#include <asm/types.h>
#include <io.h>
+#include <io-64-nonatomic-lo-hi.h>
#include <linux/list.h>
#define MAX_EP_CTX_NUM 31
@@ -1112,10 +1113,7 @@ static inline u64 xhci_readq(__le64 volatile *regs)
#if BITS_PER_LONG == 64
return readq(regs);
#else
- __u32 *ptr = (__u32 *)regs;
- u64 val_lo = readl(ptr);
- u64 val_hi = readl(ptr + 1);
- return val_lo + (val_hi << 32);
+ return lo_hi_readq(regs);
#endif
}
@@ -1124,12 +1122,7 @@ static inline void xhci_writeq(__le64 volatile *regs, const u64 val)
#if BITS_PER_LONG == 64
writeq(val, regs);
#else
- __u32 *ptr = (__u32 *)regs;
- u32 val_lo = lower_32_bits(val);
- /* FIXME */
- u32 val_hi = upper_32_bits(val);
- writel(val_lo, ptr);
- writel(val_hi, ptr + 1);
+ lo_hi_writeq(val, regs);
#endif
}