dc2ace7be2e0868207dc8b1376638ef3772d59e0
[openwrt/staging/ldir.git] /
1 From 74d7e639cce7ae95cacd948dcf5ed3b28c3fff5c Mon Sep 17 00:00:00 2001
2 From: Fugang Duan <fugang.duan@nxp.com>
3 Date: Mon, 28 Jan 2019 10:27:27 +0800
4 Subject: [PATCH] tty: serial: fsl_lpuart: add magic SysRq support
5
6 Add magic SysRq key support.
7
8 Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
9 ---
10 drivers/tty/serial/fsl_lpuart.c | 7 ++++++-
11 1 file changed, 6 insertions(+), 1 deletion(-)
12
13 --- a/drivers/tty/serial/fsl_lpuart.c
14 +++ b/drivers/tty/serial/fsl_lpuart.c
15 @@ -931,7 +931,12 @@ static void lpuart32_rxint(struct lpuart
16 */
17 sr = lpuart32_read(&sport->port, UARTSTAT);
18 rx = lpuart32_read(&sport->port, UARTDATA);
19 - rx &= 0x3ff;
20 +
21 + if ((sr & UARTSTAT_FE) && (rx & UARTDATA_FRETSC) &&
22 + !(rx & UARTDATA_MASK)) {
23 + if (uart_handle_break(&sport->port))
24 + continue;
25 + }
26
27 if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
28 continue;