1#ifndef __HD64570_H
2#define __HD64570_H
3
4
5
6
7
8
9
10
11
12
13#define LPR 0x00
14
15
16#define PABR0 0x02
17#define PABR1 0x03
18#define WCRL 0x04
19#define WCRM 0x05
20#define WCRH 0x06
21
22#define PCR 0x08
23#define DMER 0x09
24
25
26
27#define ISR0 0x10
28#define ISR1 0x11
29#define ISR2 0x12
30
31#define IER0 0x14
32#define IER1 0x15
33#define IER2 0x16
34
35#define ITCR 0x18
36#define IVR 0x1A
37#define IMVR 0x1C
38
39
40
41
42
43
44#define MSCI0_OFFSET 0x20
45#define MSCI1_OFFSET 0x40
46
47#define TRBL 0x00
48#define TRBH 0x01
49#define ST0 0x02
50#define ST1 0x03
51#define ST2 0x04
52#define ST3 0x05
53#define FST 0x06
54#define IE0 0x08
55#define IE1 0x09
56#define IE2 0x0A
57#define FIE 0x0B
58#define CMD 0x0C
59#define MD0 0x0E
60#define MD1 0x0F
61#define MD2 0x10
62#define CTL 0x11
63#define SA0 0x12
64#define SA1 0x13
65#define IDL 0x14
66#define TMC 0x15
67#define RXS 0x16
68#define TXS 0x17
69#define TRC0 0x18
70#define TRC1 0x19
71#define RRC 0x1A
72#define CST0 0x1C
73#define CST1 0x1D
74
75
76
77
78
79
80
81
82#define TIMER0RX_OFFSET 0x60
83#define TIMER0TX_OFFSET 0x68
84#define TIMER1RX_OFFSET 0x70
85#define TIMER1TX_OFFSET 0x78
86
87#define TCNTL 0x00
88#define TCNTH 0x01
89#define TCONRL 0x02
90#define TCONRH 0x03
91#define TCSR 0x04
92#define TEPR 0x05
93
94
95
96
97
98
99
100
101
102#define DMAC0RX_OFFSET 0x80
103#define DMAC0TX_OFFSET 0xA0
104#define DMAC1RX_OFFSET 0xC0
105#define DMAC1TX_OFFSET 0xE0
106
107#define BARL 0x00
108#define BARH 0x01
109#define BARB 0x02
110
111#define DARL 0x00
112#define DARH 0x01
113#define DARB 0x02
114
115#define SARL 0x04
116#define SARH 0x05
117#define SARB 0x06
118
119#define CPB 0x06
120
121#define CDAL 0x08
122#define CDAH 0x09
123#define EDAL 0x0A
124#define EDAH 0x0B
125#define BFLL 0x0C
126#define BFLH 0x0D
127#define BCRL 0x0E
128#define BCRH 0x0F
129#define DSR 0x10
130#define DSR_RX(node) (DSR + (node ? DMAC1RX_OFFSET : DMAC0RX_OFFSET))
131#define DSR_TX(node) (DSR + (node ? DMAC1TX_OFFSET : DMAC0TX_OFFSET))
132#define DMR 0x11
133#define DMR_RX(node) (DMR + (node ? DMAC1RX_OFFSET : DMAC0RX_OFFSET))
134#define DMR_TX(node) (DMR + (node ? DMAC1TX_OFFSET : DMAC0TX_OFFSET))
135#define FCT 0x13
136#define FCT_RX(node) (FCT + (node ? DMAC1RX_OFFSET : DMAC0RX_OFFSET))
137#define FCT_TX(node) (FCT + (node ? DMAC1TX_OFFSET : DMAC0TX_OFFSET))
138#define DIR 0x14
139#define DIR_RX(node) (DIR + (node ? DMAC1RX_OFFSET : DMAC0RX_OFFSET))
140#define DIR_TX(node) (DIR + (node ? DMAC1TX_OFFSET : DMAC0TX_OFFSET))
141#define DCR 0x15
142#define DCR_RX(node) (DCR + (node ? DMAC1RX_OFFSET : DMAC0RX_OFFSET))
143#define DCR_TX(node) (DCR + (node ? DMAC1TX_OFFSET : DMAC0TX_OFFSET))
144
145
146
147
148
149
150typedef struct {
151 u16 cp;
152 u32 bp;
153 u16 len;
154 u8 stat;
155 u8 unused;
156}__packed pkt_desc;
157
158
159
160
161#define ST_TX_EOM 0x80
162#define ST_TX_EOT 0x01
163
164#define ST_RX_EOM 0x80
165#define ST_RX_SHORT 0x40
166#define ST_RX_ABORT 0x20
167#define ST_RX_RESBIT 0x10
168#define ST_RX_OVERRUN 0x08
169#define ST_RX_CRC 0x04
170
171#define ST_ERROR_MASK 0x7C
172
173#define DIR_EOTE 0x80
174#define DIR_EOME 0x40
175#define DIR_BOFE 0x20
176#define DIR_COFE 0x10
177
178
179#define DSR_EOT 0x80
180#define DSR_EOM 0x40
181#define DSR_BOF 0x20
182#define DSR_COF 0x10
183#define DSR_DE 0x02
184#define DSR_DWE 0x01
185
186
187#define DMER_DME 0x80
188
189
190#define CMD_RESET 0x21
191#define CMD_TX_ENABLE 0x02
192#define CMD_RX_ENABLE 0x12
193
194#define MD0_HDLC 0x80
195#define MD0_CRC_ENA 0x04
196#define MD0_CRC_CCITT 0x02
197#define MD0_CRC_PR1 0x01
198
199#define MD0_CRC_NONE 0x00
200#define MD0_CRC_16_0 0x04
201#define MD0_CRC_16 0x05
202#define MD0_CRC_ITU_0 0x06
203#define MD0_CRC_ITU 0x07
204
205#define MD2_NRZ 0x00
206#define MD2_NRZI 0x20
207#define MD2_MANCHESTER 0x80
208#define MD2_FM_MARK 0xA0
209#define MD2_FM_SPACE 0xC0
210#define MD2_LOOPBACK 0x03
211
212#define CTL_NORTS 0x01
213#define CTL_IDLE 0x10
214#define CTL_UDRNC 0x20
215
216#define ST0_TXRDY 0x02
217#define ST0_RXRDY 0x01
218
219#define ST1_UDRN 0x80
220#define ST1_CDCD 0x04
221
222#define ST3_CTS 0x08
223#define ST3_DCD 0x04
224
225#define IE0_TXINT 0x80
226#define IE0_RXINTA 0x40
227#define IE1_UDRN 0x80
228#define IE1_CDCD 0x04
229
230#define DCR_ABORT 0x01
231#define DCR_CLEAR_EOF 0x02
232
233
234#define CLK_BRG_MASK 0x0F
235#define CLK_LINE_RX 0x00
236#define CLK_LINE_TX 0x00
237#define CLK_BRG_RX 0x40
238#define CLK_BRG_TX 0x40
239#define CLK_RXCLK_TX 0x60
240
241#endif
242