diff options
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh770x.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/setup-sh7750.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 13 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.h | 29 | ||||
-rw-r--r-- | include/linux/serial_sci.h | 2 |
5 files changed, 17 insertions, 29 deletions
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c index 4551ad647c2c..6d549792f791 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c | |||
@@ -108,6 +108,7 @@ static struct platform_device rtc_device = { | |||
108 | 108 | ||
109 | static struct plat_sci_port scif0_platform_data = { | 109 | static struct plat_sci_port scif0_platform_data = { |
110 | .mapbase = 0xfffffe80, | 110 | .mapbase = 0xfffffe80, |
111 | .port_reg = 0xa4000136, | ||
111 | .flags = UPF_BOOT_AUTOCONF, | 112 | .flags = UPF_BOOT_AUTOCONF, |
112 | .scscr = SCSCR_TE | SCSCR_RE, | 113 | .scscr = SCSCR_TE | SCSCR_RE, |
113 | .scbrr_algo_id = SCBRR_ALGO_2, | 114 | .scbrr_algo_id = SCBRR_ALGO_2, |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c index e53b4b38bd11..8ea26e791187 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c | |||
@@ -38,6 +38,7 @@ static struct platform_device rtc_device = { | |||
38 | 38 | ||
39 | static struct plat_sci_port sci_platform_data = { | 39 | static struct plat_sci_port sci_platform_data = { |
40 | .mapbase = 0xffe00000, | 40 | .mapbase = 0xffe00000, |
41 | .port_reg = 0xffe0001C | ||
41 | .flags = UPF_BOOT_AUTOCONF, | 42 | .flags = UPF_BOOT_AUTOCONF, |
42 | .scscr = SCSCR_TE | SCSCR_RE, | 43 | .scscr = SCSCR_TE | SCSCR_RE, |
43 | .scbrr_algo_id = SCBRR_ALGO_2, | 44 | .scbrr_algo_id = SCBRR_ALGO_2, |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index bb27885ea2e5..3248ddaa889d 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -363,6 +363,19 @@ static int sci_rxfill(struct uart_port *port) | |||
363 | return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0; | 363 | return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0; |
364 | } | 364 | } |
365 | 365 | ||
366 | /* | ||
367 | * SCI helper for checking the state of the muxed port/RXD pins. | ||
368 | */ | ||
369 | static inline int sci_rxd_in(struct uart_port *port) | ||
370 | { | ||
371 | struct sci_port *s = to_sci_port(port); | ||
372 | |||
373 | if (s->cfg->port_reg <= 0) | ||
374 | return 1; | ||
375 | |||
376 | return !!__raw_readb(s->cfg->port_reg); | ||
377 | } | ||
378 | |||
366 | /* ********************************************************************** * | 379 | /* ********************************************************************** * |
367 | * the interrupt related routines * | 380 | * the interrupt related routines * |
368 | * ********************************************************************** */ | 381 | * ********************************************************************** */ |
diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h index caab353a98b5..1c20f7f9ba4f 100644 --- a/drivers/tty/serial/sh-sci.h +++ b/drivers/tty/serial/sh-sci.h | |||
@@ -287,32 +287,3 @@ SCIF_FNS(SCLSR, 0, 0, 0x24, 16) | |||
287 | #endif | 287 | #endif |
288 | #define sci_in(port, reg) sci_##reg##_in(port) | 288 | #define sci_in(port, reg) sci_##reg##_in(port) |
289 | #define sci_out(port, reg, value) sci_##reg##_out(port, value) | 289 | #define sci_out(port, reg, value) sci_##reg##_out(port, value) |
290 | |||
291 | #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ | ||
292 | defined(CONFIG_CPU_SUBTYPE_SH7707) || \ | ||
293 | defined(CONFIG_CPU_SUBTYPE_SH7708) || \ | ||
294 | defined(CONFIG_CPU_SUBTYPE_SH7709) | ||
295 | static inline int sci_rxd_in(struct uart_port *port) | ||
296 | { | ||
297 | if (port->mapbase == 0xfffffe80) | ||
298 | return __raw_readb(SCPDR)&0x01 ? 1 : 0; /* SCI */ | ||
299 | return 1; | ||
300 | } | ||
301 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | ||
302 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | ||
303 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ | ||
304 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ | ||
305 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ | ||
306 | defined(CONFIG_CPU_SUBTYPE_SH7091) | ||
307 | static inline int sci_rxd_in(struct uart_port *port) | ||
308 | { | ||
309 | if (port->mapbase == 0xffe00000) | ||
310 | return __raw_readb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */ | ||
311 | return 1; | ||
312 | } | ||
313 | #else /* default case for non-SCI processors */ | ||
314 | static inline int sci_rxd_in(struct uart_port *port) | ||
315 | { | ||
316 | return 1; | ||
317 | } | ||
318 | #endif | ||
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 5fac3bccfd87..ecefec7c0b67 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -86,6 +86,8 @@ struct plat_sci_port { | |||
86 | int overrun_bit; | 86 | int overrun_bit; |
87 | unsigned int error_mask; | 87 | unsigned int error_mask; |
88 | 88 | ||
89 | int port_reg; | ||
90 | |||
89 | struct device *dma_dev; | 91 | struct device *dma_dev; |
90 | 92 | ||
91 | unsigned int dma_slave_tx; | 93 | unsigned int dma_slave_tx; |