arch/arm/src/xmc4: Do not run at 144MHz unless BOARD_FCPU_144MHZ is selected in the board.h header file.

This commit is contained in:
Alan Carvalho de Assis 2017-11-24 12:47:47 -06:00 committed by Gregory Nutt
parent 3931621bde
commit 0ac8ac240a
2 changed files with 8 additions and 4 deletions

View File

@ -436,12 +436,14 @@ void xmc4_clock_configure(void)
delay(DELAY_CNT_50US_120MHZ); delay(DELAY_CNT_50US_120MHZ);
#ifdef BOARD_FCPU_144MHZ
regval = (SCU_PLLCON1_NDIV(BOARD_PLL_NDIV) | regval = (SCU_PLLCON1_NDIV(BOARD_PLL_NDIV) |
SCU_PLLCON1_K2DIV(BOARD_PLL_K2DIV) | SCU_PLLCON1_K2DIV(BOARD_PLL_K2DIV) |
SCU_PLLCON1_PDIV(BOARD_PLL_PDIV)); SCU_PLLCON1_PDIV(BOARD_PLL_PDIV));
putreg32(regval, XMC4_SCU_PLLCON1); putreg32(regval, XMC4_SCU_PLLCON1);
delay(DELAY_CNT_50US_144MHZ); delay(DELAY_CNT_50US_144MHZ);
#endif
#endif /* BOARD_ENABLE_PLL */ #endif /* BOARD_ENABLE_PLL */

View File

@ -51,8 +51,10 @@
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ************************************************************************************/
#undef XMC4_FCPU_144MHZ /* The maximum frequency for the XMC4500 is 120MHz. */
#define XMC4_FCPU_120MHZ 1
#undef BOARD_FCPU_144MHZ
#define BOARD_FCPU_120MHZ 1
/* Clocking *************************************************************************/ /* Clocking *************************************************************************/
@ -67,7 +69,7 @@
#define BOARD_XTAL_FREQUENCY 12000000 /* 12MHz XTAL */ #define BOARD_XTAL_FREQUENCY 12000000 /* 12MHz XTAL */
#undef BOARD_RTC_XTAL_FRQUENCY /* 32.768KHz RTC XTAL not available on the Relax Lite */ #undef BOARD_RTC_XTAL_FRQUENCY /* 32.768KHz RTC XTAL not available on the Relax Lite */
#if defined(XMC4_FCPU_144MHZ) #if defined(BOARD_FCPU_144MHZ)
/* Default clock initialization /* Default clock initialization
* *
* fXTAL = 12Mhz * fXTAL = 12Mhz
@ -120,7 +122,7 @@
# define BOARD_PBDIV 1 /* No division */ # define BOARD_PBDIV 1 /* No division */
# define BOARD_PERIPH_FREQUENCY 144000000 # define BOARD_PERIPH_FREQUENCY 144000000
#elif defined(XMC4_FCPU_120MHZ) #elif defined(BOARD_FCPU_120MHZ)
/* Default clock initialization /* Default clock initialization
* *
* fXTAL = 12Mhz * fXTAL = 12Mhz