From: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
To: Thomas Koeller <thomas.koeller@baslerweb.com>
Cc: yoichi_yuasa@tripeaks.co.jp, sshtylyov@ru.mvista.com,
rmk+serial@arm.linux.org.uk, linux-serial@vger.kernel.org,
ralf@linux-mips.org, linux-mips@linux-mips.org,
thomas@koeller.dyndns.org
Subject: Re: [PATCH] RM9000 serial driver
Date: Tue, 22 Aug 2006 09:59:42 +0900 [thread overview]
Message-ID: <20060822095942.4663a4cd.yoichi_yuasa@tripeaks.co.jp> (raw)
In-Reply-To: <200608220057.52213.thomas.koeller@baslerweb.com>
Hi,
On Tue, 22 Aug 2006 00:57:51 +0200
Thomas Koeller <thomas.koeller@baslerweb.com> wrote:
<snip>
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index 0ae9ced..c6c28ed 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -251,9 +251,16 @@ static const struct serial8250_config ua
> .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
> .flags = UART_CAP_FIFO | UART_CAP_UUE,
> },
> + [PORT_RM9000] = {
> + .name = "RM9000",
> + .fifo_size = 16,
> + .tx_loadsz = 16,
> + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
> + .flags = UART_CAP_FIFO,
> + },
> };
>
> -#ifdef CONFIG_SERIAL_8250_AU1X00
> +#if defined (CONFIG_SERIAL_8250_AU1X00)
>
> /* Au1x00 UART hardware has a weird register layout */
> static const u8 au_io_in_map[] = {
> @@ -289,6 +296,34 @@ static inline int map_8250_out_reg(struc
> return au_io_out_map[offset];
> }
>
> +#elif defined (CONFIG_SERIAL_RM9000)
CONFIG_SERIAL_8250_RM9000.
Morover, you should update drivers/serial/Kconfig
> +
> +static const u8
> + regmap_in[8] = {
> + [UART_RX] = 0x00,
> + [UART_IER] = 0x0c,
> + [UART_IIR] = 0x14,
> + [UART_LCR] = 0x1c,
> + [UART_MCR] = 0x20,
> + [UART_LSR] = 0x24,
> + [UART_MSR] = 0x28,
> + [UART_SCR] = 0x2c
> + },
> + regmap_out[8] = {
> + [UART_TX] = 0x04,
> + [UART_IER] = 0x0c,
> + [UART_FCR] = 0x18,
> + [UART_LCR] = 0x1c,
> + [UART_MCR] = 0x20,
> + [UART_LSR] = 0x24,
> + [UART_MSR] = 0x28,
> + [UART_SCR] = 0x2c
> + };
> +
> +#define map_8250_in_reg(up, offset) (regmap_in[offset])
> +#define map_8250_out_reg(up, offset) (regmap_out[offset])
> +
> +
> #else
>
> /* sane hardware needs no mapping */
> @@ -374,21 +409,21 @@ #define serial_inp(up, offset) serial_i
> #define serial_outp(up, offset, value) serial_out(up, offset, value)
>
> /* Uart divisor latch read */
> -static inline int _serial_dl_read(struct uart_8250_port *up)
> +static inline unsigned int _serial_dl_read(struct uart_8250_port *up)
> {
> return serial_inp(up, UART_DLL) | serial_inp(up, UART_DLM) << 8;
> }
>
> /* Uart divisor latch write */
> -static inline void _serial_dl_write(struct uart_8250_port *up, int value)
> +static inline void _serial_dl_write(struct uart_8250_port *up, unsigned int value)
> {
> serial_outp(up, UART_DLL, value & 0xff);
> serial_outp(up, UART_DLM, value >> 8 & 0xff);
> }
>
> -#ifdef CONFIG_SERIAL_8250_AU1X00
> +#if defined (CONFIG_SERIAL_8250_AU1X00)
> /* Au1x00 haven't got a standard divisor latch */
> -static int serial_dl_read(struct uart_8250_port *up)
> +static unsigned int serial_dl_read(struct uart_8250_port *up)
> {
> if (up->port.iotype == UPIO_AU)
> return __raw_readl(up->port.membase + 0x28);
> @@ -396,13 +431,26 @@ static int serial_dl_read(struct uart_82
> return _serial_dl_read(up);
> }
>
> -static void serial_dl_write(struct uart_8250_port *up, int value)
> +static void serial_dl_write(struct uart_8250_port *up, unsigned int value)
> {
> if (up->port.iotype == UPIO_AU)
> __raw_writel(value, up->port.membase + 0x28);
> else
> _serial_dl_write(up, value);
> }
> +#elif defined (CONFIG_SERIAL_RM9000)
> +static inline unsigned int serial_dl_read(struct uart_8250_port *up)
> +{
> + return
> + ((readl(up->port.membase + 0x10) << 8) |
> + (readl(up->port.membase + 0x08) & 0xff)) & 0xffff;
> +}
> +
> +static inline void serial_dl_write(struct uart_8250_port *up, unsigned int value)
> +{
> + writel(value, up->port.membase + 0x08);
> + writel(value >> 8, up->port.membase + 0x10);
> +}
> #else
If you have an another standard 8250 port. this driver cannot support it
You should do as well as AU1X00.
Yoichi
next prev parent reply other threads:[~2006-08-22 1:00 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 21:18 [PATCH] RM9000 serial driver Thomas Koeller
2006-08-11 19:39 ` Sergei Shtylyov
2006-08-15 21:15 ` Thomas Koeller
2006-08-15 21:35 ` Sergei Shtylyov
2006-08-21 22:57 ` Thomas Koeller
2006-08-22 0:59 ` Yoichi Yuasa [this message]
2006-08-22 20:27 ` Thomas Koeller
2006-08-29 15:14 ` Sergei Shtylyov
2006-08-29 23:05 ` Thomas Koeller
2006-08-30 11:59 ` Sergei Shtylyov
2006-08-25 22:38 ` Thomas Koeller
2006-08-26 3:56 ` Jonathan Day
2006-08-29 13:32 ` Sergei Shtylyov
2006-08-29 19:04 ` Russell King
2006-08-29 19:37 ` Sergei Shtylyov
2006-08-29 19:59 ` Russell King
2006-08-30 21:16 ` Thomas Koeller
2006-08-29 23:00 ` Thomas Koeller
2006-08-30 12:12 ` Russell King
2006-08-30 16:50 ` Sergei Shtylyov
2007-02-10 16:11 ` Thomas Koeller
2007-02-10 18:20 ` Sergei Shtylyov
2007-02-12 0:28 ` Thomas Koeller
2007-02-12 0:57 ` Thomas Koeller
2006-08-30 21:28 ` Thomas Koeller
2006-08-31 7:24 ` Sergei Shtylyov
2006-08-30 13:22 ` Sergei Shtylyov
2006-08-30 14:18 ` Sergei Shtylyov
2006-08-30 16:23 ` Sergei Shtylyov
2006-09-09 17:19 ` Sergei Shtylyov
2006-08-30 12:15 ` Russell King
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=20060822095942.4663a4cd.yoichi_yuasa@tripeaks.co.jp \
--to=yoichi_yuasa@tripeaks.co.jp \
--cc=linux-mips@linux-mips.org \
--cc=linux-serial@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=rmk+serial@arm.linux.org.uk \
--cc=sshtylyov@ru.mvista.com \
--cc=thomas.koeller@baslerweb.com \
--cc=thomas@koeller.dyndns.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 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.