tiva: Fix nxstyle warnings
arch/arm/src/tiva/common/lm4xx_tm3c_sysctrl.c: * Fix nxstyle warnings. No functional changes. arch/arm/src/tiva/common/lmxx_tm4c_enableclks.h: * Fix nxstyle warnings. No functional changes. arch/arm/src/tiva/common/lmxx_tm4c_enablepwr.h: * Fix nxstyle warnings. No functional changes. arch/arm/src/tiva/common/lmxx_tm4c_gpioirq.c: * Fix nxstyle warnings. No functional changes. arch/arm/src/tiva/common/lmxx_tm4c_start.c: * Fix nxstyle warnings. No functional changes.
This commit is contained in:
parent
5a1788822d
commit
55b9f046c9
@ -86,9 +86,9 @@
|
|||||||
* Name: tiva_delay
|
* Name: tiva_delay
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Wait for the newly selected oscillator(s) to settle. This is tricky because
|
* Wait for the newly selected oscillator(s) to settle. This is tricky
|
||||||
* the time that we wait can be significant and is determined by the previous
|
* because the time that we wait can be significant and is determined by
|
||||||
* clock setting, not the one that we are configuring.
|
* the previous clock setting, not the one that we are configuring.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -104,9 +104,9 @@ static inline void tiva_delay(uint32_t delay)
|
|||||||
* Name: tiva_oscdelay
|
* Name: tiva_oscdelay
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Wait for the newly selected oscillator(s) to settle. This is tricky because
|
* Wait for the newly selected oscillator(s) to settle. This is tricky
|
||||||
* the time that we wait can be significant and is determined by the previous
|
* because the time that we wait can be significant and is determined by
|
||||||
* clock setting, not the one that we are configuring.
|
* the previous clock setting, not the one that we are configuring.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -210,21 +210,21 @@ void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
|
|||||||
{
|
{
|
||||||
uint32_t dummy;
|
uint32_t dummy;
|
||||||
|
|
||||||
/* According to TM4C123GH6PM datasheet page 231 item 5.3 we must perform
|
/* According to TM4C123GH6PM datasheet page 231 item 5.3 we must
|
||||||
* the following steps to initialize and configure TM4C123G chip to use
|
* perform the following steps to initialize and configure TM4C123G
|
||||||
* a PLL based system clock.
|
* chip to use a PLL based system clock.
|
||||||
*
|
*
|
||||||
* 1. Bypass the PLL and system clock divider by setting the BYPASS bit
|
* 1. Bypass the PLL and system clock divider by setting the BYPASS
|
||||||
* and clearing the USESYS bit in the RCC register.
|
* bit and clearing the USESYS bit in the RCC register.
|
||||||
*
|
*
|
||||||
* 2. Select the crystal value (XTAL) and oscillator source (OSCSRC),
|
* 2. Select the crystal value (XTAL) and oscillator source (OSCSRC),
|
||||||
* and clear the PWRDN bit in RCC/RCC2. Setting the XTAL field
|
* and clear the PWRDN bit in RCC/RCC2. Setting the XTAL field
|
||||||
* automatically pulls valid PLL configuration data for the appropriate
|
* automatically pulls valid PLL configuration data for the
|
||||||
* crystal, and clearing the PWRDN bit powers and enables the PLL and
|
* appropriate crystal, and clearing the PWRDN bit powers and
|
||||||
* its output.
|
* enables the PLL and its output.
|
||||||
*
|
*
|
||||||
* 3. Select the desired system divider (SYSDIV) in RCC/RCC2 and set the
|
* 3. Select the desired system divider (SYSDIV) in RCC/RCC2 and set
|
||||||
* USESYS bit in RCC. The SYSDIV field determines the system
|
* the USESYS bit in RCC. The SYSDIV field determines the system
|
||||||
* frequency for the microcontroller.
|
* frequency for the microcontroller.
|
||||||
*
|
*
|
||||||
* 4. Wait for the PLL to lock by polling the PLLLRIS bit in the Raw
|
* 4. Wait for the PLL to lock by polling the PLLLRIS bit in the Raw
|
||||||
@ -262,9 +262,9 @@ void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
|
|||||||
/* Write the new RCC/RCC2 values.
|
/* Write the new RCC/RCC2 values.
|
||||||
*
|
*
|
||||||
* LM4F120 Data Sheet: "Write the RCC register prior to writing the
|
* LM4F120 Data Sheet: "Write the RCC register prior to writing the
|
||||||
* RCC2 register. If a subsequent write to the RCC register is required,
|
* RCC2 register. If a subsequent write to the RCC register is
|
||||||
* include another register access after writing the RCC register and
|
* required, include another register access after writing the RCC
|
||||||
* before writing the RCC2 register."
|
* register and before writing the RCC2 register."
|
||||||
*/
|
*/
|
||||||
|
|
||||||
putreg32(rcc, TIVA_SYSCON_RCC);
|
putreg32(rcc, TIVA_SYSCON_RCC);
|
||||||
@ -272,7 +272,9 @@ void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
|
|||||||
UNUSED(dummy);
|
UNUSED(dummy);
|
||||||
putreg32(rcc2, TIVA_SYSCON_RCC2);
|
putreg32(rcc2, TIVA_SYSCON_RCC2);
|
||||||
|
|
||||||
/* Wait for the new crystal value and oscillator source to take effect */
|
/* Wait for the new crystal value and oscillator source to take
|
||||||
|
* effect
|
||||||
|
*/
|
||||||
|
|
||||||
tiva_delay(16);
|
tiva_delay(16);
|
||||||
|
|
||||||
@ -311,8 +313,10 @@ void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (((rcc & SYSCON_RCC_MOSCDIS) != 0 && (newrcc & SYSCON_RCC_MOSCDIS) == 0) ||
|
if (((rcc & SYSCON_RCC_MOSCDIS) != 0 &&
|
||||||
((rcc & SYSCON_RCC_IOSCDIS) != 0 && (newrcc & SYSCON_RCC_IOSCDIS) == 0))
|
(newrcc & SYSCON_RCC_MOSCDIS) == 0) ||
|
||||||
|
((rcc & SYSCON_RCC_IOSCDIS) != 0 &&
|
||||||
|
(newrcc & SYSCON_RCC_IOSCDIS) == 0))
|
||||||
{
|
{
|
||||||
/* Temporarily bypass the PLL and system clock dividers */
|
/* Temporarily bypass the PLL and system clock dividers */
|
||||||
|
|
||||||
@ -328,9 +332,10 @@ void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
|
|||||||
rcc &= (~RCC_OSCMASK | (newrcc & RCC_OSCMASK));
|
rcc &= (~RCC_OSCMASK | (newrcc & RCC_OSCMASK));
|
||||||
putreg32(rcc, TIVA_SYSCON_RCC);
|
putreg32(rcc, TIVA_SYSCON_RCC);
|
||||||
|
|
||||||
/* Wait for the newly selected oscillator(s) to settle. This is tricky because
|
/* Wait for the newly selected oscillator(s) to settle. This is
|
||||||
* the time that we wait can be significant and is determined by the previous
|
* tricky because the time that we wait can be significant and is
|
||||||
* clock setting, not the one that we are configuring.
|
* determined by the previous clock setting, not the one that we are
|
||||||
|
* configuring.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tiva_oscdelay(rcc, rcc2);
|
tiva_oscdelay(rcc, rcc2);
|
||||||
@ -356,11 +361,15 @@ void tiva_clock_reconfigure(uint32_t newrcc, uint32_t newrcc2)
|
|||||||
putreg32(rcc, TIVA_SYSCON_RCC);
|
putreg32(rcc, TIVA_SYSCON_RCC);
|
||||||
putreg32(rcc2, TIVA_SYSCON_RCC2);
|
putreg32(rcc2, TIVA_SYSCON_RCC2);
|
||||||
|
|
||||||
/* Wait for the new crystal value and oscillator source to take effect */
|
/* Wait for the new crystal value and oscillator source to take
|
||||||
|
* effect
|
||||||
|
*/
|
||||||
|
|
||||||
tiva_delay(16);
|
tiva_delay(16);
|
||||||
|
|
||||||
/* Set the requested system divider and disable the non-selected osciallators */
|
/* Set the requested system divider and disable the non-selected
|
||||||
|
* osciallators
|
||||||
|
*/
|
||||||
|
|
||||||
rcc &= ~RCC_DIVMASK;
|
rcc &= ~RCC_DIVMASK;
|
||||||
rcc |= (newrcc & RCC_DIVMASK);
|
rcc |= (newrcc & RCC_DIVMASK);
|
||||||
@ -413,8 +422,8 @@ void tiva_clock_configure(void)
|
|||||||
putreg32(SYSCON_LPDOPCTL_2750MV, TIVA_SYSCON_LDOPCTL);
|
putreg32(SYSCON_LPDOPCTL_2750MV, TIVA_SYSCON_LDOPCTL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set the clocking to run with the default settings provided in the board.h
|
/* Set the clocking to run with the default settings provided in the
|
||||||
* header file
|
* board.h header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tiva_clock_reconfigure(TIVA_RCC_VALUE, TIVA_RCC2_VALUE);
|
tiva_clock_reconfigure(TIVA_RCC_VALUE, TIVA_RCC2_VALUE);
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/* Clocks are enabled or disabled by setting or clearing a bit (b) in a system
|
/* Clocks are enabled or disabled by setting or clearing a bit (b) in a system
|
||||||
* control register (a))
|
* control register (a))
|
||||||
*/
|
*/
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/* Power control is enabled or disabled by setting or clearing a bit (b) in a system
|
/* Power control is enabled or disabled by setting or clearing a bit (b) in a system
|
||||||
* control register (a))
|
* control register (a))
|
||||||
*/
|
*/
|
||||||
|
@ -284,7 +284,8 @@ static int tiva_gpioporthandler(uint8_t port, void *context)
|
|||||||
if (((mis >> pin) & 1) != 0)
|
if (((mis >> pin) & 1) != 0)
|
||||||
{
|
{
|
||||||
int index = TIVA_GPIO_IRQ_IDX(port, pin);
|
int index = TIVA_GPIO_IRQ_IDX(port, pin);
|
||||||
FAR struct gpio_handler_s *handler = &g_gpioportirqvector[index];
|
FAR struct gpio_handler_s *handler =
|
||||||
|
&g_gpioportirqvector[index];
|
||||||
|
|
||||||
gpioinfo("port=%d pin=%d isr=%p arg=%p index=%d\n",
|
gpioinfo("port=%d pin=%d isr=%p arg=%p index=%d\n",
|
||||||
port, pin, handler->isr, handler->arg, index);
|
port, pin, handler->isr, handler->arg, index);
|
||||||
@ -752,9 +753,9 @@ void tiva_gpioirqclear(pinconfig_t pinconfig)
|
|||||||
uint8_t pin = 1 << ((pinconfig & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT);
|
uint8_t pin = 1 << ((pinconfig & GPIO_PIN_MASK) >> GPIO_PIN_SHIFT);
|
||||||
uintptr_t base = tiva_gpiobaseaddress(port);
|
uintptr_t base = tiva_gpiobaseaddress(port);
|
||||||
|
|
||||||
/* "The GPIOICR register is the interrupt clear register. Writing a 1 to a bit
|
/* "The GPIOICR register is the interrupt clear register. Writing a 1 to a
|
||||||
* in this register clears the corresponding interrupt edge detection logic
|
* bit in this register clears the corresponding interrupt edge detection
|
||||||
* register. Writing a 0 has no effect."
|
* logic register. Writing a 0 has no effect."
|
||||||
*/
|
*/
|
||||||
|
|
||||||
putreg32((1 << pin), base + TIVA_GPIO_ICR_OFFSET);
|
putreg32((1 << pin), base + TIVA_GPIO_ICR_OFFSET);
|
||||||
|
@ -122,7 +122,8 @@ const uintptr_t g_idle_topstack = HEAP_BASE;
|
|||||||
* done, the processor reserves space on the stack for the FP state,
|
* done, the processor reserves space on the stack for the FP state,
|
||||||
* but does not save that state information to the stack.
|
* but does not save that state information to the stack.
|
||||||
*
|
*
|
||||||
* Software must not change the value of the ASPEN bit or LSPEN bit while either:
|
* Software must not change the value of the ASPEN bit or LSPEN bit while
|
||||||
|
* either:
|
||||||
* - the CPACR permits access to CP10 and CP11, that give access to the FP
|
* - the CPACR permits access to CP10 and CP11, that give access to the FP
|
||||||
* extension, or
|
* extension, or
|
||||||
* - the CONTROL.FPCA bit is set to 1
|
* - the CONTROL.FPCA bit is set to 1
|
||||||
@ -156,7 +157,7 @@ static inline void tiva_fpuconfig(void)
|
|||||||
/* Enable full access to CP10 and CP11 */
|
/* Enable full access to CP10 and CP11 */
|
||||||
|
|
||||||
regval = getreg32(NVIC_CPACR);
|
regval = getreg32(NVIC_CPACR);
|
||||||
regval |= ((3 << (2*10)) | (3 << (2*11)));
|
regval |= ((3 << (2 * 10)) | (3 << (2 * 11)));
|
||||||
putreg32(regval, NVIC_CPACR);
|
putreg32(regval, NVIC_CPACR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +187,7 @@ static inline void tiva_fpuconfig(void)
|
|||||||
/* Enable full access to CP10 and CP11 */
|
/* Enable full access to CP10 and CP11 */
|
||||||
|
|
||||||
regval = getreg32(NVIC_CPACR);
|
regval = getreg32(NVIC_CPACR);
|
||||||
regval |= ((3 << (2*10)) | (3 << (2*11)));
|
regval |= ((3 << (2 * 10)) | (3 << (2 * 11)));
|
||||||
putreg32(regval, NVIC_CPACR);
|
putreg32(regval, NVIC_CPACR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,7 +273,7 @@ void __start(void)
|
|||||||
showprogress('F');
|
showprogress('F');
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_EEPROM
|
#ifdef CONFIG_TIVA_EEPROM
|
||||||
/*Initialize the EEPROM */
|
/* Initialize the EEPROM */
|
||||||
|
|
||||||
tiva_eeprom_initialize();
|
tiva_eeprom_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user