summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/io.h
diff options
context:
space:
mode:
authorIdo Shayevitz <idos@codeaurora.org>2012-04-24 14:18:39 +0300
committerFelipe Balbi <balbi@ti.com>2012-04-24 15:37:04 +0300
commit51249dca627d9d0e6b41531e716cbc308554a62c (patch)
tree02338bf0474d5e03c366e180acc9c86b8d65c5cd /drivers/usb/dwc3/io.h
parentab5e59dbdb6d2e2d784381bd194e0229b8b990b5 (diff)
downloadlinux-51249dca627d9d0e6b41531e716cbc308554a62c.tar.gz
linux-51249dca627d9d0e6b41531e716cbc308554a62c.tar.bz2
linux-51249dca627d9d0e6b41531e716cbc308554a62c.zip
usb: dwc3: core: split host address space
This fix prevents a problem with dwc3 and host mode where we were requesting the entire memory region in dwc3/core.c, thus preventing xhci-plat from ever ioremapping its own address space. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/io.h')
-rw-r--r--drivers/usb/dwc3/io.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/io.h b/drivers/usb/dwc3/io.h
index 071d561f3e68..a50f76b9d19b 100644
--- a/drivers/usb/dwc3/io.h
+++ b/drivers/usb/dwc3/io.h
@@ -41,14 +41,26 @@
#include <linux/io.h>
+#include "core.h"
+
static inline u32 dwc3_readl(void __iomem *base, u32 offset)
{
- return readl(base + offset);
+ /*
+ * We requested the mem region starting from the Globals address
+ * space, see dwc3_probe in core.c.
+ * However, the offsets are given starting from xHCI address space.
+ */
+ return readl(base + (offset - DWC3_GLOBALS_REGS_START));
}
static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
{
- writel(value, base + offset);
+ /*
+ * We requested the mem region starting from the Globals address
+ * space, see dwc3_probe in core.c.
+ * However, the offsets are given starting from xHCI address space.
+ */
+ writel(value, base + (offset - DWC3_GLOBALS_REGS_START));
}
#endif /* __DRIVERS_USB_DWC3_IO_H */