LM3/4: Several errors were unmasked with UARTs > UART2 were enabled. Fromo Gosha

This commit is contained in:
Gregory Nutt 2014-02-19 17:02:30 -06:00
parent ff899bf0e3
commit 951f4ff4a3
3 changed files with 50 additions and 8 deletions

View File

@ -6624,4 +6624,6 @@
* arch/arm/src/samd/sam_spi.c: Add framework for a SAMD SPI driver.
The initial check-in is a crude port of the SAMA5 SPI driver with
a lot of missing logic (2014-2-19).
* arch/arm/src/lm/lm_lowputc.c and lm_serial.c: Several errors
are unmasked with UARTs > UART2 are enabled. From gosha (2014-2-19).

View File

@ -77,31 +77,31 @@
# define LM_CONSOLE_PARITY CONFIG_UART2_PARITY
# define LM_CONSOLE_2STOP CONFIG_UART2_2STOP
#elif defined(CONFIG_UART3_SERIAL_CONSOLE)
# define LM_CONSOLE_BASE LM_UART2_BASE
# define LM_CONSOLE_BASE LM_UART3_BASE
# define LM_CONSOLE_BAUD CONFIG_UART3_BAUD
# define LM_CONSOLE_BITS CONFIG_UART3_BITS
# define LM_CONSOLE_PARITY CONFIG_UART3_PARITY
# define LM_CONSOLE_2STOP CONFIG_UART3_2STOP
#elif defined(CONFIG_UART4_SERIAL_CONSOLE)
# define LM_CONSOLE_BASE LM_UART2_BASE
# define LM_CONSOLE_BASE LM_UART4_BASE
# define LM_CONSOLE_BAUD CONFIG_UART4_BAUD
# define LM_CONSOLE_BITS CONFIG_UART4_BITS
# define LM_CONSOLE_PARITY CONFIG_UART4_PARITY
# define LM_CONSOLE_2STOP CONFIG_UART4_2STOP
#elif defined(CONFIG_UART5_SERIAL_CONSOLE)
# define LM_CONSOLE_BASE LM_UART2_BASE
# define LM_CONSOLE_BASE LM_UART5_BASE
# define LM_CONSOLE_BAUD CONFIG_UART5_BAUD
# define LM_CONSOLE_BITS CONFIG_UART5_BITS
# define LM_CONSOLE_PARITY CONFIG_UART5_PARITY
# define LM_CONSOLE_2STOP CONFIG_UART5_2STOP
#elif defined(CONFIG_UART6_SERIAL_CONSOLE)
# define LM_CONSOLE_BASE LM_UART2_BASE
# define LM_CONSOLE_BASE LM_UART6_BASE
# define LM_CONSOLE_BAUD CONFIG_UART6_BAUD
# define LM_CONSOLE_BITS CONFIG_UART6_BITS
# define LM_CONSOLE_PARITY CONFIG_UART6_PARITY
# define LM_CONSOLE_2STOP CONFIG_UART6_2STOP
#elif defined(CONFIG_UART7_SERIAL_CONSOLE)
# define LM_CONSOLE_BASE LM_UART2_BASE
# define LM_CONSOLE_BASE LM_UART7_BASE
# define LM_CONSOLE_BAUD CONFIG_UART7_BAUD
# define LM_CONSOLE_BITS CONFIG_UART7_BITS
# define LM_CONSOLE_PARITY CONFIG_UART7_PARITY
@ -354,7 +354,4 @@ void up_lowsetup(void)
ctl |= (UART_CTL_UARTEN|UART_CTL_TXE|UART_CTL_RXE);
putreg32(ctl, LM_CONSOLE_BASE+LM_UART_CTL_OFFSET);
#endif
}

View File

@ -960,10 +960,53 @@ static int up_interrupt(int irq, void *context)
dev = &g_uart1port;
}
else
#endif
#ifdef CONFIG_LM_UART2
if (g_uart2priv.irq == irq)
{
dev = &g_uart2port;
}
else
#endif
#ifdef CONFIG_LM_UART3
if (g_uart3priv.irq == irq)
{
dev = &g_uart3port;
}
else
#endif
#ifdef CONFIG_LM_UART4
if (g_uart4priv.irq == irq)
{
dev = &g_uart4port;
}
else
#endif
#ifdef CONFIG_LM_UART5
if (g_uart5priv.irq == irq)
{
dev = &g_uart5port;
}
else
#endif
#ifdef CONFIG_LM_UART6
if (g_uart6priv.irq == irq)
{
dev = &g_uart6port;
}
else
#endif
#ifdef CONFIG_LM_UART7
if (g_uart7priv.irq == irq)
{
dev = &g_uart7port;
}
else
#endif
{
PANIC();
}
priv = (struct up_dev_s*)dev->priv;
/* Loop until there are no characters to be transferred or,