public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sunxi: musb: Properly turn of musb controller before booting
@ 2016-06-05 14:54 Hans de Goede
  2016-06-12 12:27 ` Ian Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2016-06-05 14:54 UTC (permalink / raw)
  To: u-boot

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>
---
 drivers/usb/musb-new/sunxi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 3081afc..c016a0b 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;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] sunxi: musb: Properly turn of musb controller before booting
  2016-06-05 14:54 [U-Boot] [PATCH] sunxi: musb: Properly turn of musb controller before booting Hans de Goede
@ 2016-06-12 12:27 ` Ian Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2016-06-12 12:27 UTC (permalink / raw)
  To: u-boot

On Sun, 2016-06-05 at 16:54 +0200, Hans de Goede wrote:
> 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>

Acked-by: Ian Campbell <ijc@hellion.org.uk>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-12 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05 14:54 [U-Boot] [PATCH] sunxi: musb: Properly turn of musb controller before booting Hans de Goede
2016-06-12 12:27 ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox