Linux – setserial /dev/ttyS4: Cannot set serial info

linuxserial port

So, I have a board with 6 hardware serial ports: the first 2 on the ETX bus and the last 4 on the ISA bus. The following configuration is how it is supposed to be:

/dev/ttyS0 port 0x03F8 irq 4
/dev/ttyS1 port 0x02F8 irq 3
/dev/ttyS2 port 0x0100 irq 5
/dev/ttyS3 port 0x0108 irq 5
/dev/ttyS4 port 0x0110 irq 5
/dev/ttyS5 port 0x0118 irq 5

On startup, I run:

# dmesg | egrep -i 'serial|ttys'
Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

# cat /proc/tty/driver/serial
Serinfo:1.0 driver revision:
0: uart:16550A port: 000003F8 irq:4 tx:0 rx:0
1: uart:16550A port: 000002F8 irq:3 tx:0 rx:0
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
4: uart:unknown port:00000000 irq:0
5: uart:unknown port:00000000 irq:0

So, I'm trying to use setserial to configure ports ttyS2-ttyS5 with the correct values:

# setserial /dev/ttyS2 irq 5 port 0x100 uart 16550A
# setserial /dev/ttyS3 irq 5 port 0x108 uart 16550A
# setserial /dev/ttyS4 irq 5 port 0x110 uart 16550A
Cannot set serial info: Invalid argument
# setserial /dev/ttyS5 irq 5 port 0x118 uart 16550A
Cannot set serial info: Invalid argument

Even taking out the uart option from the last command:

# setserial /dev/ttyS4 irq 5
Cannot set serial info: Invalid argument

What do I need to do to get ttyS4 and ttyS5 configured through setserial?

Best Answer

A couple of things strike me about what I see in your /proc and dmesg output:

  • You shouldn't try to share an IRQ between devices. It may work, but the intention with ISA is that each device on the bus that needs an interrupt line to work gets its own IRQ. If your serial port cards don't give you enough IRQ options, you may simply not be able to use them all together in that PC.

  • The I/O addresses you are using for the second pair of serial ports are nonstandard. ttyS2 is normally at 0x3E8 and ttyS3 is normally at 0x2E8. I would move those if you have that option with the serial card. (There are no standard I/O addresses or IRQs for ttyS4 and up.)

Aside from all that, if I needed 6 serial ports on a Linux box, I wouldn't try to use plain old serial port adapter cards. I would use something like a Digi AccelePort. They still offer one that will work in your ISA slots, the Xe model. If you need cheap, you should be able to find one floating around on the used market; they were very popular back in the day.

Related Question