* [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
@ 2006-05-17 10:14 Zang Roy-r61911
2006-05-17 13:26 ` Kumar Gala
2006-05-18 1:00 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 10+ messages in thread
From: Zang Roy-r61911 @ 2006-05-17 10:14 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev list, Alexandre.Bounine, Yang Xin-Xin-r48390
This patch contains changes to the serial device driver specific for integrated
serial port in Tsi108 Host Bridge.
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>From nobody Mon Sep 17 00:00:00 2001
From: roy zang <tie-fei.zang@freescale.com>
Date: Tue May 16 15:26:02 2006 +0800
Subject: [PATCH] Add tsi108 serial support
---
drivers/serial/8250.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
6cb950357e9970afa671d59f172dbc4b03f11560
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index bbf78aa..c12f516 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -723,7 +723,9 @@ static int broken_efr(struct uart_8250_p
static void autoconfig_16550a(struct uart_8250_port *up)
{
unsigned char status1, status2;
+#ifndef CONFIG_TSI108_BRIDGE
unsigned int iersave;
+#endif
up->port.type = PORT_16550A;
up->capabilities |= UART_CAP_FIFO;
@@ -833,6 +835,7 @@ static void autoconfig_16550a(struct uar
* trying to write and read a 1 just to make sure it's not
* already a 1 and maybe locked there before we even start start.
*/
+#ifndef CONFIG_TSI108_BRIDGE
iersave = serial_in(up, UART_IER);
serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
if (!(serial_in(up, UART_IER) & UART_IER_UUE)) {
@@ -859,6 +862,7 @@ static void autoconfig_16550a(struct uar
DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
}
serial_outp(up, UART_IER, iersave);
+#endif
}
/*
@@ -1348,7 +1352,12 @@ static irqreturn_t serial8250_interrupt(
up = list_entry(l, struct uart_8250_port, list);
+#ifdef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
+ /* read IIR as part of 32-bit word */
+ iir = (in_be32((u32 *)(up->port.membase + UART_RX)) >> 8) & 0xff;
+#else
iir = serial_in(up, UART_IIR);
+#endif
if (!(iir & UART_IIR_NO_INT)) {
serial8250_handle_port(up, regs);
@@ -1529,7 +1538,9 @@ static int serial8250_startup(struct uar
{
struct uart_8250_port *up = (struct uart_8250_port *)port;
unsigned long flags;
+#ifndef CONFIG_TSI108_BRIDGE
unsigned char lsr, iir;
+#endif
int retval;
up->capabilities = uart_config[up->port.type].flags;
@@ -1567,7 +1578,9 @@ #endif
*/
(void) serial_inp(up, UART_LSR);
(void) serial_inp(up, UART_RX);
+#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
(void) serial_inp(up, UART_IIR);
+#endif
(void) serial_inp(up, UART_MSR);
/*
@@ -1634,6 +1647,7 @@ #endif
serial8250_set_mctrl(&up->port, up->port.mctrl);
+#ifndef CONFIG_TSI108_BRIDGE
/*
* Do a quick test to see if we receive an
* interrupt when we enable the TX irq.
@@ -1652,6 +1666,7 @@ #endif
} else {
up->bugs &= ~UART_BUG_TXEN;
}
+#endif
spin_unlock_irqrestore(&up->port.lock, flags);
@@ -1678,7 +1693,9 @@ #endif
*/
(void) serial_inp(up, UART_LSR);
(void) serial_inp(up, UART_RX);
+#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
(void) serial_inp(up, UART_IIR);
+#endif
(void) serial_inp(up, UART_MSR);
return 0;
--
1.3.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
2006-05-17 10:14 Zang Roy-r61911
@ 2006-05-17 13:26 ` Kumar Gala
2006-05-18 1:00 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 10+ messages in thread
From: Kumar Gala @ 2006-05-17 13:26 UTC (permalink / raw)
To: Zang Roy-r61911
Cc: linuxppc-dev list, Yang Xin-Xin-r48390, Paul Mackerras,
Alexandre.Bounine
On May 17, 2006, at 5:14 AM, Zang Roy-r61911 wrote:
> This patch contains changes to the serial device driver specific
> for integrated
> serial port in Tsi108 Host Bridge.
>
> Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>
>> From nobody Mon Sep 17 00:00:00 2001
> From: roy zang <tie-fei.zang@freescale.com>
> Date: Tue May 16 15:26:02 2006 +0800
> Subject: [PATCH] Add tsi108 serial support
This patch needs to go to Russell King as uart/8250 driver maintainer.
- kumar
>
> ---
>
> drivers/serial/8250.c | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> 6cb950357e9970afa671d59f172dbc4b03f11560
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index bbf78aa..c12f516 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -723,7 +723,9 @@ static int broken_efr(struct uart_8250_p
> static void autoconfig_16550a(struct uart_8250_port *up)
> {
> unsigned char status1, status2;
> +#ifndef CONFIG_TSI108_BRIDGE
> unsigned int iersave;
> +#endif
>
> up->port.type = PORT_16550A;
> up->capabilities |= UART_CAP_FIFO;
> @@ -833,6 +835,7 @@ static void autoconfig_16550a(struct uar
> * trying to write and read a 1 just to make sure it's not
> * already a 1 and maybe locked there before we even start start.
> */
> +#ifndef CONFIG_TSI108_BRIDGE
> iersave = serial_in(up, UART_IER);
> serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
> if (!(serial_in(up, UART_IER) & UART_IER_UUE)) {
> @@ -859,6 +862,7 @@ static void autoconfig_16550a(struct uar
> DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
> }
> serial_outp(up, UART_IER, iersave);
> +#endif
> }
>
> /*
> @@ -1348,7 +1352,12 @@ static irqreturn_t serial8250_interrupt(
>
> up = list_entry(l, struct uart_8250_port, list);
>
> +#ifdef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> + /* read IIR as part of 32-bit word */
> + iir = (in_be32((u32 *)(up->port.membase + UART_RX)) >> 8) & 0xff;
> +#else
> iir = serial_in(up, UART_IIR);
> +#endif
> if (!(iir & UART_IIR_NO_INT)) {
> serial8250_handle_port(up, regs);
>
> @@ -1529,7 +1538,9 @@ static int serial8250_startup(struct uar
> {
> struct uart_8250_port *up = (struct uart_8250_port *)port;
> unsigned long flags;
> +#ifndef CONFIG_TSI108_BRIDGE
> unsigned char lsr, iir;
> +#endif
> int retval;
>
> up->capabilities = uart_config[up->port.type].flags;
> @@ -1567,7 +1578,9 @@ #endif
> */
> (void) serial_inp(up, UART_LSR);
> (void) serial_inp(up, UART_RX);
> +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> (void) serial_inp(up, UART_IIR);
> +#endif
> (void) serial_inp(up, UART_MSR);
>
> /*
> @@ -1634,6 +1647,7 @@ #endif
>
> serial8250_set_mctrl(&up->port, up->port.mctrl);
>
> +#ifndef CONFIG_TSI108_BRIDGE
> /*
> * Do a quick test to see if we receive an
> * interrupt when we enable the TX irq.
> @@ -1652,6 +1666,7 @@ #endif
> } else {
> up->bugs &= ~UART_BUG_TXEN;
> }
> +#endif
>
> spin_unlock_irqrestore(&up->port.lock, flags);
>
> @@ -1678,7 +1693,9 @@ #endif
> */
> (void) serial_inp(up, UART_LSR);
> (void) serial_inp(up, UART_RX);
> +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> (void) serial_inp(up, UART_IIR);
> +#endif
> (void) serial_inp(up, UART_MSR);
>
> return 0;
> --
> 1.3.0
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
2006-05-17 10:14 Zang Roy-r61911
2006-05-17 13:26 ` Kumar Gala
@ 2006-05-18 1:00 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 10+ messages in thread
From: Benjamin Herrenschmidt @ 2006-05-18 1:00 UTC (permalink / raw)
To: Zang Roy-r61911
Cc: linuxppc-dev list, Yang Xin-Xin-r48390, Paul Mackerras,
Alexandre.Bounine
On Wed, 2006-05-17 at 18:14 +0800, Zang Roy-r61911 wrote:
> This patch contains changes to the serial device driver specific for integrated
> serial port in Tsi108 Host Bridge.
You'll have to discuss this patch with Russell as Kumar pointed out,
though I'll predict you'll have a hard time getting it through in its
current... chip specific #ifdef's are bad. If workarounds are needed,
they should be using a softer mecanism, either the capabilities bits or
whatever is the best approach for that driver (talk to Russell). Also
the use of in_be32 will probably not be accepted in there neither... If
you really have to do a 32 bits read, use readl (which will do an endian
conversion that you may have to take into account)
Ben.
> Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>
> >From nobody Mon Sep 17 00:00:00 2001
> From: roy zang <tie-fei.zang@freescale.com>
> Date: Tue May 16 15:26:02 2006 +0800
> Subject: [PATCH] Add tsi108 serial support
>
> ---
>
> drivers/serial/8250.c | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> 6cb950357e9970afa671d59f172dbc4b03f11560
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index bbf78aa..c12f516 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -723,7 +723,9 @@ static int broken_efr(struct uart_8250_p
> static void autoconfig_16550a(struct uart_8250_port *up)
> {
> unsigned char status1, status2;
> +#ifndef CONFIG_TSI108_BRIDGE
> unsigned int iersave;
> +#endif
>
> up->port.type = PORT_16550A;
> up->capabilities |= UART_CAP_FIFO;
> @@ -833,6 +835,7 @@ static void autoconfig_16550a(struct uar
> * trying to write and read a 1 just to make sure it's not
> * already a 1 and maybe locked there before we even start start.
> */
> +#ifndef CONFIG_TSI108_BRIDGE
> iersave = serial_in(up, UART_IER);
> serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
> if (!(serial_in(up, UART_IER) & UART_IER_UUE)) {
> @@ -859,6 +862,7 @@ static void autoconfig_16550a(struct uar
> DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
> }
> serial_outp(up, UART_IER, iersave);
> +#endif
> }
>
> /*
> @@ -1348,7 +1352,12 @@ static irqreturn_t serial8250_interrupt(
>
> up = list_entry(l, struct uart_8250_port, list);
>
> +#ifdef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> + /* read IIR as part of 32-bit word */
> + iir = (in_be32((u32 *)(up->port.membase + UART_RX)) >> 8) & 0xff;
> +#else
> iir = serial_in(up, UART_IIR);
> +#endif
> if (!(iir & UART_IIR_NO_INT)) {
> serial8250_handle_port(up, regs);
>
> @@ -1529,7 +1538,9 @@ static int serial8250_startup(struct uar
> {
> struct uart_8250_port *up = (struct uart_8250_port *)port;
> unsigned long flags;
> +#ifndef CONFIG_TSI108_BRIDGE
> unsigned char lsr, iir;
> +#endif
> int retval;
>
> up->capabilities = uart_config[up->port.type].flags;
> @@ -1567,7 +1578,9 @@ #endif
> */
> (void) serial_inp(up, UART_LSR);
> (void) serial_inp(up, UART_RX);
> +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> (void) serial_inp(up, UART_IIR);
> +#endif
> (void) serial_inp(up, UART_MSR);
>
> /*
> @@ -1634,6 +1647,7 @@ #endif
>
> serial8250_set_mctrl(&up->port, up->port.mctrl);
>
> +#ifndef CONFIG_TSI108_BRIDGE
> /*
> * Do a quick test to see if we receive an
> * interrupt when we enable the TX irq.
> @@ -1652,6 +1666,7 @@ #endif
> } else {
> up->bugs &= ~UART_BUG_TXEN;
> }
> +#endif
>
> spin_unlock_irqrestore(&up->port.lock, flags);
>
> @@ -1678,7 +1693,9 @@ #endif
> */
> (void) serial_inp(up, UART_LSR);
> (void) serial_inp(up, UART_RX);
> +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> (void) serial_inp(up, UART_IIR);
> +#endif
> (void) serial_inp(up, UART_MSR);
>
> return 0;
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
@ 2006-05-18 4:00 Zang Roy-r61911
2006-06-05 10:04 ` Russell King
0 siblings, 1 reply; 10+ messages in thread
From: Zang Roy-r61911 @ 2006-05-18 4:00 UTC (permalink / raw)
To: rmk+serial
Cc: Alexandre.Bounine, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
-----Original Message-----
From: Kumar Gala [mailto:galak@kernel.crashing.org]
Sent: 2006=E5=B9=B45=E6=9C=8817=E6=97=A5 21:26
To: Zang Roy-r61911
Cc: Paul Mackerras; linuxppc-dev list; Alexandre.Bounine@tundra.com; =
Yang Xin-Xin-r48390
Subject: Re: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
On May 17, 2006, at 5:14 AM, Zang Roy-r61911 wrote:
> This patch contains changes to the serial device driver specific =20
> for integrated
> serial port in Tsi108 Host Bridge.
>
> Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>
>> From nobody Mon Sep 17 00:00:00 2001
> From: roy zang <tie-fei.zang@freescale.com>
> Date: Tue May 16 15:26:02 2006 +0800
> Subject: [PATCH] Add tsi108 serial support
This patch needs to go to Russell King as uart/8250 driver maintainer.
- kumar
>
> ---
>
> drivers/serial/8250.c | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> 6cb950357e9970afa671d59f172dbc4b03f11560
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index bbf78aa..c12f516 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -723,7 +723,9 @@ static int broken_efr(struct uart_8250_p
> static void autoconfig_16550a(struct uart_8250_port *up)
> {
> unsigned char status1, status2;
> +#ifndef CONFIG_TSI108_BRIDGE
> unsigned int iersave;
> +#endif
>
> up->port.type =3D PORT_16550A;
> up->capabilities |=3D UART_CAP_FIFO;
> @@ -833,6 +835,7 @@ static void autoconfig_16550a(struct uar
> * trying to write and read a 1 just to make sure it's not
> * already a 1 and maybe locked there before we even start start.
> */
> +#ifndef CONFIG_TSI108_BRIDGE
> iersave =3D serial_in(up, UART_IER);
> serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
> if (!(serial_in(up, UART_IER) & UART_IER_UUE)) {
> @@ -859,6 +862,7 @@ static void autoconfig_16550a(struct uar
> DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
> }
> serial_outp(up, UART_IER, iersave);
> +#endif
> }
>
> /*
> @@ -1348,7 +1352,12 @@ static irqreturn_t serial8250_interrupt(
>
> up =3D list_entry(l, struct uart_8250_port, list);
>
> +#ifdef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> + /* read IIR as part of 32-bit word */
> + iir =3D (in_be32((u32 *)(up->port.membase + UART_RX)) >> 8) & =
0xff;
> +#else
> iir =3D serial_in(up, UART_IIR);
> +#endif
> if (!(iir & UART_IIR_NO_INT)) {
> serial8250_handle_port(up, regs);
>
> @@ -1529,7 +1538,9 @@ static int serial8250_startup(struct uar
> {
> struct uart_8250_port *up =3D (struct uart_8250_port *)port;
> unsigned long flags;
> +#ifndef CONFIG_TSI108_BRIDGE
> unsigned char lsr, iir;
> +#endif
> int retval;
>
> up->capabilities =3D uart_config[up->port.type].flags;
> @@ -1567,7 +1578,9 @@ #endif
> */
> (void) serial_inp(up, UART_LSR);
> (void) serial_inp(up, UART_RX);
> +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> (void) serial_inp(up, UART_IIR);
> +#endif
> (void) serial_inp(up, UART_MSR);
>
> /*
> @@ -1634,6 +1647,7 @@ #endif
>
> serial8250_set_mctrl(&up->port, up->port.mctrl);
>
> +#ifndef CONFIG_TSI108_BRIDGE
> /*
> * Do a quick test to see if we receive an
> * interrupt when we enable the TX irq.
> @@ -1652,6 +1666,7 @@ #endif
> } else {
> up->bugs &=3D ~UART_BUG_TXEN;
> }
> +#endif
>
> spin_unlock_irqrestore(&up->port.lock, flags);
>
> @@ -1678,7 +1693,9 @@ #endif
> */
> (void) serial_inp(up, UART_LSR);
> (void) serial_inp(up, UART_RX);
> +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> (void) serial_inp(up, UART_IIR);
> +#endif
> (void) serial_inp(up, UART_MSR);
>
> return 0;
> --=20
> 1.3.0
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
2006-05-18 4:00 [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support Zang Roy-r61911
@ 2006-06-05 10:04 ` Russell King
0 siblings, 0 replies; 10+ messages in thread
From: Russell King @ 2006-06-05 10:04 UTC (permalink / raw)
To: Zang Roy-r61911
Cc: Alexandre.Bounine, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
On Thu, May 18, 2006 at 12:00:43PM +0800, Zang Roy-r61911 wrote:
>
> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: 2006???5???17??? 21:26
> To: Zang Roy-r61911
> Cc: Paul Mackerras; linuxppc-dev list; Alexandre.Bounine@tundra.com; Yang Xin-Xin-r48390
> Subject: Re: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
>
>
>
> On May 17, 2006, at 5:14 AM, Zang Roy-r61911 wrote:
>
> > This patch contains changes to the serial device driver specific
> > for integrated
> > serial port in Tsi108 Host Bridge.
There's no explaination about why this is required. What is the problem?
Which changes relate directly to this problem and which changes are
related to fixing some other issue not related to the errata?
Plus, every patch line is prefixed by "> "... patch doesn't like that.
> >
> > Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
> > Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> >
> >> From nobody Mon Sep 17 00:00:00 2001
> > From: roy zang <tie-fei.zang@freescale.com>
> > Date: Tue May 16 15:26:02 2006 +0800
> > Subject: [PATCH] Add tsi108 serial support
>
> This patch needs to go to Russell King as uart/8250 driver maintainer.
>
> - kumar
>
> >
> > ---
> >
> > drivers/serial/8250.c | 17 +++++++++++++++++
> > 1 files changed, 17 insertions(+), 0 deletions(-)
> >
> > 6cb950357e9970afa671d59f172dbc4b03f11560
> > diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> > index bbf78aa..c12f516 100644
> > --- a/drivers/serial/8250.c
> > +++ b/drivers/serial/8250.c
> > @@ -723,7 +723,9 @@ static int broken_efr(struct uart_8250_p
> > static void autoconfig_16550a(struct uart_8250_port *up)
> > {
> > unsigned char status1, status2;
> > +#ifndef CONFIG_TSI108_BRIDGE
> > unsigned int iersave;
> > +#endif
> >
> > up->port.type = PORT_16550A;
> > up->capabilities |= UART_CAP_FIFO;
> > @@ -833,6 +835,7 @@ static void autoconfig_16550a(struct uar
> > * trying to write and read a 1 just to make sure it's not
> > * already a 1 and maybe locked there before we even start start.
> > */
> > +#ifndef CONFIG_TSI108_BRIDGE
> > iersave = serial_in(up, UART_IER);
> > serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
> > if (!(serial_in(up, UART_IER) & UART_IER_UUE)) {
> > @@ -859,6 +862,7 @@ static void autoconfig_16550a(struct uar
> > DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
> > }
> > serial_outp(up, UART_IER, iersave);
> > +#endif
> > }
> >
> > /*
> > @@ -1348,7 +1352,12 @@ static irqreturn_t serial8250_interrupt(
> >
> > up = list_entry(l, struct uart_8250_port, list);
> >
> > +#ifdef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> > + /* read IIR as part of 32-bit word */
> > + iir = (in_be32((u32 *)(up->port.membase + UART_RX)) >> 8) & 0xff;
> > +#else
> > iir = serial_in(up, UART_IIR);
> > +#endif
> > if (!(iir & UART_IIR_NO_INT)) {
> > serial8250_handle_port(up, regs);
> >
> > @@ -1529,7 +1538,9 @@ static int serial8250_startup(struct uar
> > {
> > struct uart_8250_port *up = (struct uart_8250_port *)port;
> > unsigned long flags;
> > +#ifndef CONFIG_TSI108_BRIDGE
> > unsigned char lsr, iir;
> > +#endif
> > int retval;
> >
> > up->capabilities = uart_config[up->port.type].flags;
> > @@ -1567,7 +1578,9 @@ #endif
> > */
> > (void) serial_inp(up, UART_LSR);
> > (void) serial_inp(up, UART_RX);
> > +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> > (void) serial_inp(up, UART_IIR);
> > +#endif
> > (void) serial_inp(up, UART_MSR);
> >
> > /*
> > @@ -1634,6 +1647,7 @@ #endif
> >
> > serial8250_set_mctrl(&up->port, up->port.mctrl);
> >
> > +#ifndef CONFIG_TSI108_BRIDGE
> > /*
> > * Do a quick test to see if we receive an
> > * interrupt when we enable the TX irq.
> > @@ -1652,6 +1666,7 @@ #endif
> > } else {
> > up->bugs &= ~UART_BUG_TXEN;
> > }
> > +#endif
> >
> > spin_unlock_irqrestore(&up->port.lock, flags);
> >
> > @@ -1678,7 +1693,9 @@ #endif
> > */
> > (void) serial_inp(up, UART_LSR);
> > (void) serial_inp(up, UART_RX);
> > +#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
> > (void) serial_inp(up, UART_IIR);
> > +#endif
> > (void) serial_inp(up, UART_MSR);
> >
> > return 0;
> > --
> > 1.3.0
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
@ 2006-06-13 5:39 Zang Roy-r61911
2006-06-14 14:25 ` Adrian Cox
0 siblings, 1 reply; 10+ messages in thread
From: Zang Roy-r61911 @ 2006-06-13 5:39 UTC (permalink / raw)
To: Russell King
Cc: Alexandre.Bounine, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
> >
> > On May 17, 2006, at 5:14 AM, Zang Roy-r61911 wrote:
> >
> > > This patch contains changes to the serial device driver
> specific for
> > > integrated serial port in Tsi108 Host Bridge.
>
> There's no explaination about why this is required. What is
> the problem?
> Which changes relate directly to this problem and which
> changes are related to fixing some other issue not related to
> the errata?
>
> Plus, every patch line is prefixed by "> "... patch doesn't like that.
The reason is that the serial port on tsi108/9 is a bit difference with the
standard 8250 serial port. the patch deal with the difference.
The prefixed ">" is caused by "Fw" the email. Sorry for that. The following
is the original patch.
Signed-off-by: Alexandre Bounine <alexandreb@tundra.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
drivers/serial/8250.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
6cb950357e9970afa671d59f172dbc4b03f11560
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index bbf78aa..c12f516 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -723,7 +723,9 @@ static int broken_efr(struct uart_8250_p static void autoconfig_16550a(struct uart_8250_port *up) {
unsigned char status1, status2;
+#ifndef CONFIG_TSI108_BRIDGE
unsigned int iersave;
+#endif
up->port.type = PORT_16550A;
up->capabilities |= UART_CAP_FIFO;
@@ -833,6 +835,7 @@ static void autoconfig_16550a(struct uar
* trying to write and read a 1 just to make sure it's not
* already a 1 and maybe locked there before we even start start.
*/
+#ifndef CONFIG_TSI108_BRIDGE
iersave = serial_in(up, UART_IER);
serial_outp(up, UART_IER, iersave & ~UART_IER_UUE);
if (!(serial_in(up, UART_IER) & UART_IER_UUE)) { @@ -859,6 +862,7 @@ static void autoconfig_16550a(struct uar
DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 ");
}
serial_outp(up, UART_IER, iersave);
+#endif
}
/*
@@ -1348,7 +1352,12 @@ static irqreturn_t serial8250_interrupt(
up = list_entry(l, struct uart_8250_port, list);
+#ifdef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
+ /* read IIR as part of 32-bit word */
+ iir = (in_be32((u32 *)(up->port.membase + UART_RX)) >> 8) & 0xff;
+#else
iir = serial_in(up, UART_IIR);
+#endif
if (!(iir & UART_IIR_NO_INT)) {
serial8250_handle_port(up, regs);
@@ -1529,7 +1538,9 @@ static int serial8250_startup(struct uar {
struct uart_8250_port *up = (struct uart_8250_port *)port;
unsigned long flags;
+#ifndef CONFIG_TSI108_BRIDGE
unsigned char lsr, iir;
+#endif
int retval;
up->capabilities = uart_config[up->port.type].flags; @@ -1567,7 +1578,9 @@ #endif
*/
(void) serial_inp(up, UART_LSR);
(void) serial_inp(up, UART_RX);
+#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
(void) serial_inp(up, UART_IIR);
+#endif
(void) serial_inp(up, UART_MSR);
/*
@@ -1634,6 +1647,7 @@ #endif
serial8250_set_mctrl(&up->port, up->port.mctrl);
+#ifndef CONFIG_TSI108_BRIDGE
/*
* Do a quick test to see if we receive an
* interrupt when we enable the TX irq.
@@ -1652,6 +1666,7 @@ #endif
} else {
up->bugs &= ~UART_BUG_TXEN;
}
+#endif
spin_unlock_irqrestore(&up->port.lock, flags);
@@ -1678,7 +1693,9 @@ #endif
*/
(void) serial_inp(up, UART_LSR);
(void) serial_inp(up, UART_RX);
+#ifndef CONFIG_TSI108_BRIDGE /* for TSI108_REV_Z1 errata U2 */
(void) serial_inp(up, UART_IIR);
+#endif
(void) serial_inp(up, UART_MSR);
return 0;
--
1.3.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
2006-06-13 5:39 Zang Roy-r61911
@ 2006-06-14 14:25 ` Adrian Cox
0 siblings, 0 replies; 10+ messages in thread
From: Adrian Cox @ 2006-06-14 14:25 UTC (permalink / raw)
To: Zang Roy-r61911
Cc: Alexandre.Bounine, Russell King, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
On Tue, 2006-06-13 at 13:39 +0800, Zang Roy-r61911 wrote:
> The reason is that the serial port on tsi108/9 is a bit difference with the
> standard 8250 serial port. the patch deal with the difference.
> The prefixed ">" is caused by "Fw" the email. Sorry for that. The following
> is the original patch.
The problem I see is that the code uses a CONFIG option, to change the
behaviour of the generic 8250 driver. What happens if somebody adds a
PCI serial card to a tsi108 based machine?
Perhaps you should define a new value for uart_8250_port.port.iotype,
and add code to serial_in and serial_out to handle the IIR register.
--
Adrian Cox <adrian@humboldt.co.uk>
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
@ 2006-06-15 3:27 Zang Roy-r61911
0 siblings, 0 replies; 10+ messages in thread
From: Zang Roy-r61911 @ 2006-06-15 3:27 UTC (permalink / raw)
To: Adrian Cox
Cc: Alexandre.Bounine, Russell King, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
> On Tue, 2006-06-13 at 13:39 +0800, Zang Roy-r61911 wrote:
>
> > The reason is that the serial port on tsi108/9 is a bit difference
> > with the standard 8250 serial port. the patch deal with the
> difference.
> > The prefixed ">" is caused by "Fw" the email. Sorry for that. The
> > following is the original patch.
>
> The problem I see is that the code uses a CONFIG option, to
> change the behaviour of the generic 8250 driver. What happens
> if somebody adds a PCI serial card to a tsi108 based machine?
I do not like CONFIG option:). It might be a problem in the environment you suggesting.
>
> Perhaps you should define a new value for
> uart_8250_port.port.iotype, and add code to serial_in and
> serial_out to handle the IIR register.
I will consider it.
>
> --
> Adrian Cox <adrian@humboldt.co.uk>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
@ 2006-06-15 5:13 Zang Roy-r61911
0 siblings, 0 replies; 10+ messages in thread
From: Zang Roy-r61911 @ 2006-06-15 5:13 UTC (permalink / raw)
To: Russell King
Cc: Alexandre.Bounine, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
> > On May 17, 2006, at 5:14 AM, Zang Roy-r61911 wrote:
> >
> > > This patch contains changes to the serial device driver
> specific for
> > > integrated serial port in Tsi108 Host Bridge.
>
> There's no explaination about why this is required. What is
> the problem?
> Which changes relate directly to this problem and which
> changes are related to fixing some other issue not related to
> the errata?
>
More detailed explanation:
This patch addresses two differences in the Tsi108/109 UART behavior from the standard one.
1. Check for UART_IER_UUE bit in the autoconfig routine. This section of autoconfig is excluded for
Tsi108/109 because bits 7 and 6 are reserved for internal use. They are R/W bits. In addition to incorrect
identification, changing these bits (from 00) will make Tsi108/109 UART non-functional.
2. ERRATA. Reading the UART's Interrupt Identification Register (IIR) clears the Transmit
Holding Register Empty (THRE) and Transmit buffer Empty (TEMP) interrupts even
if they are not enabled in the Interrupt Enable Register (IER). This leads to loss of the interrupts.
Interrupts are not cleared when reading UART registers as 32-bit word.
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support
@ 2006-06-15 11:04 Zang Roy-r61911
0 siblings, 0 replies; 10+ messages in thread
From: Zang Roy-r61911 @ 2006-06-15 11:04 UTC (permalink / raw)
To: Adrian Cox, Russell King
Cc: Alexandre.Bounine, linux-kernel, linuxppc-dev list,
Paul Mackerras, linux-serial, Yang Xin-Xin-r48390
>
> Perhaps you should define a new value for
> uart_8250_port.port.iotype, and add code to serial_in and
> serial_out to handle the IIR register.
>
> --
> Adrian Cox <adrian@humboldt.co.uk>
>
The following patch gets rid of CONFIG_TSI108_BRIDGE.
I add UPIO_TSI to handle IIR and IER register in serial_in and
serial_out.
(1) the reason to rewrite serial_in:
TSI108 rev Z1 version ERRATA. Reading the UART's Interrupt Identification Register (IIR) clears the Transmit
Holding Register Empty (THRE) and Transmit buffer Empty (TEMP) interrupts even if they are not enabled in
the Interrupt Enable Register (IER). This leads to loss of the interrupts. Interrupts are not cleared
when reading UART registers as 32-bit word.
(2) the reason to rewrite serial_out:
Check for UART_IER_UUE bit in the autoconfig routine. This section of autoconfig is excluded for
Tsi108/109 because bits 7 and 6 are reserved for internal use. They are R/W bits. In addition to
incorrect identification, changing these bits (from 00) will make Tsi108/109 UART non-functional.
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index bbf78aa..6343d7a 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -300,6 +300,7 @@ #endif
static unsigned int serial_in(struct uart_8250_port *up, int offset)
{
+ unsigned int tmp;
offset = map_8250_in_reg(up, offset) << up->port.regshift;
switch (up->port.iotype) {
@@ -317,6 +318,13 @@ #ifdef CONFIG_SERIAL_8250_AU1X00
case UPIO_AU:
return __raw_readl(up->port.membase + offset);
#endif
+
+ case UPIO_TSI:
+ if (offset == UART_IIR){
+ tmp = readl((u32 *)(up->port.membase + UART_RX)) ;
+ return (cpu_to_le32(tmp)>> 8) & 0xff;
+ }else
+ return readb(up->port.membase + offset);
default:
return inb(up->port.iobase + offset);
@@ -347,6 +355,10 @@ #ifdef CONFIG_SERIAL_8250_AU1X00
__raw_writel(value, up->port.membase + offset);
break;
#endif
+ case UPIO_TSI:
+ if (!((offset == UART_IER) && (value & UART_IER_UUE)))
+ writeb(value, up->port.membase + offset);
+ break;
default:
outb(value, up->port.iobase + offset);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index bd14858..fcf48d3 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -224,6 +224,7 @@ #define UPIO_HUB6 (1)
#define UPIO_MEM (2)
#define UPIO_MEM32 (3)
#define UPIO_AU (4) /* Au1x00 type IO */
+#define UPIO_TSI (5) /* Tsi108/109 type IO */
unsigned int read_status_mask; /* driver specific */
unsigned int ignore_status_mask; /* driver specific */
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-06-15 11:04 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-18 4:00 [PATCH/2.6.17-rc4 8/10] Add tsi108 8250 serial support Zang Roy-r61911
2006-06-05 10:04 ` Russell King
-- strict thread matches above, loose matches on Subject: below --
2006-06-15 11:04 Zang Roy-r61911
2006-06-15 5:13 Zang Roy-r61911
2006-06-15 3:27 Zang Roy-r61911
2006-06-13 5:39 Zang Roy-r61911
2006-06-14 14:25 ` Adrian Cox
2006-05-17 10:14 Zang Roy-r61911
2006-05-17 13:26 ` Kumar Gala
2006-05-18 1:00 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).