All of lore.kernel.org
 help / color / mirror / Atom feed
* Serial console on non-legacy PCI serial card?
@ 2009-04-28 19:35 Nigel Gamble
  2009-04-28 20:28 ` Ross Philipson
  2009-05-05  1:31 ` Yu Zhao
  0 siblings, 2 replies; 7+ messages in thread
From: Nigel Gamble @ 2009-04-28 19:35 UTC (permalink / raw)
  To: xen-devel

I have an Intel DX50SO motherboard for a Core i7 CPU which has no  
legacy ports whatsoever, so no COM1 serial port.  I added a "SIIG  
CyberPro PCI 1S" single serial port PCI card.

Linux dmesg shows it as:

[   30.244790] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[   30.244984] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
[   30.245287] serial 0000:06:02.0: PCI INT A -> GSI 18 (level, low) - 
 > IRQ 18
[   30.245459] ttyS0: detected caps 00000700 should be 00000100
[   30.245518] 0000:06:02.0: ttyS0 at I/O 0x1060 (irq = 18) is a  
16C950/954
[   30.245583] console [ttyS0] enabled
[   32.448682] ttyS2: detected caps 00000700 should be 00000100
[   32.454929] 0000:06:02.0: ttyS2 at I/O 0x1068 (irq = 18) is a  
16C950/954

Note that the only port actually connected to the single connecter is  
ttyS0 at 0x1060.  I can successfully use this as the Linux serial  
console by adding the Linux boot parameters:

console=uart,io,0x1060,115200n8

However, I'm having problems trying to get it to work as a Xen  
console.  If I add:

com1=115200,8n1,0x1060,0 console=vga,com1

to Xen, I do get some output to the port, but all the characters look  
like this:

.<.....~.o....¼..4.|.a.½¬o.§¼4.#.ÿ.......ö4..¬.... 4.  . 
4Ä...T.Ä ..¼.Ä ....<.

Can anyone help me to get this to work?

Thanks,
Nigel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: Serial console on non-legacy PCI serial card?
  2009-04-28 19:35 Serial console on non-legacy PCI serial card? Nigel Gamble
@ 2009-04-28 20:28 ` Ross Philipson
  2009-04-28 22:17   ` Nigel Gamble
  2009-05-05  1:31 ` Yu Zhao
  1 sibling, 1 reply; 7+ messages in thread
From: Ross Philipson @ 2009-04-28 20:28 UTC (permalink / raw)
  To: Nigel Gamble, xen-devel

Perhaps you need to specify the crystal frequency of the device. The parameter would look like:

com1=115200/<frequency>,8n1,0x1060,0 console=vga,com1

Of course I don't know what it might be for this card.

Thanks
Ross



-----Original Message-----
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Nigel Gamble
Sent: Tuesday, April 28, 2009 3:36 PM
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Serial console on non-legacy PCI serial card?

I have an Intel DX50SO motherboard for a Core i7 CPU which has no  
legacy ports whatsoever, so no COM1 serial port.  I added a "SIIG  
CyberPro PCI 1S" single serial port PCI card.

Linux dmesg shows it as:

[   30.244790] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[   30.244984] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
[   30.245287] serial 0000:06:02.0: PCI INT A -> GSI 18 (level, low) - 
 > IRQ 18
[   30.245459] ttyS0: detected caps 00000700 should be 00000100
[   30.245518] 0000:06:02.0: ttyS0 at I/O 0x1060 (irq = 18) is a  
16C950/954
[   30.245583] console [ttyS0] enabled
[   32.448682] ttyS2: detected caps 00000700 should be 00000100
[   32.454929] 0000:06:02.0: ttyS2 at I/O 0x1068 (irq = 18) is a  
16C950/954

Note that the only port actually connected to the single connecter is  
ttyS0 at 0x1060.  I can successfully use this as the Linux serial  
console by adding the Linux boot parameters:

console=uart,io,0x1060,115200n8

However, I'm having problems trying to get it to work as a Xen  
console.  If I add:

com1=115200,8n1,0x1060,0 console=vga,com1

to Xen, I do get some output to the port, but all the characters look  
like this:

.<.....~.o....¼..4.|.a.½¬o.§¼4.#.ÿ.......ö4..¬.... 4.  . 
4Ä...T.Ä ..¼.Ä ....<.

Can anyone help me to get this to work?

Thanks,
Nigel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Serial console on non-legacy PCI serial card?
  2009-04-28 20:28 ` Ross Philipson
