From 75973db9ccd05142ad07a402e60a5f6c7f8eaba7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 28 Feb 2016 15:18:43 -0600 Subject: [PATCH] Change name IMX to IMX1 in configuration variable names to make room for i.MX6 --- arch/arm/Kconfig | 12 +++---- arch/arm/src/imx1/Kconfig | 22 +++++------- arch/arm/src/imx1/imx_serial.c | 66 +++++++++++++++++----------------- arch/arm/src/imx1/imx_spi.c | 22 ++++++------ 4 files changed, 59 insertions(+), 63 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 60d291a8c7..4571ac7055 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -57,13 +57,13 @@ config ARCH_CHIP_EFM32 ---help--- Energy Micro EFM32 microcontrollers (ARM Cortex-M). -config ARCH_CHIP_IMX - bool "Freescale iMX" +config ARCH_CHIP_IMX1 + bool "Freescale iMX.1" select ARCH_ARM920T select ARCH_HAVE_HEAP2 select ARCH_HAVE_LOWVECTORS ---help--- - Freescale iMX architectures (ARM920T) + Freescale iMX.1 architectures (ARM920T) config ARCH_CHIP_KINETIS bool "Freescale Kinetis" @@ -370,7 +370,7 @@ config ARCH_CHIP default "calypso" if ARCH_CHIP_CALYPSO default "dm320" if ARCH_CHIP_DM320 default "efm32" if ARCH_CHIP_EFM32 - default "imx" if ARCH_CHIP_IMX + default "imx1" if ARCH_CHIP_IMX1 default "kinetis" if ARCH_CHIP_KINETIS default "kl" if ARCH_CHIP_KL default "tiva" if ARCH_CHIP_LM || ARCH_CHIP_TIVA @@ -554,8 +554,8 @@ endif if ARCH_CHIP_EFM32 source arch/arm/src/efm32/Kconfig endif -if ARCH_CHIP_IMX -source arch/arm/src/imx/Kconfig +if ARCH_CHIP_IMX1 +source arch/arm/src/imx1/Kconfig endif if ARCH_CHIP_KINETIS source arch/arm/src/kinetis/Kconfig diff --git a/arch/arm/src/imx1/Kconfig b/arch/arm/src/imx1/Kconfig index c9239521b3..68e3fde23b 100644 --- a/arch/arm/src/imx1/Kconfig +++ b/arch/arm/src/imx1/Kconfig @@ -3,37 +3,33 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -if ARCH_CHIP_IMX +if ARCH_CHIP_IMX1 -# choice "iMX Chip Selection" +# choice "iMX.1 Chip Selection" -config ARCH_CHIP_IMX1 - bool - default y +menu "iMX.1 Peripheral Selection" -menu "iMX Peripheral Selection" - -config IMX_UART1 +config IMX1_UART1 bool "UART1" default n select ARCH_HAVE_UART1 -config IMX_UART2 +config IMX1_UART2 bool "UART2" default n select ARCH_HAVE_UART2 -config IMX_UART3 +config IMX1_UART3 bool "UART2" default n select ARCH_HAVE_UART3 -config IMX_SPI1 +config IMX1_SPI1 bool "SPI1" default n select SPI -config IMX_SPI2 +config IMX1_SPI2 bool "SPI2" default n select SPI @@ -46,4 +42,4 @@ config RAM_NUTTXENTRY ---help--- The virtual address of the NuttX entry point -endif +endif # ARCH_CHIP_IMX1 diff --git a/arch/arm/src/imx1/imx_serial.c b/arch/arm/src/imx1/imx_serial.c index 70c353627b..ac93aa949b 100644 --- a/arch/arm/src/imx1/imx_serial.c +++ b/arch/arm/src/imx1/imx_serial.c @@ -70,8 +70,8 @@ /* The i.MXL chip has only two UARTs */ -#if defined(CONFIG_ARCH_CHIP_IMXL) && defined(CONFIG_IMX_UART3) -# undef CONFIG_IMX_UART3 +#if defined(CONFIG_ARCH_CHIP_IMXL) && defined(CONFIG_IMX1_UART3) +# undef CONFIG_IMX1_UART3 #endif /**************************************************************************** @@ -146,24 +146,24 @@ static const struct uart_ops_s g_uart_ops = /* I/O buffers */ -#ifdef CONFIG_IMX_UART1 +#ifdef CONFIG_IMX1_UART1 static char g_uart1rxbuffer[CONFIG_UART1_RXBUFSIZE]; static char g_uart1txbuffer[CONFIG_UART1_TXBUFSIZE]; #endif -#ifdef CONFIG_IMX_UART2 +#ifdef CONFIG_IMX1_UART2 static char g_uart2rxbuffer[CONFIG_UART2_RXBUFSIZE]; static char g_uart2txbuffer[CONFIG_UART2_TXBUFSIZE]; #endif -#ifdef CONFIG_IMX_UART3 +#ifdef CONFIG_IMX1_UART3 static char g_uart3rxbuffer[CONFIG_UART2_RXBUFSIZE]; static char g_uart3txbuffer[CONFIG_UART2_TXBUFSIZE]; #endif /* This describes the state of the IMX uart1 port. */ -#ifdef CONFIG_IMX_UART1 +#ifdef CONFIG_IMX1_UART1 static struct up_dev_s g_uart1priv = { .uartbase = IMX_UART1_VBASE, @@ -198,7 +198,7 @@ static uart_dev_t g_uart1port = /* This describes the state of the IMX uart2 port. */ -#ifdef CONFIG_IMX_UART2 +#ifdef CONFIG_IMX1_UART2 static struct up_dev_s g_uart2priv = { .uartbase = IMX_UART2_VBASE, @@ -231,7 +231,7 @@ static uart_dev_t g_uart2port = }; #endif -#ifdef CONFIG_IMX_UART3 +#ifdef CONFIG_IMX1_UART3 static struct up_dev_s g_uart3priv = { .uartbase = IMX_UART3_REGISTER_BASE, @@ -266,19 +266,19 @@ static uart_dev_t g_uart3port = /* Now, which one with be tty0/console and which tty1 and tty2? */ -#if defined(CONFIG_UART1_SERIAL_CONSOLE) && defined(CONFIG_IMX_UART1) +#if defined(CONFIG_UART1_SERIAL_CONSOLE) && defined(CONFIG_IMX1_UART1) # define CONSOLE_DEV g_uart1port /* UART1 is /dev/console */ # undef CONFIG_UART2_SERIAL_CONSOLE # undef CONFIG_UART3_SERIAL_CONSOLE # define TTYS0_DEV g_uart1port /* UART1 is /dev/ttyS0 */ -# if defined(CONFIG_IMX_UART2) +# if defined(CONFIG_IMX1_UART2) # define TTYS1_DEV g_uart2port /* UART2 is /dev/ttyS1 */ -# if defined(CONFIG_IMX_UART3) +# if defined(CONFIG_IMX1_UART3) # define TTYS2_DEV g_uart3port /* UART3 is /dev/ttyS2 */ # else # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -# elif defined(CONFIG_IMX_UART3) +# elif defined(CONFIG_IMX1_UART3) # define TTYS1_DEV g_uart3port /* UART3 is /dev/ttyS1 */ # undef TTYS2_DEV /* No /dev/ttyS2 */ # else @@ -286,38 +286,38 @@ static uart_dev_t g_uart3port = # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -#elif defined(CONFIG_UART2_SERIAL_CONSOLE) && defined(CONFIG_IMX_UART2) +#elif defined(CONFIG_UART2_SERIAL_CONSOLE) && defined(CONFIG_IMX1_UART2) # define CONSOLE_DEV g_uart2port /* UART2 is /dev/console */ # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_UART3_SERIAL_CONSOLE # define TTYS0_DEV g_uart2port /* UART2 is /dev/ttyS0 */ -# if defined(CONFIG_IMX_UART1) +# if defined(CONFIG_IMX1_UART1) # define TTYS1_DEV g_uart1port /* UART1 is /dev/ttyS1 */ -# if defined(CONFIG_IMX_UART3) +# if defined(CONFIG_IMX1_UART3) # define TTYS2_DEV g_uart3port /* UART3 is /dev/ttyS2 */ # else # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -# elif defined(CONFIG_IMX_UART3) +# elif defined(CONFIG_IMX1_UART3) # define TTYS1_DEV g_uart3port /* UART3 is /dev/ttyS1 */ # else # undef TTYS1_DEV /* No /dev/ttyS1 */ # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -#elif defined(CONFIG_UART3_SERIAL_CONSOLE) && defined(CONFIG_IMX_UART3) +#elif defined(CONFIG_UART3_SERIAL_CONSOLE) && defined(CONFIG_IMX1_UART3) # define CONSOLE_DEV g_uart3port /* UART3 is /dev/console */ # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_UART2_SERIAL_CONSOLE # define TTYS0_DEV g_uart3port /* UART3 is /dev/ttyS0 */ -# if defined(CONFIG_IMX_UART1) +# if defined(CONFIG_IMX1_UART1) # define TTYS1_DEV g_uart1port /* UART1 is /dev/ttyS1 */ -# if defined(CONFIG_IMX_UART2) +# if defined(CONFIG_IMX1_UART2) # define TTYS2_DEV g_uart2port /* UART2 is /dev/ttyS2 */ # else # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -# elif defined(CONFIG_IMX_UART2) +# elif defined(CONFIG_IMX1_UART2) # define TTYS1_DEV g_uart2port /* UART2 is /dev/ttyS1 */ # undef TTYS2_DEV /* No /dev/ttyS2 */ # else @@ -331,16 +331,16 @@ static uart_dev_t g_uart3port = # undef CONFIG_UART2_SERIAL_CONSOLE # undef CONFIG_UART3_SERIAL_CONSOLE -# if defined(CONFIG_IMX_UART1) +# if defined(CONFIG_IMX1_UART1) # define TTYS0_DEV g_uart1port /* UART1 is /dev/ttyS0 */ -# if defined(CONFIG_IMX_UART2) +# if defined(CONFIG_IMX1_UART2) # define TTYS1_DEV g_uart2port /* UART2 is /dev/ttyS1 */ -# if defined(CONFIG_IMX_UART3) +# if defined(CONFIG_IMX1_UART3) # define TTYS2_DEV g_uart3port /* UART3 is /dev/ttyS2 */ # else # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -# elif defined(CONFIG_IMX_UART3) +# elif defined(CONFIG_IMX1_UART3) # define TTYS1_DEV g_uart3port /* UART3 is /dev/ttyS1 */ # undef TTYS2_DEV /* No /dev/ttyS2 */ # else @@ -348,16 +348,16 @@ static uart_dev_t g_uart3port = # undef TTYS2_DEV /* No /dev/ttyS2 */ # endif -# elif defined(CONFIG_IMX_UART2) +# elif defined(CONFIG_IMX1_UART2) # define TTYS0_DEV g_uart2port /* UART2 is /dev/ttyS0 */ # undef TTYS2_DEV /* No /dev/ttyS2 */ -# if defined(CONFIG_IMX_UART3) +# if defined(CONFIG_IMX1_UART3) # define TTYS1_DEV g_uart2port /* UART2 is /dev/ttyS1 */ # else # undef TTYS1_DEV /* No /dev/ttyS1 */ # endif -# elif defined(CONFIG_IMX_UART3) +# elif defined(CONFIG_IMX1_UART3) # define TTYS0_DEV g_uart3port /* UART3 is /dev/ttyS0 */ # undef TTYS1_DEV /* No /dev/ttyS1 */ # undef TTYS2_DEV /* No /dev/ttyS2 */ @@ -767,7 +767,7 @@ static inline struct uart_dev_s *up_mapirq(int irq) switch (irq) { -#ifdef CONFIG_IMX_UART1 +#ifdef CONFIG_IMX1_UART1 #if defined(CONFIG_ARCH_CHIP_IMX1) || defined(CONFIG_ARCH_CHIP_IMXL) case IMX_IRQ_UART1RX: case IMX_IRQ_UART1TX: @@ -778,7 +778,7 @@ static inline struct uart_dev_s *up_mapirq(int irq) break; #endif -#ifdef CONFIG_IMX_UART2 +#ifdef CONFIG_IMX1_UART2 #if defined(CONFIG_ARCH_CHIP_IMX1) || defined(CONFIG_ARCH_CHIP_IMXL) case IMX_IRQ_UART2RX: case IMX_IRQ_UART2TX: @@ -789,7 +789,7 @@ static inline struct uart_dev_s *up_mapirq(int irq) break; #endif -#ifdef CONFIG_IMX_UART3 +#ifdef CONFIG_IMX1_UART3 #if defined(CONFIG_ARCH_CHIP_IMX1) || defined(CONFIG_ARCH_CHIP_IMXL) case IMX_IRQ_UART3RX: case IMX_IRQ_UART3TX: @@ -1074,7 +1074,7 @@ void up_earlyserialinit(void) { /* Configure and disable the UART1 */ -#ifdef CONFIG_IMX_UART1 +#ifdef CONFIG_IMX1_UART1 up_serialout(&g_uart1priv, UART_UCR1, 0); up_serialout(&g_uart1priv, UART_UCR2, 0); @@ -1088,7 +1088,7 @@ void up_earlyserialinit(void) /* Configure and disable the UART2 */ -#ifdef CONFIG_IMX_UART2 +#ifdef CONFIG_IMX1_UART2 up_serialout(&g_uart2priv, UART_UCR1, 0); up_serialout(&g_uart2priv, UART_UCR2, 0); @@ -1104,7 +1104,7 @@ void up_earlyserialinit(void) /* Configure and disable the UART3 */ -#ifdef CONFIG_IMX_UART3 +#ifdef CONFIG_IMX1_UART3 up_serialout(&g_uart3priv, UART_UCR1, 0); up_serialout(&g_uart3priv, UART_UCR2, 0); diff --git a/arch/arm/src/imx1/imx_spi.c b/arch/arm/src/imx1/imx_spi.c index c47aaa7eaf..fb58314386 100644 --- a/arch/arm/src/imx1/imx_spi.c +++ b/arch/arm/src/imx1/imx_spi.c @@ -65,16 +65,16 @@ /* The i.MX1/L supports 2 SPI interfaces. Which have been enabled? */ -#ifdef CONFIG_IMX_SPI1 +#ifdef CONFIG_IMX1_SPI1 # define SPI1_NDX 0 /* Index to SPI1 in g_spidev[] */ -# ifdef CONFIG_IMX_SPI2 +# ifdef CONFIG_IMX1_SPI2 # define SPI2_NDX 1 /* Index to SPI2 in g_spidev[] */ # define NSPIS 2 /* Two SPI interfaces: SPI1 & SPI2 */ # else # define NSPIS 1 /* One SPI interface: SPI1 */ # endif #else -# ifdef CONFIG_IMX_SPI2 +# ifdef CONFIG_IMX1_SPI2 # define SPI2_NDX 0 /* Index to SPI2 in g_spidev[] */ # define NSPIS 1 /* One SPI interface: SPI2 */ # else @@ -215,7 +215,7 @@ static const struct spi_ops_s g_spiops = static struct imx_spidev_s g_spidev[] = { -#ifdef CONFIG_IMX_SPI1 +#ifdef CONFIG_IMX1_SPI1 { .ops = &g_spiops, .base = IMX_CSPI1_VBASE, @@ -224,7 +224,7 @@ static struct imx_spidev_s g_spidev[] = #endif }, #endif -#ifdef CONFIG_IMX_SPI2 +#ifdef CONFIG_IMX1_SPI2 { .ops = &g_spiops, .base = IMX_CSPI2_VBASE, @@ -617,11 +617,11 @@ static inline struct imx_spidev_s *spi_mapirq(int irq) { switch (irq) { -#ifdef CONFIG_IMX_SPI1 +#ifdef CONFIG_IMX1_SPI1 case IMX_IRQ_CSPI1: return &g_spidev[SPI1_NDX]; #endif -#ifdef CONFIG_IMX_SPI2 +#ifdef CONFIG_IMX1_SPI2 case IMX_IRQ_CSPI2: return &g_spidev[SPI2_NDX]; #endif @@ -1040,7 +1040,7 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port) switch (port) { -#ifdef CONFIG_IMX_SPI1 +#ifdef CONFIG_IMX1_SPI1 case 1: /* Select SPI1 */ @@ -1055,9 +1055,9 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port) imxgpio_configpfinput(GPIOC, 16); /* Port C, pin 16: MISO */ imxgpio_configpfoutput(GPIOC, 17); /* Port C, pin 17: MOSI */ break; -#endif /* CONFIG_IMX_SPI1 */ +#endif /* CONFIG_IMX1_SPI1 */ -#ifdef CONFIG_IMX_SPI2 +#ifdef CONFIG_IMX1_SPI2 case 2: /* Select SPI2 */ @@ -1107,7 +1107,7 @@ FAR struct spi_dev_s *imx_spibus_initialize(int port) imxgpio_configoutput(GPIOD, 10); #endif break; -#endif /* CONFIG_IMX_SPI2 */ +#endif /* CONFIG_IMX1_SPI2 */ default: return NULL;