arch/arm/include/tiva and src/tiva: Improve GPIO interrupt support by removing unnecessary, hard-coded per-MCU defines and using the existing Kconfig configuration options instead.

This commit is contained in:
Lwazi Dube 2018-12-31 07:19:30 -06:00 committed by Gregory Nutt
parent fc9964f6b6
commit 53ce088a54
5 changed files with 22 additions and 151 deletions

View File

@ -47,61 +47,6 @@
* Pre-processor Definitions
************************************************************************************/
#if defined(CONFIG_ARCH_CHIP_LM3S) || defined(CONFIG_ARCH_CHIP_LM4F)
/* I don't believe that any of these families support interrupts on port J. Many
* do not support interrupts on port H either.
*/
# undef CONFIG_TIVA_GPIOJ_IRQS
#elif defined(CONFIG_ARCH_CHIP_TM4C)
/* The TM4C123GH6PMI supports ports A-F of which any can support interrupts */
# if defined(CONFIG_ARCH_CHIP_TM4C123GH6PMI)
# undef CONFIG_TIVA_GPIOP_IRQS /* P-Q */
# undef CONFIG_TIVA_GPIOQ_IRQS
/* The TM4C123GH6PGE supports interrupts only on port P */
# elif defined(CONFIG_ARCH_CHIP_TM4C123GH6PGE)
# undef CONFIG_TIVA_GPIOA_IRQS /* A-F */
# undef CONFIG_TIVA_GPIOB_IRQS
# undef CONFIG_TIVA_GPIOC_IRQS
# undef CONFIG_TIVA_GPIOD_IRQS
# undef CONFIG_TIVA_GPIOE_IRQS
# undef CONFIG_TIVA_GPIOF_IRQS
# undef CONFIG_TIVA_GPIOQ_IRQS /* Q */
/* The TM4C123GH6ZRB and the TM4C129x support interrupts only on ports P and Q. */
# else
# undef CONFIG_TIVA_GPIOA_IRQS /* A-F */
# undef CONFIG_TIVA_GPIOB_IRQS
# undef CONFIG_TIVA_GPIOC_IRQS
# undef CONFIG_TIVA_GPIOD_IRQS
# undef CONFIG_TIVA_GPIOE_IRQS
# undef CONFIG_TIVA_GPIOF_IRQS
# endif
/* No supported architecture supports interrupts on ports G-N or R-T */
# undef CONFIG_TIVA_GPIOG_IRQS /* G-N */
# undef CONFIG_TIVA_GPIOH_IRQS
# undef CONFIG_TIVA_GPIOJ_IRQS
# undef CONFIG_TIVA_GPIOK_IRQS
# undef CONFIG_TIVA_GPIOL_IRQS
# undef CONFIG_TIVA_GPIOM_IRQS
# undef CONFIG_TIVA_GPION_IRQS
# undef CONFIG_TIVA_GPIOR_IRQS /* R-T */
# undef CONFIG_TIVA_GPIOS_IRQS
# undef CONFIG_TIVA_GPIOT_IRQS
#endif
/* Mark GPIO interrupts as disabled for non-existent GPIO ports. */
#if TIVA_NPORTS < 1

View File

@ -632,54 +632,6 @@
#define TIVA_IRQ_NEXTINT (NR_IRQS - 16)
/* GPIO IRQs -- Note that support for individual GPIO ports can
* be disabled in order to reduce the size of the implementation.
*/
/* The TM4C123GH6PMI supports ports A-F of which any can support interrupts */
#if defined(CONFIG_ARCH_CHIP_TM4C123GH6PMI)
# undef CONFIG_TIVA_GPIOP_IRQS /* P-Q */
# undef CONFIG_TIVA_GPIOQ_IRQS
/* The TM4C123GH6PGE supports interrupts only on port P */
#elif defined(CONFIG_ARCH_CHIP_TM4C123GH6PGE)
# undef CONFIG_TIVA_GPIOA_IRQS /* A-F */
# undef CONFIG_TIVA_GPIOB_IRQS
# undef CONFIG_TIVA_GPIOC_IRQS
# undef CONFIG_TIVA_GPIOD_IRQS
# undef CONFIG_TIVA_GPIOE_IRQS
# undef CONFIG_TIVA_GPIOF_IRQS
# undef CONFIG_TIVA_GPIOQ_IRQS /* Q */
/* The TM4C123GH6ZRB and the TM4C129x support interrupts only on ports P and Q. */
#else
# undef CONFIG_TIVA_GPIOA_IRQS /* A-F */
# undef CONFIG_TIVA_GPIOB_IRQS
# undef CONFIG_TIVA_GPIOC_IRQS
# undef CONFIG_TIVA_GPIOD_IRQS
# undef CONFIG_TIVA_GPIOE_IRQS
# undef CONFIG_TIVA_GPIOF_IRQS
#endif
/* No supported architecture supports interrupts on ports G-N or R-T */
#undef CONFIG_TIVA_GPIOG_IRQS /* G-N */
#undef CONFIG_TIVA_GPIOH_IRQS
#undef CONFIG_TIVA_GPIOJ_IRQS
#undef CONFIG_TIVA_GPIOK_IRQS
#undef CONFIG_TIVA_GPIOL_IRQS
#undef CONFIG_TIVA_GPIOM_IRQS
#undef CONFIG_TIVA_GPION_IRQS
#undef CONFIG_TIVA_GPIOR_IRQS /* R-T */
#undef CONFIG_TIVA_GPIOS_IRQS
#undef CONFIG_TIVA_GPIOT_IRQS
#if defined(CONFIG_TIVA_GPIOA_IRQS)
# define TIVA_IRQ_GPIOA_0 (NR_IRQS + 0)
# define TIVA_IRQ_GPIOA_1 (NR_IRQS + 1)

