1#ifndef __LINUX_SERIAL_SCI_H
2#define __LINUX_SERIAL_SCI_H
3
4#include <linux/serial_core.h>
5#include <linux/sh_dma.h>
6
7
8
9
10
11#define SCIx_NOT_SUPPORTED (-1)
12
13
14#define SCSMR_CHR (1 << 6)
15#define SCSMR_PE (1 << 5)
16#define SCSMR_ODD (1 << 4)
17#define SCSMR_STOP (1 << 3)
18#define SCSMR_CKS 0x0003
19
20
21#define SCSCR_TIE (1 << 7)
22#define SCSCR_RIE (1 << 6)
23#define SCSCR_TE (1 << 5)
24#define SCSCR_RE (1 << 4)
25#define SCSCR_REIE (1 << 3)
26#define SCSCR_TOIE (1 << 2)
27#define SCSCR_CKE1 (1 << 1)
28#define SCSCR_CKE0 (1 << 0)
29
30#define SCSCR_TDRQE (1 << 15)
31#define SCSCR_RDRQE (1 << 14)
32
33
34#define SCI_TDRE 0x80
35#define SCI_RDRF 0x40
36#define SCI_ORER 0x20
37#define SCI_FER 0x10
38#define SCI_PER 0x08
39#define SCI_TEND 0x04
40
41#define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER)
42
43
44#define SCIF_ER 0x0080
45#define SCIF_TEND 0x0040
46#define SCIF_TDFE 0x0020
47#define SCIF_BRK 0x0010
48#define SCIF_FER 0x0008
49#define SCIF_PER 0x0004
50#define SCIF_RDF 0x0002
51#define SCIF_DR 0x0001
52
53#define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
54
55
56#define SCFCR_LOOP (1 << 0)
57
58
59#define SCSPTR_RTSIO (1 << 7)
60#define SCSPTR_CTSIO (1 << 5)
61#define SCSPTR_SPB2IO (1 << 1)
62#define SCSPTR_SPB2DT (1 << 0)
63
64
65#define HSCIF_SRE 0x8000
66
67enum {
68 SCIx_PROBE_REGTYPE,
69
70 SCIx_SCI_REGTYPE,
71 SCIx_IRDA_REGTYPE,
72 SCIx_SCIFA_REGTYPE,
73 SCIx_SCIFB_REGTYPE,
74 SCIx_SH2_SCIF_FIFODATA_REGTYPE,
75 SCIx_SH3_SCIF_REGTYPE,
76 SCIx_SH4_SCIF_REGTYPE,
77 SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
78 SCIx_SH4_SCIF_FIFODATA_REGTYPE,
79 SCIx_SH7705_SCIF_REGTYPE,
80 SCIx_HSCIF_REGTYPE,
81
82 SCIx_NR_REGTYPES,
83};
84
85
86
87
88
89enum {
90 SCSMR,
91 SCBRR,
92 SCSCR,
93 SCxSR,
94 SCFCR,
95 SCFDR,
96 SCxTDR,
97 SCxRDR,
98 SCLSR,
99 SCTFDR,
100 SCRFDR,
101 SCSPTR,
102 HSSRR,
103
104 SCIx_NR_REGS,
105};
106
107struct device;
108
109struct plat_sci_port_ops {
110 void (*init_pins)(struct uart_port *, unsigned int cflag);
111};
112
113
114
115
116#define SCIx_HAVE_RTSCTS (1 << 0)
117
118
119
120
121struct plat_sci_port {
122 unsigned int type;
123 upf_t flags;
124 unsigned long capabilities;
125
126 unsigned int sampling_rate;
127 unsigned int scscr;
128
129
130
131
132 int port_reg;
133 unsigned char regshift;
134 unsigned char regtype;
135
136 struct plat_sci_port_ops *ops;
137
138 unsigned int dma_slave_tx;
139 unsigned int dma_slave_rx;
140};
141
142#endif
143