Stallion Technologiessupport
Product documentation
online documentation
 
Documetation image, 8K

EasyIO Driver Installation for Linux 

EasyConnection

EasyIO

EasyServer II

Contents: 

Hardware Installation

Hardware Installation Reference 

 
Note: Due to the rapidly changing nature of the Linux environment, it is important to check the driver source for the latest information. 

The other utilities supplied in the Linux installation can be used with Stallion drivers on any version of the kernel. 


Installing EasyIO Software 

  • Mount /dev/cdrom /mnt
  • cd /usr/src
  • tar xvf /mnt/drivers/easyio/linux/v550.tar
  • Extract the files using the tar command, eg. tar xvf stallion-5.5.0.tar 
  • This creates a directory containing the driver source files, eg. stallion-5.5.0 
  • Change to the appropriate directory, eg. cd stallion-5.5.0 
  • Copy the required source files into the two appropriate directories, eg.

    cp stallion.c istallion.c /usr/src/linux/drivers/char 
    cp stallion.h cd1400.h sc26198.h /usr/include/linux/include/linux 
    cp istallion.h cdk.h comstats.h /usr/include/linux/include/linux 

These files are on the installation archive. They only need to be copied from a new driver source file. 

You will need to build a new kernel to link in the Stallion drivers. The first thing you need is to have the full kernel source. Most people will have this. The following assumes that the kernel source is in /usr/src/linux. 

The drivers can be used as loadable modules or compiled into the kernel. Depending on which form of driver loading you decide to use, the installation procedure will be slightly different. 

ISA boards need to be entered into the driver(s) configuration structures. PCI boards will be automatically detected when you load the driver - so they do not need to be entered into the driver(s) configuration structure.  Note that kernel PCI BIOS32 support is required to use PCI boards. 

Entering ISA boards into the driver(s) configuration structure involves editing the driver(s) source file. Both drivers can support up to 4 boards. 
 

Driver Download

The driver can be downloaded from the Stallion web site (www.stallion.com), or from the Stallion Technologies Software & User Documentation CD ROM.  The downloaded file will have a name similar to stallion-5.5.0.tar.gz. 

Step 1.  
Download the driver to a suitable directory on your system, eg. /usr/src 

Step 2.  
Uncompress the file using gzip, eg. gunzip stallion-5.5.0.tar.gz  

Step 3.  
Extract the files using the tar command, eg. tar xvf stallion-5.5.0.tar.  This creates a directory containing the driver source files, eg. stallion-5.5.- 

Step 4.  
Change to the appropriate directory, eg. cd stallion-5.5.0 

Step 5.  
Copy the required source files into the two appropriate directories, eg. 

cp stallion.c istallion.c /usr/src/linux/drivers/char  
cp stallion.h cd1400.h sc26198.h /usr/include/linux/include/linux  
cp istallion.h cdk.h comstats.h /usr/include/linux/include/linux 

These files are on the distribution diskette. They only need to be copied from a new driver source file. 

Loadable Module Drivers 

If you are not using a pre-built Stallion driver module, the build the module.  You will need the gcc compiler and make installed on your system to make the driver modules.  You will also need to have installed the kernel source on the system, and have at least performed a 'make config' and 'make dep'.  You may want to read the kernel source README file, usually found in:  /usr/src/linux. 

At the top of the Linux kernel source tree do: 

make modules

You must have configured your kernel source with the Stallion drivers as modules. 

Typically, to load up the smart board driver use: 

insmod stallion.o

It will output a message to say that it loaded, and print the driver version number.  It will also print out whether it found the configured boards or not.  These messages may not appear on the console, but typically are always logged to /var/adm/messages or /var/log/syslog files - depending on how the klogd and syslog daemons are set up on your system. 

To load the intelligent board use: 

insmod stallion.o

It will output similar messages to the smart board driver. 

If not using an auto detectable board type (that is a PCI board) then you will also need to supply command line arguments to the "insmod" command when loading the driver. 
The general form of the configuration argument is: 

board?=<name>[,<ioaddr>[,<addr>] [,<irq>]]

where:

board? - specifies the arbitrary board number of this board, can be in the range of 0 to 3. 

name - textual name of this board.  The board name is the common board name, or any "shortened" version of that.  The board type number may also be used here. 

ioaddr - specifies the I/O address of this board.  This argument is optional, but should generally be specified. 

addr - optional second address argument.  Some board types require a second I/O address, some require a memory address.  The exact meaning of this argument depends upon the board type. 

irq - optional IRQ line used by this board.

Up to 4 board configuration arguments can be specified on the load line. 

Here are some examples: 

insmod istallion.o board3=ec8/64,0x2c0,0xcc000

This configures an EasyConnection 8/64 ISA board at I/o address 0x2c0 at memory address 0xcc000. 
 

insmod stallion.o board1=ec8/32-at,0x2a0,0x280,10

This configures an EasyConnection 8/32 ISA board at primary I/O address 0x2a0, secondary address 0x280 and IRQ 10. 

You will probably want to enter this module load and configuration information into your system startup scripts so that the drivers are loaded and configured on each system boot.  Typically the startup script would be something like: 
/etc/rd.c.d/rc.modules.

Static Drivers (Kernel Linked) 

You will need to build a new kernel to link in the Stallion drivers. The first thing you need is to have the full kernel source. Most people will have this. The following assumes that the kernel source is in /usr/src/linux. 

To install the drivers, perform the following: 

Step 1. 
Enter the following commands: 

cp stallion.c istallion.c /usr/src/linux/drivers/char  
cp stallion.h cd1400.h sc26198.h /usr/include/linux/include/linux 

Step 2. 
Setup the driver configuration for the boards.  If installing a smart board (EasyIO 8/32), use an editor (for example vi) to perform the following: 

