===============================================================================

                 CTI Driver Patch for Linux 2.6.X Kernel  
                      Copyright (C) 2008, CTI.

-(v2) June 3, 2008 - Added Support for Xtreme/104-Plus Opto (XOG005)
NOTE: This patch has been tested on 2.6.18 - 2.6.21 kernels
It is known to NOT work on 2.6.23 and newer kernels

Please contact support@connecttech.com if you require this.

===============================================================================
Content

1. Introduction
2. System Requirement
3. Installation & Setup
  3.1 Hardware installation
  3.2 Obtaining Driver files
  3.3 Installing the Serial Driver
  3.4 Compiling the Linux Kernel With Support For Your CTI Product
  3.5 Verifying Your Installation
  3.6 RS485 modes
4. Additional Support

-------------------------------------------------------------------------------

1. Introduction

   This serial driver supports following multiport boards.

    PCI UART FAMILY
    - BlueStorm/LP
    - BlueStorm/SP
    - BlueStorm/SP Opto
    - BlueStorm/Express
    - BlueStorm/Express Opto
    - Xtreme/104-Plus
   
    EOL BLUEHEAT FAMILY
	- BlueHeat/PCI
	- BlueHeat Opto
	- BlueHeat Universal
	- BlueHeat PTM
	- BlueHeat CL
   
    TITAN cPCI FAMILY
	- Titan/cPCI
	- Titan/cPCI Rear IO
	- Titan/104-Plus

   All the drivers and utilities are published in form of source code under  GNU General Public License in this version. Please refer to GNU General Public     License announcement in each source code file for more detail.

   The driver can be only be installed as a patch to linux kernel source tree.  Before you install the driver, please refer to hardware installation procedure  in the User's Manual. Once the driver is installed there are some utilities that will allow you to use some of the extra features of the driver. These are found in the "utilities" directory found in this driver package.
  
-----------------------------------------------------------------------------

2. System Requirement
   - Hardware platform: x86
   - Kernel version: 2.6.x
   - gcc version 2.72 or later
   - Maximum 8 boards can be installed, with a combined maximum of 64 ports
   - This driver has only been tested with in linux kernel 2.6.18 with:
	--> Fedora Core 6
	--> RHEL 4
	--> Debain 3.1
	--> Ubuntu 6.06

-----------------------------------------------------------------------------

3. Installation & Setup

******
NOTE: This section of the document assumes the following:
- You are using a Linux 2.6.X kernel.
- You have the full kernel source on your system, that you have either got from a source RPM or a kernel.org tar.gz package.
- You have development tools installed on your system and are able to compile   source code
- You are using the GRUB boot loader
- That any time you see a # in this guide what follows it is a command to be    entered into the terminal
******

-------------------------------------------------------------------------------

   3.1 Hardware installation
      
		You may need to adjust IRQ usage in BIOS to avoid IRQ conflict  with legacy ISA devices. 

-------------------------------------------------------------------------------
		
	3.2 Obtaining Driver files

		The driver package may be downloaded from our website or off the CD-ROM that came with your product. The first step is to copy the driver file  "bhtnpciu-2.6.X.tar.gz" onto a local directory which we will denote as          {local_dir}, then execute 'tar -xzf bhtnpciu-2.6.X.tar.gz', where X is the      kernel version supported by the driver package.
	
-------------------------------------------------------------------------------
	
	3.3 Installing the Serial Driver

		To install the driver you must first navigate to your linux     kernel source tree. The Linux kernel source tree is typically located in        /usr/src/linux or /usr/src/linux-KERNELVERSION. This may vary from distribution to distribution. From your kernel directory, use the following command to patch your kernel:
	
		# patch -p1 < /{local_dir}/bhtnpciu-2.6.X.patch

At this point you should see an output verifying that the patch succeeded.  If  you received any error messages please first ensure that your kernel version is the same as the driver version.  If you are still having errors and your kernel matches the version of the driver please contact support@connecttech.com for    assistance.  If you are using a kernel version that the driver does not support please contact support@connecttech.com and they will assist you in obtaining a  proper driver for your kernel version.
		
-------------------------------------------------------------------------------
		
	3.4 Compiling the Linux Kernel With Support For Your CTI Product

		This next step after patching your kernel is to recompile your  linux kernel so that the new support you have added can be implemented.  This   next section will guide you through a step by step process of compiling a Linux 2.6 kernel.  First be sure you are still in your source directory of the kernel you just recently patched.  Now issue the following set of commands:

		# make mrproper
		# make clean

Now you will need to setup your kernel config file to enable some extra support for your CTI product, do this enter the menuconfig like so:

		# make menuconfig

