From 4f714d2be4f28f34d003c0a5c7900999364dff0d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 27 Nov 2013 13:14:23 -0600 Subject: [PATCH] LPC31 EHCI: Seems to work after re-ordering some initialization logic --- arch/arm/src/lpc31xx/lpc31_ehci.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 22c105c33f..8802ef6387 100755 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -4307,7 +4307,7 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) * SLOM Not used in host mode. * SDIS = 1, Stream disable mode. Eliminates overruns/underruns at * the expense of some performance. - * VBPS = 1, off chip power source + * VBPS = 1, off-chip power source */ putreg32(USBHOST_USBMODE_CMHOST | USBHOST_USBMODE_SDIS | USBHOST_USBMODE_VBPS, @@ -4323,6 +4323,14 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) return NULL; } + /* Re-program the USB host controller. As implemented, lpc31_reset() + * requires the host mode setup in order to work. However, we lose the + * host configuration in the reset. + */ + + putreg32(USBHOST_USBMODE_CMHOST | USBHOST_USBMODE_SDIS | USBHOST_USBMODE_VBPS, + LPC31_USBDEV_USBMODE); + /* "In order to initialize the host controller, software should perform the * following steps: *