aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/meson_uart.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-14 00:05:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-14 00:05:31 -0500
commitfb0255fb2941ef6f21742b2bc146d6b9aef4fedc (patch)
tree8334f3485152b1c887ddfe04ba9a95c8a704481c /drivers/tty/serial/meson_uart.c
parent449fcf3ab0baf3dde9952385e6789f2ca10c3980 (diff)
parent57f5d648c45c3d40a3257c06629c14fd53c383bc (diff)
Merge tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial updates from Greg KH: "Here is the big tty/serial driver pull request for 4.15-rc1. Lots of serial driver updates in here, some small vt cleanups, and a raft of SPDX and license boilerplate cleanups, messing up the diffstat a bit. Nothing major, with no realy functional changes except better hardware support for some platforms. All of these have been in linux-next for a while with no reported issues" * tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (110 commits) tty: ehv_bytechan: fix spelling mistake tty: serial: meson: allow baud-rates lower than 9600 serial: 8250_fintek: Fix crash with baud rate B0 serial: 8250_fintek: Disable delays for ports != 0 serial: 8250_fintek: Return -EINVAL on invalid configuration tty: Remove redundant license text tty: serdev: Remove redundant license text tty: hvc: Remove redundant license text tty: serial: Remove redundant license text tty: add SPDX identifiers to all remaining files in drivers/tty/ tty: serial: jsm: remove redundant pointer ts tty: serial: jsm: add space before the open parenthesis '(' tty: serial: jsm: fix coding style tty: serial: jsm: delete space between function name and '(' tty: serial: jsm: add blank line after declarations tty: serial: jsm: change the type of local variable tty: serial: imx: remove dead code imx_dma_rxint tty: serial: imx: disable ageing timer interrupt if dma in use serial: 8250: fix potential deadlock in rs485-mode serial: m32r_sio: Drop redundant .data assignment ...
Diffstat (limited to 'drivers/tty/serial/meson_uart.c')
-rw-r--r--drivers/tty/serial/meson_uart.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 07c0f98be3ac..daafe60175da 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -1,19 +1,14 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Based on meson_uart.c, by AMLOGIC, INC. 3 * Based on meson_uart.c, by AMLOGIC, INC.
3 * 4 *
4 * Copyright (C) 2014 Carlo Caione <carlo@caione.org> 5 * Copyright (C) 2014 Carlo Caione <carlo@caione.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */ 6 */
16 7
8#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
9#define SUPPORT_SYSRQ
10#endif
11
17#include <linux/clk.h> 12#include <linux/clk.h>
18#include <linux/console.h> 13#include <linux/console.h>
19#include <linux/delay.h> 14#include <linux/delay.h>
@@ -183,12 +178,12 @@ static void meson_receive_chars(struct uart_port *port)
183{ 178{
184 struct tty_port *tport = &port->state->port; 179 struct tty_port *tport = &port->state->port;
185 char flag; 180 char flag;
186 u32 status, ch, mode; 181 u32 ostatus, status, ch, mode;
187 182
188 do { 183 do {
189 flag = TTY_NORMAL; 184 flag = TTY_NORMAL;
190 port->icount.rx++; 185 port->icount.rx++;
191 status = readl(port->membase + AML_UART_STATUS); 186 ostatus = status = readl(port->membase + AML_UART_STATUS);
192 187
193 if (status & AML_UART_ERR) { 188 if (status & AML_UART_ERR) {
194 if (status & AML_UART_TX_FIFO_WERR) 189 if (status & AML_UART_TX_FIFO_WERR)
@@ -216,6 +211,16 @@ static void meson_receive_chars(struct uart_port *port)
216 ch = readl(port->membase + AML_UART_RFIFO); 211 ch = readl(port->membase + AML_UART_RFIFO);
217 ch &= 0xff; 212 ch &= 0xff;
218 213
214 if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
215 port->icount.brk++;
216 flag = TTY_BREAK;
217 if (uart_handle_break(port))
218 continue;
219 }
220
221 if (uart_handle_sysrq_char(port, ch))
222 continue;
223
219 if ((status & port->ignore_status_mask) == 0) 224 if ((status & port->ignore_status_mask) == 0)
220 tty_insert_flip_char(tport, ch, flag); 225 tty_insert_flip_char(tport, ch, flag);
221 226
@@ -362,7 +367,7 @@ static void meson_uart_set_termios(struct uart_port *port,
362 367
363 writel(val, port->membase + AML_UART_CONTROL); 368 writel(val, port->membase + AML_UART_CONTROL);
364 369
365 baud = uart_get_baud_rate(port, termios, old, 9600, 4000000); 370 baud = uart_get_baud_rate(port, termios, old, 50, 4000000);
366 meson_uart_change_speed(port, baud); 371 meson_uart_change_speed(port, baud);
367 372
368 port->read_status_mask = AML_UART_TX_FIFO_WERR; 373 port->read_status_mask = AML_UART_TX_FIFO_WERR;