sunxi: musb: Properly turn of musb controller before booting
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/usb/musb-new/sunxi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/musb-new/sunxi.c +7 -0
@@ -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 ; }
Signature · 1 line
2.7.4
PATCH 1/1 sunxi: musb: Properly turn of musb controller before booting
Quoted 8 lines · Hans de Goede
Turn of the clock and assert the reset when
musb_stopgets 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 <[email protected]>
Acked-by Ian Campbell <[email protected]>