Skip to contentSkip to conversation

ce4100 does no longer boots with CONFIG_EARLY_PRINTK enabled

PATCH Sebastian Andrzej Siewior 2 participants 3 messages Jun 16, 2011 – Jun 17, 2011

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

The ce4100 discovers the uart via PCI (PCI_DEVICE_ID_INTEL_CE4100_UART). There is a fixup routine in has an uart defined in arch/x86/platform/ce4100/ce4100.c.

Booting commit 1ff42c32c76 ("x86: ce4100: Configure IOAPIC pins for USB and SATA to level type") results in:

| Refined TSC clocksource calibration: 1200.000 MHz.
| Switching to clocksource tsc
| Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
| 0000:01:0b.0: ttyS0 at MMIO 0xdffe0200 (irq = 38) is a XScale
| console [ttyS0] enabled

i.e. it works. Booting v3.0-rc1 gives me:

| Refined TSC clocksource calibration: 1199.999 MHz.
| Switching to clocksource tsc
| Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

and the box hangs. Current HEAD of Linus and the TIP tree gives the same result. Removing the legacy ports via

arch/x86/include/asm/serial.h +2 -0
index 628c801..e6004c1 100644
@@ -19,11 +19,13 @@
 #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
 #endif
 
+#if 0
 #define SERIAL_PORT_DFNS			\
 	/* UART CLK   PORT IRQ     FLAGS        */			\
 	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
 	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\
 	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\
 	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */
+#endif
 
 #endif /* _ASM_X86_SERIAL_H */

helps. The problem with the legacy uart is that funny things happen once we are in APIC mode and we still use ioport 0x3f8. git bisect recommends to revert commit

|commit 4539c24fe4f92c09ee668ef959d3e8180df619b9
|Author: Stephen Warren <[email protected]>
|Date:   Tue May 17 16:12:36 2011 -0600
| 
|    tty/serial: Add explicit PORT_TEGRA type

This also does the job. With it removed I see:

| Refined TSC clocksource calibration: 1200.000 MHz.
| Switching to clocksource tsc
| Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
| serial8250: ttyS0 at MMIO 0xdffe0200 (irq = 4) is a XScale
| 0000:01:0b.0: ttyS0 at MMIO 0xdffe0200 (irq = 38) is a XScale

I'm little worried that it seems somehow that I have two uarts at 0xdffe0200 and IRQ4 which is evil.

Any recomendations on that? Should we declare SERIAL_PORT_DFNS via x86_ops or is the PORT_TEGRA regression obvious?

Sebastian

#1 lore raw

Sebastian Andrzej Siewior wrote at Thursday, June 16, 2011 1:11 PM:

Quoted 50 lines

The ce4100 discovers the uart via PCI (PCI_DEVICE_ID_INTEL_CE4100_UART). There is a fixup routine in has an uart defined in arch/x86/platform/ce4100/ce4100.c.

Booting commit 1ff42c32c76 ("x86: ce4100: Configure IOAPIC pins for USB and SATA to level type") results in:

| Refined TSC clocksource calibration: 1200.000 MHz.
| Switching to clocksource tsc
| Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
| 0000:01:0b.0: ttyS0 at MMIO 0xdffe0200 (irq = 38) is a XScale
| console [ttyS0] enabled

i.e. it works. Booting v3.0-rc1 gives me:

| Refined TSC clocksource calibration: 1199.999 MHz.
| Switching to clocksource tsc
| Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

and the box hangs. Current HEAD of Linus and the TIP tree gives the same result. Removing the legacy ports via

arch/x86/include/asm/serial.h +2 -0
index 628c801..e6004c1 100644
@@ -19,11 +19,13 @@
 #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
 #endif
 
+#if 0
 #define SERIAL_PORT_DFNS			\
 	/* UART CLK   PORT IRQ     FLAGS        */			\
 	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
 	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\
 	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\
 	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */
+#endif
 
 #endif /* _ASM_X86_SERIAL_H */

helps. The problem with the legacy uart is that funny things happen once we are in APIC mode and we still use ioport 0x3f8. git bisect recommends to revert commit

|commit 4539c24fe4f92c09ee668ef959d3e8180df619b9
|Author: Stephen Warren <[email protected]>
|Date:   Tue May 17 16:12:36 2011 -0600
|
|    tty/serial: Add explicit PORT_TEGRA type
Quoted 6 lines

This also does the job. With it removed I see:

| Refined TSC clocksource calibration: 1200.000 MHz.
| Switching to clocksource tsc
| Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
| serial8250: ttyS0 at MMIO 0xdffe0200 (irq = 4) is a XScale
| 0000:01:0b.0: ttyS0 at MMIO 0xdffe0200 (irq = 38) is a XScale

Just guessing here, but is the solution to add this patch to ToT?:

drivers/tty/serial/8250.c +1 -1
index b40f7b9..bca2232 100644
@@ -1107,7 +1107,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
                         */
                        DEBUG_AUTOCONF("Xscale ");
                        up->port.type = PORT_XSCALE;
-                       up->capabilities |= UART_CAP_UUE;
+                       up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE;
                        return;
                }
        } else {

I added a new flag used for both XSCALE and TEGRA port types, and modified the XSCALE port type to define the new flag, thinking that all code would take the capabilities from that port type table entry, but perhaps the auto-detection logic needs an equivalent change for XSCALE.

Quoted 2 lines

I'm little worried that it seems somehow that I have two uarts at 0xdffe0200 and IRQ4 which is evil.

That does sound odd. It's very unclear to me how my change would cause that...

Quoted 4 lines

Any recomendations on that? Should we declare SERIAL_PORT_DFNS via x86_ops or is the PORT_TEGRA regression obvious?

Sebastian

Signature · 1 line
nvpublic
#2 lore raw
Quoted 7 lines · Stephen Warren

Just guessing here, but is the solution to add this patch to ToT?:

drivers/tty/serial/8250.c +0 -0
index b40f7b9..bca2232 100644

drivers/tty/serial/8250.c static void autoconfig_16550a(struct uart_8250_port *up) · line 1113

Quoted 8 lines
drivers/tty/serial/8250.c +1 -1
@@ -1107,7 +1107,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
                         */
                        DEBUG_AUTOCONF("Xscale ");
                        up->port.type = PORT_XSCALE;
-                       up->capabilities |= UART_CAP_UUE;
+                       up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE;
                        return;
                }
        } else {

With that patch I have a working serial again.

Quoted 10 lines

I added a new flag used for both XSCALE and TEGRA port types, and modified the XSCALE port type to define the new flag, thinking that all code would take the capabilities from that port type table entry, but perhaps the auto-detection logic needs an equivalent change for XSCALE.

Quoted 2 lines

I'm little worried that it seems somehow that I have two uarts at 0xdffe0200 and IRQ4 which is evil.

That does sound odd. It's very unclear to me how my change would cause that...

Seems unrelated to your change.

Sebastian