Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-18 Thread H. Peter Anvin
Rene Herman wrote: The number of places expected to contain something sensible should I believe first be verified at 0x410 -- the equipment word. Bits 11-9 (0x0e00) should be the number of serial ports, 0 to 4 (so 5-7 is also a sanity check) and if BIOSes can be expected to zero out the

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-18 Thread H. Peter Anvin
Rene Herman wrote: The number of places expected to contain something sensible should I believe first be verified at 0x410 -- the equipment word. Bits 11-9 (0x0e00) should be the number of serial ports, 0 to 4 (so 5-7 is also a sanity check) and if BIOSes can be expected to zero out the

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Rene Herman
On 16-01-08 21:42, H. Peter Anvin wrote: Bodo Eggert wrote: BTW1: These addresses may be used to detect ports on non-standard addresses, but unfortunately they don't tell the IRQ. BTW2: When I submitted a patch using the BIOS data area, I was told that it might not exist on systems

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread H. Peter Anvin
Bodo Eggert wrote: BTW1: These addresses may be used to detect ports on non-standard addresses, but unfortunately they don't tell the IRQ. BTW2: When I submitted a patch using the BIOS data area, I was told that it might not exist on systems booting from non-PC firmware. This claim was not yet

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Bodo Eggert
Bjorn Helgaas <[EMAIL PROTECTED]> wrote: > On Wednesday 16 January 2008 11:44:37 am H. Peter Anvin wrote: >> Bjorn Helgaas wrote: >> > +#ifdef CONFIG_X86 >> > + switch (port->iobase) { >> > + case 0x3f8: return 0; /* COM1 -> ttyS0 */ >> > + case 0x2f8: return 1; /* COM2 ->

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread H. Peter Anvin
Bjorn Helgaas wrote: + Arguably, the right thing is to use the addresses present in the array at address 0x400. In particular, COM3 and COM4 aren't always at those addresses. Wow. I bow before your storehouse of x86 arcana :-) I guess you're referring to the "BIOS data area," which I'd

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Bjorn Helgaas
On Wednesday 16 January 2008 11:44:37 am H. Peter Anvin wrote: > Bjorn Helgaas wrote: > > x86 users expect COM1-COM4 ports at the conventional ioport addresses > > to be named ttyS0-ttyS3. For PNP devices, the BIOS determines the > > order we discover them, so we might discover COM2 before COM1.

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread H. Peter Anvin
Bjorn Helgaas wrote: x86 users expect COM1-COM4 ports at the conventional ioport addresses to be named ttyS0-ttyS3. For PNP devices, the BIOS determines the order we discover them, so we might discover COM2 before COM1. We currently always get the correct names, even without this patch. But

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Russell King
On Wed, Jan 16, 2008 at 10:05:43AM -0700, Bjorn Helgaas wrote: > static int __devinit > +serial_pnp_line(struct uart_port *port) > +{ > +#ifdef CONFIG_X86 > + switch (port->iobase) { > + case 0x3f8: return 0; /* COM1 -> ttyS0 */ > + case 0x2f8: return 1; /* COM2 ->

[patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Bjorn Helgaas
x86 users expect COM1-COM4 ports at the conventional ioport addresses to be named ttyS0-ttyS3. For PNP devices, the BIOS determines the order we discover them, so we might discover COM2 before COM1. We currently always get the correct names, even without this patch. But that's only because

[patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Bjorn Helgaas
x86 users expect COM1-COM4 ports at the conventional ioport addresses to be named ttyS0-ttyS3. For PNP devices, the BIOS determines the order we discover them, so we might discover COM2 before COM1. We currently always get the correct names, even without this patch. But that's only because

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Russell King
On Wed, Jan 16, 2008 at 10:05:43AM -0700, Bjorn Helgaas wrote: static int __devinit +serial_pnp_line(struct uart_port *port) +{ +#ifdef CONFIG_X86 + switch (port-iobase) { + case 0x3f8: return 0; /* COM1 - ttyS0 */ + case 0x2f8: return 1; /* COM2 - ttyS1 */

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread H. Peter Anvin
Bjorn Helgaas wrote: x86 users expect COM1-COM4 ports at the conventional ioport addresses to be named ttyS0-ttyS3. For PNP devices, the BIOS determines the order we discover them, so we might discover COM2 before COM1. We currently always get the correct names, even without this patch. But

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Bjorn Helgaas
On Wednesday 16 January 2008 11:44:37 am H. Peter Anvin wrote: Bjorn Helgaas wrote: x86 users expect COM1-COM4 ports at the conventional ioport addresses to be named ttyS0-ttyS3. For PNP devices, the BIOS determines the order we discover them, so we might discover COM2 before COM1. We

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread H. Peter Anvin
Bjorn Helgaas wrote: + Arguably, the right thing is to use the addresses present in the array at address 0x400. In particular, COM3 and COM4 aren't always at those addresses. Wow. I bow before your storehouse of x86 arcana :-) I guess you're referring to the BIOS data area, which I'd

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Bodo Eggert
Bjorn Helgaas [EMAIL PROTECTED] wrote: On Wednesday 16 January 2008 11:44:37 am H. Peter Anvin wrote: Bjorn Helgaas wrote: +#ifdef CONFIG_X86 + switch (port-iobase) { + case 0x3f8: return 0; /* COM1 - ttyS0 */ + case 0x2f8: return 1; /* COM2 - ttyS1 */ + case

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread H. Peter Anvin
Bodo Eggert wrote: BTW1: These addresses may be used to detect ports on non-standard addresses, but unfortunately they don't tell the IRQ. BTW2: When I submitted a patch using the BIOS data area, I was told that it might not exist on systems booting from non-PC firmware. This claim was not yet

Re: [patch 2/2] 8250_pnp: register x86 COM ports at the conventional ttyS names

2008-01-16 Thread Rene Herman
On 16-01-08 21:42, H. Peter Anvin wrote: Bodo Eggert wrote: BTW1: These addresses may be used to detect ports on non-standard addresses, but unfortunately they don't tell the IRQ. BTW2: When I submitted a patch using the BIOS data area, I was told that it might not exist on systems