arch/arm/src/tiva: Remove option CONFIG_TIVA_BOARD_CLOCKCONFIG. It is not used and unnecessary. Fix some naming. up_clockconfig() is inappropriate. Change tiva_clockconfig() to tiva_clock_reconfigure() then we can change up_clockconfig() to tive_clock_configure().

This commit is contained in:
Gregory Nutt 2018-12-04 18:15:46 -06:00
parent 98b5ccdec0
commit 7aaa5a800d
6 changed files with 22 additions and 48 deletions

View File

@ -637,14 +637,6 @@ config TIVA_RAMVBAR
beginning of RAM (vs the beginning of FLASH). The beginning of RAM
is that address defined by CONFIG_RAM_START.
config TIVA_BOARD_CLOCKCONFIG
bool "Board-specific clock configuration"
default n
---help---
If CONFIG_TIVA_BOARD_CLOCKCONFIG is defined, then the board-specific
logic must provide the function tiva_board_clockconfig(). That
function will then be called to perform all clock initialization.
menu "Enable GPIO Interrupts"
config TIVA_GPIO_IRQS

View File

@ -218,7 +218,7 @@ void __start(void)
/* Configure the UART so that we can get debug output as soon as possible */
up_clockconfig();
tiva_clock_configure();
up_lowsetup();
tiva_fpuconfig();
showprogress('A');

View File

@ -180,7 +180,7 @@ static inline void tiva_pll_lock(void)
****************************************************************************/
/****************************************************************************
* Name: tiva_clockconfig
* Name: tiva_clock_reconfigure
*
* Description:
* Called to change to new clock based on desired rcc and rcc2 settings.
@ -189,7 +189,7 @@ static inline void tiva_pll_lock(void)
*
****************************************************************************/
void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2)
void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
{
/* We are probably using the main oscillator. The main oscillator is
* disabled on reset and so probably must be enabled here. The internal
@ -395,7 +395,7 @@ void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2)
}
/****************************************************************************
* Name: up_clockconfig
* Name: tiva_clock_configure
*
* Description:
* Called early in the boot sequence (before .data and .bss are available)
@ -403,14 +403,8 @@ void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2)
*
****************************************************************************/
void up_clockconfig(void)
void tiva_clock_configure(void)
{
#if defined(CONFIG_TIVA_BOARD_CLOCKCONFIG)
/* Execute the board specific clock configuration logic */
tiva_board_clockconfig();
#else
#ifdef CONFIG_LM_REVA2
/* Some early LM3 silicon returned an increase LDO voltage to 2.75V to work
* around a PLL bug
@ -423,6 +417,5 @@ void up_clockconfig(void)
* header file
*/
tiva_clockconfig(TIVA_RCC_VALUE, TIVA_RCC2_VALUE);
#endif
tiva_clock_reconfigure(TIVA_RCC_VALUE, TIVA_RCC2_VALUE);
}

View File

@ -47,7 +47,7 @@
************************************************************************************/
#ifdef CONFIG_ARCH_CHIP_TM4C129
/* Helpers for use with the TM4C129 version of tiva_clockconfig() */
/* Helpers for use with the TM4C129 version of tiva_clock_reconfigure() */
# define M2PLLFREQ0(mint,mfrac) \
((uint32_t)((mint) << SYSCON_PLLFREQ0_MINT_SHIFT) | \
@ -83,7 +83,7 @@ extern "C"
#if defined(CONFIG_ARCH_CHIP_TM4C129)
/****************************************************************************
* Name: tiva_clockconfig
* Name: tiva_clock_reconfigure
*
* Description:
* Called to change to new clock based on desired pllfreq0, pllfreq1, and
@ -116,11 +116,12 @@ extern "C"
*
****************************************************************************/
uint32_t tiva_clockconfig(uint32_t pllfreq0, uint32_t pllfreq1, uint32_t sysdiv);
uint32_t tiva_clock_reconfigure(uint32_t pllfreq0, uint32_t pllfreq1,
uint32_t sysdiv);
#else
/****************************************************************************
* Name: tiva_clockconfig
* Name: tiva_clock_reconfigure
*
* Description:
* Called to change to new clock based on desired rcc and rcc2 settings.
@ -129,25 +130,11 @@ uint32_t tiva_clockconfig(uint32_t pllfreq0, uint32_t pllfreq1, uint32_t sysdiv)
*
****************************************************************************/
void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2);
#endif
#if defined(CONFIG_TIVA_BOARD_CLOCKCONFIG)
/****************************************************************************
* Name: tiva_board_clockconfig
*
* Description:
* If CONFIG_TIVA_BOARD_CLOCKCONFIG is defined, then the board-specific
* logic must provide the function tiva_board_clockconfig(). That
* function will then be called to perform all clock initialization.
*
****************************************************************************/
void tiva_board_clockconfig(void);
void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2);
#endif
/****************************************************************************
* Name: up_clockconfig
* Name: tiva_clock_configure
*
* Description:
* Called early in the boot sequence (before .data and .bss are available)
@ -155,7 +142,7 @@ void tiva_board_clockconfig(void);
*
****************************************************************************/
void up_clockconfig(void);
void tiva_clock_configure(void);
#if defined(__cplusplus)
}

View File

@ -208,7 +208,7 @@ static uint32_t tiva_vco_frequency(uint32_t pllfreq0, uint32_t pllfreq1)
****************************************************************************/
/****************************************************************************
* Name: tiva_clockconfig
* Name: tiva_clock_reconfigure
*
* Description:
* Called to change to new clock based on desired pllfreq0, pllfreq1, and
@ -241,7 +241,8 @@ static uint32_t tiva_vco_frequency(uint32_t pllfreq0, uint32_t pllfreq1)
*
****************************************************************************/
uint32_t tiva_clockconfig(uint32_t pllfreq0, uint32_t pllfreq1, uint32_t sysdiv)
uint32_t tiva_clock_reconfigure(uint32_t pllfreq0, uint32_t pllfreq1,
uint32_t sysdiv)
{
uint32_t sysclk;
uint32_t regval;
@ -377,7 +378,7 @@ uint32_t tiva_clockconfig(uint32_t pllfreq0, uint32_t pllfreq1, uint32_t sysdiv)
}
/****************************************************************************
* Name: up_clockconfig
* Name: tiva_clock_configure
*
* Description:
* Called early in the boot sequence (before .data and .bss are available)
@ -385,7 +386,7 @@ uint32_t tiva_clockconfig(uint32_t pllfreq0, uint32_t pllfreq1, uint32_t sysdiv)
*
****************************************************************************/
void up_clockconfig(void)
void tiva_clock_configure(void)
{
uint32_t pllfreq0;
uint32_t pllfreq1;
@ -396,7 +397,7 @@ void up_clockconfig(void)
pllfreq0 = M2PLLFREQ0(BOARD_PLL_MINT, BOARD_PLL_MFRAC);
pllfreq1 = QN2PLLFREQ1(BOARD_PLL_Q, BOARD_PLL_N);
tiva_clockconfig(pllfreq0, pllfreq1, BOARD_PLL_SYSDIV);
tiva_clock_reconfigure(pllfreq0, pllfreq1, BOARD_PLL_SYSDIV);
/* Set up the alternate clock source
*

View File

@ -3466,7 +3466,8 @@ static inline void tiva_phy_initialize(FAR struct tiva_ethmac_s *priv)
* for proper operation. The MOSC source can be a single-ended source or a
* crystal."
*
* These are currently set up in tiva_clockconfig() before this function runs.
* These are currently set up in tiva_clock_reconfigure() before this function
* runs.
*
* MII/RMII Clocking:
*