mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
SAMA5 OHCI: When UPLL drives OHCI the logically correct divider of 10 does not work; But a divider of 5 does. Why?
This commit is contained in:
@@ -5594,4 +5594,7 @@
|
|||||||
Correct some inconsistencies in the way that USB configuration
|
Correct some inconsistencies in the way that USB configuration
|
||||||
settings are used. This caused compilation errors in SAMA5 OHCI
|
settings are used. This caused compilation errors in SAMA5 OHCI
|
||||||
when USB debug was ON but USB host tracing was off (2013-9-19).
|
when USB debug was ON but USB host tracing was off (2013-9-19).
|
||||||
|
* nuttx/arch/arm/src/sama5/sam_clockconfig.c: When 480MHz UPLL
|
||||||
|
is used to drive OHCI, it should have a divider of 10. However,
|
||||||
|
that does not work. A divider of 5 does. Why? (2013-9-19).
|
||||||
|
|
||||||
|
|||||||
@@ -397,9 +397,16 @@ static inline void sam_usbclockconfig(void)
|
|||||||
/* 7) Program the OHCI clocks (UHP48M and UHP12M) with USBDIV field in
|
/* 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
|
* PMC_USB register. USBDIV must be 9 (division by 10) if UPLLCK is
|
||||||
* selected.
|
* selected.
|
||||||
|
*
|
||||||
|
* REVISIT: The divisor of 10 produces a rate that is too high. Division
|
||||||
|
* by 5, however, seems to work just fine. No idea why?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regval |= PMC_USB_USBDIV(9);
|
#if 1 /* REVISIT */
|
||||||
|
regval |= PMC_USB_USBDIV(4); /* Division by 5 */
|
||||||
|
#else
|
||||||
|
regval |= PMC_USB_USBDIV(9); /* Division by 10 */
|
||||||
|
#endif
|
||||||
putreg32(regval, SAM_PMC_USB);
|
putreg32(regval, SAM_PMC_USB);
|
||||||
|
|
||||||
#else /* BOARD_USE_UPLL */
|
#else /* BOARD_USE_UPLL */
|
||||||
|
|||||||
@@ -136,7 +136,11 @@
|
|||||||
|
|
||||||
# undef BOARD_USE_UPLL /* Use PLLA as source clock */
|
# undef BOARD_USE_UPLL /* Use PLLA as source clock */
|
||||||
# define BOARD_OHCI_INPUT PMC_USB_USBS_PLLA /* Input is PLLACK */
|
# define BOARD_OHCI_INPUT PMC_USB_USBS_PLLA /* Input is PLLACK */
|
||||||
# define BOARD_OHCI_DIVIDER (7) /* Divided by 8 */
|
# if 1 /* REVISIT */
|
||||||
|
# define BOARD_OHCI_DIVIDER (7) /* Divided by 8 */
|
||||||
|
# else
|
||||||
|
# define BOARD_OHCI_DIVIDER (15) /* Divided by 16 */
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Resulting frequencies */
|
/* Resulting frequencies */
|
||||||
|
|||||||
Reference in New Issue
Block a user