aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/sh-sci.c22
-rw-r--r--drivers/serial/sh-sci.h19
2 files changed, 41 insertions, 0 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 9031b57f12dd..c53b69610a51 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -319,6 +319,28 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
319 319
320 sci_out(port, SCFCR, fcr_val); 320 sci_out(port, SCFCR, fcr_val);
321} 321}
322#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
323static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
324{
325 unsigned int fcr_val = 0;
326
327 if (cflag & CRTSCTS) {
328 fcr_val |= SCFCR_MCE;
329
330 ctrl_outw(0x0000, PORT_PSCR);
331 } else {
332 unsigned short data;
333
334 data = ctrl_inw(PORT_PSCR);
335 data &= 0x033f;
336 data |= 0x0400;
337 ctrl_outw(data, PORT_PSCR);
338
339 ctrl_outw(ctrl_inw(SCSPTR0) & 0x17, SCSPTR0);
340 }
341
342 sci_out(port, SCFCR, fcr_val);
343}
322#else 344#else
323/* For SH7750 */ 345/* For SH7750 */
324static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) 346static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index e4557cc4f74b..77f7d6351ab1 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -90,6 +90,13 @@
90# define SCSPTR3 0xffe30010 /* 16 bit SCIF */ 90# define SCSPTR3 0xffe30010 /* 16 bit SCIF */
91# define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */ 91# define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */
92# define SCIF_ONLY 92# define SCIF_ONLY
93#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
94# define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */
95# define SCSPTR0 SCPDR0
96# define SCIF_ORER 0x0001 /* overrun error bit */
97# define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
98# define SCIF_ONLY
99# define PORT_PSCR 0xA405011E
93#elif defined(CONFIG_CPU_SUBTYPE_SH4_202) 100#elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
94# define SCSPTR2 0xffe80020 /* 16 bit SCIF */ 101# define SCSPTR2 0xffe80020 /* 16 bit SCIF */
95# define SCIF_ORER 0x0001 /* overrun error bit */ 102# define SCIF_ORER 0x0001 /* overrun error bit */
@@ -495,6 +502,7 @@ static inline int sci_rxd_in(struct uart_port *port)
495 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ 502 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
496 if (port->mapbase == 0xfe620000) 503 if (port->mapbase == 0xfe620000)
497 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ 504 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */
505 return 1;
498} 506}
499#elif defined(CONFIG_CPU_SUBTYPE_SH7300) 507#elif defined(CONFIG_CPU_SUBTYPE_SH7300)
500static inline int sci_rxd_in(struct uart_port *port) 508static inline int sci_rxd_in(struct uart_port *port)
@@ -521,6 +529,13 @@ static inline int sci_rxd_in(struct uart_port *port)
521 return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */ 529 return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */
522 return 1; 530 return 1;
523} 531}
532#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
533static inline int sci_rxd_in(struct uart_port *port)
534{
535 if (port->mapbase == 0xffe00000)
536 return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */
537 return 1;
538}
524#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) 539#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
525static inline int sci_rxd_in(struct uart_port *port) 540static inline int sci_rxd_in(struct uart_port *port)
526{ 541{
@@ -550,6 +565,7 @@ static inline int sci_rxd_in(struct uart_port *port)
550 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ 565 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
551 if (port->mapbase == 0xff925000) 566 if (port->mapbase == 0xff925000)
552 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ 567 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */
568 return 1;
553} 569}
554#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 570#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
555static inline int sci_rxd_in(struct uart_port *port) 571static inline int sci_rxd_in(struct uart_port *port)
@@ -558,6 +574,7 @@ static inline int sci_rxd_in(struct uart_port *port)
558 return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */ 574 return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */
559 if (port->mapbase == 0xffe10000) 575 if (port->mapbase == 0xffe10000)
560 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ 576 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
577 return 1;
561} 578}
562#elif defined(CONFIG_CPU_SUBTYPE_SH7206) 579#elif defined(CONFIG_CPU_SUBTYPE_SH7206)
563static inline int sci_rxd_in(struct uart_port *port) 580static inline int sci_rxd_in(struct uart_port *port)
@@ -570,6 +587,7 @@ static inline int sci_rxd_in(struct uart_port *port)
570 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ 587 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */
571 if (port->mapbase == 0xfffe9800) 588 if (port->mapbase == 0xfffe9800)
572 return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */ 589 return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */
590 return 1;
573} 591}
574#elif defined(CONFIG_CPU_SUBTYPE_SH7619) 592#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
575static inline int sci_rxd_in(struct uart_port *port) 593static inline int sci_rxd_in(struct uart_port *port)
@@ -580,6 +598,7 @@ static inline int sci_rxd_in(struct uart_port *port)
580 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ 598 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
581 if (port->mapbase == 0xf8420000) 599 if (port->mapbase == 0xf8420000)
582 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ 600 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */
601 return 1;
583} 602}
584#endif 603#endif
585 604