aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sh-sci.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-03-12 01:38:59 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-05-06 22:10:53 -0400
commit32351a28a7e1f2c68afbe559dd35e1ad0301be6d (patch)
tree289c28c605da6876125fa2105d880860b88b5017 /drivers/serial/sh-sci.c
parentbe782df54c51b50dd4dbc363a5a5afa04565fc60 (diff)
sh: Add SH7785 Highlander board support (R7785RP).
This adds preliminary support for the SH7785-based Highlander board. Some of the Highlander support code is reordered so that most of it can be reused directly. This also plugs in missing SH7785 checks in the places that need it, as this is the first board to support the CPU. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/serial/sh-sci.c')
-rw-r--r--drivers/serial/sh-sci.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 4b17f845f5cd..94deebda6da0 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -62,7 +62,7 @@ struct sci_port {
62 unsigned int type; 62 unsigned int type;
63 63
64 /* Port IRQs: ERI, RXI, TXI, BRI (optional) */ 64 /* Port IRQs: ERI, RXI, TXI, BRI (optional) */
65 unsigned int irqs[SCIx_NR_IRQS]; 65 unsigned int irqs[SCIx_NR_IRQS];
66 66
67 /* Port pin configuration */ 67 /* Port pin configuration */
68 void (*init_pins)(struct uart_port *port, 68 void (*init_pins)(struct uart_port *port,
@@ -351,7 +351,7 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
351 } else { 351 } else {
352#ifdef CONFIG_CPU_SUBTYPE_SH7343 352#ifdef CONFIG_CPU_SUBTYPE_SH7343
353 /* Nothing */ 353 /* Nothing */
354#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 354#elif defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785)
355 ctrl_outw(0x0080, SCSPTR0); /* Set RTS = 1 */ 355 ctrl_outw(0x0080, SCSPTR0); /* Set RTS = 1 */
356#else 356#else
357 ctrl_outw(0x0080, SCSPTR2); /* Set RTS = 1 */ 357 ctrl_outw(0x0080, SCSPTR2); /* Set RTS = 1 */
@@ -361,7 +361,9 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
361} 361}
362#endif 362#endif
363 363
364#if defined(CONFIG_CPU_SUBTYPE_SH7760) || defined(CONFIG_CPU_SUBTYPE_SH7780) 364#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
365 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
366 defined(CONFIG_CPU_SUBTYPE_SH7785)
365static inline int scif_txroom(struct uart_port *port) 367static inline int scif_txroom(struct uart_port *port)
366{ 368{
367 return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0x7f); 369 return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0x7f);
@@ -1368,9 +1370,19 @@ static int __devinit sci_probe(struct platform_device *dev)
1368 struct plat_sci_port *p = dev->dev.platform_data; 1370 struct plat_sci_port *p = dev->dev.platform_data;
1369 int i; 1371 int i;
1370 1372
1371 for (i = 0; p && p->flags != 0 && i < SCI_NPORTS; p++, i++) { 1373 for (i = 0; p && p->flags != 0; p++, i++) {
1372 struct sci_port *sciport = &sci_ports[i]; 1374 struct sci_port *sciport = &sci_ports[i];
1373 1375
1376 /* Sanity check */
1377 if (unlikely(i == SCI_NPORTS)) {
1378 dev_notice(&dev->dev, "Attempting to register port "
1379 "%d when only %d are available.\n",
1380 i+1, SCI_NPORTS);
1381 dev_notice(&dev->dev, "Consider bumping "
1382 "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n");
1383 break;
1384 }
1385
1374 sciport->port.mapbase = p->mapbase; 1386 sciport->port.mapbase = p->mapbase;
1375 1387
1376 /* 1388 /*