author: Acrux WORK IN PROGRESS


Serial Console Baud Rates matrix

s1 matrix

machine serial port bps speed bits DTR/DSR
Acube Sam440ep, Sam440ep-flex, Sam460ex ttyS0 115200 8-N-1 No
Apple PowerMac, Xserve G4/G5 ttyPZ0 57600 8-N-1  
Genesi Pegasos I/II ttyS0 115200 8-N-1 No
Genesi Efika, generic Freescale PowerPC SoC ttyPSC0 115200 8-N-1 No
IBM CHRP - cpu 604 ttyS0 9600 8-N-1  
IBM pSeries - cpu ≤ POWER4+ ttyS0 9600 8-N-1 Yes
IBM Blade, IBM managed via HVC - cpu ≥ POWER5 hvc0 - - -
IBM unmanaged - cpu ≥ POWER5 hvsi0 19200 8-N-1 Yes
IBM Blade JS (SLOF), YDL Powerstation, IBM POWER 185 - cpu = PPC970 ttyS0 19200 8-N-1 No

s2 Setup Serial Console

You need to enable console redirection under CRUX PPC to see remote server boot information and any diagnostic information that is normally printed to the screen you can configure and access CRUX PPC server over serial console.
Thus if you want access your machine via serial console (as it should be for IBM RS/6000, pSeries, Apple Xserve or Genesi EFIKA users) you also have to add ttyS0 (ttyPZ0 for Xserve or ttyPSC0 for EFIKA) in the /etc/securetty and c7:2:respawn:/sbin/agetty 9600 ttyS0 (c7:2:respawn:/sbin/agetty 57600 ttyPZ0 for Xserve or c7:2:respawn:/sbin/agetty 115200 ttyPSC0 for EFIKA) in the /etc/inittab file. IBM System p and PPC970 cpu based systems work with 19200bps serial console.

s3 agetty

agetty opens a tty port, prompts for a login name and invokes the /bin/login command. It is normally invoked by init(8). agetty has several non-standard features that are useful for hard-wired and for dial-in lines. agetty options explained:

    * -L    force line to be local line with no need for carrier detect (when you have no modem).
    * -f    alternative /etc/issue file. This is what a user sees at the login prompt.
    * -i    do not display any messages at the login prompt.
    * 9600    serial line rate in bps. Set this to your dumb terminal or terminal emulator line rate.
    * ttyS0    this is the serial port identifier.
    * vt100    is the terminal emulation. You can use others, but VT100 is the most common or "standard". Another widely used termial type is VT102.

Possible serial line rates (sometimes called baud rates) for the 16550A UART:

    * 110 bps
    * 300 bps
    * 1200 bps
    * 2400 bps
    * 4800 bps
    * 9600 bps
    * 19,200 bps
    * 38,400 bps
    * 57,600 bps
    * 115,200 bps

or a hard-wired line or a console tty:

      /sbin/agetty 9600 ttyS1

For a directly connected terminal without proper carriage detect wiring: (try this if your terminal just sleeps instead of giving you a password: prompt.)

      /sbin/agetty -L 9600 ttyS1 vt100 

9600 bps is generally is a very common setting for networking hardware. 38,400 bps is the speed of the standard Linux console. 19,200 bps it is reasonably speedy and you will not be annoyed.

s4 iso scripts

from CRUX PPC 2.7

#!/bin/sh
#
# /usr/bin/serial_console
#
# This script opens a tty on /dev/tts/0 if it is a valid terminal, otherwise
# goes to sleep for a year. This script is needed to prevent init(1) from
# respawning agetty over and over again on machines that don't have a serial
# port.
#
# CRUX PPC - 32bit Release

        # Apple Power Mac, Xserve G4
if stty -F /dev/ttyPZ0 > /dev/null 2>&1; then
        exec /sbin/agetty 57600 ttyPZ0 vt100
       # generic Freescale SoC
elif stty -F /dev/ttyPSC0 > /dev/null 2>&1; then
        exec /sbin/agetty 115200 ttyPSC0 vt100
        # standard serial console
elif stty -F /dev/ttyS0 > /dev/null 2>&1; then
        # serial console - Acube Sam440ep, Sam440ep-flex, Sam460ex
    if [ "`cat /proc/cpuinfo | grep Sam`" != "" ]; then
        exec /sbin/agetty 115200 ttyS0 vt100
        # serial console - IBM CHRP
    elif [ "`cat /proc/cpuinfo | grep CHRP`" != "" ]; then
        exec /sbin/agetty 9600 ttyS0 vt100
    else
        #  serial console - unknown generic
        exec /sbin/agetty 38400 ttyS0 vt100
    fi
else
        exec /bin/sleep 365d
fi

# End Of File
#!/bin/sh
#
# /usr/bin/serial_console
#
# This script opens a tty on /dev/ttS/0 if it is a valid terminal, otherwise
# goes to sleep for a year. This script is needed to prevent init(1) from
# respawning agetty over and over again on machines that don't have a serial
# port.
#
# CRUX PPC - 64bit Release

        # Apple Xserve G5
if stty -F /dev/ttyPZ0 > /dev/null 2>&1; then
        exec /sbin/agetty 57600 ttyPZ0 vt100
        # generic Freescale SoC
elif stty -F /dev/ttyPSC0 > /dev/null 2>&1; then
        exec /sbin/agetty 115200 ttyPSC0 vt100
        # console via HMC - cpu >= POWER5 & Blade
elif stty -F /dev/hvc0 > /dev/null 2>&1; then
        exec /sbin/agetty 19200 hvc0 vt320
        # console via rs232 - cpu >= POWER5
elif stty -F /dev/hvsi0 > /dev/null 2>&1; then
        exec /sbin/agetty 19200 hvsi0 vt100
        # standard serial console
elif stty -F /dev/ttyS0 > /dev/null 2>&1; then
        # serial console - cpu <= POWER4+
    if [ "`cat /proc/cpuinfo | grep POWER`" != "" ]; then
        exec /sbin/agetty 9600 ttyS0 vt100
        # serial console - Maple PPC970, POWER 185
    elif [ "`cat /proc/cpuinfo | grep PPC970`" != "" ]; then
        exec /sbin/agetty 19200 ttyS0 vt100
    else
        # serial console - unknown generic
        exec /sbin/agetty 38400 ttyS0 vt100
    fi
else
        exec /bin/sleep 365d
fi

# End Of File

s5 usb-serial

If you are using the usb -> RS232 adapter, the serial drivers may need to be installed for the device to work properly. After plugging in the device, first check the hardware messages to see the device was detected.

  stty -F /dev/ttyUSB0 9600

should set /dev/ttyUSB0 to 9600bps.

In other words, this works exactly like any other serial port, you can set its speed using stty. Once the device is visible to the system, applications (including stty) do not know or care whether the serial port is a virtual one over USB, or any other low level hardware details about the way the device is implemented -- the driver and the kernel hide all that from applications. That's how Unix/Linux is supposed to work.

To see if setting the speed worked, use

  stty -F /dev/ttyUSB0 -a

and you should get all the details of exactly how that serial port is currently configured, including its speed.

s6 reference

ref1: http://lxr.linux.no/#linux+v2.6.35.7/drivers/usb/serial/Kconfig
ref2: http://tldp.org/HOWTO/Serial-HOWTO.html