@ 2009-04-28 22:17   ` Nigel Gamble
  2009-04-29  7:17     ` Keir Fraser
  0 siblings, 1 reply; 7+ messages in thread
From: Nigel Gamble @ 2009-04-28 22:17 UTC (permalink / raw)
  To: Ross Philipson; +Cc: xen-devel

Thanks for the suggestion.  I've tried all frequencies of the form

115200 * 2^n, for n = 0 to 8

but none of them seemed to work.  It looks like the Linux early_uart  
driver has a bit more functionality when dealing with non-legacy ports  
that the current Xen driver.

Nigel

On Apr 28, 2009, at 1:28 PM, Ross Philipson wrote:

> Perhaps you need to specify the crystal frequency of the device. The  
> parameter would look like:
>
> com1=115200/<frequency>,8n1,0x1060,0 console=vga,com1
>
> Of course I don't know what it might be for this card.
>
> Thanks
> Ross
>
>
>
> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com 
> ] On Behalf Of Nigel Gamble
> Sent: Tuesday, April 28, 2009 3:36 PM
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] Serial console on non-legacy PCI serial card?
>
> I have an Intel DX50SO motherboard for a Core i7 CPU which has no
> legacy ports whatsoever, so no COM1 serial port.  I added a "SIIG
> CyberPro PCI 1S" single serial port PCI card.
>
> Linux dmesg shows it as:
>
> [   30.244790] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> [   30.244984] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
> [   30.245287] serial 0000:06:02.0: PCI INT A -> GSI 18 (level, low) -
>> IRQ 18
> [   30.245459] ttyS0: detected caps 00000700 should be 00000100
> [   30.245518] 0000:06:02.0: ttyS0 at I/O 0x1060 (irq = 18) is a
> 16C950/954
> [   30.245583] console [ttyS0] enabled
> [   32.448682] ttyS2: detected caps 00000700 should be 00000100
> [   32.454929] 0000:06:02.0: ttyS2 at I/O 0x1068 (irq = 18) is a
> 16C950/954
>
> Note that the only port actually connected to the single connecter is
> ttyS0 at 0x1060.  I can successfully use this as the Linux serial
> console by adding the Linux boot parameters:
>
> console=uart,io,0x1060,115200n8
>
> However, I'm having problems trying to get it to work as a Xen
> console.  If I add:
>
> com1=115200,8n1,0x1060,0 console=vga,com1
>
> to Xen, I do get some output to the port, but all the characters look
> like this:
>
> .<.....~.o....¼..4.|.a.½¬o.§¼4.#.ÿ.......ö4..¬.... 4.  .
> 4Ä...T.Ä ..¼.Ä ....<.
>
> Can anyone help me to get this to work?
>
> Thanks,
> Nigel
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Serial console on non-legacy PCI serial card?
  2009-04-28 22:17   ` Nigel Gamble
@ 2009-04-29  7:17     ` Keir Fraser
  0 siblings, 0 replies; 7+ messages in thread
From: Keir Fraser @ 2009-04-29  7:17 UTC (permalink / raw)
  To: Nigel Gamble, Ross Philipson; +Cc: xen-devel

On 28/04/2009 23:17, "Nigel Gamble" <nigel@nrg.org> wrote:

> but none of them seemed to work.  It looks like the Linux early_uart
> driver has a bit more functionality when dealing with non-legacy ports
> that the current Xen driver.

