2 * Copyright (c) 2009, ETH Zurich. All rights reserved.
4 * This file is distributed under the terms in the attached LICENSE file.
5 * If you do not find this file, copies can be found by writing to:
6 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
12 * DESCRIPTION: Low Power UART
14 * This is derived from:
16 * i.MX 8DualXPlus Appliacations Processor Reference Manual, revision D, NXP
22 device lpuart msbfirst (addr base) "LPUART" {
24 constants feature "feature set number" {
25 standard = 0b01 "Standard feature set";
26 irda = 0b11 "Standard feature set with MODEM/IrDA support";
29 constants trgsel "trigger select" {
30 disabled = 0b00 "Input trigger is disabled.";
31 rx = 0b01 "Input trigger is used instead of RX pin input.";
32 ctsb = 0b10 "Input trigger is used instead of CTS_B pin input.`";
33 modrx = 0b11 "Input trigger is used to modulate TX pin output.";
36 constants osr "oversampling ratio" {
37 default = 0b00000 "Writing 0 to this field will result in an oversampling ratio of 16.";
38 ratio4 = 0b00011 "Oversampling ratio of 4, requires BOTHEDGE to be set.";
39 ratio5 = 0b00100 "Oversampling ratio of 5, requires BOTHEDGE to be set.";
40 ratio6 = 0b00101 "Oversampling ratio of 6, requires BOTHEDGE to be set.";
41 ratio7 = 0b00110 "Oversampling ratio of 7, requires BOTHEDGE to be set.";
42 ratio8 = 0b00111 "Oversampling ratio of 8.";
43 ratio9 = 0b01000 "Oversampling ratio of 9.";
44 ratio10 = 0b01001 "Oversampling ratio of 10.";
45 ratio11 = 0b01010 "Oversampling ratio of 11.";
46 ratio12 = 0b01011 "Oversampling ratio of 12.";
47 ratio13 = 0b01100 "Oversampling ratio of 13.";
48 ratio14 = 0b01101 "Oversampling ratio of 14.";
49 ratio15 = 0b01110 "Oversampling ratio of 15.";
50 ratio16 = 0b01111 "Oversampling ratio of 16.";
51 ratio17 = 0b10000 "Oversampling ratio of 17.";
52 ratio18 = 0b10001 "Oversampling ratio of 18.";
53 ratio19 = 0b10010 "Oversampling ratio of 19.";
54 ratio20 = 0b10011 "Oversampling ratio of 20.";
55 ratio21 = 0b10100 "Oversampling ratio of 21.";
56 ratio22 = 0b10101 "Oversampling ratio of 22.";
57 ratio23 = 0b10110 "Oversampling ratio of 23.";
58 ratio24 = 0b10111 "Oversampling ratio of 24.";
59 ratio25 = 0b11000 "Oversampling ratio of 25.";
60 ratio26 = 0b11001 "Oversampling ratio of 26.";
61 ratio27 = 0b11010 "Oversampling ratio of 27.";
62 ratio28 = 0b11011 "Oversampling ratio of 28.";
63 ratio29 = 0b11100 "Oversampling ratio of 29.";
64 ratio30 = 0b11101 "Oversampling ratio of 30.";
65 ratio31 = 0b11110 "Oversampling ratio of 31.";
66 ratio32 = 0b11111 "Oversampling ratio of 32.";
69 register verid ro addr(base, 0x0) "Version ID Register" {
70 major 8 "Major Version Number";
71 minor 8 "Minor Version Number";
72 feature 16 type(feature) "Feature Identification Number";
75 register param ro addr(base, 0x4) "Parameter Register" {
77 rxfifo 8 "Receive FIFO size (2^RXFIFO)";
78 txfifo 8 "Transmit FIFO size (2^FIFO)";
81 register global ro addr(base, 0x8) "LPUART Global Register" {
83 rst 1 rw "Software Reset";
87 register pincfg addr(base, 0xc) "LPUART Pin Configuration Register" {
89 trgsel 2 rw type(trgsel) "Trigger select";
92 register baud addr(base, 0x10) "LPUART Baud Rate Register" {
93 maen1 1 "Match address mode enable 1";
94 maen2 1 "Match address mode enable 2";
95 m10 1 "10-bit mode select";
96 osr 5 type(osr) "Oversampling ratio";
97 tdmae 1 "Transmitter DMA Enable";
99 rdmae 1 "Receiver Full DMA Enable";
100 ridmae 1 "Receiver idle DMA Enable";
101 matcfg 2 "Match Configuration";
102 bothedge 1 "Both Edge Sampling";
103 resynccdis 1 "Resynchronization Disable";
104 lbkdie 1 "LIN Break Detect Interrupt Enable";
105 rxedgie 1 "RX Input Active Edge Interrupt Enable";
106 sbns 1 "Stop Bit Number Select";
107 sbr 13 "Baud Rate Modulo Divisor";
110 register stat addr(base, 0x14) "LPUART Status Register" {
111 lbkdif 1 rw1c "LIN Break Detect Interrupt flag";
112 rxedgif 1 rw1c "RX Pin Active Edge Interrupt Flag";
114 rxinv 1 "Receive Data Inversion";
115 rwuid 1 "Whether idle char sets IDLE bit.";
116 brk13 1 "Break Character Generation Length";
117 lbkde 1 "LIN Break Detection Enable";
118 raf 1 ro "Receiver Active Flag";
119 tdre 1 ro "Transmit Data Register Empty Flag";
120 tc 1 ro "Transmit Complete Flag";
121 rdrf 1 ro "Receive Data Register Full Flag";
122 idle 1 rw1c "Idle Line Flag";
123 or 1 rw1c "Receiver Overrun Flag";
124 nf 1 rw1c "Noise Flag";
125 fe 1 rw1c "Framing Error Flag";
126 pf 1 rw1c "Parity Error Flag";
127 ma1f 1 rw1c "Match 1 Flag";
128 ma2f 1 rw1c "Match 2 Flag";
132 register ctrl addr(base, 0x18) "LPUART Control Register" {
133 r8t9 1 "Receive Bit 8 / Transmit Bit 9";
134 r9t8 1 "Receive Bit 9 / Transmit Bit 8";
135 txdir 1 "TX Pin Direction Single-Wire Mode";
136 txinv 1 "Transmit Data Inversion";
137 orie 1 "Overrrun Interrupt Enable";
138 neie 1 "Noise Error Interrupt Enable";
139 feie 1 "Framing Error Interrupt Enable";
140 peie 1 "Parity Error Interrupt Enable";
141 tie 1 "Transmit Interrupt Enable";
142 tcie 1 "Transmission Complete Interrupt Enable";
143 rie 1 "Receiver Interrupt Enable";
144 iue 1 "Idle Line Interrupt Enable";
145 te 1 "Transmitter Enable";
146 re 1 "Receiver Enable";
147 rwu 1 "Receiver Wakeup Control";
149 ma1ie 1 "Match 1 Interrupt Enable";
150 ma2ie 1 "Match 2 Interrupt Enable";
152 m7 1 "7-Bit Mode Select";
153 idlecfg 3 "Idle Configuration (2^IDLECFG idle characters before IDLE flag set)";
154 loops 1 "Loop Mode Select";
155 dozeen 1 "Doze Enable";
156 rsrc 1 "Receiver Source Select";
157 m 1 "9-Bit or 8-Bit Mode Select";
158 wake 1 "Receiver Wakeup Method Select";
159 ilt 1 "Idle Line Type Select";
160 pe 1 "Parity Enable";
164 register data addr(base, 0x1c) "LPUART Receive Data Register" {
166 noisy 1 ro "Whether received with noise.";
167 paritye 1 ro "Whether received with parity error.";
168 fretsc 1 "Whether received with frame error/Transmit Special Character";
169 rxempt 1 ro "Receive Buffer Empty";
170 idline 1 ro "Idle Line";
172 buf 10 "Data buffer";
175 register match addr(base, 0x20) "LPUART Match Address Register" {
177 ma2 10 "Match Address 2";
179 ma1 10 "Match Address 1";
182 register modir addr(base, 0x24) "LPUART Modem IrDA Register" {
184 iren 1 "Infrared enable";
185 tnp 2 "Transmitter narrow pulse";
187 rtswater 6 "Receive RTS Configuration";
189 txctssrc 1 "Transmit CTS Source";
190 txctsc 1 "Transmit CTS Configuration";
191 rxrtse 1 "Receiver request-to-send enable";
192 txrtspol 1 "Transmitter request-to-send polarity";
193 txrtse 1 "Transmitter request-to-send enable";
194 txctse 1 "Transmitter clear-to-send enable";
197 register fifo addr(base, 0x28) "LPUART FIFO Register" {
199 txempt 1 ro "Transmit Buffer/FIFO Empty";
200 rxempt 1 ro "Receive Buffer/FIFO Empty";
202 txof 1 rw1c "Trasnmitter Buffer Overflow Flag";
203 rxuf 1 rw1c "Receiver Buffer Underflow Flag";
204 txflush 1 wo "Transmit FIFO/Buffer Flush";
205 rxflush 1 wo "Receive FIFO/Buffer Flush";
207 rxiden 3 "Receiver Idle Empty Enable";
208 txofe 1 "Transmit FIFO Overflow Interrupt Enable";
209 rxufe 1 "Receive FIFO Underflow Interrupt Enable";
210 txfe 1 "Transmit FIFO Enable";
211 txfifosize 3 ro "Transmit FIFO Buffer Depth";
212 rxfe 1 "Receive FIFO Enable";
213 rxfifosize 3 ro "Receive FIFO Buffer Depth";
216 register water addr(base, 0x2c) "LPUART Watemark Register" {
218 rxcount 7 ro "Receive Counter";
220 rxwater 6 "Receiver Watermark";
222 txcount 7 ro "Transmit Counter";
224 txwater 6 "Transmit Watermark";