summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci-sunxi.c
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-10-21 02:24:29 +0100
committerMarek Vasut <marex@denx.de>2016-10-29 19:45:40 +0200
commit57faca19a82fc9b43a227824c30aeb76a43d1957 (patch)
treed8db13a5988005dd9922cbf6e6c85b7b594d3419 /drivers/usb/host/ohci-sunxi.c
parent9eea45f532301376af4498a131246ff1e130a63a (diff)
drivers: USB: OHCI: allow compilation for 64-bit targets
OHCI has a known limitation of allowing only 32-bit DMA buffer addresses, so we have a lot of u32 variables around, which are assigned to pointers and vice versa. This obviously creates issues with 64-bit systems, so the compiler complains here and there. To allow compilation for 64-bit boards which use only memory below 4GB anyway (and to avoid more invasive fixes), adjust some casts and types and assume that the EDs and TDs are all located in the lower 4GB. This fixes compilation of the OHCI driver for the Pine64. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb/host/ohci-sunxi.c')
-rw-r--r--drivers/usb/host/ohci-sunxi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
index 2a1e8bf1e8..06893749b0 100644
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -51,7 +51,7 @@ static int ohci_usb_probe(struct udevice *dev)
extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0;
#endif
priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST;
+ priv->phy_index = ((uintptr_t)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST;
priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
extra_ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
priv->usb_gate_mask <<= priv->phy_index;