summaryrefslogtreecommitdiff
path: root/drivers/usb/musb-new/sunxi.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-06-05 16:53:04 +0200
committerHans de Goede <hdegoede@redhat.com>2016-06-10 12:09:38 +0200
commitbca4c3c5fcb3d170308e621dadcc5555a1aca1b8 (patch)
tree931e4d490e4eff14ac5dbd9ea2facb071d09717c /drivers/usb/musb-new/sunxi.c
parentfd2aa39a619ce011414f6cb6efb0232136e300c7 (diff)
sunxi: musb: Properly turn of musb controller before booting
Turn of the clock and assert the reset when musb_stop gets called, so that the os gets the musb controller in a pristine state. This fixes a spurious VBus error interrupt triggering as soon as the Linux musb driver loads. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb/musb-new/sunxi.c')
-rw-r--r--drivers/usb/musb-new/sunxi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 3081afca0e..c016a0bb54 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -340,9 +340,16 @@ int musb_usb_probe(struct udevice *dev)
int musb_usb_remove(struct udevice *dev)
{
struct musb_host_data *host = dev_get_priv(dev);
+ struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
musb_stop(host->host);
+ sunxi_usb_phy_exit(0);
+#ifdef CONFIG_SUNXI_GEN_SUN6I
+ clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_GATE_OFFSET_USB0);
+#endif
+ clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_USB0);
+
return 0;
}