Linux reports ttyS1 as ns16550a, so it can't be very non-legacy. You might
have to add tracing to the Linux driver to find out how it sets up the uart
registers, and work out a patch from that.

 -- Keir

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Serial console on non-legacy PCI serial card?
  2009-04-28 19:35 Serial console on non-legacy PCI serial card? Nigel Gamble
  2009-04-28 20:28 ` Ross Philipson
@ 2009-05-05  1:31 ` Yu Zhao
  2009-05-05  7:26   ` Keir Fraser
  1 sibling, 1 reply; 7+ messages in thread
From: Yu Zhao @ 2009-05-05  1:31 UTC (permalink / raw)
  To: Nigel Gamble; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

Please apply the attached patch to the grub-0.97, reinstall the grub
and use the UART boot parameter you have figured out for Xen.

  kernel /boot/xen.gz com1=115200,8n1,0x1060,0 ...

Then you should get a workable serial console for Xen.

Good luck,
Yu

On Wed, Apr 29, 2009 at 03:35:59AM +0800, Nigel Gamble wrote:
> I have an Intel DX50SO motherboard for a Core i7 CPU which has no  
> legacy ports whatsoever, so no COM1 serial port.  I added a "SIIG  
> CyberPro PCI 1S" single serial port PCI card.
> 
> Linux dmesg shows it as:
> 
> [   30.244790] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> [   30.244984] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
> [   30.245287] serial 0000:06:02.0: PCI INT A -> GSI 18 (level, low) - 
>  > IRQ 18
> [   30.245459] ttyS0: detected caps 00000700 should be 00000100
> [   30.245518] 0000:06:02.0: ttyS0 at I/O 0x1060 (irq = 18) is a  
> 16C950/954
> [   30.245583] console [ttyS0] enabled
> [   32.448682] ttyS2: detected caps 00000700 should be 00000100
> [   32.454929] 0000:06:02.0: ttyS2 at I/O 0x1068 (irq = 18) is a  
> 16C950/954
> 
> Note that the only port actually connected to the single connecter is  
> ttyS0 at 0x1060.  I can successfully use this as the Linux serial  
> console by adding the Linux boot parameters:
> 
> console=uart,io,0x1060,115200n8
> 
> However, I'm having problems trying to get it to work as a Xen  
> console.  If I add:
> 
> com1=115200,8n1,0x1060,0 console=vga,com1
> 
> to Xen, I do get some output to the port, but all the characters look  
> like this:
> 
> .<.....~.o....¼..4.|.a.½¬o.§¼4.#.ÿ.......ö4..¬.... 4.  . 
> 4Ä...T.Ä ..¼.Ä ....<.
> 
> Can anyone help me to get this to work?
> 
> Thanks,
> Nigel
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

[-- Attachment #2: grub.diff --]
[-- Type: text/plain, Size: 1632 bytes --]

--- grub-0.97.orig/stage2/builtins.c	2005-02-15 16:58:23.000000000 -0500
+++ grub-0.97/stage2/builtins.c	2009-05-04 21:05:56.000000000 -0400
@@ -49,6 +49,8 @@
 # include <md5.h>
 #endif
 
+#include "netboot/linux-asm-io.h"
+
 /* The type of kernel loaded.  */
 kernel_t kernel_type;
 /* The boot device.  */
@@ -3376,6 +3378,23 @@ static struct builtin builtin_savedefaul
 
 \f

 #ifdef SUPPORT_SERIAL
+
+#define CONFIG_CMD(bus, device_fn, where)   (0x80000000 | (bus << 16) | (device_fn << 8) | (where & ~3))
+
+static void pcibios_write_config_word (unsigned int bus, unsigned int device_fn,
+				unsigned int where, unsigned short value)
+{
+    outl(CONFIG_CMD(bus,device_fn,where), 0xCF8);
+    outw(value, 0xCFC + (where&2));
+}
+
+static void pcibios_write_config_dword (unsigned int bus, unsigned int device_fn,
+				unsigned int where, unsigned int value)
+{
+    outl(CONFIG_CMD(bus,device_fn,where), 0xCF8);
+    outl(value, 0xCFC);
+}
+
 /* serial */
 static int
 serial_func (char *arg, int flags)
@@ -3501,6 +3520,16 @@ serial_func (char *arg, int flags)
       arg = skip_to (0, arg);
     }
 
+    /* program 0x1060 to 06:02.0 BAR 0 */
+    pcibios_write_config_dword (0x06, 0x10, 0x10, 0x1060);
+    /* program 0x1068 to 06:02.1 BAR 0 */
+    pcibios_write_config_dword (0x06, 0x11, 0x10, 0x1068);
+
+    /* enable I/O Space for 06:02.0 */
+    pcibios_write_config_word (0x06, 0x10, 0x04, 0x0401);
+    /* enable I/O Space for 06:02.1 */
+    pcibios_write_config_word (0x06, 0x11, 0x04, 0x0401);
+
   /* Initialize the serial unit.  */
   if (! serial_hw_init (port, speed, word_len, parity, stop_bit_len))
     {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Serial console on non-legacy PCI serial card?
  2009-05-05  1:31 ` Yu Zhao
