Patchwork [U-Boot,5/8] arm: bootm: call udc_disable() before booting linux

login
register
mail settings
Submitter Mike Dunn
Date April 7, 2013, 4:41 p.m.
Message ID <1365352865-2137-6-git-send-email-mikedunn@newsguy.com>
Download mbox | patch
Permalink /patch/234519/
State Superseded
Delegated to: Albert ARIBAUD
Headers show

Comments

Mike Dunn - April 7, 2013, 4:41 p.m.
On the pxa270 (at least), if the udc device is not disabled before jumping to
linux, the device fails to initialize in linux because it was left in a running
state, and the linux driver assumes that it is in a disabled state.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---

Arguably, this is a bug in the linux driver, but it seemed pretty simple and
benign to just disable it in u-boot.

 arch/arm/include/asm/bootm.h |    1 +
 arch/arm/lib/bootm.c         |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
Marek Vasut - April 8, 2013, 5:29 a.m.
Dear Mike Dunn,

> On the pxa270 (at least), if the udc device is not disabled before jumping
> to linux, the device fails to initialize in linux because it was left in a
> running state, and the linux driver assumes that it is in a disabled
> state.
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
> ---
> 
> Arguably, this is a bug in the linux driver, but it seemed pretty simple
> and benign to just disable it in u-boot.

Fix the linux one too though please.

Best regards,
Marek Vasut

Patch

diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
index db2ff94..68189cc 100644
--- a/arch/arm/include/asm/bootm.h
+++ b/arch/arm/include/asm/bootm.h
@@ -21,6 +21,7 @@ 
 
 #ifdef CONFIG_USB_DEVICE
 extern void udc_disconnect(void);
+extern void udc_disable(void);
 #endif
 
 #endif
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index f3b30c5..6daa7bf 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -105,6 +105,7 @@  static void announce_and_cleanup(void)
 
 #ifdef CONFIG_USB_DEVICE
 	udc_disconnect();
+	udc_disable();
 #endif
 	cleanup_before_linux();
 }