View File

@ -113,6 +113,15 @@ config ARCH_CHIP_TM4C1294NC
select ARCH_CHIP_TM4C129
select TIVA_HAVE_ETHERNET
select TIVA_HAVE_EEPROM
select TIVA_HAVE_GPIOG_IRQS
select TIVA_HAVE_GPIOH_IRQS
select TIVA_HAVE_GPIOJ_IRQS
select TIVA_HAVE_GPIOK_IRQS
select TIVA_HAVE_GPIOL_IRQS
select TIVA_HAVE_GPIOM_IRQS
select TIVA_HAVE_GPION_IRQS
select TIVA_HAVE_GPIOP_IRQS
select TIVA_HAVE_GPIOQ_IRQS
config ARCH_CHIP_TM4C129XNC
bool "TM4C129XNC"
@ -120,6 +129,18 @@ config ARCH_CHIP_TM4C129XNC
select ARCH_CHIP_TM4C
select ARCH_CHIP_TM4C129
select TIVA_HAVE_ETHERNET
select TIVA_HAVE_GPIOG_IRQS
select TIVA_HAVE_GPIOH_IRQS
select TIVA_HAVE_GPIOJ_IRQS
select TIVA_HAVE_GPIOK_IRQS
select TIVA_HAVE_GPIOL_IRQS
select TIVA_HAVE_GPIOM_IRQS
select TIVA_HAVE_GPION_IRQS
select TIVA_HAVE_GPIOP_IRQS
select TIVA_HAVE_GPIOQ_IRQS
select TIVA_HAVE_GPIOR_IRQS
select TIVA_HAVE_GPIOS_IRQS
select TIVA_HAVE_GPIOT_IRQS
config ARCH_CHIP_CC1310
bool "CC1310 SimpleLink"
@ -203,8 +224,6 @@ config ARCH_CHIP_TM4C123
config ARCH_CHIP_TM4C129
bool
select TIVA_HAVE_GPIOP_IRQS
select TIVA_HAVE_GPIOQ_IRQS
select TIVA_HAVE_I2C4
select TIVA_HAVE_I2C5
select TIVA_HAVE_I2C6
@ -223,7 +242,6 @@ config ARCH_CHIP_TM4C
select ARCH_HAVE_FPU
select TIVA_HAVE_ADC0
select TIVA_HAVE_ADC1
select TIVA_HAVE_GPIOP_IRQS
select TIVA_HAVE_I2C1
select TIVA_HAVE_I2C2
select TIVA_HAVE_I2C3

View File

@ -52,50 +52,6 @@
/* Configuration ************************************************************/
/* The TM4C123GH6PMI supports ports A-F of which any can support interrupts */
#if defined(CONFIG_ARCH_CHIP_TM4C123GH6PMI)
# undef CONFIG_TIVA_GPIOP_IRQS /* P-Q */
# undef CONFIG_TIVA_GPIOQ_IRQS
/* The TM4C123GH6PGE supports interrupts only on port P */
#elif defined(CONFIG_ARCH_CHIP_TM4C123GH6PGE)
# undef CONFIG_TIVA_GPIOA_IRQS /* A-F */
# undef CONFIG_TIVA_GPIOB_IRQS
# undef CONFIG_TIVA_GPIOC_IRQS
# undef CONFIG_TIVA_GPIOD_IRQS
# undef CONFIG_TIVA_GPIOE_IRQS
# undef CONFIG_TIVA_GPIOF_IRQS
# undef CONFIG_TIVA_GPIOQ_IRQS /* Q */
/* The TM4C123GH6ZRB and the TM4C129x support interrupts only on ports P and Q. */
#else
# undef CONFIG_TIVA_GPIOA_IRQS /* A-F */
# undef CONFIG_TIVA_GPIOB_IRQS
# undef CONFIG_TIVA_GPIOC_IRQS
# undef CONFIG_TIVA_GPIOD_IRQS
# undef CONFIG_TIVA_GPIOE_IRQS
# undef CONFIG_TIVA_GPIOF_IRQS
#endif
/* No supported architecture supports interrupts on ports G-N or R-T */
#undef CONFIG_TIVA_GPIOG_IRQS /* G-N */
#undef CONFIG_TIVA_GPIOH_IRQS
#undef CONFIG_TIVA_GPIOJ_IRQS
#undef CONFIG_TIVA_GPIOK_IRQS
#undef CONFIG_TIVA_GPIOL_IRQS
#undef CONFIG_TIVA_GPIOM_IRQS
#undef CONFIG_TIVA_GPION_IRQS
#undef CONFIG_TIVA_GPIOR_IRQS /* R-T */
#undef CONFIG_TIVA_GPIOS_IRQS
#undef CONFIG_TIVA_GPIOT_IRQS
/* Mark GPIO interrupts as disabled for non-existent GPIO ports. */
#if TIVA_NPORTS < 1

View File

@ -693,7 +693,7 @@ static void tun_net_receive_tap(FAR struct tun_device_s *priv)
NETDEV_RXARP(&priv->dev);
/* If the above function invocation resulted in data that should be
* sent out on the network, the field d_len will set to a value > 0.
* sent out on the network, the field d_len will set to a value > 0.
*/
if (priv->dev.d_len > 0)