From: Russell King <rmk@arm.linux.org.uk>
To: Martin Michlmayr <tbm@cyrius.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org,
Stanislaw Skowronek <skylark@linux-mips.org>
Subject: Re: Merging Skylark's IOC3 patch
Date: Sun, 19 Feb 2006 22:07:22 +0000 [thread overview]
Message-ID: <20060219220722.GB968@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060219215740.GQ10266@deprecation.cyrius.com>
On Sun, Feb 19, 2006 at 09:57:40PM +0000, Martin Michlmayr wrote:
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -310,6 +310,9 @@ static unsigned int serial_in(struct uar
> case UPIO_MEM:
> return readb(up->port.membase + offset);
>
> + case UPIO_IOC3:
> + return readb(up->port.membase + (offset^3));
> +
> case UPIO_MEM32:
> return readl(up->port.membase + offset);
>
> @@ -338,6 +341,10 @@ serial_out(struct uart_8250_port *up, in
> writeb(value, up->port.membase + offset);
> break;
>
> + case UPIO_IOC3:
> + writeb(value, up->port.membase + (offset^3));
> + break;
> +
> case UPIO_MEM32:
> writel(value, up->port.membase + offset);
> break;
Hmm, this starts to open up the question of whether having an array
of register pointers becomes cheaper.
> @@ -2300,8 +2311,10 @@ int __init serial8250_start_console(stru
>
> add_preferred_console("ttyS", line, options);
> printk("Adding console on ttyS%d at %s 0x%lx (options '%s')\n",
> - line, port->iotype == UPIO_MEM ? "MMIO" : "I/O port",
> - port->iotype == UPIO_MEM ? (unsigned long) port->mapbase :
> + line, port->iotype == UPIO_MEM ? "MMIO" :
> + port->iotype == UPIO_IOC3 ? "IOC3" : "I/O port",
> + (port->iotype == UPIO_MEM || port->iotype == UPIO_IOC3) ?
> + (unsigned long) port->mapbase :
> (unsigned long) port->iobase, options);
Maybe the "iotype" should index an array?
> diff --git a/include/linux/serial.h b/include/linux/serial.h
> index c69c6b9..a3ee515 100644
> --- a/include/linux/serial.h
> +++ b/include/linux/serial.h
> @@ -82,6 +82,7 @@ struct serial_struct {
> #define SERIAL_IO_PORT 0
> #define SERIAL_IO_HUB6 1
> #define SERIAL_IO_MEM 2
> +#define SERIAL_IO_IOC3 3
>
> struct serial_uart_config {
> char *name;
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 4041122..9441c90 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -221,6 +221,7 @@ struct uart_port {
> #define UPIO_MEM (2)
> #define UPIO_MEM32 (3)
> #define UPIO_AU (4) /* Au1x00 type IO */
> +#define UPIO_IOC3 (5)
Comparing SERIAL_IO_* and UPIO_*, I have to say no here. Always ensure
that they end up with the same number. SERIAL_IO_* is the current
userland version of UPIO_*. At some point in the future (once the
pipedream of having _all_ serial drivers updated becomes reality) this
can be sorted out sanely.
> + port.membase = (unsigned char *) &idd->vma->sregs.uarta;
> + port.mapbase = ((unsigned long) port.membase) & 0xFFFFFFFFFF;
> + d->line_a = serial8250_register_port(&port);
mapbase is supposed to be the physical address, whereas membase is what is
used to access the register, and should be something compatible with MMIO
accessors. Is the cast really required here?
Are you tagging MMIO stuff with __iomem ?
Apart from that, I don't have any further comments at present.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-02-19 22:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-19 21:15 Merging Skylark's IOC3 patch Martin Michlmayr
2006-02-19 21:15 ` Martin Michlmayr
2006-02-19 21:54 ` Martin Michlmayr
2006-02-19 22:04 ` Martin Michlmayr
2006-02-19 21:55 ` Martin Michlmayr
2006-02-19 22:31 ` Dmitry Torokhov
2006-02-19 21:56 ` Martin Michlmayr
2006-02-19 21:57 ` Martin Michlmayr
2006-02-19 22:07 ` Russell King [this message]
2006-02-19 21:58 ` Martin Michlmayr
2006-02-19 22:01 ` Martin Michlmayr
2006-02-19 22:10 ` Martin Michlmayr
2006-02-19 21:58 ` Martin Michlmayr
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=20060219220722.GB968@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=skylark@linux-mips.org \
--cc=tbm@cyrius.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.