aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/uartlite.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-10-02 12:47:02 -0400
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2007-10-03 08:37:41 -0400
commite077b50c29a7e8be5812d1156934ea837b712ca6 (patch)
tree45fc2e9e02a9b9f97f4d671d7fa98753f1a05fc6 /drivers/serial/uartlite.c
parentbe1b4d34e3a379d20d50e75a95aa5c3f0c7cf612 (diff)
[POWERPC] Uartlite: Revert register io access changes
Reverts commit a15da8eff3627b8368db7f5dd260e5643213d918 This driver is used by devices other than the xilinx opb-uartlite which depend on bytewise access to the registers. The change to 32 bit access does not work on these devices. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/serial/uartlite.c')
-rw-r--r--drivers/serial/uartlite.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 2b8404c81164..dfef83f14960 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -75,7 +75,7 @@ static int ulite_receive(struct uart_port *port, int stat)
75 /* stats */ 75 /* stats */
76 if (stat & ULITE_STATUS_RXVALID) { 76 if (stat & ULITE_STATUS_RXVALID) {
77 port->icount.rx++; 77 port->icount.rx++;
78 ch = in_be32((void*)port->membase + ULITE_RX); 78 ch = readb(port->membase + ULITE_RX);
79 79
80 if (stat & ULITE_STATUS_PARITY) 80 if (stat & ULITE_STATUS_PARITY)
81 port->icount.parity++; 81 port->icount.parity++;
@@ -120,7 +120,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
120 return 0; 120 return 0;
121 121
122 if (port->x_char) { 122 if (port->x_char) {
123 out_be32((void*)port->membase + ULITE_TX, port->x_char); 123 writeb(port->x_char, port->membase + ULITE_TX);
124 port->x_char = 0; 124 port->x_char = 0;
125 port->icount.tx++; 125 port->icount.tx++;
126 return 1; 126 return 1;
@@ -129,7 +129,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
129 if (uart_circ_empty(xmit) || uart_tx_stopped(port)) 129 if (uart_circ_empty(xmit) || uart_tx_stopped(port))
130 return 0; 130 return 0;
131 131
132 out_be32((void*)port->membase + ULITE_TX, xmit->buf[xmit->tail]); 132 writeb(xmit->buf[xmit->tail], port->membase + ULITE_TX);
133 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE-1); 133 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE-1);
134 port->icount.tx++; 134 port->icount.tx++;
135 135
@@ -146,7 +146,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
146 int busy; 146 int busy;
147 147
148 do { 148 do {
149 int stat = in_be32((void*)port->membase + ULITE_STATUS); 149 int stat = readb(port->membase + ULITE_STATUS);
150 busy = ulite_receive(port, stat); 150 busy = ulite_receive(port, stat);
151 busy |= ulite_transmit(port, stat); 151 busy |= ulite_transmit(port, stat);
152 } while (busy); 152 } while (busy);
@@ -162,7 +162,7 @@ static unsigned int ulite_tx_empty(struct uart_port *port)
162 unsigned int ret; 162 unsigned int ret;
163 163
164 spin_lock_irqsave(&port->lock, flags); 164 spin_lock_irqsave(&port->lock, flags);
165 ret = in_be32((void*)port->membase + ULITE_STATUS); 165 ret = readb(port->membase + ULITE_STATUS);
166 spin_unlock_irqrestore(&port->lock, flags); 166 spin_unlock_irqrestore(&port->lock, flags);
167 167
168 return ret & ULITE_STATUS_TXEMPTY ? TIOCSER_TEMT : 0; 168 return ret & ULITE_STATUS_TXEMPTY ? TIOCSER_TEMT : 0;
@@ -185,7 +185,7 @@ static void ulite_stop_tx(struct uart_port *port)
185 185
186static void ulite_start_tx(struct uart_port *port) 186static void ulite_start_tx(struct uart_port *port)
187{ 187{
188 ulite_transmit(port, in_be32((void*)port->membase + ULITE_STATUS)); 188 ulite_transmit(port, readb(port->membase + ULITE_STATUS));
189} 189}
190 190
191static void ulite_stop_rx(struct uart_port *port) 191static void ulite_stop_rx(struct uart_port *port)
@@ -214,17 +214,17 @@ static int ulite_startup(struct uart_port *port)
214 if (ret) 214 if (ret)
215 return ret; 215 return ret;
216 216
217 out_be32((void*)port->membase + ULITE_CONTROL, 217 writeb(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX,
218 ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX); 218 port->membase + ULITE_CONTROL);
219 out_be32((void*)port->membase + ULITE_CONTROL, ULITE_CONTROL_IE); 219 writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
220 220
221 return 0; 221 return 0;
222} 222}
223 223
224static void ulite_shutdown(struct uart_port *port) 224static void ulite_shutdown(struct uart_port *port)
225{ 225{
226 out_be32((void*)port->membase + ULITE_CONTROL, 0); 226 writeb(0, port->membase + ULITE_CONTROL);
227 in_be32((void*)port->membase + ULITE_CONTROL); /* dummy */ 227 readb(port->membase + ULITE_CONTROL); /* dummy */
228 free_irq(port->irq, port); 228 free_irq(port->irq, port);
229} 229}
230 230
@@ -332,7 +332,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
332 332
333 /* wait up to 10ms for the character(s) to be sent */ 333 /* wait up to 10ms for the character(s) to be sent */
334 for (i = 0; i < 10000; i++) { 334 for (i = 0; i < 10000; i++) {
335 if (in_be32((void*)port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY) 335 if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY)
336 break; 336 break;
337 udelay(1); 337 udelay(1);
338 } 338 }
@@ -341,7 +341,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
341static void ulite_console_putchar(struct uart_port *port, int ch) 341static void ulite_console_putchar(struct uart_port *port, int ch)
342{ 342{
343 ulite_console_wait_tx(port); 343 ulite_console_wait_tx(port);
344 out_be32((void*)port->membase + ULITE_TX, ch); 344 writeb(ch, port->membase + ULITE_TX);
345} 345}
346 346
347static void ulite_console_write(struct console *co, const char *s, 347static void ulite_console_write(struct console *co, const char *s,
@@ -358,8 +358,8 @@ static void ulite_console_write(struct console *co, const char *s,
358 spin_lock_irqsave(&port->lock, flags); 358 spin_lock_irqsave(&port->lock, flags);
359 359
360 /* save and disable interrupt */ 360 /* save and disable interrupt */
361 ier = in_be32((void*)port->membase + ULITE_STATUS) & ULITE_STATUS_IE; 361 ier = readb(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
362 out_be32((void*)port->membase + ULITE_CONTROL, 0); 362 writeb(0, port->membase + ULITE_CONTROL);
363 363
364 uart_console_write(port, s, count, ulite_console_putchar); 364 uart_console_write(port, s, count, ulite_console_putchar);
365 365
@@ -367,7 +367,7 @@ static void ulite_console_write(struct console *co, const char *s,
367 367
368 /* restore interrupt state */ 368 /* restore interrupt state */
369 if (ier) 369 if (ier)
370 out_be32((void*)port->membase + ULITE_CONTROL, ULITE_CONTROL_IE); 370 writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
371 371
372 if (locked) 372 if (locked)
373 spin_unlock_irqrestore(&port->lock, flags); 373 spin_unlock_irqrestore(&port->lock, flags);
@@ -598,7 +598,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
598 598
599 rc = of_address_to_resource(op->node, 0, &res); 599 rc = of_address_to_resource(op->node, 0, &res);
600 if (rc) { 600 if (rc) {
601 dev_err(&op->dev, "invalide address\n"); 601 dev_err(&op->dev, "invalid address\n");
602 return rc; 602 return rc;
603 } 603 }
604 604
@@ -606,7 +606,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
606 606
607 id = of_get_property(op->node, "port-number", NULL); 607 id = of_get_property(op->node, "port-number", NULL);
608 608
609 return ulite_assign(&op->dev, id ? *id : -1, res.start, irq); 609 return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq);
610} 610}
611 611
612static int __devexit ulite_of_remove(struct of_device *op) 612static int __devexit ulite_of_remove(struct of_device *op)