diff options
Diffstat (limited to 'drivers/serial/imx.c')
| -rw-r--r-- | drivers/serial/imx.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 4d53fb5ca87b..c3b7a6673e9c 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
| @@ -743,6 +743,13 @@ static void __init imx_init_ports(void) | |||
| 743 | } | 743 | } |
| 744 | 744 | ||
| 745 | #ifdef CONFIG_SERIAL_IMX_CONSOLE | 745 | #ifdef CONFIG_SERIAL_IMX_CONSOLE |
| 746 | static void imx_console_putchar(struct uart_port *port, int ch) | ||
| 747 | { | ||
| 748 | struct imx_port *sport = (struct imx_port *)port; | ||
| 749 | while ((UTS((u32)sport->port.membase) & UTS_TXFULL)) | ||
| 750 | barrier(); | ||
| 751 | URTX0((u32)sport->port.membase) = ch; | ||
| 752 | } | ||
| 746 | 753 | ||
| 747 | /* | 754 | /* |
| 748 | * Interrupts are disabled on entering | 755 | * Interrupts are disabled on entering |
| @@ -751,7 +758,7 @@ static void | |||
| 751 | imx_console_write(struct console *co, const char *s, unsigned int count) | 758 | imx_console_write(struct console *co, const char *s, unsigned int count) |
| 752 | { | 759 | { |
| 753 | struct imx_port *sport = &imx_ports[co->index]; | 760 | struct imx_port *sport = &imx_ports[co->index]; |
| 754 | unsigned int old_ucr1, old_ucr2, i; | 761 | unsigned int old_ucr1, old_ucr2; |
| 755 | 762 | ||
| 756 | /* | 763 | /* |
| 757 | * First, save UCR1/2 and then disable interrupts | 764 | * First, save UCR1/2 and then disable interrupts |
| @@ -764,22 +771,7 @@ imx_console_write(struct console *co, const char *s, unsigned int count) | |||
| 764 | & ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN); | 771 | & ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN); |
| 765 | UCR2((u32)sport->port.membase) = old_ucr2 | UCR2_TXEN; | 772 | UCR2((u32)sport->port.membase) = old_ucr2 | UCR2_TXEN; |
| 766 | 773 | ||
| 767 | /* | 774 | uart_console_write(&sport->port, s, count, imx_console_putchar); |
| 768 | * Now, do each character | ||
| 769 | */ | ||
| 770 | for (i = 0; i < count; i++) { | ||
| 771 | |||
| 772 | while ((UTS((u32)sport->port.membase) & UTS_TXFULL)) | ||
| 773 | barrier(); | ||
| 774 | |||
| 775 | URTX0((u32)sport->port.membase) = s[i]; | ||
| 776 | |||
| 777 | if (s[i] == '\n') { | ||
| 778 | while ((UTS((u32)sport->port.membase) & UTS_TXFULL)) | ||
| 779 | barrier(); | ||
| 780 | URTX0((u32)sport->port.membase) = '\r'; | ||
| 781 | } | ||
| 782 | } | ||
| 783 | 775 | ||
| 784 | /* | 776 | /* |
| 785 | * Finally, wait for transmitter to become empty | 777 | * Finally, wait for transmitter to become empty |
