From 3b1928e1f1148547f591cfd936d883934a1cee88 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 21 Nov 2013 18:25:10 -0600 Subject: [PATCH] LPC31xx EHCI: Power power changes --- arch/arm/src/lpc31xx/lpc31_ehci.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index a91a3a1d6d..19d1c2c5a2 100755 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -4513,8 +4513,24 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) * PORTSC register to enable power. */ - lpc31_usbhost_vbusdrive(0, true); - up_mdelay(50); + /* Handle root hub status change on each root port */ + + for (i = 0; i < LPC31_EHCI_NRHPORT; i++) + { + /* Enable VBUS power for the port */ + + lpc31_usbhost_vbusdrive(i, true); + up_mdelay(25); + + /* Power up the power. REVISIT: Is this necessary? The PP bit never + * gets set unless I explicitly set it here. + */ + + regval = lpc31_getreg(&HCOR->portsc[i]); + regval |= EHCI_PORTSC_PP; + lpc31_putreg(regval, &HCOR->portsc[i]); + up_mdelay(25); + } /* If there is a USB device in the slot at power up, then we will not * get the status change interrupt to signal us that the device is