Skip to contentSkip to conversation

serial: 8250: reduce Alchemy serial port space size

PATCH In review Manuel Lauss 4 participants 9 messages Oct 28, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 serial: 8250: reduce Alchemy serial port space size

This patch limits the amount of address space claimed for Alchemy serial ports to 0x1000. On the Au1300, ports are only 0x1000 apart, and the registers only extend to 0x110 at most on all supported alchemy models.

---
I'm not sure who to send this patch to; I added Ralf Baechle because he always takes my alchemy patches, 8250 is unmaintained and this patch is required for adding support for a new alchemy model (this patch gets me a working serial console on the DB1300).

 drivers/serial/8250.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/serial/8250.c +1 -1
index b1ae774..2ff81eb 100644
@@ -2429,7 +2429,7 @@ serial8250_pm(struct uart_port *port, unsigned int state,
 static unsigned int serial8250_port_size(struct uart_8250_port *pt)
 {
 	if (pt->port.iotype == UPIO_AU)
-		return 0x100000;
+		return 0x1000;
 #ifdef CONFIG_ARCH_OMAP
 	if (is_omap_port(pt))
 		return 0x16 << pt->port.regshift;
Signature · 1 line
1.6.5
#1 lore raw

PATCH 2/2 MIPS: Alchemy: UARTs are 16550A

UART autodetection breaks on the Au1300 but the IP blocks are identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move the MSR quirk to another place sind autoconf() is now no longer called on init.

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
arch/mips/alchemy/common/platform.c +3 -1
index 195e5b3..3be14b0 100644
@@ -26,7 +26,9 @@
 		.irq		= _irq,				\
 		.regshift	= 2,				\
 		.iotype		= UPIO_AU,			\
-		.flags		= UPF_SKIP_TEST | UPF_IOREMAP	\
+		.flags		= UPF_SKIP_TEST | UPF_IOREMAP |	\
+				  UPF_FIXED_TYPE,		\
+		.type		= PORT_16550A,			\
 	}
 
 static struct plat_serial8250_port au1x00_uart_data[] = {
drivers/serial/8250.c +7 -6
index 2ff81eb..9538e5b 100644
@@ -1214,12 +1214,6 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
 	}
 #endif
 
-#ifdef CONFIG_SERIAL_8250_AU1X00
-	/* if access method is AU, it is a 16550 with a quirk */
-	if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU)
-		up->bugs |= UART_BUG_NOMSR;
-#endif
-
 	serial_outp(up, UART_LCR, save_lcr);
 
 	if (up->capabilities != uart_config[up->port.type].flags) {
@@ -2586,6 +2580,13 @@ static void serial8250_config_port(struct uart_port *port, int flags)
 
 	if (flags & UART_CONFIG_TYPE)
 		autoconfig(up, probeflags);
+
+#ifdef CONFIG_SERIAL_8250_AU1X00
+	/* if access method is AU, it is a 16550 with a quirk */
+	if (up->port.type == PORT_16550A && up->port.iotype == UPIO_AU)
+		up->bugs |= UART_BUG_NOMSR;
+#endif
+
 	if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
 		autoconfig_irq(up);
 
Signature · 1 line
1.6.5
#2 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

Quoted 21 lines · On Wed, 28 Oct 2009 20:09:14 +0100 Manuel Lauss <[email protected]>…

UART autodetection breaks on the Au1300 but the IP blocks are identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move the MSR quirk to another place sind autoconf() is now no longer called on init.

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
arch/mips/alchemy/common/platform.c +0 -0
index 195e5b3..3be14b0 100644

arch/mips/alchemy/common/platform.c line 32

Quoted 8 lines
arch/mips/alchemy/common/platform.c +3 -1
@@ -26,7 +26,9 @@
 		.irq		= _irq,				\
 		.regshift	= 2,				\
 		.iotype		= UPIO_AU,			\
-		.flags		= UPF_SKIP_TEST | UPF_IOREMAP	\
+		.flags		= UPF_SKIP_TEST | UPF_IOREMAP |	\
+				  UPF_FIXED_TYPE,		\
+		.type		= PORT_16550A,			\
 	}

The kernel which you patched differs from current mainline here.

#3 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

Quoted 21 lines · Andrew Morton
Quoted 12 lines · On Wed, 28 Oct 2009 20:09:14 +0100 Manuel Lauss <[email protected]>…

