1 From d9d3dc9a5a28b2bbb82fedca63aadae8ca540e94 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Sat, 19 Jun 2010 04:08:16 +0000
4 Subject: [PATCH] MIPS: JZ4740: Add serial support
6 The JZ4740 UART interface is almost 16550 compatible.
7 The UART module needs to be enabled by setting a bit in the FCR register
8 and it has support for receive timeout interrupts. Instead of adding yet
9 another machine specific quirk to the 8250 serial driver we provide a
10 serial_out implementation which sets the required additional flags.
12 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
13 Cc: linux-mips@linux-mips.org
14 Cc: linux-kernel@vger.kernel.org
15 Patchwork: https://patchwork.linux-mips.org/patch/1403/
16 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
18 arch/mips/jz4740/serial.c | 33 +++++++++++++++++++++++++++++++++
19 arch/mips/jz4740/serial.h | 20 ++++++++++++++++++++
20 2 files changed, 53 insertions(+), 0 deletions(-)
21 create mode 100644 arch/mips/jz4740/serial.c
22 create mode 100644 arch/mips/jz4740/serial.h
25 +++ b/arch/mips/jz4740/serial.c
28 + * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
29 + * JZ4740 serial support
31 + * This program is free software; you can redistribute it and/or modify it
32 + * under the terms of the GNU General Public License as published by the
33 + * Free Software Foundation; either version 2 of the License, or (at your
34 + * option) any later version.
36 + * You should have received a copy of the GNU General Public License along
37 + * with this program; if not, write to the Free Software Foundation, Inc.,
38 + * 675 Mass Ave, Cambridge, MA 02139, USA.
42 +#include <linux/io.h>
43 +#include <linux/serial_core.h>
44 +#include <linux/serial_reg.h>
46 +void jz4740_serial_out(struct uart_port *p, int offset, int value)
50 + value |= 0x10; /* Enable uart module */
53 + value |= (value & 0x4) << 2;
58 + writeb(value, p->membase + (offset << p->regshift));
61 +++ b/arch/mips/jz4740/serial.h
64 + * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
65 + * JZ4740 serial support
67 + * This program is free software; you can redistribute it and/or modify it
68 + * under the terms of the GNU General Public License as published by the
69 + * Free Software Foundation; either version 2 of the License, or (at your
70 + * option) any later version.
72 + * You should have received a copy of the GNU General Public License along
73 + * with this program; if not, write to the Free Software Foundation, Inc.,
74 + * 675 Mass Ave, Cambridge, MA 02139, USA.
78 +#ifndef __MIPS_JZ4740_SERIAL_H__
80 +void jz4740_serial_out(struct uart_port *p, int offset, int value);