aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sh-sci.c
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>2008-06-06 04:04:08 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-07-28 05:10:29 -0400
commitc63847a3621d2bac054f5709783860ecabd0ee7e (patch)
treea04e0aca07d0a672a56b1611544f7d2da0b621e4 /drivers/serial/sh-sci.c
parent04e917b606ffe6ec10fb75c21447162cba31f6b6 (diff)
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 <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/serial/sh-sci.c')
-rw-r--r--drivers/serial/sh-sci.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 208e42ba9455..3df2aaec829f 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)
410#endif 410#endif
411 411
412#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ 412#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
413 defined(CONFIG_CPU_SUBTYPE_SH7763) || \
414 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 413 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
415 defined(CONFIG_CPU_SUBTYPE_SH7785) 414 defined(CONFIG_CPU_SUBTYPE_SH7785)
416static inline int scif_txroom(struct uart_port *port) 415static inline int scif_txroom(struct uart_port *port)
@@ -422,6 +421,22 @@ static inline int scif_rxroom(struct uart_port *port)
422{ 421{
423 return sci_in(port, SCRFDR) & 0xff; 422 return sci_in(port, SCRFDR) & 0xff;
424} 423}
424#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
425static inline int scif_txroom(struct uart_port *port)
426{
427 if((port->mapbase == 0xffe00000) || (port->mapbase == 0xffe08000)) /* SCIF0/1*/
428 return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff);
429 else /* SCIF2 */
430 return SCIF2_TXROOM_MAX - (sci_in(port, SCFDR) >> 8);
431}
432
433static inline int scif_rxroom(struct uart_port *port)
434{
435 if((port->mapbase == 0xffe00000) || (port->mapbase == 0xffe08000)) /* SCIF0/1*/
436 return sci_in(port, SCRFDR) & 0xff;
437 else /* SCIF2 */
438 return sci_in(port, SCFDR) & SCIF2_RFDC_MASK;
439}
425#else 440#else
426static inline int scif_txroom(struct uart_port *port) 441static inline int scif_txroom(struct uart_port *port)
427{ 442{