Once in the configuration menu screen browse to and enable the following options
(Bus Options -> PCI Support)
(Device Drivers -> Character Devices -> Serial drivers -> 8250/16550 and        compatible serial support)
(Device Drivers -> Character Devices -> Serial drivers -> Extended 8250/16550   serial driver options)
(Device Drivers -> Character Devices -> Serial drivers -> Support more than 4   legacy serial ports)
(Device Drivers -> Character Devices -> Serial drivers -> Support for sharing   serial interrupts)
(Device Drivers -> Character Devices -> Serial drivers -> Maximum number of 8250/16550 serial ports to a high number ie. 128)
(Device Drivers -> Character Devices -> Serial drivers -> Number of 8250/16550  serial ports to register at runtime to a high number ie. 128)

Now it is a good idea to change the "extra version" field in the kernel makefile so that when you do a recompile you can select this patched kernel as a        different boot option then from your original kernel.  To do this do the        following:

		# vi Makefile 
		
Edit The Extra Version Line to be specific for your application (ie. -CTI).  Now continue on compiling your kernel with the following commands.

		# make bzImage
		# make modules
		# make modules_install
		# cp arch/i386/boot/bzImage /boot/vmlinuz-MODULENAME 
		
The MODULENAME will need to be the linux kernel version plus the extra version  line [ie. 2.6.X-CTI].  Continuing on with our recompile please finish by issuing the following:
		
		# cp System.map /boot/System.map-MODULENAME
		# mkinitrd -f /boot/initrd-MODULENAME.img MODULENAME
	
If you are using a Debian based distro you will need to give this command a -o  instead.  Now the final step here is to edit your boot config file to have the  newly recompiled kernel listed as an bootable option. The easiest way to do this is to copy a previous entry and paste it and make the appropriate changes to   the kernel image and ram disk.
		
		# vi /boot/grub/grub.conf OR # vi /boot/grub/menu.lst

Once you have completed you changes save your boot config file, reboot your     system and select the new kernel from the boot menu.  Now you are finished and  you should be booted into your new kernel. 

-------------------------------------------------------------------------------

	3.5 Verifying Your Installation

		To verify that your card is properly installed and everything is working fine, check the dmesg output for the ttyS# serial devices. To do this  issue the following command:

		# dmesg | grep tty

If things are properly installed you should see an out listing the ports of the on board and CTI serial ports.  For example if you had 8 port CTI card and one  on board standard serial port your out would look like this:
		
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
0000:02:00.0: ttyS4 at MMIO 0xfd4ff000 (irq = 5) is a ST16650
0000:02:00.0: ttyS5 at MMIO 0xfd4ff200 (irq = 5) is a ST16650
0000:02:00.0: ttyS6 at MMIO 0xfd4ff400 (irq = 5) is a ST16650
0000:02:00.0: ttyS7 at MMIO 0xfd4ff600 (irq = 5) is a ST16650
0000:02:00.0: ttyS8 at MMIO 0xfd4ff800 (irq = 5) is a ST16650
0000:02:00.0: ttyS9 at MMIO 0xfd4ffa00 (irq = 5) is a ST16650
0000:02:00.0: ttyS10 at MMIO 0xfd4ffc00 (irq = 5) is a ST16650
0000:02:00.0: ttyS11 at MMIO 0xfd4ffe00 (irq = 5) is a ST16650

You can see from the above output that the CTI card is on ports ttyS4 to ttyS11.  Now if you would like to do a functional verification we recommend trying the following steps:
- connect a "loopback" connector to one of the ports in test
- open a terminal application like minicom on that port
- type some characters and see if they are echoed back
- remove the loopback connector and type some more characters and see if the    echoing stops.

-------------------------------------------------------------------------------

	3.6 RS485 modes
	
		When using RS485, you must tell the driver what mode the port   has been jumpered as.  This is accomplished in one of two ways.

	3.6.1 Use CTI's set485 utility
		Connect Tech has a small utility called set485 which comes      packaged with the BlueStorm driver. This utility allows you to set each port to full duplex, half duplex, or multi-drop slave. The utilites can be found in the utilties directory contained in our package.  More information can be found on  this in the README in that directory.

	3.6.2 Send IOCTLs from your app
		Included with the driver source is 'cti485.h'.  This header     includes defines for IOCTLs used to get and set the 485 mode of a port.         See 'cti485.h' for more information.
	
-------------------------------------------------------------------------------

4. Additional Support

If you require any additional support please feel free to call our support      department and their team of highly intelligent, friendly and helpful indviduals would be more than happy to help with any issue you may be having. To contact  CTI Technical Support Department you can reach them by the following:

	email: support@connecttech.com
	phone: 1-800-426-8979
	phone2: 1-519-836-1291
	fax: 1-519-836-4878