@ 2009-05-05  7:26   ` Keir Fraser
  2009-05-05  9:02     ` Yu Zhao
  0 siblings, 1 reply; 7+ messages in thread
From: Keir Fraser @ 2009-05-05  7:26 UTC (permalink / raw)
  To: Yu Zhao, Nigel Gamble; +Cc: xen-devel

Isn't the UART already enabled, since he was seeing garbage on the wire
rather than nothing?

 -- Keir

On 05/05/2009 02:31, "Yu Zhao" <yu.zhao@intel.com> wrote:

> Please apply the attached patch to the grub-0.97, reinstall the grub
> and use the UART boot parameter you have figured out for Xen.
> 
>   kernel /boot/xen.gz com1=115200,8n1,0x1060,0 ...
> 
> Then you should get a workable serial console for Xen.
> 
> Good luck,
> Yu
> 
> On Wed, Apr 29, 2009 at 03:35:59AM +0800, Nigel Gamble wrote:
>> I have an Intel DX50SO motherboard for a Core i7 CPU which has no
>> legacy ports whatsoever, so no COM1 serial port.  I added a "SIIG
>> CyberPro PCI 1S" single serial port PCI card.
>> 
>> Linux dmesg shows it as:
>> 
>> [   30.244790] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
>> [   30.244984] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
>> [   30.245287] serial 0000:06:02.0: PCI INT A -> GSI 18 (level, low) -
>>> IRQ 18
>> [   30.245459] ttyS0: detected caps 00000700 should be 00000100
>> [   30.245518] 0000:06:02.0: ttyS0 at I/O 0x1060 (irq = 18) is a
>> 16C950/954
>> [   30.245583] console [ttyS0] enabled
>> [   32.448682] ttyS2: detected caps 00000700 should be 00000100
>> [   32.454929] 0000:06:02.0: ttyS2 at I/O 0x1068 (irq = 18) is a
>> 16C950/954
>> 
>> Note that the only port actually connected to the single connecter is
>> ttyS0 at 0x1060.  I can successfully use this as the Linux serial
>> console by adding the Linux boot parameters:
>> 
>> console=uart,io,0x1060,115200n8
>> 
>> However, I'm having problems trying to get it to work as a Xen
>> console.  If I add:
>> 
>> com1=115200,8n1,0x1060,0 console=vga,com1
>> 
>> to Xen, I do get some output to the port, but all the characters look
>> like this:
>> 
>> .<.....~.o....¼..4.|.a.½¬o.§¼4.#.ÿ.......ö4..¬.... 4.  .
>> 4Ä...T.Ä ..¼.Ä ....<.
>> 
>> Can anyone help me to get this to work?
>> 
>> Thanks,
>> Nigel
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Serial console on non-legacy PCI serial card?
  2009-05-05  7:26   ` Keir Fraser
@ 2009-05-05  9:02     ` Yu Zhao
  0 siblings, 0 replies; 7+ messages in thread
