source: mainline/kernel/genarch/include/drivers/amdm37x_uart/amdm37x_uart.h@ b0e58c7

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since b0e58c7 was b0e58c7, checked in by Jan Vesely <jano.vesely@…>, 14 years ago

arm32, amdm37x: Add UART driver skeleton.

  • Property mode set to 100644
File size: 15.4 KB
Line 
1/*
2 * Copyright (c) 2012 Jan Vesely
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28/** @addtogroup genarch
29 * @{
30 */
31/**
32 * @file
33 * @brief Texas Instruments AMDM37x on-chip interrupt controller driver.
34 */
35
36#ifndef KERN_AMDM37x_UART_H_
37#define KERN_AMDM37x_UART_H_
38
39#include <typedefs.h>
40#include <console/chardev.h>
41
42/* AMDM37x TRM p. 2950 */
43#define AMDM37x_UART1_BASE_ADDRESS 0x4806a000
44#define AMDM37x_UART1_SIZE 1024
45#define AMDM37x_UART1_IRQ 72 /* AMDM37x TRM p. 2418 */
46
47#define AMDM37x_UART2_BASE_ADDRESS 0x4806b000
48#define AMDM37x_UART2_SIZE 1024
49#define AMDM37x_UART2_IRQ 73 /* AMDM37x TRM p. 2418 */
50
51#define AMDM37x_UART3_BASE_ADDRESS 0x49020000
52#define AMDM37x_UART3_SIZE 1024
53#define AMDM37x_UART3_IRQ 74 /* AMDM37x TRM p. 2418 */
54
55#define AMDM37x_UART4_BASE_ADDRESS 0x49042000
56#define AMDM37x_UART4_SIZE 1024
57#define AMDM37x_UART4_IRQ 80 /* AMDM37x TRM p. 2418 */
58
59typedef struct {
60 union {
61 /** Stores lower part of the 14-bit baud divisor */
62 ioport32_t dll;
63#define AMDM37x_UART_DLL_MASK (0xff)
64
65 /** Receive holding register */
66 const ioport32_t rhr;
67#define AMDM37x_UART_RHR_MASK (0xff)
68
69 /** Transmit holding register */
70 ioport32_t thr;
71#define AMDM37x_UART_THR_MASK (0xff)
72 };
73
74 union {
75 /** Stores higher part of the 14-bit baud divisor */
76 ioport32_t dlh;
77#define AMDM37x_UART_DLH_MASK (0x1f)
78
79 /** Interrupt enable registers */
80 ioport32_t ier;
81#define AMDM37x_UART_IER_RHR_IRQ_FLAG (1 << 0)
82#define AMDM37x_UART_IER_THR_IRQ_FLAG (1 << 1)
83#define AMDM37x_UART_IER_LINE_STS_IRQ_FLAG (1 << 2)
84#define AMDM37x_UART_IER_MODEM_STS_IRQ_FLAG (1 << 3)
85#define AMDM37x_UART_IER_SLEEP_MODE_FLAG (1 << 4)
86#define AMDM37x_UART_IER_XOFF_IRQ_FLAG (1 << 5)
87#define AMDM37x_UART_IER_RTS_IRQ_FLAG (1 << 6)
88#define AMDM37x_UART_IER_CTS_IRQ_FLAG (1 << 7)
89
90#define AMDM37x_CIR_IER_RHR_IRQ_FLAG (1 << 0)
91#define AMDM37x_CIR_IER_THR_IRQ_FLAG (1 << 1)
92#define AMDM37x_CIR_IER_RX_STOP_IRQ_FLAG (1 << 2)
93#define AMDM37x_CIR_IER_RX_OVERRUN_IRQ_FLAG (1 << 3)
94#define AMDM37x_CIR_IER_TX_STS_IRQ_FLAG (1 << 5)
95
96#define AMDM37x_IRDA_IER_RHR_IRQ_FLAG (1 << 0)
97#define AMDM37x_IRDA_IER_THR_IRQ_FLAG (1 << 1)
98#define AMDM37x_IRDA_IER_LAST_RX_BYTE_IRQ_FLAG (1 << 2)
99#define AMDM37x_IRDA_IER_RX_OVERRUN_IRQ_FLAG (1 << 3)
100#define AMDM37x_IRDA_IER_STS_FIFO_TRIG_IRQ_FLAG (1 << 4)
101#define AMDM37x_IRDA_IER_TX_STS_IRQ_FLAG (1 << 5)
102#define AMDM37x_IRDA_IER_LINE_STS_IRQ_FLAG (1 << 6)
103#define AMDM37x_IRDA_IER_EOF_IRQ_FLAG (1 << 7)
104 };
105
106 union {
107 /** Interrupt identification register */
108 const ioport32_t iir;
109#define AMDM37x_UART_IIR_IRQ_PENDING_FLAG (1 << 0)
110#define AMDM37x_UART_IIR_TYPE_MASK (0x1f)
111#define AMDM37x_UART_IIR_TYPE_SHIFT (1)
112#define AMDM37x_UART_IIR_FCR_MASK (0x3)
113#define AMDM37x_UART_IIR_FCR_SHIFT (6)
114
115#define AMDM37x_CIR_IIR_RHR_IRQ_FLAG (1 << 0)
116#define AMDM37x_CIR_IIR_THR_IRQ_FLAG (1 << 1)
117#define AMDM37x_CIR_IIR_RX_STOP_IRQ_FLAG (1 << 2)
118#define AMDM37x_CIR_IIR_RX_OE_IRQ_FLAG (1 << 3)
119#define AMDM37x_CIR_IIR_TX_STS_IRQ_FLAG (1 << 5)
120
121#define AMDM37x_IRDA_IIR_RHR_IRQ_FLAG (1 << 0)
122#define AMDM37x_IRDA_IIR_THR_IRQ_FLAG (1 << 1)
123#define AMDM37x_IRDA_IIR_RX_FIFO_LB_IRQ_FLAG (1 << 2)
124#define AMDM37x_IRDA_IIR_RX_OE_IRQ_FLAG (1 << 3)
125#define AMDM37x_IRDA_IIR_STS_FIFO_IRQ_FLAG (1 << 4)
126#define AMDM37x_IRDA_IIR_TX_STS_IRQ_FLAG (1 << 5)
127#define AMDM37x_IRDA_IIR_LINE_STS_IRQ_FLAG (1 << 6)
128#define AMDM37x_IRDA_IIR_EOF_IRQ_FLAG (1 << 7)
129
130 /** FIFO control register */
131 ioport32_t fcr;
132#define AMDM37x_UART_FCR_FIFO_EN_FLAG (1 << 0)
133#define AMDM37x_UART_FCR_RX_FIFO_CLR_FLAG (1 << 1)
134#define AMDM37x_UART_FCR_TX_FIFO_CLR_FLAG (1 << 3)
135#define AMDM37x_UART_FCR_DMA_MODE_FLAG (1 << 4)
136
137#define AMDM37x_UART_FCR_TX_FIFO_TRIG_MASK (0x3)
138#define AMDM37x_UART_FCR_TX_FIFO_TRIG_SHIFT (4)
139
140#define AMDM37x_UART_FCR_RX_FIFO_TRIG_MASK (0x3)
141#define AMDM37x_UART_FCR_RX_FIFO_TRIG_SHIFT (6)
142
143 /** Enhanced feature register */
144 ioport32_t efr;
145#define AMDM37x_UART_EFR_SW_FLOW_CTRL_RX_MASK (0x3)
146#define AMDM37x_UART_EFR_SW_FLOW_CTRL_RX_SHIFT (0)
147#define AMDM37x_UART_EFR_SW_FLOW_CTRL_TX_MASK (0x3)
148#define AMDM37x_UART_EFR_SW_FLOW_CTRL_TX_SHIFT (2)
149
150#define AMDM37x_UART_EFR_SW_FLOW_CTRL_NONE (0x0)
151#define AMDM37x_UART_EFR_SW_FLOW_CTRL_X2 (0x1)
152#define AMDM37x_UART_EFR_SW_FLOW_CTRL_X1 (0x2)
153#define AMDM37x_UART_EFR_SW_FLOW_CTRL_XBOTH (0x3)
154
155#define AMDM37x_UART_EFR_ENH_FLAG (1 << 4)
156#define AMDM37x_UART_EFR_SPEC_CHAR_FLAG (1 << 5)
157#define AMDM37x_UART_EFR_AUTO_RTS_EN_FLAG (1 << 6)
158#define AMDM37x_UART_EFR_AUTO_CTS_EN_FLAG (1 << 7)
159 };
160
161 /** Line control register */
162 ioport32_t lcr;
163#define AMDM37x_UART_LCR_CHAR_LENGTH_MASK (0x3)
164#define AMDM37x_UART_LCR_CHAR_LENGTH_SHIFT (0)
165#define AMDM37x_UART_LCR_CHAR_LENGTH_5BITS (0x0)
166#define AMDM37x_UART_LCR_CHAR_LENGTH_6BITS (0x1)
167#define AMDM37x_UART_LCR_CHAR_LENGTH_7BITS (0x2)
168#define AMDM37x_UART_LCR_CHAR_LENGTH_8BITS (0x3)
169#define AMDM37x_UART_LCR_NB_STOP_FLAG (1 << 2)
170#define AMDM37x_UART_LCR_PARITY_EN_FLAG (1 << 3)
171#define AMDM37x_UART_LCR_PARITY_TYPE1_FLAG (1 << 4)
172#define AMDM37x_UART_LCR_PARITY_TYPE2_FLAG (1 << 5)
173#define AMDM37x_UART_LCR_BREAK_EN_FLAG (1 << 6)
174#define AMDM37x_UART_LCR_DIV_EN_FLAG (1 << 7)
175
176
177 union {
178 /** Modem control register */
179 ioport32_t mcr;
180#define AMDM37x_UART_MCR_DTR_FLAG (1 << 0)
181#define AMDM37x_UART_MCR_RTS_FLAG (1 << 1)
182#define AMDM37x_UART_MCR_RI_STS_CH_FLAG (1 << 2)
183#define AMDM37x_UART_MCR_CD_STS_CH_FLAG (1 << 3)
184#define AMDM37x_UART_MCR_LOOPBACK_EN_FLAG (1 << 4)
185#define AMDM37x_UART_MCR_XON_EN_FLAG (1 << 5)
186#define AMDM37x_UART_MCR_TCR_TLR_FLAG (1 << 6)
187
188 /** UART: XON1 char, IRDA: ADDR1 address */
189 ioport32_t xon1_addr1;
190#define AMDM37x_UART_XON1_ADDR1_MASK (0xff)
191 };
192
193 union {
194 /** Line status register */
195 const ioport32_t lsr;
196#define AMDM37x_UART_LSR_RX_FIFO_E_FLAG (1 << 0)
197#define AMDM37x_UART_LSR_RX_OE_FLAG (1 << 1)
198#define AMDM37x_UART_LSR_RX_PE_FLAG (1 << 2)
199#define AMDM37x_UART_LSR_RX_FE_FLAG (1 << 3)
200#define AMDM37x_UART_LSR_RX_BI_FLAG (1 << 4)
201#define AMDM37x_UART_LSR_TX_FIFO_E_FLAG (1 << 5)
202#define AMDM37x_UART_LSR_TX_SR_E_FLAG (1 << 6)
203#define AMDM37x_UART_LSR_RX_FIFO_STS_FLAG (1 << 7)
204
205#define AMDM37x_CIR_LSR_RX_FIFO_E_FLAG (1 << 0)
206#define AMDM37x_CIR_LSR_RX_STOP_FLAG (1 << 5)
207#define AMDM37x_CIR_LSR_THR_EMPTY_FLAG (1 << 7)
208
209#define AMDM37x_IRDA_LSR_RX_FIFO_E_FLAG (1 << 0)
210#define AMDM37x_IRDA_LSR_STS_FIFO_E_FLAG (1 << 1)
211#define AMDM37x_IRDA_LSR_CRC_FLAG (1 << 2)
212#define AMDM37x_IRDA_LSR_ABORT_FLAG (1 << 3)
213#define AMDM37x_IRDA_LSR_FTL_FLAG (1 << 4)
214#define AMDM37x_IRDA_LSR_RX_LAST_FLAG (1 << 5)
215#define AMDM37x_IRDA_LSR_STS_FIFO_FULL_FLAG (1 << 6)
216#define AMDM37x_IRDA_LSR_THR_EMPTY_FLAG (1 << 7)
217
218 /** UART: XON2 char, IRDA: ADDR2 address */
219 ioport32_t xon2_addr2;
220 };
221
222 union {
223 /** Modem status register */
224 const ioport32_t msr;
225#define AMDM37x_UART_MSR_CTS_STS_FLAG (1 << 0)
226#define AMDM37x_UART_MSR_DSR_STS_FLAG (1 << 1)
227#define AMDM37x_UART_MSR_RI_STS_FLAG (1 << 2)
228#define AMDM37x_UART_MSR_DCD_STS_FLAG (1 << 3)
229#define AMDM37x_UART_MSR_NCTS_STS_FLAG (1 << 4)
230#define AMDM37x_UART_MSR_NDSR_STS_FLAG (1 << 5)
231#define AMDM37x_UART_MSR_NRI_STS_FLAG (1 << 6)
232#define AMDM37x_UART_MSR_NCD_STS_FLAG (1 << 7)
233
234 /** Transmission control register */
235 ioport32_t tcr;
236#define AMDM37x_UART_TCR_FIFO_TRIG_MASK (0xf)
237#define AMDM37x_UART_TCR_FIFO_TRIG_HALT_SHIFT (0)
238#define AMDM37x_UART_TCR_FIFO_TRIG_START_SHIFT (4)
239
240 /** UART: XOFF1 char */
241 ioport32_t xoff1;
242#define AMDM37x_UART_XOFF1_MASK (0xff)
243 };
244
245 union {
246 /* Scratchpad register, does nothing */
247 ioport32_t spr;
248#define AMDM37x_UART_SPR_MASK (0xff)
249
250 /* Trigger level register */
251 ioport32_t tlr;
252#define AMDM37x_UART_TLR_LEVEL_MASK (0xf)
253#define AMDM37x_UART_TLR_TX_FIFO_TRIG_SHIFT (0)
254#define AMDM37x_UART_TLR_RX_FIFO_TRIG_SHIFT (4)
255
256 /** UART: XOFF2 char */
257 ioport32_t xoff2;
258#define AMDM37x_UART_XOFF2_MASK (0xff)
259 };
260
261 /** Mode definition register. */
262 ioport32_t mdr1;
263#define AMDM37x_UART_MDR_MS_MASK (0x7)
264#define AMDM37x_UART_MDR_MS_SHIFT (0)
265#define AMDM37x_UART_MDR_MS_UART16 (0x0)
266#define AMDM37x_UART_MDR_MS_SIR (0x1)
267#define AMDM37x_UART_MDR_MS_UART16_AUTO (0x2)
268#define AMDM37x_UART_MDR_MS_UART13 (0x3)
269#define AMDM37x_UART_MDR_MS_MIR (0x4)
270#define AMDM37x_UART_MDR_MS_FIR (0x5)
271#define AMDM37x_UART_MDR_MS_CIR (0x6)
272#define AMDM37x_UART_MDR_MS_DISABLE (0x7)
273
274#define AMDM37x_UART_MDR_IR_SLEEP_FLAG (1 << 3)
275#define AMDM37x_UART_MDR_SET_TXIR_FLAG (1 << 4)
276#define AMDM37x_UART_MDR_SCT_FLAG (1 << 5)
277#define AMDM37x_UART_MDR_SIP_FLAG (1 << 6)
278#define AMDM37x_UART_MDR_FRAME_END_MODE_FLAG (1 << 7)
279
280 /** Mode definition register */
281 ioport32_t mdr2;
282#define AMDM37x_UART_MDR_IRTX_UNDERRUN_FLAG (1 << 0)
283#define AMDM37x_UART_MDR_STS_FIFO_TRIG_MASK (0x3)
284#define AMDM37x_UART_MDR_STS_FIFO_TRIG_SHIFT (1)
285#define AMDM37x_UART_MDR_PULSE_SHAPING_FLAG (1 << 3)
286#define AMDM37x_UART_MDR_CIR_PULSE_MODE_MASK (0x3)
287#define AMDM37x_UART_MDR_CIR_PULSE_MODE_SHIFT (4)
288#define AMDM37x_UART_MDR_IRRXINVERT_FLAG (1 << 6)
289
290
291 /* UART3 specific */
292 union {
293 /** Status FIFO line status register (IrDA only) */
294 const ioport32_t sflsr;
295#define AMDM37x_IRDA_SFLSR_CRC_ERROR_FLAG (1 << 1)
296#define AMDM37x_IRDA_SFLSR_ABORT_FLAG (1 << 2)
297#define AMDM37x_IRDA_SFLSR_FTL_FLAG (1 << 3)
298#define AMDM37x_IRDA_SFLSR_OE_FLAG (1 << 4)
299
300 /** Transmit frame length low (IrDA only) */
301 ioport32_t txfll;
302#define AMDM37x_UART_TXFLL_MASK (0xff)
303 };
304
305 /* UART3 specific */
306 union {
307 /** Dummy register to restart TX or RX (IrDA only) */
308 const ioport32_t resume;
309 /** Transmit frame length high (IrDA only) */
310 ioport32_t txflh;
311#define AMDM37x_UART_TXFLH_MASK (0xff)
312 };
313
314 /* UART3 specific */
315 union {
316 /** Status FIFO register low (IrDA only) */
317 const ioport32_t sfregl;
318#define AMDM37x_UART_SFREGL_MASK (0xff)
319 /** Received frame length low (IrDA only) */
320 ioport32_t rxfll;
321#define AMDM37x_UART_RXFLL_MASK (0xff)
322 };
323
324 /* UART3 specific */
325 union {
326 /** Status FIFO register high (IrDA only) */
327 const ioport32_t sfregh;
328#define AMDM37x_UART_SFREGH_MASK (0xf)
329 /** Received frame length high (IrDA only) */
330 ioport32_t rxflh;
331#define AMDM37x_UART_RXFLH_MASK (0xf)
332 };
333
334 union {
335 /** UART autobauding status register */
336 const ioport32_t uasr;
337#define AMDM37x_UART_UASR_SPEED_MASK (0x1f)
338#define AMDM37x_UART_UASR_SPEED_SHIFT (0)
339#define AMDM37x_UART_UASR_8BIT_CHAR_FLAG (1 << 5)
340#define AMDM37x_UART_UASR_PARITY_MASK (0x3)
341#define AMDM37x_UART_UASR_PARITY_SHIFT (6)
342
343 /** BOF control register (IrDA only) */
344 ioport32_t blr; /* UART3 sepcific */
345#define AMDM37x_IRDA_BLR_XBOF_TYPE_FLAG (1 << 6)
346#define AMDM37x_IRDA_BLR_STS_FIFO_RESET (1 << 7)
347 };
348
349 /** Auxiliary control register (IrDA only) */
350 ioport32_t acreg; /* UART3 specific */
351#define AMDM37x_IRDA_ACREG_EOT_EN_FLAG (1 << 0)
352#define AMDM37x_IRDA_ACREG_ABORT_EN_FLAG (1 << 1)
353#define AMDM37x_IRDA_ACREG_SCTX_EN_FLAG (1 << 2)
354#define AMDM37x_IRDA_ACREG_SEND_SIP_FLAG (1 << 3)
355#define AMDM37x_IRDA_ACREG_DIS_TX_UNDERRUN_FLAG (1 << 4)
356#define AMDM37x_IRDA_ACREG_DIS_IR_RX_FLAG (1 << 5)
357#define AMDM37x_IRDA_ACREG_SD_MOD_FLAG (1 << 6)
358#define AMDM37x_IRDA_ACREG_PULSE_TYPE_FLAG (1 << 7)
359
360 /** Supplementary control register */
361 ioport32_t scr;
362#define AMDM37x_UART_SCR_DMA_MODE_CTL_FLAG (1 << 0)
363#define AMDM37x_UART_SCR_DMA_MODE_MASK (0x3)
364#define AMDM37x_UART_SCR_DMA_MODE_SHIFT (1)
365#define AMDM37x_UART_SCR_TX_EMPTY_CTL_IRQ_FLAG (1 << 3)
366#define AMDM37x_UART_SCR_RX_CTS_WU_EN_FLAG (1 << 4)
367#define AMDM37x_UART_SCR_TX_TRIG_GRANU1_FLAG (1 << 6)
368#define AMDM37x_UART_SCR_RX_TRIG_GRANU1_FLAG (1 << 7)
369
370 /** Supplementary status register */
371 const ioport32_t ssr;
372#define AMDM37x_UART_SSR_TX_FIFO_FULL_FLAG (1 << 0)
373#define AMDM37x_UART_SSR_RX_CTS_WU_STS_FLAG (1 << 1)
374#define AMDM37x_UART_SSR_DMA_COUNTER_RESET_FLAG (1 << 2)
375
376 /** BOF Length register (IrDA only)*/
377 ioport32_t eblr; /* UART3 specific */
378#define AMDM37x_IRDA_EBLR_DISABLED (0x00)
379#define AMDM37x_IRDA_EBLR_RX_STOP_BITS(bits) (bits & 0xff)
380
381 uint32_t padd0_;
382
383 /** Module version register */
384 const ioport32_t mvr;
385#define AMDM37x_UART_MVR_MINOR_MASK (0xf)
386#define AMDM37x_UART_MVR_MINOR_SHIFT (0)
387#define AMDM37x_UART_MVR_MAJOR_MASK (0xf)
388#define AMDM37x_UART_MVR_MAJOR_SHIFT (4)
389
390 /** System configuration register */
391 ioport32_t sysc;
392#define AMDM37x_UART_SYSC_AUTOIDLE_FLAG (1 << 0)
393#define AMDM37x_UART_SYSC_SOFTRESET_FLAG (1 << 1)
394#define AMDM37x_UART_SYSC_ENWAKEUP_FLAG (1 << 2)
395#define AMDM37x_UART_SYSC_IDLE_MODE_MASK (0x3)
396#define AMDM37x_UART_SYSC_IDLE_MODE_SHIFT (3)
397#define AMDM37x_UART_SYSC_IDLE_MODE_FORCE (0x0)
398#define AMDM37x_UART_SYSC_IDLE_MODE_NO (0x1)
399#define AMDM37x_UART_SYSC_IDLE_MODE_SMART (0x2)
400
401 /** System status register */
402 const ioport32_t syss;
403#define AMDM37x_UART_SYSS_RESETDONE_FLAG (1 << 0)
404
405 /** Wake-up enable register */
406 ioport32_t wer;
407#define AMDM37x_UART_WER_CTS_ACTIVITY_FLAG (1 << 0)
408#define AMDM37x_UART_WER_RI_ACTIVITY_FLAG (1 << 2)
409#define AMDM37x_UART_WER_RX_ACTIVITY_FLAG (1 << 4)
410#define AMDM37x_UART_WER_RHR_IRQ_FLAG (1 << 5)
411#define AMDM37x_UART_WER_RLS_IRQ_FLAG (1 << 6)
412#define AMDM37x_UART_WER_TX_WAKEUP_EN_FLAG (1 << 7)
413
414 /** Carrier frequency prescaler */
415 ioport32_t cfps; /* UART3 specific */
416#define AMDM37x_UART_CFPS_MASK (0xff)
417
418 /** Number of bytes in RX fifo */
419 const ioport32_t rx_fifo_lvl;
420#define AMDM37x_UART_RX_FIFO_LVL_MASK (0xff)
421
422 /** Number of bytes in TX fifo */
423 const ioport32_t tx_fifo_lvl;
424#define AMDM37x_UART_TX_FIFO_LVL_MASK (0xff)
425
426 /** RX/TX empty interrupts */
427 ioport32_t ier2;
428#define AMDM37x_UART_IER2_RX_FIFO_EMPTY_IRQ_EN_FLAG (1 << 0)
429#define AMDM37x_UART_IER2_TX_FIFO_EMPTY_IRQ_EN_FLAG (1 << 1)
430
431 /** RX/TX empty status */
432 ioport32_t isr2;
433#define AMDM37x_UART_IER2_RX_FIFO_EMPTY_FLAG (1 << 0)
434#define AMDM37x_UART_IER2_TX_FIFO_EMPTY_FLAG (1 << 1)
435
436 uint32_t padd2_[3];
437
438 /** Mode definition register 3 */
439 ioport32_t mdr3;
440#define AMDM37x_UART_MDR3_DIS_CIR_RX_DEMOD_FLAG (1 << 0)
441} amdm37x_uart_regs_t;
442
443typedef struct {
444 amdm37x_uart_regs_t *regs;
445 indev_t *indev;
446 outdev_t outdev;
447} amdm37x_uart_t;
448
449
450int amdm37x_uart_init(amdm37x_uart_t *, inr_t, uintptr_t, size_t);
451void amdm37x_uart_input_wire(amdm37x_uart_t *, indev_t *);
452
453#endif
454
455/**
456 * @}
457 */
Note: See TracBrowser for help on using the repository browser.