[U-Boot] [PATCH] sunxi: musb: Properly put the musb controller back in reset on exit

Hans de Goede hdegoede at redhat.com
Wed May 20 16:40:40 CEST 2015


Assert reset and disable the clock to properly put the musb controller
back in reset on exit.

Signed-off-by: Hans de Goede <hdegoede at 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 e8a3a23..e2c9d5a 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -284,6 +284,8 @@ static int sunxi_musb_init(struct musb *musb)
 
 static int sunxi_musb_exit(struct musb *musb)
 {
+	struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+
 	pr_debug("%s():\n", __func__);
 
 	USBC_DisableDpDmPullUp(musb->mregs);
@@ -291,6 +293,11 @@ static int sunxi_musb_exit(struct musb *musb)
 	sunxi_usb_phy_power_off(0);
 	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.4.1



More information about the U-Boot mailing list