From 8b2fb4725ba9bfb0af48d484a14416e346cf603e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 3 Jul 2014 12:28:11 -0600 Subject: [PATCH] SAMA5D3/4: UPLL divisor to generate 48MHz for OHCI is different from the two families. No idea why. --- arch/arm/src/sama5/sam_clockconfig.c | 12 +++++------- arch/arm/src/sama5/sam_ohci.c | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/arm/src/sama5/sam_clockconfig.c b/arch/arm/src/sama5/sam_clockconfig.c index a561bb9a2f..d34a07fa08 100644 --- a/arch/arm/src/sama5/sam_clockconfig.c +++ b/arch/arm/src/sama5/sam_clockconfig.c @@ -492,15 +492,13 @@ static inline void sam_usbclockconfig(void) * PMC_USB register. USBDIV must be 9 (division by 10) if UPLLCK is * 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? + * REVISIT: The divisor of 10 produces a rate that is too high with + * SAMA5D3. A divisor of 5, however, seems to work just fine for the + * SAMA5D3. The SAMA5D4, on the other hand, needs the divisor of 10. + * No idea why? Let the board.h file decide which to use. */ -#if 1 /* REVISIT */ - regval |= PMC_USB_USBDIV(4); /* Division by 5 */ -#else - regval |= PMC_USB_USBDIV(9); /* Division by 10 */ -#endif + regval |= PMC_USB_USBDIV(BOARD_UPLL_OHCI_DIV-1); putreg32(regval, SAM_PMC_USB); #else /* BOARD_USE_UPLL */ diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 84f9ac601d..cdf040adca 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -1880,7 +1880,7 @@ static void sam_wdh_bottomhalf(void) /* Invalidate D-cache to force re-reading of the Done Head */ -# if 0 /* Apparently insufficient */ +#if 0 /* Apparently insufficient */ cp15_invalidate_dcache((uintptr_t)&g_hcca.donehead, (uintptr_t)&g_hcca.donehead + sizeof(uint32_t)); #else