aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci-sunxi.c
diff options
context:
space:
mode:
authorJelle van der Waa2016-02-09 23:59:33 +0100
committerHans de Goede2016-02-23 20:59:10 +0100
commitdc44fd8ae4be0a88123a90ae2b3acdec45290ecf (patch)
tree931a7d47d5535c7078d9403ffa4c8210d1b31f91 /drivers/usb/host/ohci-sunxi.c
parent0d8382ae70e7559eba873b4d8b2cf9a15aeccf20 (diff)
sunxi: H3: Add support for the host usb-phys
Add support for phy 1-3. Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl> [hdegoede@redhat.com: use setclrbits_le32 instead of read-modify-write] Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb/host/ohci-sunxi.c')
-rw-r--r--drivers/usb/host/ohci-sunxi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/host/ohci-sunxi.c b/drivers/usb/host/ohci-sunxi.c
index 60792726ee3..1b1f6516978 100644
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -37,15 +37,14 @@ static int ohci_usb_probe(struct udevice *dev)
* This should go away once we've moved to the driver model for
* clocks resp. phys.
*/
- if (regs == (void *)(SUNXI_USB1_BASE + 0x400)) {
- priv->ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_OHCI0;
- priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
- priv->phy_index = 1;
- } else {
- priv->ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_OHCI1;
- priv->usb_gate_mask = CCM_USB_CTRL_OHCI1_CLK;
- priv->phy_index = 2;
- }
+ priv->ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_OHCI0;
+#ifdef CONFIG_MACH_SUN8I_H3
+ priv->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)) / 0x1000 + 1;
+ priv->ahb_gate_mask <<= priv->phy_index - 1;
+ priv->usb_gate_mask <<= priv->phy_index - 1;
setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask);
setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask);
@@ -86,6 +85,7 @@ static const struct udevice_id ohci_usb_ids[] = {
{ .compatible = "allwinner,sun6i-a31-ohci", },
{ .compatible = "allwinner,sun7i-a20-ohci", },
{ .compatible = "allwinner,sun8i-a23-ohci", },
+ { .compatible = "allwinner,sun8i-h3-ohci", },
{ .compatible = "allwinner,sun9i-a80-ohci", },
{ }
};