aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_lh7a40x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial_lh7a40x.c')
-rw-r--r--drivers/serial/serial_lh7a40x.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c
index aa521b8e0d4e..776d4ff06084 100644
--- a/drivers/serial/serial_lh7a40x.c
+++ b/drivers/serial/serial_lh7a40x.c
@@ -145,14 +145,15 @@ lh7a40xuart_rx_chars (struct uart_port* port)
145{ 145{
146 struct tty_struct* tty = port->info->tty; 146 struct tty_struct* tty = port->info->tty;
147 int cbRxMax = 256; /* (Gross) limit on receive */ 147 int cbRxMax = 256; /* (Gross) limit on receive */
148 unsigned int data, flag;/* Received data and status */ 148 unsigned int data; /* Received data and status */
149 unsigned int flag;
149 150
150 while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) { 151 while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) {
151 data = UR (port, UART_R_DATA); 152 data = UR (port, UART_R_DATA);
152 flag = TTY_NORMAL; 153 flag = TTY_NORMAL;
153 ++port->icount.rx; 154 ++port->icount.rx;
154 155
155 if (unlikely(data & RxError)) { /* Quick check, short-circuit */ 156 if (unlikely(data & RxError)) {
156 if (data & RxBreak) { 157 if (data & RxBreak) {
157 data &= ~(RxFramingError | RxParityError); 158 data &= ~(RxFramingError | RxParityError);
158 ++port->icount.brk; 159 ++port->icount.brk;
@@ -303,7 +304,7 @@ static void lh7a40xuart_set_mctrl (struct uart_port* port, unsigned int mctrl)
303 /* Note, kernel appears to be setting DTR and RTS on console. */ 304 /* Note, kernel appears to be setting DTR and RTS on console. */
304 305
305 /* *** FIXME: this deserves more work. There's some work in 306 /* *** FIXME: this deserves more work. There's some work in
306 tracing all of the IO pins. */ 307 tracing all of the IO pins. */
307#if 0 308#if 0
308 if( port->mapbase == UART1_PHYS) { 309 if( port->mapbase == UART1_PHYS) {
309 gpioRegs_t *gpio = (gpioRegs_t *)IO_ADDRESS(GPIO_PHYS); 310 gpioRegs_t *gpio = (gpioRegs_t *)IO_ADDRESS(GPIO_PHYS);
@@ -662,9 +663,13 @@ static int __init lh7a40xuart_init(void)
662 if (ret == 0) { 663 if (ret == 0) {
663 int i; 664 int i;
664 665
665 for (i = 0; i < DEV_NR; i++) 666 for (i = 0; i < DEV_NR; i++) {
667 /* UART3, when used, requires GPIO pin reallocation */
668 if (lh7a40x_ports[i].port.mapbase == UART3_PHYS)
669 GPIO_PINMUX |= 1<<3;
666 uart_add_one_port (&lh7a40x_reg, 670 uart_add_one_port (&lh7a40x_reg,
667 &lh7a40x_ports[i].port); 671 &lh7a40x_ports[i].port);
672 }
668 } 673 }
669 return ret; 674 return ret;
670} 675}