SAMA5D-EK: Correct system timer frequency. Input clock is MCK/2, not MCK

This commit is contained in:
Gregory Nutt 2014-07-29 07:12:36 -06:00
parent 1b6eec572d
commit 53930d5531
13 changed files with 21 additions and 3 deletions

View File

@ -52,11 +52,16 @@
#include "chip/sam_pit.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* The PIT counter runs at a rate of the main clock (MCK) divided by 16 */
/* The PIT counter runs at a rate of the main clock (MCK) divided by 16.
*
* On the SAMA5D4, the clocking to the PIC may be divided down from MCK.
* Perhaps because of H32MXDIV? We will let the board.h tell us the correct
* PIT include clock by defining BOARD_PIT_FREQUENCY.
*/
#define PIT_CLOCK (BOARD_MCK_FREQUENCY >> 4)
#define PIT_CLOCK (BOARD_PIT_FREQUENCY >> 4)
/* The desired timer interrupt frequency is provided by the definition
* CLK_TCK (see include/time.h). CLK_TCK defines the desired number of

View File

@ -170,6 +170,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
/* HSMCI clocking

View File

@ -128,6 +128,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -127,6 +127,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -66,6 +66,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -170,6 +170,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
/* HSMCI clocking

View File

@ -128,6 +128,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -127,7 +127,9 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \
defined(CONFIG_SAMA5_UDPHS)

View File

@ -66,6 +66,7 @@
* but not for the SAMA5D3.
*/
#define BOARD_PIT_FREQUENCY BOARD_MCK_FREQUENCY
#define BOARD_USART_FREQUENCY BOARD_MCK_FREQUENCY
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -169,6 +169,7 @@
* REVISIT: I am not sure why this is. Perhaps because of H32MXDIV?
*/
#define BOARD_PIT_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
/* HSMCI clocking

View File

@ -127,6 +127,7 @@
* REVISIT: I am not sure why this is. Perhaps because of H32MXDIV?
*/
#define BOARD_PIT_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -126,6 +126,7 @@
* REVISIT: I am not sure why this is. Perhaps because of H32MXDIV?
*/
#define BOARD_PIT_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \

View File

@ -67,6 +67,7 @@
* REVISIT: I am not sure why this is. Perhaps because of H32MXDIV?
*/
#define BOARD_PIT_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#define BOARD_USART_FREQUENCY (BOARD_MCK_FREQUENCY >> 1)
#if defined(CONFIG_SAMA5_EHCI) || defined(CONFIG_SAMA5_OHCI) || \