From c63847a3621d2bac054f5709783860ecabd0ee7e Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 6 Jun 2008 17:04:08 +0900 Subject: sh: Add SCIF2 support for SH7763. SH7763 has 3 SCIF device. Current code supports SCIF0 and 1. SCIF0 and 1 are same register constitution, but only SCIF2 is different. I added support of SCIF2. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Paul Mundt --- drivers/serial/sh-sci.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'drivers/serial/sh-sci.c') diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 208e42ba945..3df2aaec829 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c @@ -410,7 +410,6 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) #endif #if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ - defined(CONFIG_CPU_SUBTYPE_SH7763) || \ defined(CONFIG_CPU_SUBTYPE_SH7780) || \ defined(CONFIG_CPU_SUBTYPE_SH7785) static inline int scif_txroom(struct uart_port *port) @@ -422,6 +421,22 @@ static inline int scif_rxroom(struct uart_port *port) { return sci_in(port, SCRFDR) & 0xff; } +#elif defined(CONFIG_CPU_SUBTYPE_SH7763) +static inline int scif_txroom(struct uart_port *port) +{ + if((port->mapbase == 0xffe00000) || (port->mapbase == 0xffe08000)) /* SCIF0/1*/ + return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff); + else /* SCIF2 */ + return SCIF2_TXROOM_MAX - (sci_in(port, SCFDR) >> 8); +} + +static inline int scif_rxroom(struct uart_port *port) +{ + if((port->mapbase == 0xffe00000) || (port->mapbase == 0xffe08000)) /* SCIF0/1*/ + return sci_in(port, SCRFDR) & 0xff; + else /* SCIF2 */ + return sci_in(port, SCFDR) & SCIF2_RFDC_MASK; +} #else static inline int scif_txroom(struct uart_port *port) { -- cgit v1.2.3