All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH 3/7] serial/8250: move UPIO_TSI to powerpc
Date: Thu, 01 Sep 2011 16:02:06 +1000	[thread overview]
Message-ID: <1314856926.4145.12.camel@pasglop> (raw)
In-Reply-To: <1309211120-2803-4-git-send-email-arnd@arndb.de>

On Mon, 2011-06-27 at 23:45 +0200, Arnd Bergmann wrote:
> This iotype is only used by the legacy_serial code in powerpc, so the
> code should live there, rather than be compiled in for every 8250
> driver.

Obviously untested :-)

Misses the definition of UART_IIR etc...

I'm committing a fixed version in my tree

Cheers.
Ben.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: linux-serial@vger.kernel.org
> ---
>  arch/powerpc/kernel/legacy_serial.c |   24 ++++++++++++++++++++++++
>  drivers/tty/serial/8250.c           |   23 -----------------------
>  2 files changed, 24 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
> index 2b97b80..b229e1e 100644
> --- a/arch/powerpc/kernel/legacy_serial.c
> +++ b/arch/powerpc/kernel/legacy_serial.c
> @@ -47,6 +47,24 @@ static struct __initdata of_device_id legacy_serial_parents[] = {
>  static unsigned int legacy_serial_count;
>  static int legacy_serial_console = -1;
>  
> +static unsigned int tsi_serial_in(struct uart_port *p, int offset)
> +{
> +	unsigned int tmp;
> +	offset = offset << p->regshift;
> +	if (offset == UART_IIR) {
> +		tmp = readl(p->membase + (UART_IIR & ~3));
> +		return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
> +	} else
> +		return readb(p->membase + offset);
> +}
> +
> +static void tsi_serial_out(struct uart_port *p, int offset, int value)
> +{
> +	offset = offset << p->regshift;
> +	if (!((offset == UART_IER) && (value & UART_IER_UUE)))
> +		writeb(value, p->membase + offset);
> +}
> +
>  static int __init add_legacy_port(struct device_node *np, int want_index,
>  				  int iotype, phys_addr_t base,
>  				  phys_addr_t taddr, unsigned long irq,
> @@ -102,6 +120,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
>  		legacy_serial_ports[index].iobase = base;
>  	else
>  		legacy_serial_ports[index].mapbase = base;
> +
>  	legacy_serial_ports[index].iotype = iotype;
>  	legacy_serial_ports[index].uartclk = clock;
>  	legacy_serial_ports[index].irq = irq;
> @@ -112,6 +131,11 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
>  	legacy_serial_infos[index].speed = spd ? be32_to_cpup(spd) : 0;
>  	legacy_serial_infos[index].irq_check_parent = irq_check_parent;
>  
> +	if (iotype == UPIO_TSI) {
> +		legacy_serial_ports[index].serial_in = tsi_serial_in;
> +		legacy_serial_ports[index].serial_out = tsi_serial_out;
> +	}
> +
>  	printk(KERN_DEBUG "Found legacy serial port %d for %s\n",
>  	       index, np->full_name);
>  	printk(KERN_DEBUG "  %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n",
> diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
> index c8f107e..d575ccb 100644
> --- a/drivers/tty/serial/8250.c
> +++ b/drivers/tty/serial/8250.c
> @@ -345,24 +345,6 @@ static unsigned int mem32_serial_in(struct uart_port *p, int offset)
>  	return readl(p->membase + offset);
>  }
>  
> -static unsigned int tsi_serial_in(struct uart_port *p, int offset)
> -{
> -	unsigned int tmp;
> -	offset = map_8250_in_reg(p, offset) << p->regshift;
> -	if (offset == UART_IIR) {
> -		tmp = readl(p->membase + (UART_IIR & ~3));
> -		return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
> -	} else
> -		return readb(p->membase + offset);
> -}
> -
> -static void tsi_serial_out(struct uart_port *p, int offset, int value)
> -{
> -	offset = map_8250_out_reg(p, offset) << p->regshift;
> -	if (!((offset == UART_IER) && (value & UART_IER_UUE)))
> -		writeb(value, p->membase + offset);
> -}
> -
>  /* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */
>  static inline void dwapb_save_out_value(struct uart_port *p, int offset,
>  					int value)
> @@ -431,11 +413,6 @@ static void set_io_from_upio(struct uart_port *p)
>  		p->serial_out = mem32_serial_out;
>  		break;
>  
> -	case UPIO_TSI:
> -		p->serial_in = tsi_serial_in;
> -		p->serial_out = tsi_serial_out;
> -		break;
> -
>  	case UPIO_DWAPB:
>  		p->serial_in = mem_serial_in;
>  		p->serial_out = dwapb_serial_out;

WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linuxppc-dev@lists.ozlabs.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH 3/7] serial/8250: move UPIO_TSI to powerpc
Date: Thu, 01 Sep 2011 16:02:06 +1000	[thread overview]
Message-ID: <1314856926.4145.12.camel@pasglop> (raw)
In-Reply-To: <1309211120-2803-4-git-send-email-arnd@arndb.de>

On Mon, 2011-06-27 at 23:45 +0200, Arnd Bergmann wrote:
> This iotype is only used by the legacy_serial code in powerpc, so the
> code should live there, rather than be compiled in for every 8250
> driver.

Obviously untested :-)

