From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: John Linn <john.linn@xilinx.com>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 17/25] serial: uartlite: move from byte accesses to word accesses
Date: Fri, 21 May 2010 09:51:46 -0700 [thread overview]
Message-ID: <1274460714-11277-17-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20100521165113.GB11216@kroah.com>
From: John Linn <john.linn@xilinx.com>
Byte accesses for I/O devices in Xilinx IP is going to be less
desired in the future such that the driver is being changed to
use 32 bit accesses.
This change facilitates using the uartlite IP over a PCIe bus
which only allows 32 bit accesses.
Signed-off-by: John Linn <john.linn@xilinx.com>
Tested-by: Michal Simek <monstr@monstr.eu>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/serial/uartlite.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index f0a6c61..e6639a9 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -86,7 +86,7 @@ static int ulite_receive(struct uart_port *port, int stat)
/* stats */
if (stat & ULITE_STATUS_RXVALID) {
port->icount.rx++;
- ch = readb(port->membase + ULITE_RX);
+ ch = ioread32be(port->membase + ULITE_RX);
if (stat & ULITE_STATUS_PARITY)
port->icount.parity++;
@@ -131,7 +131,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
return 0;
if (port->x_char) {
- writeb(port->x_char, port->membase + ULITE_TX);
+ iowrite32be(port->x_char, port->membase + ULITE_TX);
port->x_char = 0;
port->icount.tx++;
return 1;
@@ -140,7 +140,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
if (uart_circ_empty(xmit) || uart_tx_stopped(port))
return 0;
- writeb(xmit->buf[xmit->tail], port->membase + ULITE_TX);
+ iowrite32be(xmit->buf[xmit->tail], port->membase + ULITE_TX);
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE-1);
port->icount.tx++;
@@ -157,7 +157,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
int busy, n = 0;
do {
- int stat = readb(port->membase + ULITE_STATUS);
+ int stat = ioread32be(port->membase + ULITE_STATUS);
busy = ulite_receive(port, stat);
busy |= ulite_transmit(port, stat);
n++;
@@ -178,7 +178,7 @@ static unsigned int ulite_tx_empty(struct uart_port *port)
unsigned int ret;
spin_lock_irqsave(&port->lock, flags);
- ret = readb(port->membase + ULITE_STATUS);
+ ret = ioread32be(port->membase + ULITE_STATUS);
spin_unlock_irqrestore(&port->lock, flags);
return ret & ULITE_STATUS_TXEMPTY ? TIOCSER_TEMT : 0;
@@ -201,7 +201,7 @@ static void ulite_stop_tx(struct uart_port *port)
static void ulite_start_tx(struct uart_port *port)
{
- ulite_transmit(port, readb(port->membase + ULITE_STATUS));
+ ulite_transmit(port, ioread32be(port->membase + ULITE_STATUS));
}
static void ulite_stop_rx(struct uart_port *port)
@@ -230,17 +230,17 @@ static int ulite_startup(struct uart_port *port)
if (ret)
return ret;
- writeb(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX,
+ iowrite32be(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX,
port->membase + ULITE_CONTROL);
- writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
+ iowrite32be(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
return 0;
}
static void ulite_shutdown(struct uart_port *port)
{
- writeb(0, port->membase + ULITE_CONTROL);
- readb(port->membase + ULITE_CONTROL); /* dummy */
+ iowrite32be(0, port->membase + ULITE_CONTROL);
+ ioread32be(port->membase + ULITE_CONTROL); /* dummy */
free_irq(port->irq, port);
}
@@ -352,7 +352,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
/* Spin waiting for TX fifo to have space available */
for (i = 0; i < 100000; i++) {
- val = readb(port->membase + ULITE_STATUS);
+ val = ioread32be(port->membase + ULITE_STATUS);
if ((val & ULITE_STATUS_TXFULL) == 0)
break;
cpu_relax();
@@ -362,7 +362,7 @@ static void ulite_console_wait_tx(struct uart_port *port)
static void ulite_console_putchar(struct uart_port *port, int ch)
{
ulite_console_wait_tx(port);
- writeb(ch, port->membase + ULITE_TX);
+ iowrite32be(ch, port->membase + ULITE_TX);
}
static void ulite_console_write(struct console *co, const char *s,
@@ -379,8 +379,8 @@ static void ulite_console_write(struct console *co, const char *s,
spin_lock_irqsave(&port->lock, flags);
/* save and disable interrupt */
- ier = readb(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
- writeb(0, port->membase + ULITE_CONTROL);
+ ier = ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
+ iowrite32be(0, port->membase + ULITE_CONTROL);
uart_console_write(port, s, count, ulite_console_putchar);
@@ -388,7 +388,7 @@ static void ulite_console_write(struct console *co, const char *s,
/* restore interrupt state */
if (ier)
- writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
+ iowrite32be(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
if (locked)
spin_unlock_irqrestore(&port->lock, flags);
@@ -601,7 +601,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
id = of_get_property(op->node, "port-number", NULL);
- return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq);
+ return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
}
static int __devexit ulite_of_remove(struct of_device *op)
--
1.7.0.3
next prev parent reply other threads:[~2010-05-21 16:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-21 16:51 [GIT PATCH] TTY patches for 2.6.35 Greg KH
2010-05-21 16:51 ` [PATCH 01/25] serial: bfin_sport_uart: work around anomaly 05000473 (make 32bit fifo read atomic) Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 02/25] serial: bfin_sport_uart: shorten the SPORT TX waiting loop Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 03/25] serial: bfin_sport_uart: remove unused peripheral pin lists Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 04/25] serial: bfin_sport_uart: add missing mapbase initialization Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 05/25] serial: bfin_sport_uart: rename early platform driver class string Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 06/25] serial: bfin_sport_uart: add support for CTS/RTS via GPIOs Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 07/25] serial: bfin_sport_uart: protect changes to uart_port Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 08/25] serial: bfin_sport_uart: zero sport_uart_port if allocated dynamically Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 09/25] serial: bfin_sport_uart: drop useless status masks Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 10/25] serial: bfin_sport_uart: only enable SPORT TX if data is to be sent Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 11/25] serial: bfin_sport_uart: pull in bfin_sport.h for SPORT defines Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 12/25] serial: bfin_sport_uart: drop the experimental markings Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 13/25] serial: bfin_sport_uart: drop redundant cpu depends Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 14/25] serial: TTY: new ldiscs for staging Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 15/25] tty: n_gsm line discipline Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 16/25] tty: n_gsm: depends on NET Greg Kroah-Hartman
2010-05-21 16:51 ` Greg Kroah-Hartman [this message]
2010-05-21 16:51 ` [PATCH 18/25] serial: two branches the same in timbuart_set_mctrl() Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 19/25] serial: timbuart: make sure last byte is sent when port is closed Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 20/25] serial: Add driver for the Altera JTAG UART Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 21/25] serial: Add driver for the Altera UART Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 22/25] tty: fix obsolete comment on tty_insert_flip_string_fixed_flag Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 23/25] serial: bfin_sport_uart: Use resource size to fix off-by-one error Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 24/25] serial: isicomm: handle running out of slots Greg Kroah-Hartman
2010-05-21 16:51 ` [PATCH 25/25] serial: Tidy REMOTE_DEBUG Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274460714-11277-17-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=john.linn@xilinx.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®