cd /usr/src/linux/drivers/char 

Step 3.  
Setup the driver configuration for the boards. Perform the following: 

cd /stallion-5.x.x  
vi stallion.c 

  • Find the definition of the stl_brdconf array (of structures) near top of the file 
  • Modify this to match the boards you are going to install 
  • Save and exit 

Step 4. 
Enter the following command:  cd /usr/src/linux 

Step 5. 
Build a new kernel. If you haven't done this before read the README file in /usr/src/linux. 

Once you have a new kernel built, reboot to start it up. On startup the driver will output a message to say it is operational (with the driver version number). It will also print out if it could find the boards listed in its configuration structure or not.  Check this output to verify that the boards you have configured have actually been found. 
 

Sharing Interrupts 

It is possible to share interrupts between multiple EasyIO boards in an EISA system. 

Step 1.   
When entering the board resources into the stallion.c file you need to mark the boards as using level triggered interrupts. Do this by replacing the `0' entry at field position 6 (the last field) in the board configuration structure with a `1'. (This is the structure that defines the board type, I/O locations, etc. for each board).  All boards that are sharing an interrupt must be set this way, and each board should have the same interrupt number specified here as well. Now build the module or kernel as you would normally. 

Step 2.  
When physically installing the boards into the system you must enter the system EISA configuration utility. You will need to install the EISA configuration files for EasyIO boards that are sharing interrupts. The Stallion EasyIO EISA configuration files required are supplied on this CD. You will need to edit the board resources to choose level triggered interrupts, and make sure to set each board's interrupt to the same IRQ number. On EasyIO8-M and EasyIO4 you also need to change the shunt on the board from `edge' to `level' triggered IRQs. 

You must complete both the above steps for this to work. When you reboot or load the driver your EasyIO board(s) will be sharing interrupts. 
 

Linux Kernel Versions 2.1.X 

There may be some minor differences between the driver source code in this package and that in the Linux kernel source. This will be due to changes needed in the drivers so that they work correctly on newer kernels. 

The driver source included in this package is intended for use with 2.0.X series kernels. If you have a kernel version 2.1.0 or later then use the source provided with the kernel - it will be more up to date. Stallion Technologies regularly submits the latest driver source to be included in the new kernel source releases. 

Troubleshooting 

If a board is not found by the driver but is actually in the system then the most likely problem is that the I/O address is wrong. Change the module load arguments or change the resources in th edriver stallion.c or istallion.c configuration structure and rebuild the kernel.  Alternatively, you can change the DIPswitches on the board.  On EasyIO and EasyConnection 8/32 boards the IRQ is software programmable, so if there is a confilect you may need to change the IRQ used for a board in the module load argument or in the stallion.c configuration structure.  There are no interrupts to worry obout for EasyConnection 8/64 boards.   

Using the Drivers 

Once the driver is installed you will need to setup some device nodes to access the serial ports. Use the supplied `mkdevnods' script to automatically create all required device entries for one board. This will create the normal serial port devices as /dev/ttyE# where # is the port number starting from 0. A set of callout type devices is also created. They are created as the devices /dev/cue# where # is the same as for the ttyE devices. 

To create device nodes for ports on multiple boards supply a number of boards argument to the `mkdevnods' script. For example to create nodes for four boards use `mkdevnods 4'. This means that the first port on the second board is port 64, the first port on the third board is 128, etc. 

The Stallion driver emulates the standard PC system COM ports and the standard Linux serial driver. You can use Stallion board ports and COM ports interchangeably without modifying anything but the device name. 

Since this driver emulates standard serial ports as much as possible, most system utilities should work as they do for the standard COM ports. Most importantly `stty' works as expected and `setserial' can be also be used (excepting the ability to auto-configure the I/O and IRQ addresses of boards). Higher baud rates are supported in the usual way through setserial or using the CBAUDEX extensions. 

This driver should work with anything that works on standard Linux serial ports. 
It has been used on the following devices under Linux: 

  • Standard dumb terminals (using agetty, getty) 
  • Serial mice (under X) 
  • Modems (using cu, uucp, minicom, seyon, uugetty) 
  • slip and ppp connections 

Notes 
The major device numbers used by this driver conform to the Linux Device Registry, so they should not clash with any other devices. Also the device naming scheme is the `standard' used by most Linux serial port devices. 

EasyIO drivers can be used in a system. However to do this you will need to change the major numbers used by one of the drivers. Currently both drivers use major numbers 24, 25 and 28 for their devices. 

Change one driver to use some other major numbers, and then modify the mkdevnods script to make device nodes based on those new major numbers. For example, you could change the stallion.c driver to use major numbers 60, 61 and 62. You will also need to create device nodes with different names for the ports, for example ttyF# and cuf#. 
 

Utilities 

There is a utility program included called `stlstty'. Most people will not need to use this. Use the `mapcts maprts' flag options to this utility on the port(s) that you wish to do this mapping on, e.g. ./stlstty maprts mapcts < /dev/cue0 This enables RTS to act like DTR and CTS to act like DCD on the specified port. 

The ports of the EasyIO-8M board do not have DCD or DTR signals. So these ports cannot be used as real modem devices. Generally when using these ports you should only use the cueX devices. 

There is another utility in this package that reports statistics on the serial ports. You need the curses library installed on your system to build it. 

To build the statistics display program type: 

make stlstats 

Once compiled simply run it (you will need to be root) and it will display a port summary for the first board installed. Use the digits to select different board numbers. Press `p', to display detailed port 0 information. Use the digits and letters `a' through `f' to select the different ports (on this board). 
 

Go to Contents

Back to top

Copyright © 2007 Lantronix. All rights reserved