From 7aaa5a800d9ff011beb6a13dcd33daa50383d2c5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 4 Dec 2018 18:15:46 -0600 Subject: [PATCH] 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(). --- arch/arm/src/tiva/Kconfig | 8 ------- arch/arm/src/tiva/common/tiva_start.c | 2 +- arch/arm/src/tiva/common/tiva_sysctrl.c | 17 ++++---------- arch/arm/src/tiva/tiva_sysctrl.h | 29 +++++++----------------- arch/arm/src/tiva/tm4c/tm4c129_sysctrl.c | 11 +++++---- arch/arm/src/tiva/tm4c/tm4c_ethernet.c | 3 ++- 6 files changed, 22 insertions(+), 48 deletions(-) diff --git a/arch/arm/src/tiva/Kconfig b/arch/arm/src/tiva/Kconfig index c385f976b4..867dd16ea9 100644 --- a/arch/arm/src/tiva/Kconfig +++ b/arch/arm/src/tiva/Kconfig @@ -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 diff --git a/arch/arm/src/tiva/common/tiva_start.c b/arch/arm/src/tiva/common/tiva_start.c index 46491ca551..44ee7f7bbd 100644 --- a/arch/arm/src/tiva/common/tiva_start.c +++ b/arch/arm/src/tiva/common/tiva_start.c @@ -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'); diff --git a/arch/arm/src/tiva/common/tiva_sysctrl.c b/arch/arm/src/tiva/common/tiva_sysctrl.c index 77f952a856..597a50f70f 100644 --- a/arch/arm/src/tiva/common/tiva_sysctrl.c +++ b/arch/arm/src/tiva/common/tiva_sysctrl.c @@ -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); } diff --git a/arch/arm/src/tiva/tiva_sysctrl.h b/arch/arm/src/tiva/tiva_sysctrl.h index e69d1704ef..ed977d0144 100644 --- a/arch/arm/src/tiva/tiva_sysctrl.h +++ b/arch/arm/src/tiva/tiva_sysctrl.h @@ -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) } diff --git a/arch/arm/src/tiva/tm4c/tm4c129_sysctrl.c b/arch/arm/src/tiva/tm4c/tm4c129_sysctrl.c index ae3708eaaa..a57f29f26c 100644 --- a/arch/arm/src/tiva/tm4c/tm4c129_sysctrl.c +++ b/arch/arm/src/tiva/tm4c/tm4c129_sysctrl.c @@ -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 * diff --git a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c index 09cc93ce1a..44213bb21e 100644 --- a/arch/arm/src/tiva/tm4c/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c/tm4c_ethernet.c @@ -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: *