UART autodetection breaks on the Au1300 but the IP blocks are identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move the MSR quirk to another place sind autoconf() is now no longer called on init.

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

Review

Quoted 5 lines
 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
(quoted diff) +0 -0

b/arch/mips/alchemy/common/platform.c

Quoted 14 lines

arch/mips/alchemy/common/platform.c line 32

Quoted 12 lines

index 195e5b3..3be14b0 100644

arch/mips/alchemy/common/platform.c +3 -1
@@ -26,7 +26,9 @@
              .irq            = _irq,                         \
              .regshift       = 2,                            \
              .iotype         = UPIO_AU,                      \
-             .flags          = UPF_SKIP_TEST | UPF_IOREMAP   \
+             .flags          = UPF_SKIP_TEST | UPF_IOREMAP | \
+                               UPF_FIXED_TYPE,               \
+             .type           = PORT_16550A,                  \
      }

The kernel which you patched differs from current mainline here.

I know, that's why I added "The mips parts apply on top of Ralf's
mips-queue tree" below
the patch description.
If it makes it easier to apply, I could split this one in a mips and in a 8250 patch?

Thank you!
Manuel Lauss

#4 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

Quoted 39 lines · On Wed, 28 Oct 2009 20:27:16 +0100 Manuel Lauss <[email protected]>…
Quoted 21 lines · Andrew Morton
Quoted 12 lines · On Wed, 28 Oct 2009 20:09:14 +0100 Manuel Lauss <[email protected]>…

UART autodetection breaks on the Au1300 but the IP blocks are identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move the MSR quirk to another place sind autoconf() is now no longer called on init.

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

Review

Quoted 5 lines
 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
(quoted diff) +0 -0

b/arch/mips/alchemy/common/platform.c

Quoted 14 lines

arch/mips/alchemy/common/platform.c line 32

Quoted 12 lines

index 195e5b3..3be14b0 100644

arch/mips/alchemy/common/platform.c +3 -1
@@ -26,7 +26,9 @@
              .irq            = _irq,                         \
              .regshift       = 2,                            \
              .iotype         = UPIO_AU,                      \
-             .flags          = UPF_SKIP_TEST | UPF_IOREMAP   \
+             .flags          = UPF_SKIP_TEST | UPF_IOREMAP | \
+                               UPF_FIXED_TYPE,               \
+             .type           = PORT_16550A,                  \
      }

The kernel which you patched differs from current mainline here.

Quoted 3 lines

I know, that's why I added "The mips parts apply on top of Ralf's
mips-queue tree" below
the patch description.

If that's the case then Ralf's mips-queue tree isn't in linux-next :(

Quoted 2 lines

If it makes it easier to apply, I could split this one in a mips and in a 8250 patch?

That's a hard call without knowing what's going on in mipsworld. If these patches applied to current mainline we could do it all as one patch and, with suitable acks, slap it into 2.6.32.

Are these fixes also appropriate to 2.6.31.x and earlier? If so, that's another reason to prepare the patches against current mainline and just trample over the mips devel queue.

#5 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

Quoted 47 lines · Andrew Morton
Quoted 1 line · On Wed, 28 Oct 2009 20:27:16 +0100 Manuel Lauss <[email protected]>…

On Wed, Oct 28, 2009 at 8:24 PM, Andrew Morton <

Quoted 38 lines · [email protected]>wrote:
Quoted 22 lines
Quoted 12 lines · On Wed, 28 Oct 2009 20:09:14 +0100 Manuel Lauss <[email protected]>…

UART autodetection breaks on the Au1300 but the IP blocks are identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move the MSR quirk to another place sind autoconf() is now no longer called on init.

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

Review

Quoted 5 lines
 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
(quoted diff) +0 -0

b/arch/mips/alchemy/common/platform.c

Quoted 14 lines

arch/mips/alchemy/common/platform.c line 32

Quoted 12 lines

index 195e5b3..3be14b0 100644

arch/mips/alchemy/common/platform.c +3 -1
@@ -26,7 +26,9 @@
              .irq            = _irq,                         \
              .regshift       = 2,                            \
              .iotype         = UPIO_AU,                      \
-             .flags          = UPF_SKIP_TEST | UPF_IOREMAP   \
+             .flags          = UPF_SKIP_TEST | UPF_IOREMAP | \
+                               UPF_FIXED_TYPE,               \
+             .type           = PORT_16550A,                  \
      }

The kernel which you patched differs from current mainline here.

Quoted 3 lines

