@@ -33,29 +33,29 @@ struct timbuart_port {
33
33
struct uart_port port ;
34
34
struct tasklet_struct tasklet ;
35
35
int usedma ;
36
- u8 last_ier ;
36
+ u32 last_ier ;
37
37
struct platform_device * dev ;
38
38
};
39
39
40
40
static int baudrates [] = {9600 , 19200 , 38400 , 57600 , 115200 , 230400 , 460800 ,
41
41
921600 , 1843200 , 3250000 };
42
42
43
- static void timbuart_mctrl_check (struct uart_port * port , u8 isr , u8 * ier );
43
+ static void timbuart_mctrl_check (struct uart_port * port , u32 isr , u32 * ier );
44
44
45
45
static irqreturn_t timbuart_handleinterrupt (int irq , void * devid );
46
46
47
47
static void timbuart_stop_rx (struct uart_port * port )
48
48
{
49
49
/* spin lock held by upper layer, disable all RX interrupts */
50
- u8 ier = ioread8 (port -> membase + TIMBUART_IER ) & ~RXFLAGS ;
51
- iowrite8 (ier , port -> membase + TIMBUART_IER );
50
+ u32 ier = ioread32 (port -> membase + TIMBUART_IER ) & ~RXFLAGS ;
51
+ iowrite32 (ier , port -> membase + TIMBUART_IER );
52
52
}
53
53
54
54
static void timbuart_stop_tx (struct uart_port * port )
55
55
{
56
56
/* spinlock held by upper layer, disable TX interrupt */
57
- u8 ier = ioread8 (port -> membase + TIMBUART_IER ) & ~TXBAE ;
58
- iowrite8 (ier , port -> membase + TIMBUART_IER );
57
+ u32 ier = ioread32 (port -> membase + TIMBUART_IER ) & ~TXBAE ;
58
+ iowrite32 (ier , port -> membase + TIMBUART_IER );
59
59
}
60
60
61
61
static void timbuart_start_tx (struct uart_port * port )
@@ -72,14 +72,14 @@ static void timbuart_flush_buffer(struct uart_port *port)
72
72
u8 ctl = ioread8 (port -> membase + TIMBUART_CTRL ) | TIMBUART_CTRL_FLSHTX ;
73
73
74
74
iowrite8 (ctl , port -> membase + TIMBUART_CTRL );
75
- iowrite8 (TXBF , port -> membase + TIMBUART_ISR );
75
+ iowrite32 (TXBF , port -> membase + TIMBUART_ISR );
76
76
}
77
77
78
78
static void timbuart_rx_chars (struct uart_port * port )
79
79
{
80
80
struct tty_struct * tty = port -> info -> port .tty ;
81
81
82
- while (ioread8 (port -> membase + TIMBUART_ISR ) & RXDP ) {
82
+ while (ioread32 (port -> membase + TIMBUART_ISR ) & RXDP ) {
83
83
u8 ch = ioread8 (port -> membase + TIMBUART_RXFIFO );
84
84
port -> icount .rx ++ ;
85
85
tty_insert_flip_char (tty , ch , TTY_NORMAL );
@@ -97,7 +97,7 @@ static void timbuart_tx_chars(struct uart_port *port)
97
97
{
98
98
struct circ_buf * xmit = & port -> info -> xmit ;
99
99
100
- while (!(ioread8 (port -> membase + TIMBUART_ISR ) & TXBF ) &&
100
+ while (!(ioread32 (port -> membase + TIMBUART_ISR ) & TXBF ) &&
101
101
!uart_circ_empty (xmit )) {
102
102
iowrite8 (xmit -> buf [xmit -> tail ],
103
103
port -> membase + TIMBUART_TXFIFO );
@@ -114,7 +114,7 @@ static void timbuart_tx_chars(struct uart_port *port)
114
114
ioread8 (port -> membase + TIMBUART_BAUDRATE ));
115
115
}
116
116
117
- static void timbuart_handle_tx_port (struct uart_port * port , u8 isr , u8 * ier )
117
+ static void timbuart_handle_tx_port (struct uart_port * port , u32 isr , u32 * ier )
118
118
{
119
119
struct timbuart_port * uart =
120
120
container_of (port , struct timbuart_port , port );
@@ -129,7 +129,7 @@ static void timbuart_handle_tx_port(struct uart_port *port, u8 isr, u8 *ier)
129
129
if (isr & TXFLAGS ) {
130
130
timbuart_tx_chars (port );
131
131
/* clear all TX interrupts */
132
- iowrite8 (TXFLAGS , port -> membase + TIMBUART_ISR );
132
+ iowrite32 (TXFLAGS , port -> membase + TIMBUART_ISR );
133
133
134
134
if (uart_circ_chars_pending (xmit ) < WAKEUP_CHARS )
135
135
uart_write_wakeup (port );
@@ -148,7 +148,7 @@ static void timbuart_handle_tx_port(struct uart_port *port, u8 isr, u8 *ier)
148
148
dev_dbg (port -> dev , "%s - leaving\n" , __func__ );
149
149
}
150
150
151
- void timbuart_handle_rx_port (struct uart_port * port , u8 isr , u8 * ier )
151
+ void timbuart_handle_rx_port (struct uart_port * port , u32 isr , u32 * ier )
152
152
{
153
153
if (isr & RXFLAGS ) {
154
154
/* Some RX status is set */
@@ -161,7 +161,7 @@ void timbuart_handle_rx_port(struct uart_port *port, u8 isr, u8 *ier)
161
161
timbuart_rx_chars (port );
162
162
163
163
/* ack all RX interrupts */
164
- iowrite8 (RXFLAGS , port -> membase + TIMBUART_ISR );
164
+ iowrite32 (RXFLAGS , port -> membase + TIMBUART_ISR );
165
165
}
166
166
167
167
/* always have the RX interrupts enabled */
@@ -173,11 +173,11 @@ void timbuart_handle_rx_port(struct uart_port *port, u8 isr, u8 *ier)
173
173
void timbuart_tasklet (unsigned long arg )
174
174
{
175
175
struct timbuart_port * uart = (struct timbuart_port * )arg ;
176
- u8 isr , ier = 0 ;
176
+ u32 isr , ier = 0 ;
177
177
178
178
spin_lock (& uart -> port .lock );
179
179
180
- isr = ioread8 (uart -> port .membase + TIMBUART_ISR );
180
+ isr = ioread32 (uart -> port .membase + TIMBUART_ISR );
181
181
dev_dbg (uart -> port .dev , "%s ISR: %x\n" , __func__ , isr );
182
182
183
183
if (!uart -> usedma )
@@ -188,17 +188,17 @@ void timbuart_tasklet(unsigned long arg)
188
188
if (!uart -> usedma )
189
189
timbuart_handle_rx_port (& uart -> port , isr , & ier );
190
190
191
- iowrite8 (ier , uart -> port .membase + TIMBUART_IER );
191
+ iowrite32 (ier , uart -> port .membase + TIMBUART_IER );
192
192
193
193
spin_unlock (& uart -> port .lock );
194
194
dev_dbg (uart -> port .dev , "%s leaving\n" , __func__ );
195
195
}
196
196
197
197
static unsigned int timbuart_tx_empty (struct uart_port * port )
198
198
{
199
- u8 isr = ioread8 (port -> membase + TIMBUART_ISR );
199
+ u32 isr = ioread32 (port -> membase + TIMBUART_ISR );
200
200
201
- return (isr & TXBAE ) ? TIOCSER_TEMT : 0 ;
201
+ return (isr & TXBE ) ? TIOCSER_TEMT : 0 ;
202
202
}
203
203
204
204
static unsigned int timbuart_get_mctrl (struct uart_port * port )
@@ -222,13 +222,13 @@ static void timbuart_set_mctrl(struct uart_port *port, unsigned int mctrl)
222
222
iowrite8 (TIMBUART_CTRL_RTS , port -> membase + TIMBUART_CTRL );
223
223
}
224
224
225
- static void timbuart_mctrl_check (struct uart_port * port , u8 isr , u8 * ier )
225
+ static void timbuart_mctrl_check (struct uart_port * port , u32 isr , u32 * ier )
226
226
{
227
227
unsigned int cts ;
228
228
229
229
if (isr & CTS_DELTA ) {
230
230
/* ack */
231
- iowrite8 (CTS_DELTA , port -> membase + TIMBUART_ISR );
231
+ iowrite32 (CTS_DELTA , port -> membase + TIMBUART_ISR );
232
232
cts = timbuart_get_mctrl (port );
233
233
uart_handle_cts_change (port , cts & TIOCM_CTS );
234
234
wake_up_interruptible (& port -> info -> delta_msr_wait );
@@ -255,9 +255,9 @@ static int timbuart_startup(struct uart_port *port)
255
255
dev_dbg (port -> dev , "%s\n" , __func__ );
256
256
257
257
iowrite8 (TIMBUART_CTRL_FLSHRX , port -> membase + TIMBUART_CTRL );
258
- iowrite8 ( 0xff , port -> membase + TIMBUART_ISR );
258
+ iowrite32 ( 0x1ff , port -> membase + TIMBUART_ISR );
259
259
/* Enable all but TX interrupts */
260
- iowrite8 (RXBAF | RXBF | RXTT | CTS_DELTA ,
260
+ iowrite32 (RXBAF | RXBF | RXTT | CTS_DELTA ,
261
261
port -> membase + TIMBUART_IER );
262
262
263
263
return request_irq (port -> irq , timbuart_handleinterrupt , IRQF_SHARED ,
@@ -270,7 +270,7 @@ static void timbuart_shutdown(struct uart_port *port)
270
270
container_of (port , struct timbuart_port , port );
271
271
dev_dbg (port -> dev , "%s\n" , __func__ );
272
272
free_irq (port -> irq , uart );
273
- iowrite8 (0 , port -> membase + TIMBUART_IER );
273
+ iowrite32 (0 , port -> membase + TIMBUART_IER );
274
274
}
275
275
276
276
static int get_bindex (int baud )
@@ -359,10 +359,10 @@ static irqreturn_t timbuart_handleinterrupt(int irq, void *devid)
359
359
struct timbuart_port * uart = (struct timbuart_port * )devid ;
360
360
361
361
if (ioread8 (uart -> port .membase + TIMBUART_IPR )) {
362
- uart -> last_ier = ioread8 (uart -> port .membase + TIMBUART_IER );
362
+ uart -> last_ier = ioread32 (uart -> port .membase + TIMBUART_IER );
363
363
364
364
/* disable interrupts, the tasklet enables them again */
365
- iowrite8 (0 , uart -> port .membase + TIMBUART_IER );
365
+ iowrite32 (0 , uart -> port .membase + TIMBUART_IER );
366
366
367
367
/* fire off bottom half */
368
368
tasklet_schedule (& uart -> tasklet );
0 commit comments