diff --git a/arch/arm/src/lm/lm_serial.c b/arch/arm/src/lm/lm_serial.c index f2e9796cfe..52773608e1 100644 --- a/arch/arm/src/lm/lm_serial.c +++ b/arch/arm/src/lm/lm_serial.c @@ -119,28 +119,28 @@ # define TTYS5_DEV g_uart7port /* UART7 is ttyS0 */ #else # undef CONSOLE_DEV /* No console */ -# if defined(CONFIG_KINETIS_UART0) +# if defined(CONFIG_LM_UART0) # define TTYS0_DEV g_uart0port /* UART0 is ttyS0 */ # define UART0_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART1) +# elif defined(CONFIG_LM_UART1) # define TTYS0_DEV g_uart1port /* UART1 is ttyS0 */ # define UART1_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART2) +# elif defined(CONFIG_LM_UART2) # define TTYS0_DEV g_uart2port /* UART2 is ttyS0 */ # define UART2_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART3) +# elif defined(CONFIG_LM_UART3) # define TTYS0_DEV g_uart3port /* UART3 is ttyS0 */ # define UART3_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART4) +# elif defined(CONFIG_LM_UART4) # define TTYS0_DEV g_uart4port /* UART4 is ttyS0 */ # define UART4_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART5) +# elif defined(CONFIG_LM_UART5) # define TTYS0_DEV g_uart5port /* UART5 is ttyS0 */ # define UART5_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART6) +# elif defined(CONFIG_LM_UART6) # define TTYS0_DEV g_uart6port /* UART5 is ttyS0 */ # define UART6_ASSIGNED 1 -# elif defined(CONFIG_KINETIS_UART7) +# elif defined(CONFIG_LM_UART7) # define TTYS0_DEV g_uart7port /* UART5 is ttyS0 */ # define UART7_ASSIGNED 1 # endif @@ -148,28 +148,28 @@ /* Pick ttys1. This could be any of UART0-7 excluding the console UART. */ -#if defined(CONFIG_KINETIS_UART0) && !defined(UART0_ASSIGNED) +#if defined(CONFIG_LM_UART0) && !defined(UART0_ASSIGNED) # define TTYS1_DEV g_uart0port /* UART0 is ttyS1 */ # define UART0_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART1) && !defined(UART1_ASSIGNED) +#elif defined(CONFIG_LM_UART1) && !defined(UART1_ASSIGNED) # define TTYS1_DEV g_uart1port /* UART1 is ttyS1 */ # define UART1_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART2) && !defined(UART2_ASSIGNED) +#elif defined(CONFIG_LM_UART2) && !defined(UART2_ASSIGNED) # define TTYS1_DEV g_uart2port /* UART2 is ttyS1 */ # define UART2_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART3) && !defined(UART3_ASSIGNED) +#elif defined(CONFIG_LM_UART3) && !defined(UART3_ASSIGNED) # define TTYS1_DEV g_uart3port /* UART3 is ttyS1 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART4) && !defined(UART4_ASSIGNED) +#elif defined(CONFIG_LM_UART4) && !defined(UART4_ASSIGNED) # define TTYS1_DEV g_uart4port /* UART4 is ttyS1 */ # define UART4_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART5) && !defined(UART5_ASSIGNED) +#elif defined(CONFIG_LM_UART5) && !defined(UART5_ASSIGNED) # define TTYS1_DEV g_uart5port /* UART5 is ttyS1 */ # define UART5_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#elif defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS1_DEV g_uart6port /* UART6 is ttyS1 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS1_DEV g_uart7port /* UART7 is ttyS1 */ # define UART7_ASSIGNED 1 #endif @@ -179,25 +179,25 @@ * console. */ -#if defined(CONFIG_KINETIS_UART1) && !defined(UART1_ASSIGNED) +#if defined(CONFIG_LM_UART1) && !defined(UART1_ASSIGNED) # define TTYS2_DEV g_uart1port /* UART1 is ttyS2 */ # define UART1_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART2) && !defined(UART2_ASSIGNED) +#elif defined(CONFIG_LM_UART2) && !defined(UART2_ASSIGNED) # define TTYS2_DEV g_uart2port /* UART2 is ttyS2 */ # define UART2_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART3) && !defined(UART3_ASSIGNED) +#elif defined(CONFIG_LM_UART3) && !defined(UART3_ASSIGNED) # define TTYS2_DEV g_uart3port /* UART3 is ttyS2 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART4) && !defined(UART4_ASSIGNED) +#elif defined(CONFIG_LM_UART4) && !defined(UART4_ASSIGNED) # define TTYS2_DEV g_uart4port /* UART4 is ttyS2 */ # define UART4_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART5) && !defined(UART5_ASSIGNED) +#elif defined(CONFIG_LM_UART5) && !defined(UART5_ASSIGNED) # define TTYS2_DEV g_uart5port /* UART5 is ttyS2 */ # define UART5_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#elif defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS2_DEV g_uart6port /* UART6 is ttyS2 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS2_DEV g_uart7port /* UART7 is ttyS2 */ # define UART7_ASSIGNED 1 #endif @@ -207,22 +207,22 @@ * UART 2-7 could also be the console. */ -#if defined(CONFIG_KINETIS_UART2) && !defined(UART2_ASSIGNED) +#if defined(CONFIG_LM_UART2) && !defined(UART2_ASSIGNED) # define TTYS3_DEV g_uart2port /* UART2 is ttyS3 */ # define UART2_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART3) && !defined(UART3_ASSIGNED) +#elif defined(CONFIG_LM_UART3) && !defined(UART3_ASSIGNED) # define TTYS3_DEV g_uart3port /* UART3 is ttyS3 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART4) && !defined(UART4_ASSIGNED) +#elif defined(CONFIG_LM_UART4) && !defined(UART4_ASSIGNED) # define TTYS3_DEV g_uart4port /* UART4 is ttyS3 */ # define UART4_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART5) && !defined(UART5_ASSIGNED) +#elif defined(CONFIG_LM_UART5) && !defined(UART5_ASSIGNED) # define TTYS3_DEV g_uart5port /* UART5 is ttyS3 */ # define UART5_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#elif defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS3_DEV g_uart6port /* UART6 is ttyS3 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS3_DEV g_uart7port /* UART7 is ttyS3 */ # define UART7_ASSIGNED 1 #endif @@ -232,19 +232,19 @@ * UART 3-7 could also be the console. */ -#if defined(CONFIG_KINETIS_UART3) && !defined(UART3_ASSIGNED) +#if defined(CONFIG_LM_UART3) && !defined(UART3_ASSIGNED) # define TTYS4_DEV g_uart3port /* UART3 is ttyS4 */ # define UART3_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART4) && !defined(UART4_ASSIGNED) +#elif defined(CONFIG_LM_UART4) && !defined(UART4_ASSIGNED) # define TTYS4_DEV g_uart4port /* UART4 is ttyS4 */ # define UART4_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART5) && !defined(UART5_ASSIGNED) +#elif defined(CONFIG_LM_UART5) && !defined(UART5_ASSIGNED) # define TTYS4_DEV g_uart5port /* UART5 is ttyS4 */ # define UART5_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#elif defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS4_DEV g_uart6port /* UART6 is ttyS4 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS4_DEV g_uart7port /* UART7 is ttyS4 */ # define UART7_ASSIGNED 1 #endif @@ -254,16 +254,16 @@ * UART 4-7 could also be the console. */ -#if defined(CONFIG_KINETIS_UART4) && !defined(UART4_ASSIGNED) +#if defined(CONFIG_LM_UART4) && !defined(UART4_ASSIGNED) # define TTYS5_DEV g_uart4port /* UART4 is ttyS5 */ # define UART4_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART5) && !defined(UART5_ASSIGNED) +#elif defined(CONFIG_LM_UART5) && !defined(UART5_ASSIGNED) # define TTYS5_DEV g_uart5port /* UART5 is ttyS5 */ # define UART5_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#elif defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS5_DEV g_uart6port /* UART6 is ttyS5 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS5_DEV g_uart7port /* UART7 is ttyS5 */ # define UART7_ASSIGNED 1 #endif @@ -273,13 +273,13 @@ * UART 5-7 could also be the console. */ -#if defined(CONFIG_KINETIS_UART5) && !defined(UART5_ASSIGNED) +#if defined(CONFIG_LM_UART5) && !defined(UART5_ASSIGNED) # define TTYS6_DEV g_uart5port /* UART5 is ttyS6 */ # define UART5_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#elif defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS6_DEV g_uart6port /* UART6 is ttyS6 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS6_DEV g_uart7port /* UART7 is ttyS6 */ # define UART7_ASSIGNED 1 #endif @@ -289,10 +289,10 @@ * UART 6-7 could also be the console. */ -#if defined(CONFIG_KINETIS_UART6) && !defined(UART6_ASSIGNED) +#if defined(CONFIG_LM_UART6) && !defined(UART6_ASSIGNED) # define TTYS7_DEV g_uart6port /* UART6 is ttyS7 */ # define UART6_ASSIGNED 1 -#elif defined(CONFIG_KINETIS_UART7) && !defined(UART7_ASSIGNED) +#elif defined(CONFIG_LM_UART7) && !defined(UART7_ASSIGNED) # define TTYS7_DEV g_uart7port /* UART7 is ttyS7 */ # define UART7_ASSIGNED 1 #endif @@ -1013,8 +1013,10 @@ static int up_interrupt(int irq, void *context) static int up_ioctl(struct file *filep, int cmd, unsigned long arg) { +#ifdef CONFIG_SERIAL_TIOCSERGSTRUCT struct inode *inode = filep->f_inode; struct uart_dev_s *dev = inode->i_private; +#endif int ret = OK; switch (cmd)