Serial settings
Setting the baud rate at runtime seems not to work. So you first have to edit the kernel sources as described for the second uart and build your own kernel.
Normal way
Install the package setserial and activate stty in bussybox and edit /etc/init.d/S15serial at runtime or ./package/setserial/files/serial.init before build with the same baudrates like in the kernel sources
#!/bin/sh /usr/sbin/setserial /dev/ttyS0 irq 1 baud_base 115200 /usr/sbin/setserial /dev/ttyS1 irq 2 baud_base 2400
- make additional settings with
stty(TODO: which ?)
Quick and dirty
Write your own program, which makes all the settings for you. Based on sunspots work I use this c programm. Change the baudrate and the device name in the sources to your needs or implement baudrate and device name as command line arguments.
Compile it using the crosscompiler, strip it and copy it into trunk/openwrt/target/linux/image/adm5120/base-files/sbin/ before you next firmware build. After you run it, your /dev/ttyS1 runs fine with 8N1, no hardware handshaking and the baudrate you entered in the sources.
