I have two serial ports, one provided via motherboard (/dev/ttyS0) and one from PCIE to RS232 card (Startech 2S952) with Oxford chip (/dev/ttyS1) (there is /dev/ttyS2 but it does not enter this story). How do I interpret baud speed in my case?
[ 1.111618] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A [ 1.112543] 0000:08:00.0: ttyS1 at I/O 0xf010 (irq = 40, base_baud = 4000000) is a 16550A I attached a logic analyzer to the Tx/Rx lines of the serial port. When I do:
stty -F /dev/ttyS0 115200 echo "ABCDEFGH" > /dev/ttyS0 then I can decode "ABCDEFGH" string followed by 0x0D 0x0A on the logic analyzer, but I have to tell it that the baud speed is 115200. Also, when I connect a laptop with usb-serial adapter (via null modem cable) and read off the serial port, I get a meaningful output only when I set the receiver to 115200. This is as I understand it should be.
Now with /dev/ttyS1:
stty -F /dev/ttyS1 115200 echo "ABCDEFGH" > /dev/ttyS1 I clearly see in the logic analyzed that my message is significantly slower in terms of milliseconds. In fact, it is approx 34.7(2) times slower and 40000000/115200 = 34.7(2). In particular, a receiver laptop receives a message consisting of several 0x00's. When I set to 3200 baud, it sees gibberish. Evidently the message is in fact being transmitted with 115200/34.6 = 3339.13... bps.
With /dev/ttyS1:
stty -F /dev/ttyS1 4000000 echo "ABCDEFGH" > /dev/ttyS1 The communication to /dev/ttyS1 occurs with bit duration matching what one expects from 115200.
Then it would mean in my case:
[ 1.112543] 0000:08:00.0: ttyS1 at I/O 0xf010 (irq = 40, base_baud = 4000000) is a 16550A Should be interpreted "4000000" is frequency of some internal oscillator that results in 115200 transmission in the real world. I would expect this value to be internal to the hardware and hidden deep inside the driver.
What am I missing? This is the first time ever I have used a serial port, so I am completely lost.
If I pass "console=ttyS1,4000000n8" as a kernel parameter, then I am able to communicate over serial with setting 115200 on the laptop.
setseriallooks to have abaud_baseoption, so see what happens if you dosetserial /dev/ttyS1 baud_base 115200?