190 lines
7.8 KiB
Diff
190 lines
7.8 KiB
Diff
3rdparty/viahss/Kconfig | 14 +++++++
|
|
3rdparty/viahss/Makefile | 3 +
|
|
3rdparty/viahss/README.html | 68 ++++++++++++++++++++++++++++++++++++
|
|
3rdparty/viahss/viahss.c | 83 ++++++++++++++++++++++++++++++++++++++++++++
|
|
4 files changed, 168 insertions(+)
|
|
diff -Nurp linux-2.6.37/3rdparty/viahss/Kconfig linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig
|
|
--- linux-2.6.37/3rdparty/viahss/Kconfig 1970-01-01 02:00:00.000000000 +0200
|
|
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig 2003-12-01 01:53:51.000000000 +0200
|
|
@@ -0,0 +1,14 @@
|
|
+config VIAHSS
|
|
+ tristate "VIA High Speed Serial"
|
|
+ depends on SERIAL_CORE && m
|
|
+ ---help---
|
|
+ VIA High Speed Serial is a little kernel module (1 KB) which enables
|
|
+ high speed serial port modes of VIA VT82C686A or VT82C686B
|
|
+ southbridge-equipped motherboards. With this module, you can use the
|
|
+ serial port at 230400 bit/s so that you can get the full 128000 bit/s
|
|
+ from ISDN-TA. The module has been tested with both 686A and 686B
|
|
+ chipsets.
|
|
+
|
|
+ To compile this driver as a module, choose M here: the
|
|
+ module will be called viahss.
|
|
+
|
|
diff -Nurp linux-2.6.37/3rdparty/viahss/Makefile linux-2.6.37.3rdparty/3rdparty/viahss/Makefile
|
|
--- linux-2.6.37/3rdparty/viahss/Makefile 1970-01-01 02:00:00.000000000 +0200
|
|
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Makefile 2003-12-01 01:43:23.000000000 +0200
|
|
@@ -0,0 +1,3 @@
|
|
+
|
|
+obj-$(CONFIG_VIAHSS) += viahss.o
|
|
+
|
|
diff -Nurp linux-2.6.37/3rdparty/viahss/README.html linux-2.6.37.3rdparty/3rdparty/viahss/README.html
|
|
--- linux-2.6.37/3rdparty/viahss/README.html 1970-01-01 02:00:00.000000000 +0200
|
|
+++ linux-2.6.37.3rdparty/3rdparty/viahss/README.html 2003-12-01 01:58:23.000000000 +0200
|
|
@@ -0,0 +1,68 @@
|
|
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
+<html>
|
|
+<head>
|
|
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
|
+ <title>High speed serial port for VIA VT82C686 chipsets for linux</title>
|
|
+</head>
|
|
+<body>
|
|
+<H3>Setting the serial port speed over 115,200bps</H3>
|
|
+<br>
|
|
+If you have motherboard which has VIA VT82C686A or VT82C686B chipset
|
|
+you can set serial ports in high speed mode with this kernel module.
|
|
+I use module with external ISDN-TA and haven't had any problems
|
|
+so far but I cannot guarantee that you won't have buffer overflows if
|
|
+you use full 230K or 460K speed all the time (FIFO's are still 16550A size).
|
|
+ISDN with two channels maxes out at 128 Kb which means that it doesn't
|
|
+really stress serial ports at 230400. Unlike SHSMOD-patches you don't have
|
|
+to patch serial driver and module takes only 1KB of memory when it's
|
|
+loaded which should leave enough room for other programs. It should
|
|
+be also possible to make this work from userspace but accessing
|
|
+pci devices is so much easier from kernel.
|
|
+
|
|
+<H3>How to use module</H3>
|
|
+Get the <A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>package</A>
|
|
+and compile it using included makefiles.
|
|
+<H3>For 2.4</H3>
|
|
+If you have kernel in some other location than /usr/src/linux edit Makefile
|
|
+before compiling. You can also install module with "make install". After
|
|
+you have loaded module in kernel (use modprobe or insmod) you can set serial
|
|
+ports to use high speed modes with setserial.<br>
|
|
+<H3>For 2.5/2.6</H3>
|
|
+Copy Makefile-2.6 on top of Makefile and do make. After loading module set
|
|
+serial speed with setserial. (NOTE: This gives a warning on depracated
|
|
+method).
|
|
+
|
|
+<br>
|
|
+# setserial /dev/ttyS0 spd_cust divisor 0x8002
|
|
+<br><br>
|
|
+which sets COM1: speed to 230400. With 0x8001 you should get 460800
|
|
+but I haven't tested it. If you want to use COM2: use ttyS1 instead of ttyS0.
|
|
+
|
|
+After this you should set program which you are using to use 38400 bps
|
|
+speed which is now actually 230K or 460K. For more information check
|
|
+setserial man page (spd_cust).
|
|
+
|
|
+You can use serial port work as normal if you do<br>
|
|
+<br>
|
|
+# setserial /dev/ttyS0 spd_normal <br><br>
|
|
+After this you can also remove viahss module with rmmod if you need to. Module doesn't intefere with normal serial port usage so you can leave
|
|
+it loaded if you don't need that extra 1KB which module uses.
|
|
+<H3>Download</H3>
|
|
+<A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>viahss-0.92.tar.gz</A>
|
|
+
|
|
+<H3>Acknowledgments</H3>
|
|
+
|
|
+Thanks to Kimmo Rintala for help with divisor settings.<br>
|
|
+I also like to thank Jeff Garzik for help with VIA datasheets.<br>
|
|
+Port to 2.5/2.6 by Kingsly John with the help of <A href=http://lwn.net>LWN</A>
|
|
+
|
|
+<H3>Version History</H3>
|
|
+0.90 First release<br>
|
|
+0.91 Fixed Makefile <br>
|
|
+0.92 Fixed for 2.5/2.6<br>
|
|
+
|
|
+<H3>Contact</H3>
|
|
+
|
|
+You can reach me by email: <A href=mailto:jrauti@iki.fi>jrauti@iki.fi</A>
|
|
+</body>
|
|
+</html>
|
|
diff -Nurp linux-2.6.37/3rdparty/viahss/viahss.c linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c
|
|
--- linux-2.6.37/3rdparty/viahss/viahss.c 1970-01-01 02:00:00.000000000 +0200
|
|
+++ linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c 2003-07-17 09:49:59.000000000 +0300
|
|
@@ -0,0 +1,83 @@
|
|
+/*
|
|
+ * VIA VT 82c686[AB] high speed serial port enabler
|
|
+ * Version 0.92
|
|
+ * Copyright (c) 2000-2001 Juhani Rautiainen <jrauti@iki.fi>
|
|
+ *
|
|
+ * 0.92:
|
|
+ * Ported to 2.5/2.6 by Kingsly John
|
|
+ * - Corrected locking (no more cli() and sti())
|
|
+ * - New makefile
|
|
+ *
|
|
+ * Can be freely distributed and used under the terms of the GNU GPL.
|
|
+*/
|
|
+
|
|
+#include <linux/module.h>
|
|
+#include <linux/config.h>
|
|
+#include <linux/version.h>
|
|
+#include <linux/init.h>
|
|
+#include <linux/pci.h>
|
|
+
|
|
+const unsigned short confindex=0x3F0,confdata=0x3F1;
|
|
+const unsigned char spcidx=0xEE;
|
|
+
|
|
+spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
|
|
+
|
|
+static int __init viahss_init(void)
|
|
+{
|
|
+ struct pci_dev *pcidev = NULL;
|
|
+ unsigned char confval,val;
|
|
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
|
+ if (pcidev) {
|
|
+ spin_lock_irq(&driver_lock);
|
|
+ /* start config */
|
|
+ pci_read_config_byte(pcidev,0x85,&confval);
|
|
+ confval |= 0x2;
|
|
+ pci_write_config_byte (pcidev, 0x85,confval);
|
|
+ /* activate high speed bits */
|
|
+ outb(spcidx,confindex); /* set index */
|
|
+ val = (unsigned char) inb(confdata);
|
|
+ val |= 0xC0; /* both ports on high speed*/
|
|
+ outb (spcidx,confindex);
|
|
+ outb (val,confdata);
|
|
+ /*stop config*/
|
|
+ confval &= ~0x2;
|
|
+ pci_write_config_byte(pcidev, 0x85, confval);
|
|
+ spin_unlock_irq(&driver_lock);
|
|
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed enabled\n");
|
|
+ }
|
|
+ else {
|
|
+ printk (KERN_INFO "Couldn't locate VIA chipset\n");
|
|
+ return -ENODEV;
|
|
+ }
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static void __exit viahss_exit(void)
|
|
+{
|
|
+ struct pci_dev *pcidev = NULL;
|
|
+ unsigned char confval,val;
|
|
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
|
+ if (pcidev) {
|
|
+ spin_lock_irq(&driver_lock);
|
|
+ /* start config */
|
|
+ pci_read_config_byte(pcidev,0x85,&confval);
|
|
+ confval |= 0x2;
|
|
+ pci_write_config_byte (pcidev, 0x85,confval);
|
|
+ /* activate high speed bits */
|
|
+ outb(spcidx,confindex); /* set index */
|
|
+ val = (unsigned char) inb(confdata);
|
|
+ val &= ~0xC0; /* both ports off high speed*/
|
|
+ outb (spcidx,confindex);
|
|
+ outb (val,confdata);
|
|
+ /*stop config*/
|
|
+ confval &= ~0x2;
|
|
+ pci_write_config_byte(pcidev, 0x85, confval);
|
|
+ spin_unlock_irq(&driver_lock);
|
|
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed disabled\n");
|
|
+ }
|
|
+}
|
|
+
|
|
+module_init(viahss_init);
|
|
+module_exit(viahss_exit);
|
|
+MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
|
|
+MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
|