blob: 395fceb8c0600988e07a05ef54392b395fa96f8a [file] [log] [blame]
Paul Mundt96de1a82008-02-26 14:52:45 +09001#ifndef __LINUX_SERIAL_SCI_H
2#define __LINUX_SERIAL_SCI_H
Paul Mundtecd95612006-09-27 17:32:30 +09003
4#include <linux/serial_core.h>
Paul Mundt14baf9d2010-05-24 16:31:08 +09005#include <linux/sh_dma.h>
Paul Mundtecd95612006-09-27 17:32:30 +09006
7/*
Guenter Roeck4b084782013-08-30 06:01:49 -07008 * Generic header for SuperH (H)SCI(F) (used by sh/sh64 and related parts)
Paul Mundtecd95612006-09-27 17:32:30 +09009 */
10
Paul Mundtdebf9502011-06-08 18:19:37 +090011#define SCIx_NOT_SUPPORTED (-1)
12
Geert Uytterhoeven26de4f12014-03-11 11:11:19 +010013/* Serial Control Register (@ = not supported by all parts) */
14#define SCSCR_TIE (1 << 7) /* Transmit Interrupt Enable */
15#define SCSCR_RIE (1 << 6) /* Receive Interrupt Enable */
16#define SCSCR_TE (1 << 5) /* Transmit Enable */
17#define SCSCR_RE (1 << 4) /* Receive Enable */
18#define SCSCR_REIE (1 << 3) /* Receive Error Interrupt Enable @ */
19#define SCSCR_TOIE (1 << 2) /* Timeout Interrupt Enable @ */
20#define SCSCR_CKE1 (1 << 1) /* Clock Enable 1 */
21#define SCSCR_CKE0 (1 << 0) /* Clock Enable 0 */
Geert Uytterhoeven26de4f12014-03-11 11:11:19 +010022
Ulrich Hechtf303b362013-05-31 17:57:01 +020023
Paul Mundt61a69762011-06-14 12:40:19 +090024enum {
25 SCIx_PROBE_REGTYPE,
26
27 SCIx_SCI_REGTYPE,
28 SCIx_IRDA_REGTYPE,
29 SCIx_SCIFA_REGTYPE,
30 SCIx_SCIFB_REGTYPE,
Phil Edworthy3af1f8a2011-10-03 15:16:47 +010031 SCIx_SH2_SCIF_FIFODATA_REGTYPE,
Paul Mundt61a69762011-06-14 12:40:19 +090032 SCIx_SH3_SCIF_REGTYPE,
33 SCIx_SH4_SCIF_REGTYPE,
34 SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
35 SCIx_SH4_SCIF_FIFODATA_REGTYPE,
36 SCIx_SH7705_SCIF_REGTYPE,
Ulrich Hechtf303b362013-05-31 17:57:01 +020037 SCIx_HSCIF_REGTYPE,
Paul Mundt61a69762011-06-14 12:40:19 +090038
39 SCIx_NR_REGTYPES,
40};
41
Guennadi Liakhovetski73a19e4c2010-03-02 11:39:15 +090042struct device;
43
Paul Mundt61a69762011-06-14 12:40:19 +090044struct plat_sci_port_ops {
45 void (*init_pins)(struct uart_port *, unsigned int cflag);
46};
47
Paul Mundtecd95612006-09-27 17:32:30 +090048/*
Paul Mundtfaf02f82011-12-02 17:44:50 +090049 * Port-specific capabilities
50 */
51#define SCIx_HAVE_RTSCTS (1 << 0)
52
53/*
Paul Mundtecd95612006-09-27 17:32:30 +090054 * Platform device specific platform_data struct
55 */
56struct plat_sci_port {
Ulrich Hechtf303b362013-05-31 17:57:01 +020057 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
Paul Mundtecd95612006-09-27 17:32:30 +090058 upf_t flags; /* UPF_* flags */
Paul Mundtfaf02f82011-12-02 17:44:50 +090059 unsigned long capabilities; /* Port features/capabilities */
Paul Mundt00b9de92009-06-24 17:53:33 +090060
Laurent Pinchartec09c5e2013-12-06 10:59:20 +010061 unsigned int sampling_rate;
Paul Mundt00b9de92009-06-24 17:53:33 +090062 unsigned int scscr; /* SCSCR initialization */
Paul Mundtf43dc232011-01-13 15:06:28 +090063
Paul Mundtdebf9502011-06-08 18:19:37 +090064 /*
65 * Platform overrides if necessary, defaults otherwise.
66 */
Paul Mundt514820e2011-06-08 18:51:32 +090067 int port_reg;
Paul Mundt61a69762011-06-14 12:40:19 +090068 unsigned char regshift;
69 unsigned char regtype;
70
71 struct plat_sci_port_ops *ops;
Paul Mundt514820e2011-06-08 18:51:32 +090072
Paul Mundt27bd1072011-01-19 15:37:31 +090073 unsigned int dma_slave_tx;
74 unsigned int dma_slave_rx;
Paul Mundtecd95612006-09-27 17:32:30 +090075};
76
Paul Mundt96de1a82008-02-26 14:52:45 +090077#endif /* __LINUX_SERIAL_SCI_H */