I know, that's why I added "The mips parts apply on top of Ralf's
mips-queue tree" below
the patch description.

Quoted 9 lines

If that's the case then Ralf's mips-queue tree isn't in linux-next :(

Quoted 2 lines

If it makes it easier to apply, I could split this one in a mips and in a 8250 patch?

That's a hard call without knowing what's going on in mipsworld. If these patches applied to current mainline we could do it all as one patch and, with suitable acks, slap it into 2.6.32.

The 8250.c hunks from both patches apply against current -git; only the mips hunk is against Ralfs queue tree (the mips hunk on its own would probably break something wrt. modem signals which I can't test now anyway)

I'll resend with a new series: 1 patch with the mips part (to Ralf) and one with the 8250.c part (to you).

Quoted 2 lines

Are these fixes also appropriate to 2.6.31.x and earlier? If so,

Not really; patch #1 is necessary to get serial going on a chip not yet supported in mainline, and patch #2 works around failing uart autodetection on this new soc.

Quoted 3 lines

that's another reason to prepare the patches against current mainline and just trample over the mips devel queue.

Understood.

Thank you!
Manuel Lauss

#6 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

In reply to Andrew Morton
Quoted 5 lines · Andrew Morton
Quoted 3 lines

I know, that's why I added "The mips parts apply on top of Ralf's
mips-queue tree" below
the patch description.

If that's the case then Ralf's mips-queue tree isn't in linux-next :(

I just respun my tree for linux-next, just in case.

Quoted 4 lines
Quoted 2 lines

If it makes it easier to apply, I could split this one in a mips and in a 8250 patch?

That's a hard call without knowing what's going on in mipsworld. If

My tree for linux-next is at

http://www.linux-mips.org/git?p=upstream-sfr.git;a=summary

Ralf

#7 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

In reply to Manuel Lauss

Hello.

Quoted 5 lines · Manuel Lauss

UART autodetection breaks on the Au1300 but the IP blocks are identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move the MSR quirk to another place sind autoconf() is now no longer

s/sind autoconf/since autoconfig/

Quoted 16 lines

called on init.

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
arch/mips/alchemy/common/platform.c +0 -0
index 195e5b3..3be14b0 100644

arch/mips/alchemy/common/platform.c line 30

Quoted 6 lines
arch/mips/alchemy/common/platform.c +2 -1
@@ -26,7 +26,9 @@
 		.irq		= _irq,				\
 		.regshift	= 2,				\
 		.iotype		= UPIO_AU,			\
-		.flags		= UPF_SKIP_TEST | UPF_IOREMAP	\
+		.flags		= UPF_SKIP_TEST | UPF_IOREMAP |	\
+				  UPF_FIXED_TYPE,		\

Good to know this has been implemented.

WBR, Sergei

#8 lore raw

Re: [PATCH 2/2] MIPS: Alchemy: UARTs are 16550A

Quoted 6 lines · Sergei Shtylyov

Hello.

Manuel Lauss wrote:

UART autodetection breaks on the Au1300 but the IP blocks are

Quoted 9 lines
Quoted 2 lines

identical, at least in the datasheets.

Pass uart type on to the 8250 driver via platform data, and move

Quoted 2 lines

the MSR quirk to another place sind autoconf() is now no longer

s/sind autoconf/since autoconfig/

Yeah, I suck at writing descriptions. Will fix.

called on init.

Quoted 1 line
Quoted 14 lines

---
Tested on DB1200 and DB1300.
The mips parts apply on top of Ralf's mips-queue tree.

 arch/mips/alchemy/common/platform.c |    4 +++-
 drivers/serial/8250.c               |   13 +++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)
arch/mips/alchemy/common/platform.c +0 -0
index 195e5b3..3be14b0 100644

arch/mips/alchemy/common/platform.c line 31

Quoted 7 lines
arch/mips/alchemy/common/platform.c +2 -1
@@ -26,7 +26,9 @@
               .irq            = _irq,                         \
               .regshift       = 2,                            \
               .iotype         = UPIO_AU,                      \
-               .flags          = UPF_SKIP_TEST | UPF_IOREMAP   \
+               .flags          = UPF_SKIP_TEST | UPF_IOREMAP | \
+                                 UPF_FIXED_TYPE,               \
 

Good to know this has been implemented.

Quoted 1 line

David Daney implemented this recently for his Octeon port, it's a very handy feature for sure.

Thank you !
Manuel Lauss