From 37d6366f0805290cfe25bd2a58c65d9fa6587c70 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 20 Jun 2014 11:40:36 -0600 Subject: [PATCH] SAMA5D4: USART peripheral clock appears to be MCK/2 --- configs/sama5d3-xplained/include/board_384mhz.h | 6 ++++++ configs/sama5d3-xplained/include/board_396mhz.h | 6 ++++++ configs/sama5d3-xplained/include/board_528mhz.h | 6 ++++++ configs/sama5d3-xplained/include/board_sdram.h | 6 ++++++ configs/sama5d3x-ek/include/board_384mhz.h | 6 ++++++ configs/sama5d3x-ek/include/board_396mhz.h | 6 ++++++ configs/sama5d3x-ek/include/board_528mhz.h | 5 +++++ configs/sama5d3x-ek/include/board_sdram.h | 6 ++++++ configs/sama5d4-ek/include/board_384mhz.h | 7 +++++++ configs/sama5d4-ek/include/board_396mhz.h | 7 +++++++ configs/sama5d4-ek/include/board_528mhz.h | 7 +++++++ configs/sama5d4-ek/include/board_sdram.h | 7 +++++++ 12 files changed, 75 insertions(+) diff --git a/configs/sama5d3-xplained/include/board_384mhz.h b/configs/sama5d3-xplained/include/board_384mhz.h index 75b4167774..f9d38fba3e 100644 --- a/configs/sama5d3-xplained/include/board_384mhz.h +++ b/configs/sama5d3-xplained/include/board_384mhz.h @@ -167,6 +167,12 @@ #define BOARD_MCK_FREQUENCY (128000000) /* MCK: PLLACK / 2 / 1 / 3 */ #define BOARD_ADCCLK_FREQUENCY (8000000) /* ADCCLK: MCK / ((7+1)*2) */ +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + /* HSMCI clocking * * Multimedia Card Interface clock (MCCK or MCI_CK) is Master Clock (MCK) diff --git a/configs/sama5d3-xplained/include/board_396mhz.h b/configs/sama5d3-xplained/include/board_396mhz.h index a16190a0bd..7293956a50 100644 --- a/configs/sama5d3-xplained/include/board_396mhz.h +++ b/configs/sama5d3-xplained/include/board_396mhz.h @@ -125,6 +125,12 @@ #define BOARD_MCK_FREQUENCY (132000000) /* MCK: PLLACK / 2 / 1 / 3 */ #define BOARD_ADCCLK_FREQUENCY (8250000) /* ADCCLK: MCK / ((7+1)*2) */ +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d3-xplained/include/board_528mhz.h b/configs/sama5d3-xplained/include/board_528mhz.h index ff1b88ca68..dc857bee4b 100644 --- a/configs/sama5d3-xplained/include/board_528mhz.h +++ b/configs/sama5d3-xplained/include/board_528mhz.h @@ -124,6 +124,12 @@ #define BOARD_MCK_FREQUENCY (132000000) /* MCK: PLLACK / 1 / 1 / 4 */ #define BOARD_ADCCLK_FREQUENCY (8250000) /* ADCCLK: MCK / ((7+1)*2) */ +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d3-xplained/include/board_sdram.h b/configs/sama5d3-xplained/include/board_sdram.h index 61d25155b5..4f2e5f971f 100644 --- a/configs/sama5d3-xplained/include/board_sdram.h +++ b/configs/sama5d3-xplained/include/board_sdram.h @@ -63,6 +63,12 @@ #define BOARD_PCK_FREQUENCY (sam_pck_frequency(BOARD_MAINOSC_FREQUENCY)) #define BOARD_MCK_FREQUENCY (sam_mck_frequency(BOARD_MAINOSC_FREQUENCY)) +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d3x-ek/include/board_384mhz.h b/configs/sama5d3x-ek/include/board_384mhz.h index 3dee820444..528ff509a3 100644 --- a/configs/sama5d3x-ek/include/board_384mhz.h +++ b/configs/sama5d3x-ek/include/board_384mhz.h @@ -167,6 +167,12 @@ #define BOARD_MCK_FREQUENCY (128000000) /* MCK: PLLACK / 2 / 1 / 3 */ #define BOARD_ADCCLK_FREQUENCY (8000000) /* ADCCLK: MCK / ((7+1)*2) */ +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + /* HSMCI clocking * * Multimedia Card Interface clock (MCCK or MCI_CK) is Master Clock (MCK) diff --git a/configs/sama5d3x-ek/include/board_396mhz.h b/configs/sama5d3x-ek/include/board_396mhz.h index 707ffd8783..ef850fda8f 100644 --- a/configs/sama5d3x-ek/include/board_396mhz.h +++ b/configs/sama5d3x-ek/include/board_396mhz.h @@ -125,6 +125,12 @@ #define BOARD_MCK_FREQUENCY (132000000) /* MCK: PLLACK / 2 / 1 / 3 */ #define BOARD_ADCCLK_FREQUENCY (8250000) /* ADCCLK: MCK / ((7+1)*2) */ +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d3x-ek/include/board_528mhz.h b/configs/sama5d3x-ek/include/board_528mhz.h index 4f79ecd4a6..0b2744030d 100644 --- a/configs/sama5d3x-ek/include/board_528mhz.h +++ b/configs/sama5d3x-ek/include/board_528mhz.h @@ -124,6 +124,11 @@ #define BOARD_MCK_FREQUENCY (132000000) /* MCK: PLLACK / 1 / 1 / 4 */ #define BOARD_ADCCLK_FREQUENCY (8250000) /* ADCCLK: MCK / ((7+1)*2) */ +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d3x-ek/include/board_sdram.h b/configs/sama5d3x-ek/include/board_sdram.h index f7e8b8015a..9e4b604690 100644 --- a/configs/sama5d3x-ek/include/board_sdram.h +++ b/configs/sama5d3x-ek/include/board_sdram.h @@ -63,6 +63,12 @@ #define BOARD_PCK_FREQUENCY (sam_pck_frequency(BOARD_MAINOSC_FREQUENCY)) #define BOARD_MCK_FREQUENCY (sam_mck_frequency(BOARD_MAINOSC_FREQUENCY)) +/* On some SAMA5's, the clocking to peripherals may be divided down from MCK, + * but not for the SAMA5D3. + */ + +#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d4-ek/include/board_384mhz.h b/configs/sama5d4-ek/include/board_384mhz.h index 878c82222a..fc2d4e4bc1 100644 --- a/configs/sama5d4-ek/include/board_384mhz.h +++ b/configs/sama5d4-ek/include/board_384mhz.h @@ -165,6 +165,13 @@ #define BOARD_MCK_FREQUENCY (128000000) /* MCK: PLLACK / 2 / 1 / 3 */ #define BOARD_ADCCLK_FREQUENCY (8000000) /* ADCCLK: MCK / ((7+1)*2) */ +/* Clocking to certain peripherals may be MCK/2. + * + * REVISIT: I am not sure why this is. Perhaps because of H32MXDIV? + */ + +#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1) + /* HSMCI clocking * * Multimedia Card Interface clock (MCCK or MCI_CK) is Master Clock (MCK) diff --git a/configs/sama5d4-ek/include/board_396mhz.h b/configs/sama5d4-ek/include/board_396mhz.h index a20527403d..11af935ed3 100644 --- a/configs/sama5d4-ek/include/board_396mhz.h +++ b/configs/sama5d4-ek/include/board_396mhz.h @@ -123,6 +123,13 @@ #define BOARD_MCK_FREQUENCY (132000000) /* MCK: PLLACK / 2 / 1 / 3 */ #define BOARD_ADCCLK_FREQUENCY (8250000) /* ADCCLK: MCK / ((7+1)*2) */ +/* Clocking to certain peripherals may be MCK/2. + * + * REVISIT: I am not sure why this is. Perhaps because of H32MXDIV? + */ + +#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1) + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d4-ek/include/board_528mhz.h b/configs/sama5d4-ek/include/board_528mhz.h index 446a480ab2..aa6a336e85 100644 --- a/configs/sama5d4-ek/include/board_528mhz.h +++ b/configs/sama5d4-ek/include/board_528mhz.h @@ -122,6 +122,13 @@ #define BOARD_MCK_FREQUENCY (132000000) /* MCK: PLLACK / 1 / 1 / 4 */ #define BOARD_ADCCLK_FREQUENCY (8250000) /* ADCCLK: MCK / ((7+1)*2) */ +/* Clocking to certain peripherals may be MCK/2. + * + * REVISIT: I am not sure why this is. Perhaps because of H32MXDIV? + */ + +#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1) + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS) diff --git a/configs/sama5d4-ek/include/board_sdram.h b/configs/sama5d4-ek/include/board_sdram.h index 338c038181..5b113d17ee 100644 --- a/configs/sama5d4-ek/include/board_sdram.h +++ b/configs/sama5d4-ek/include/board_sdram.h @@ -63,6 +63,13 @@ #define BOARD_PCK_FREQUENCY (sam_pck_frequency(BOARD_MAINOSC_FREQUENCY)) #define BOARD_MCK_FREQUENCY (sam_mck_frequency(BOARD_MAINOSC_FREQUENCY)) +/* Clocking to certain peripherals may be MCK/2. + * + * REVISIT: I am not sure why this is. Perhaps because of H32MXDIV? + */ + +#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1) + #if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \ defined(CONFIG_SAMA5_UDPHS)