Misses the definition of UART_IIR etc...

I'm committing a fixed version in my tree

Cheers.
Ben.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: linux-serial@vger.kernel.org
> ---
>  arch/powerpc/kernel/legacy_serial.c |   24 ++++++++++++++++++++++++
>  drivers/tty/serial/8250.c           |   23 -----------------------
>  2 files changed, 24 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
> index 2b97b80..b229e1e 100644
> --- a/arch/powerpc/kernel/legacy_serial.c
> +++ b/arch/powerpc/kernel/legacy_serial.c
> @@ -47,6 +47,24 @@ static struct __initdata of_device_id legacy_serial_parents[] = {
>  static unsigned int legacy_serial_count;
>  static int legacy_serial_console = -1;
>  
> +static unsigned int tsi_serial_in(struct uart_port *p, int offset)
> +{
> +	unsigned int tmp;
> +	offset = offset << p->regshift;
> +	if (offset == UART_IIR) {
> +		tmp = readl(p->membase + (UART_IIR & ~3));
> +		return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
> +	} else
> +		return readb(p->membase + offset);
> +}
> +
> +static void tsi_serial_out(struct uart_port *p, int offset, int value)
> +{
> +	offset = offset << p->regshift;
> +	if (!((offset == UART_IER) && (value & UART_IER_UUE)))
> +		writeb(value, p->membase + offset);
> +}
> +
>  static int __init add_legacy_port(struct device_node *np, int want_index,
>  				  int iotype, phys_addr_t base,
>  				  phys_addr_t taddr, unsigned long irq,
> @@ -102,6 +120,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
>  		legacy_serial_ports[index].iobase = base;
>  	else
>  		legacy_serial_ports[index].mapbase = base;
> +
>  	legacy_serial_ports[index].iotype = iotype;
>  	legacy_serial_ports[index].uartclk = clock;
>  	legacy_serial_ports[index].irq = irq;
> @@ -112,6 +131,11 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
>  	legacy_serial_infos[index].speed = spd ? be32_to_cpup(spd) : 0;
>  	legacy_serial_infos[index].irq_check_parent = irq_check_parent;
>  
> +	if (iotype == UPIO_TSI) {
> +		legacy_serial_ports[index].serial_in = tsi_serial_in;
> +		legacy_serial_ports[index].serial_out = tsi_serial_out;
> +	}
> +
>  	printk(KERN_DEBUG "Found legacy serial port %d for %s\n",
>  	       index, np->full_name);
>  	printk(KERN_DEBUG "  %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n",
> diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
> index c8f107e..d575ccb 100644
> --- a/drivers/tty/serial/8250.c
> +++ b/drivers/tty/serial/8250.c
> @@ -345,24 +345,6 @@ static unsigned int mem32_serial_in(struct uart_port *p, int offset)
>  	return readl(p->membase + offset);
>  }
>  
> -static unsigned int tsi_serial_in(struct uart_port *p, int offset)
> -{
> -	unsigned int tmp;
> -	offset = map_8250_in_reg(p, offset) << p->regshift;
> -	if (offset == UART_IIR) {
> -		tmp = readl(p->membase + (UART_IIR & ~3));
> -		return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
> -	} else
> -		return readb(p->membase + offset);
> -}
> -
> -static void tsi_serial_out(struct uart_port *p, int offset, int value)
> -{
> -	offset = map_8250_out_reg(p, offset) << p->regshift;
> -	if (!((offset == UART_IER) && (value & UART_IER_UUE)))
> -		writeb(value, p->membase + offset);
> -}
> -
>  /* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */
>  static inline void dwapb_save_out_value(struct uart_port *p, int offset,
>  					int value)
> @@ -431,11 +413,6 @@ static void set_io_from_upio(struct uart_port *p)
>  		p->serial_out = mem32_serial_out;
>  		break;
>  
> -	case UPIO_TSI:
> -		p->serial_in = tsi_serial_in;
> -		p->serial_out = tsi_serial_out;
> -		break;
> -
>  	case UPIO_DWAPB:
>  		p->serial_in = mem_serial_in;
>  		p->serial_out = dwapb_serial_out;



  parent reply	other threads:[~2011-09-01  6:02 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 21:45 [PATCH 0/7] serial/8250: I/O accessor cleanups Arnd Bergmann
2011-06-27 21:45 ` [PATCH 1/7] serial/8250: remove obsolete RM9000 port type Arnd Bergmann
2011-06-27 21:45 ` [PATCH 2/7] serial/8250: move alchemy I/O handler to platform code Arnd Bergmann
2011-06-28  8:06   ` Manuel Lauss
2011-06-28  8:06     ` Manuel Lauss
2011-06-28 11:29   ` Manuel Lauss
2011-06-28 11:29     ` Manuel Lauss
2011-06-28 15:36     ` Manuel Lauss
2011-06-28 15:36       ` Manuel Lauss
2011-06-28 17:07       ` Arnd Bergmann
2011-06-27 21:45 ` [PATCH 3/7] serial/8250: move UPIO_TSI to powerpc Arnd Bergmann
2011-06-27 21:45   ` Arnd Bergmann
2011-06-27 23:51   ` David Daney
2011-06-27 23:51     ` David Daney
2011-09-01  6:02   ` Benjamin Herrenschmidt [this message]
2011-09-01  6:02     ` Benjamin Herrenschmidt
2011-09-01  8:28     ` Arnd Bergmann
2011-09-01  8:28       ` Arnd Bergmann
2011-06-27 21:45 ` [PATCH 4/7] serial/8250: move DWAP support to arch/mips Arnd Bergmann
2011-06-27 22:15   ` Jamie Iles
2011-06-28  5:43     ` Arnd Bergmann
2011-06-28 10:06   ` Alan Cox
2011-06-28 10:48     ` Arnd Bergmann
2011-06-27 21:45 ` [PATCH 5/7] serial/8250: remove obsolete and broken PORT_RSA support Arnd Bergmann
2011-06-28 10:11   ` Alan Cox
2011-06-27 21:45 ` [PATCH 6/7] serial/8250: sanitize fourport handling Arnd Bergmann
2011-06-28 10:10   ` Alan Cox
2011-06-28 12:07     ` Arnd Bergmann
2011-06-27 21:45 ` [PATCH 7/7] serial/8250: make PIO support optional Arnd Bergmann
2011-06-28 10:05   ` Alan Cox
2011-06-28 11:52     ` Arnd Bergmann
2011-06-28 12:22       ` Alan Cox
2011-07-04 16:35         ` Arnd Bergmann
2011-07-04 17:02           ` Alan Cox
2011-07-04 19:27             ` Arnd Bergmann
2011-07-04 19:53               ` Alan Cox
2011-07-04 20:37                 ` Arnd Bergmann
2011-07-04 21:55                   ` Alan Cox
2011-07-04 21:54                     ` Arnd Bergmann
2011-06-28 10:11   ` Alan Cox
2011-06-27 23:57 ` [PATCH 0/7] serial/8250: I/O accessor cleanups David Daney

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=1314856926.4145.12.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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.