From: Yu Zhao @ 2009-05-05  9:02 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, Nigel Gamble

I guess the garbage is because the device is not properly initialized
by the BIOS. For native Linux, the card begins to work after the driver
reinitializes it. For dom0, the seiral driver is usually disabled and
Xen doesn't scan the PCI serial card either.

Thanks,
Yu

On Tue, May 05, 2009 at 03:26:21PM +0800, Keir Fraser wrote:
> Isn't the UART already enabled, since he was seeing garbage on the wire
> rather than nothing?
> 
>  -- Keir
> 
> On 05/05/2009 02:31, "Yu Zhao" <yu.zhao@intel.com> wrote:
> 
> > Please apply the attached patch to the grub-0.97, reinstall the grub
> > and use the UART boot parameter you have figured out for Xen.
> > 
> >   kernel /boot/xen.gz com1=115200,8n1,0x1060,0 ...
> > 
> > Then you should get a workable serial console for Xen.
> > 
> > Good luck,
> > Yu
> > 
> > On Wed, Apr 29, 2009 at 03:35:59AM +0800, Nigel Gamble wrote:
> >> I have an Intel DX50SO motherboard for a Core i7 CPU which has no
> >> legacy ports whatsoever, so no COM1 serial port.  I added a "SIIG
> >> CyberPro PCI 1S" single serial port PCI card.
> >> 
> >> Linux dmesg shows it as:
> >> 
> >> [   30.244790] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
> >> [   30.244984] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a NS16550A
> >> [   30.245287] serial 0000:06:02.0: PCI INT A -> GSI 18 (level, low) -
> >>> IRQ 18
> >> [   30.245459] ttyS0: detected caps 00000700 should be 00000100
> >> [   30.245518] 0000:06:02.0: ttyS0 at I/O 0x1060 (irq = 18) is a
> >> 16C950/954
> >> [   30.245583] console [ttyS0] enabled
> >> [   32.448682] ttyS2: detected caps 00000700 should be 00000100
> >> [   32.454929] 0000:06:02.0: ttyS2 at I/O 0x1068 (irq = 18) is a
> >> 16C950/954
> >> 
> >> Note that the only port actually connected to the single connecter is
> >> ttyS0 at 0x1060.  I can successfully use this as the Linux serial
> >> console by adding the Linux boot parameters:
> >> 
> >> console=uart,io,0x1060,115200n8
> >> 
> >> However, I'm having problems trying to get it to work as a Xen
> >> console.  If I add:
> >> 
> >> com1=115200,8n1,0x1060,0 console=vga,com1
> >> 
> >> to Xen, I do get some output to the port, but all the characters look
> >> like this:
> >> 
> >> .<.....~.o....¼..4.|.a.½¬o.§¼4.#.ÿ.......ö4..¬.... 4.  .
> >> 4Ä...T.Ä ..¼.Ä ....<.
> >> 
> >> Can anyone help me to get this to work?
> >> 
> >> Thanks,
> >> Nigel
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@lists.xensource.com
> >> http://lists.xensource.com/xen-devel
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-05-05  9:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28 19:35 Serial console on non-legacy PCI serial card? Nigel Gamble
2009-04-28 20:28 ` Ross Philipson
2009-04-28 22:17   ` Nigel Gamble
2009-04-29  7:17     ` Keir Fraser
2009-05-05  1:31 ` Yu Zhao
2009-05-05  7:26   ` Keir Fraser
2009-05-05  9:02     ` Yu Zhao

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.