SAMA5 OHCI+EHCI mostly cosmetic changes

This commit is contained in:
Gregory Nutt 2013-08-19 15:03:14 -06:00
parent 4bf3dbe149
commit 4d5789dfdd
2 changed files with 28 additions and 8 deletions

View File

@ -343,14 +343,37 @@ static inline void sam_usbclockconfig(void)
* value and USB Full-speed accuracy.
* 4) Enable the OHCI clocks, UHP bit in PMC_SCER register.
*
* Steps 2 and 3 are done here. 1 and 2 are performed with the USB device
* driver is opened.
* Steps 2 and 3 are done here. 1 and 2 are performed with the OHCI
* driver is initialized.
*/
putreg32(BOARD_OHCI_INPUT | BOARD_OHCI_DIVIDER << PMC_USB_USBDIV_SHIFT,
SAM_PMC_USB);
#endif
#ifdef CONFIG_SAMA5_EHCI
/* For High-speed operations, the user has to perform the following:
*
* 1) Enable UHP peripheral clock, bit (1 << AT91C_ID_UHPHS) in
* PMC_PCER register.
* 2) Write CKGR_PLLCOUNT field in PMC_UCKR register.
* 3) Enable UPLL, bit AT91C_CKGR_UPLLEN in PMC_UCKR register.
* 4) Wait until UTMI_PLL is locked. LOCKU bit in PMC_SR register
* 5) Enable BIAS, bit AT91C_CKGR_BIASEN in PMC_UCKR register.
* 6) Select UPLLCK as Input clock of OHCI part, USBS bit in PMC_USB
* register.
* 7) Program the OHCI clocks (UHP48M and UHP12M) with USBDIV field in
* PMC_USB register. USBDIV must be 9 (division by 10) if UPLLCK is
* selected.
* 8) Enable OHCI clocks, UHP bit in PMC_SCER register.
*
* Steps 2 through 7 performed here. 1 and 8 are performed in the EHCI
* driver is initialized.
*/
# warning Missing logic
#endif
#if 0 // #ifdef CONFIG_USBDEV
uint32_t regval;

View File

@ -186,7 +186,7 @@ struct sam_eplist_s
struct sam_gtd_s *tail; /* Tail transfer descriptor (TD) */
};
/* This structure retins the state of one root hub port */
/* This structure retains the state of one root hub port */
struct sam_rhport_s
{
@ -2792,9 +2792,6 @@ static int sam_transfer(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep,
struct sam_ed_s *ed;
uint32_t dirpid;
uint32_t regval;
#if SAM_IOBUFFERS > 0
uint8_t *origbuf = NULL;
#endif
bool in;
int ret;
@ -3015,7 +3012,7 @@ FAR struct usbhost_connection_s *sam_ohci_initialize(int controller)
/* Enable OHCI clocks */
regval = getreg32(SAM_PMC_SCER);
regval = getreg32(SAM_PMC_SCER);
regval |= PMC_UHP;
putreg32(regval, SAM_PMC_SCER);
irqrestore(flags);
@ -3035,7 +3032,7 @@ FAR struct usbhost_connection_s *sam_ohci_initialize(int controller)
* dedicated function
*/
udbg("Initializing Host Stack\n");
udbg("Initializing OHCI Stack\n");
/* Initialize all the HCCA to 0 */