Serial High Speed Mode Patch for Linux June 15, 1997 MIZUHARA Bun (mizuhara@acm.org) Sep 7, 1998 Updated by TAKEUCHI Yoji (ytakeuch@po.iijnet.or.jp) June 16, 2002 Updated by Marcin Wisnicki (cherry@klub.chip.pl) Feb 20, 2003 Updated by Tom Hidaka (tom@devdrv.com) 1. Introduction Some SMC/NS/Winbond Multi-I/O chips and ALI south bridge chips have High Speed mode, in which baud rate can be set to 230400, 460800 (or 921600 at NS/Winbond chips) bps. With this patch applied, the serial port driver automatically probe those chips and enable High Speed mode. This patch is initially created and tested for kernel 2.0.34 and now modified and tested for 2.4.18, 2.4.18-14(Red Hat 8.0) and 2.4.19. There is absolutely no warranty for this software. This software can be distributed or modified freely, provided that this documentation accompanies. However, it is encouraged to send comments or modifications to the authors (mizuhara@acm.org, ytakeuch@po.iijnet.or.jp, cherry@klub.chip.pl, tom@devdrv.com). Copyright 1996,1997 MIZUHARA Bun (mizuhara@acm.org). 2. History Feb. 20, 2003 Updated to V1.93b by tom@devdrv.com Added support for new ALi, Winbond,SMSC chips from Shsmod V1.93b for DOS. Feb. 14, 2003 Updated to V1.91 by tom@devdrv.com Added support for VIA, new Winbond chips from Shsmod V1.9 for DOS. June 16, 2002 Updated to V1.8b4 and kernel 2.4.18 by cherry@klub.chip.pl Added support for new Winbond chips from Shsmod V1.8b4 for DOS. Spetember 7, 1998 Updated to V1.7a. Updated features from original Shsmod V1.7a. Spetember 7, 1998 Updated to V1.7a. Updated features from original Shsmod V1.7a. June 15, 1997 Updated to v1.1. Fixed a bug in 669 probing. Added support for new chips. November 3, 1996 Released first version. (My birthday!) 3. System requirements OS: Linux kernel version 2.4.18 or later. I/O Chips: ALI: M1543/M1543C(Aladdin V south bridge) M5133 and more(not tested) Serial ports provided by this chip will run at 230400 and 460800 bps. NS: PC87308 PC87307/87317 PC97307/97317 PC87309 PC87338 PC97338 Serial ports provided by these chips will run at 230400/460800/921600 bps. SMC: 37C665IR/666IR 37C669/669FR,37N769 37B72x/77x/78x/80x,37C67x/68x/93x/93xAPM/93xFR,37M60x/61x,37N958FR and more(not tested) Serial ports provided by these chips will run at 230400 and 460800 bps. WinBond: W83877TF/ATF(TF/ATF ONLY, A/F/AF NOT supported) W83977A/F/AF/TF/ATF/EF/CTF W83627HF/F W83697HF(not tested) and more(not tested) Serial ports provided by these chips will run at 230400/460800/921600 bps. VIA: VT82C686A|B Serial ports provided by these chips will run at 230400 and 460800 bps. Visit http://www.devdrv.com/shsmod/download.html for detailed information and availability of patches for other OS. 4. Installation and testing (1) Login as root. (2) Change directory to /usr/src/linux (or "your kernel directory") (or a directory where linux kernel sources reside). (3) Apply this patch. # patch -p1 -s < shsmod-v1.93b.patch No messages should be displayed. (4) Rebuild the kernel. If serial driver is compiled in the kernel (and LILO is used as a boot loader), follow these steps: # cd linux # make bzImage If serial driver is compiled as a module, follow these steps: # cd linux # make modules # make modules_install (5) Reboot with the new kernel and watch messages carefully. If you find messages like this, congratulations! Serial driver version 4.13 with HighSpeedMode V1.7a(Linux 06-Sep-98) enabled tty00 at 0x03f8 (irq = 4) is a 16550A(NS PC87308 at 002eh, Serial Speed Mode: High) tty01 at 0x02f8 (irq = 3) is a 16550A(NS PC87308 at 002eh, Serial Speed Mode: High) The first line shows that the driver supports High Speed mode. It does not mean a chip used in your system supports High Speed mode. The second and third line shows I/O chip type and wheather it supports High Speed mode. If you cannot find "High Speed mode enabled" in the messages, your chip does not support High Speed mode. Try another motherboard or I/O card. 5. How to use serial speed higher than 38400bps From application's point of view, maximum speed of serial port is 38400bps even if High Speed mode is enabled. Set it to 38400bps, and call a program named "setserial" in order to use higher speed. # setserial /dev/cua1 spd_hi sets /dev/cua1 (com2) to 57600bps. # setserial /dev/cua0 spd_vhi sets /dev/cua0 (com1) to 115200bps. for SMC/ALI chips # setserial /dev/cua1 spd_cust divisor 0x8002 sets /dev/cua1 (com2) to 230400bps (with High Speed mode enabled). # setserial /dev/cua0 spd_cust divisor 0x8001 sets /dev/cua0 (com1) to 460800bps (with High Speed mode enabled). for NS/Winbond chips # setserial /dev/cua1 spd_cust divisor 4 sets /dev/cua1 (com2) to 230400bps (with High Speed mode enabled). # setserial /dev/cua0 spd_cust divisor 2 sets /dev/cua0 (com1) to 460800bps (with High Speed mode enabled). # setserial /dev/cua0 spd_cust divisor 1 sets /dev/cua0 (com1) to 921600bps (with High Speed mode enabled). !!! THIS MODE IS NOT TESTED !!! 6. Bug reports If you encounter problems, follow these steps. (1) Recompile the driver with DEBUG_CONFIG_SHSMOD option enabled, if possible. In the file linux/drivers/char/serial.c, you can find /* #define DEBUG_CONFIG_SHSMOD */ at line number around 80. Uncomment this line and recompile, as shown above. (2) Reboot with the kernel, and watch messages. Write down relevant messages. You can scroll up the screen by pressing Shift-PageUp. (3) Ask to BBS (http://www.devdrv.com/bbs/eshsmod.cgi) with detailed description of the kernel messages, and hardware environment. This V1.93b(beta) is for beta trial version. Please report us.