summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-03-10 11:23:50 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-03-10 11:23:50 -0600
commit7beb008424ae27e33eaf1e7b1e2caaa864a5a173 (patch)
treed016cd227e783c25c6c9c6960c7a77bdddf4f09d
parent4472a64f3a42f64fd216da15191785f3fcdd3d9c (diff)
downloadnuttx-7beb008424ae27e33eaf1e7b1e2caaa864a5a173.tar.gz
nuttx-7beb008424ae27e33eaf1e7b1e2caaa864a5a173.tar.bz2
nuttx-7beb008424ae27e33eaf1e7b1e2caaa864a5a173.zip
Make sure that every reference to LM4F has corresponding logic for TM4C
-rw-r--r--nuttx/arch/arm/src/tiva/Kconfig2
-rw-r--r--nuttx/arch/arm/src/tiva/tiva_gpio.c4
-rw-r--r--nuttx/arch/arm/src/tiva/tiva_gpio.h14
-rw-r--r--nuttx/arch/arm/src/tiva/tiva_syscontrol.c8
4 files changed, 17 insertions, 11 deletions
diff --git a/nuttx/arch/arm/src/tiva/Kconfig b/nuttx/arch/arm/src/tiva/Kconfig
index d798a23c1..55231b97c 100644
--- a/nuttx/arch/arm/src/tiva/Kconfig
+++ b/nuttx/arch/arm/src/tiva/Kconfig
@@ -48,7 +48,7 @@ config ARCH_CHIP_LM4F120
select ARCH_CHIP_LM4F
select ARCH_HAVE_FPU
-config CONFIG_ARCH_CHIP_TM4C123GH6ZRB
+config ARCH_CHIP_TM4C123GH6ZRB
bool "TM4C123GH6ZRB"
depends on ARCH_CHIP_TIVA
select ARCH_CORTEXM4
diff --git a/nuttx/arch/arm/src/tiva/tiva_gpio.c b/nuttx/arch/arm/src/tiva/tiva_gpio.c
index f9c477ccb..335142ae9 100644
--- a/nuttx/arch/arm/src/tiva/tiva_gpio.c
+++ b/nuttx/arch/arm/src/tiva/tiva_gpio.c
@@ -348,7 +348,7 @@ static void tiva_gpiofunc(uint32_t base, uint32_t pinno,
* isolation circuitry for the corresponding GPIO signal.
*/
-#ifdef LM4F
+#if defined(LM4F) || defined(TM4C)
setbit = (((uint32_t)func->setbits >> AMSEL_SHIFT) & 1) << pinno;
clrbit = (((uint32_t)func->clrbits >> AMSEL_SHIFT) & 1) << pinno;
@@ -754,7 +754,7 @@ static inline void tiva_interrupt(uint32_t base, uint32_t pin, uint32_t cfgset)
*
****************************************************************************/
-#ifdef LM4F
+#if defined(LM4F) || defined(TM4C)
static inline void tiva_portcontrol(uint32_t base, uint32_t pinno,
uint32_t cfgset,
const struct gpio_func_s *func)
diff --git a/nuttx/arch/arm/src/tiva/tiva_gpio.h b/nuttx/arch/arm/src/tiva/tiva_gpio.h
index a0f46d8f6..5523aa81e 100644
--- a/nuttx/arch/arm/src/tiva/tiva_gpio.h
+++ b/nuttx/arch/arm/src/tiva/tiva_gpio.h
@@ -59,12 +59,14 @@
*
* LM3S: FFFS SPPP III. .... .... .... VPPP PBBB
* LM4F: FFFS SPPP III. AAAA .... .... VPPP PBBB
+ * TM4C: FFFS SPPP III. AAAA .... .... VPPP PBBB
*
- * TODO: The LM4F also supports configuration of pins to trigger ADC and/or uDMA.
- * That configuratin is not addressed in this this encoding.
+ * TODO: The LM4F/TM4C also support configuration of pins to trigger ADC and/or uDMA.
+ * That configuration is not addressed in this this encoding.
*/
/* These bits set the primary function of the pin:
+ *
* FFFn .... .... .... .... .... .... ....
*/
@@ -84,6 +86,7 @@
# define GPIO_FUNC_MAX GPIO_FUNC_INTERRUPT
/* That primary may be modified by the following options
+ *
* ...S SPPP .... .... .... .... .... ....
*/
@@ -106,6 +109,7 @@
# define GPIO_PADTYPE_ANALOG (6 << GPIO_PADTYPE_SHIFT) /* Analog comparator */
/* If the pin is an interrupt, then the following options apply
+ *
* .... .... III. .... .... .... .... ....
*/
@@ -117,11 +121,13 @@
# define GPIO_INT_LOWLEVEL (3 << GPIO_INT_SHIFT) /* Interrupt on low level */
# define GPIO_INT_HIGHLEVEL (4 << GPIO_INT_SHIFT) /* Interrupt on high level */
-/* The LM4F120 supports up to 15 alternate functions per pin:
+/* The LM4F/TM4C supports up to 15 alternate functions per pin:
+ *
* LM4F: .... .... .... AAAA .... .... .... ....
+ * TM4C: .... .... .... AAAA .... .... .... ....
*/
-#ifdef LM4F
+#if defined(LM4F) || defined(TM4C)
# define GPIO_ALT_SHIFT 16 /* Bits 16-19: Alternate function */
# define GPIO_ALT_MASK (15 << GPIO_ALT_SHIFT)
# define GPIO_ALT(n) ((n) << GPIO_ALT_SHIFT)
diff --git a/nuttx/arch/arm/src/tiva/tiva_syscontrol.c b/nuttx/arch/arm/src/tiva/tiva_syscontrol.c
index e9f1c4cc9..7b40c7bfb 100644
--- a/nuttx/arch/arm/src/tiva/tiva_syscontrol.c
+++ b/nuttx/arch/arm/src/tiva/tiva_syscontrol.c
@@ -55,7 +55,7 @@
* Pre-processor Definitions
****************************************************************************/
-#ifdef LM4F
+#if defined(LM4F) || defined(TM4C)
# define RCC_OSCMASK (SYSCON_RCC_MOSCDIS)
# define RCC_XTALMASK (SYSCON_RCC_XTAL_MASK | SYSCON_RCC_OSCSRC_MASK | \
SYSCON_RCC_PWRDN)
@@ -223,7 +223,7 @@ void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2)
* on rest and if that is selected, most likely nothing needs to be done.
*/
-#ifdef LM4F
+#if defined(LM4F) || defined(TM4C)
if ((rcc & SYSCON_RCC_MOSCDIS) && !(newrcc & SYSCON_RCC_MOSCDIS))
#else
if (((rcc & SYSCON_RCC_MOSCDIS) && !(newrcc & SYSCON_RCC_MOSCDIS)) ||
@@ -266,7 +266,7 @@ void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2)
* before writing the RCC2 register.
*/
-#ifndef LM4F
+#if defined(LM4F) || defined(TM4C)
if ((rcc2 & SYSCON_RCC2_USERCC2) != 0)
{
putreg32(rcc2, TIVA_SYSCON_RCC2);
@@ -314,7 +314,7 @@ void tiva_clockconfig(uint32_t newrcc, uint32_t newrcc2)
*/
putreg32(rcc, TIVA_SYSCON_RCC);
-#ifdef LM4F
+#if defined(LM4F) || defined(TM4C)
rcc = getreg32(TIVA_SYSCON_RCC);
#endif
putreg32(rcc2, TIVA_SYSCON_RCC2);