SAMA5 EHCI: Fix bits being clobbered in PORTSC on hand-off to OHCI. OHCI: Fix some more trace configuration issues. Both: Don't muck with SFR port selection bits once they have been initialized

This commit is contained in:
Gregory Nutt 2013-09-19 10:52:33 -06:00
parent f7436ee22f
commit 07cca4b318
2 changed files with 10 additions and 7 deletions

View File

@ -580,7 +580,7 @@ static uint32_t sam_swap32(uint32_t value)
static void sam_printreg(volatile uint32_t *regaddr, uint32_t regval,
bool iswrite)
{
lldbg("%p%s%08x\n", regaddr, iswrite ? "<-" : "->", regval);
lldbg("%08x%s%08x\n", (uintptr_t)regaddr, iswrite ? "<-" : "->", regval);
}
#endif
@ -2699,10 +2699,11 @@ static inline void sam_portsc_bottomhalf(void)
}
/* Clear all pending port interrupt sources by writing a '1' to the
* corresponding bit in the PORTSC register.
* corresponding bit in the PORTSC register. In addition, we need
* to preserve the values of all R/W bits (RO bits don't matter)
*/
sam_putreg(portsc & EHCI_PORTSC_ALLINTS, &HCOR->portsc[rhpndx]);
sam_putreg(portsc, &HCOR->portsc[rhpndx]);
}
}
@ -3144,7 +3145,7 @@ static int sam_enumerate(FAR struct usbhost_connection_s *conn, int rhpndx)
regval |= EHCI_PORTSC_OWNER;
sam_putreg(regval, &HCOR->portsc[rhpndx]);
#ifdef CONFIG_SAMA5_OHCI
#if 0 /* #ifdef CONFIG_SAMA5_OHCI */
/* Give the port to the OHCI controller. Zero is the reset value for
* all ports; one makes the corresponding port available to OHCI.
*/
@ -3156,6 +3157,7 @@ static int sam_enumerate(FAR struct usbhost_connection_s *conn, int rhpndx)
/* And return a failure */
rhport->connected = false;
return -EPERM;
}
else
@ -3264,7 +3266,7 @@ static int sam_enumerate(FAR struct usbhost_connection_s *conn, int rhpndx)
regval |= EHCI_PORTSC_OWNER;
sam_putreg(regval, &HCOR->portsc[rhpndx]);
#ifdef CONFIG_SAMA5_OHCI
#if 0 /* #ifdef CONFIG_SAMA5_OHCI */
/* Give the port to the OHCI controller. Zero is the reset value for
* all ports; one makes the corresponding port available to OHCI.
*/
@ -3276,6 +3278,7 @@ static int sam_enumerate(FAR struct usbhost_connection_s *conn, int rhpndx)
/* And return a failure */
rhport->connected = false;
return -EPERM;
}

View File

@ -1928,7 +1928,7 @@ static void sam_wdh_bottomhalf(void)
ed->tdstatus = (td->hw.ctrl & GTD_STATUS_CC_MASK) >> GTD_STATUS_CC_SHIFT;
#if defined(CONFIG_DEBUG_USB) || defined(CONFIG_USBHOST_TRACE)
#ifdef HAVE_USBHOST_TRACE
if (ed->tdstatus != TD_CC_NOERROR)
{
/* The transfer failed for some reason... dump some diagnostic info. */
@ -2078,7 +2078,7 @@ static int sam_wait(FAR struct usbhost_connection_s *conn,
for (rhpndx = 0; rhpndx < SAM_OHCI_NRHPORT; rhpndx++)
{
#ifdef CONFIG_SAMA5_EHCI
#if 0 /* #ifdef CONFIG_SAMA5_EHCI */
/* If a device is no longer connected, return the port to the EHCI
* controller. Zero is the reset value for all ports; one makes
* the corresponding port available to OHCI.