Echo/Dflex/ISA, DFlex/104 and Xtreme/104 Software Installation Guide for Linux

Introduction

The instructions below are designed to assist users with the software installation of Echo/Dflex/Xtreme serial adapters under a Linux platform. If you are looking for software installation instructions for other Connect Tech products under this platform, please refer to the appropriate set of installation instructions. Although this document has been specifically written for Red Hat distributions (2.2.X and 2.4.X kernels), it will apply for other Linux distributions as well. If you are NOT using Red Hat, please take note of the following potential differences between distributions.

– Differences in directory structure.
– Differences in filenames.

There is a possibility that certain files mentioned in this document may have different file names, or may be located in different directories other than the ones mentioned here with different distributions. Depending on how your system is set up, this may be the case even with a Red Hat distribution. Before you begin the installation, make sure you know the name of your kernel and the directory in which it is located. You MUST have the Linux source tree installed before you begin the installation procedure. Where there may be potential differences in directory structure, there has been an attempt to make the installation instructions relatively generic.

NOTE: To perform the installation, please be sure you are logged in as root.

To make the installation instructions easy to follow, all commands given on the command line are written in bold text. Before beginning the software installation procedure, please be sure to carefully read the Blue Heat User’s Manual that came with the host adapter for hardware installation/configuration instructions

Linux 2.6.X users:

The majority of our products have default support in 2.6.X kernels. Be sure to add the kernel configuration options mentioned below and the system should automatically detect and install the serial ports. For the Echo, DFlex, and Xtreme/104 you will also need to add the serial port IRQ and I/O address into your serial.h. See the instructions for configuring the kernel below which assists with this.

Preamble

This section briefly describes what you will need to successfully install the Echo/Dflex multiport serial adapter in a Linux environment. There are several ways that you may obtain the necessary files for the installation:

– Linux driver CD or diskette that comes with the Echo/Dflex/Xtreme serial adapter will have all the files necessary to complete the installation.
– You can download a .tar file which contains all of the necessary files from the Echo/ISA Product Page.

Extracting the Driver

Before we begin the installation, you will need to copy all files from the Linux driver diskette or CD to a directory on your system. It is suggested that you copy the file to a /usr directory. You should place the files in an empty directory, or a newly created directory. The directory that you chose to copy the files to will be referenced by {direct}.

Once all of the files are located in the {direct} directory you will need to extract them:

# tar -xvf EC-LN24_5.5.10.tar.gz

You should see the serial driver, serial-5.10.tar.gz in the {direct} directory. To unzip the serial driver, issue the following command:

# gunzip serial-5.10.tar.gz

After the driver has been unzipped, untar the driver by using the following command:

# tar -xvf serial-5.10.tar

You will now have the serial driver in a subdirectory called serial-5.10. From this point on, this subdirectory will be referenced by {serial}.

Installing the Serial Driver

NOTE: It is strongly recommended that you back up your kernel, as well as any serial source trees before installing the serial driver or making changes to your kernel configuration.

NOTE: These patches should only be used for 2.2.x or 2.4.x kernels and serial-5.10. If you need to use other versions please contact Connect Tech support at [email protected]

NOTE: 2.4.20 is the most current 2.4.x kernel at time of release. If you need to use a newer version, these instructions may work, but we recommend contacting Connect Tech Support at [email protected]

NOTE: 2.4.11 and 2.4.15 known to be bad. This kernel is not supported.

To install the serial driver, issue the following commands:
# cd {serial}
# ./install-in-kernel {linux}

Where {linux} is the path to your kernel source tree. Typically {linux} is /usr/src/linux – the install-in-kernel script uses /usr/src/linux as the default path if {linux} is not supplied to the script as an argument.

Example: If you have your kernel source located in /usr/local/redhat, you would issue the command:
# ./install-in-kernel /usr/local/redhat

Example: If you have your kernel source located in /usr/src/linux (the default path), you would issue the command:
# ./install-in-kernel

Configuring the Kernel(2.4.x)

Run the installer:

# ./Install.DFlex

NOTE: This installer assumes a Red Hat distribution. If you are running something else, the locations of the serial.h file and the local boot script file can be specified on the command line.

Examples:

Specifying Suse’s local startup script:

# ./Install.DFlex -r /etc/init.d/boot.local

A Red Hat distribution with the kernel source tree in /kernel:

# ./Install.DFlex -s /kernel/include/asm/serial.h

NOTE: The directory include/asm in the kernel source tree is a link to the machine-specific files for your platform. On a Power PC system, include/asm would point at include/asm-ppc for example. This link may not be present when the installer is run. You can do one of two things in this case: point the installer at the serial.h in the appropriate include/asm- directory; or begin the build process. The link is created in the “make dep” step below.

NOTE: If you’re not sure where your local boot script is; please consult the documentation that came with your distribution. You may also be able to locate it by using the find command to look for the regular startup scripts:
# find / \( -name rc.d -o -name init.d -o -name rc[0-9] \) -print

NOTE: The local boot script is only updated with information when the status port is turned on. Otherwise, no changes are made.

NOTE: There is no question about what IRQ you’ve configured because the serial driver auto-detects this on boot.

NOTE: The quit command DOES NOT save the configuration. You must first use the save command. The in-program help screen mentions this.

NOTE: If the configuration has been successfully saved, when the installer is re-run, the configuration will be loaded automatically. If it is not, the configuration is not saved.
NOTE: If installing a 12 port Xtreme Isolated card, choose to install 3 separate Xtreme/Opto cards. An option for the Xtreme Isolated will be added soon.

If there’s a question you can’t answer, or if you can’t find your system files, please contact customer support: [email protected]

At this point, we will configure the kernel to ensure that we have the appropriate settings needed to support the Echo/Dflex / Xtreme adapter on your system. We will begin by issuing the following commands:

Configuring the Kernel(2.6.x)

The 2.6 kernel has support for the 8250/16650 UART in /drivers/serial/8250.c. You should be able to run our ISA serial cards(Echo, DFlex, Xtreme/104) with this driver and the proper Kernel configuration.

You’ll need to edit your serial.h file in /include/asm and add in the extra serial ports of the card.

Here’s what I added in red for a 4 port Xtreme/104 card at I/O 300 and IRQ 5. You can do the same with your card settings. If your card is using a higher clock than be sure to adjust your BAUD_BAUD value accordingly

/* Base baud for CTI boards. Default Max Baud = 460800 bps */

define CTI_BAUD (7372800 /16)

define STD_SERIAL_PORT_DFNS \

/* UART CLK PORT IRQ FLAGS */ \
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
{ 0, BASE_BAUD, 0x2E8, 3, STD_COM_FLAGS }, /* ttyS3 */ \
{ 0, CTI_BAUD, 0x300, 5, STD_COM_FLAGS }, /* ttyS4 */ \
{ 0, CTI_BAUD, 0x308, 5, STD_COM_FLAGS }, /* ttyS5 */ \
{ 0, CTI_BAUD, 0x310, 5, STD_COM_FLAGS }, /* ttyS6 */ \
{ 0, CTI_BAUD, 0x318, 5, STD_COM_FLAGS }, /* ttyS7 */
If your board has a difference clock, be sure to change the CTI_BAUD value appropriately.

Re-Compiling the Kernel(Linux 2.4)

# cd {Linux}

At this point, you have a choice of two configuration utilities that you can use to configure your kernel. One utility, named config, is text based, and the other, named menuconfig, has a simple GUI (Graphical User Interface). The menuconfig utility is easier to use than config, so unless you have specific reasons use the menuconfig utility.

To use the menuconfig / config utility:

# make menuconfig
Or
# make config

Once the configuration utility you choose is running, make sure that the following options are selected. Below shows the setting that must be enabled using the menuconfig or config utilities.

config: CONFIG_SERIAL
menuconfig: (Character Devices -> Standard/generic (dumb) serial support)

config: CONFIG_SERIAL_EXTENDED
menuconfig: (Character Devices -> Extended dumb serial driver options)

config: CONFIG_SERIAL_MANY_PORTS
menuconfig: (Character Devices -> Support more than 4 serial ports)

config: CONFIG_SERIAL_SHARE_IRQ
menuconfig: (Character Devices -> Support for sharing serial interrupts)

NOTE: Performance tip: Enabling the following option and using the corresponding setserial commmands below can speed up the operation of the serial driver.
config: CONFIG_SERIAL_MULTIPORT
menuconfig: (Character Devices -> Support special multiport boards)

After all of the options have been checked and enabled, select exit. You will be prompted to save the new kernel configuration. Select yes. After you have finished configuring your kernel, issue the two following commands:

# make dep
# make clean
# make bzImage
# make modules
# make modules_install

Re-Compiling the Kernel(Linux 2.6)

# cd {Linux}

At this point, you have a choice of two configuration utilities that you can use to configure your kernel. One utility, named config, is text based, and the other, named menuconfig, has a simple GUI (Graphical User Interface). The menuconfig utility is easier to use than config, so unless you have specific reasons use the menuconfig utility.

To use the menuconfig / config utility:

# make menuconfig
Or
# make config

Once the configuration utility you choose is running, make sure that the following options are selected. Below shows the setting that must be enabled using the menuconfig and config utilities.

config: CONFIG_PCI
menuconfig: (Bus Options -> PCI Support)

config: SERIAL_8250
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> 8250/16550 and compatible serial support)

config: CONFIG_SERIAL_8250_EXTENDED
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> Extended 8250/16550 serial driver options)

config: CONFIG_SERIAL_8250_MANY_PORTS
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> Support more than 4 legacy serial ports)

config: CONFIG_SERIAL_8250_SHARE_IRQ
menuconfig: (Device Drivers -> Character Devices -> Standard drivers -> Support for sharing serial interrupts)

After all of the options have been checked and enabled, select exit. You will be prompted to save the new kernel configuration. Select yes. After you have finished configuring your kernel, issue the two following commands:

# make clean
# make bzImage
# make modules
# make modules_install

Building/Installing the Kernel

NOTE: These instructions are for Red Hat standard installs. If you use a different distribution, or have set up your own system, these instructions will likely not help you. In that case please contact Connect Tech support at [email protected]

Copy the kernel and system map to the boot partition:

The “make bzImage” step created the kernel in the subdirectory {Linux}/arch//boot. If you don’t know what CPU type you’re using, you can find the new kernel by:

# ls -l {Linux}/arch/*/boot/bzImage

The < cpu type > is the “*” part of the pathname of the newest kernel.
/arch//boot will be referenced by {arch}.

# cp {Linux}/{arch}/bzImage /boot/vmlinuz-bh
# cp {Linux}/System.map /boot/System.map-bh

You may choose any postfix, -df is a handy one. The postfix merely distinguishes between the kernel you’ve just built and other kernels already installed. It has no other purpose.

Editing Lilo

NOTE: You only need to do one of these two sections (update lilo OR update grub). Please follow the instructions appropriate for the boot loader in your install.

1) Update lilo:

# vi /etc/lilo.conf

Image sections start with an image= keyword and end at the end of the file or the next image= keyword. Copy one section. Update the image= and label= keywords:

image=/boot/vmlinuz-df
label=Linux-df

Exit the editor.

NOTE: Running lilo here is critical. Lilo builds some information about the kernels listed in its configuration file. If you copy a new kernel over an old one and omit running lilo, the information will be wrong, and the new kernel may not work. The errors produced by this will usually appear to be unrelated to a misconfigured lilo, making this very difficult to debug.

# lilo

The kernel is now installed! To boot this kernel, press the tab key when prompted at boot time and specify the kernel you wish to boot.

2) Update grub:

# vi /boot/grub/grub.conf

Image sections start with a title keyword and end at the end of the file or the next title keyword. Copy one section. Update the title and kernel keywords:

title Linux-df
kernel /vmlinuz-df ro root=/dev/hda2

Note that pathnames in grub have a root of /boot by default, so the kernel keyword above actually refers to /boot/vmlinuz-df.

Exit the editor.

The kernel is now installed! To boot this kernel, press the tab key when prompted at boot time and specify the kernel you wish to boot.

Creating Nodes (Ports) For the Host Adapter

NOTE: Depending on your kernel distribution and configuration, nodes(ports) are often created automatically and you can skip this step. Check to see if they exist before proceeding.

Now that we have the new kernel in place capable of supporting the Blue Heat serial adapter we must create nodes, or ports, to allow the host adapter to communicate with other devices.

To begin, boot the new kernel. After the kernel has booted, open up the messages file using Vi, or your favorite text editor:

# vi {log_path}/messages
Where {log_path} is where the system logs are stored. Typically, {log_path} = /var/log but this may be different in some distributions/systems.

Go to the bottom of the file and search backwards for references to “ttySxx” where xx is a number. You should see ttyS0 and ttyS1 for the standard serial ports, as well as a ttySxx entrie for each installed Echo/Dflex port. In order to use the new ports, these ttySxx entries must exist in the /dev directory. If they do not exist (they aren’t created automatically, but do persist after reboots) you must make them with the following command:

# mknod -m [mode] /dev/ttySxx c 4 yy
[mode] is the file mode (permissions) you wish the device to have. 600 is often good.
xx is the number associated with the device which you have seen in the messages file.
yy is just xx + 64

You may also wish to make the corresponding cuaxx devices, but they are being phased out:

# mknod -m {mode} /dev/cuaxx c 5 yy
xx and yy should match the xx and yy from the previous mknod command

Here is an example of what you would do to add the nodes to your /dev directory:
First I opened the Vi editor and search for ttyS*. The results of the search show me that I have ttyS00 and ttyS01 (the standard serial ports) entries, as well as four other entries: ttyS05, ttyS06, ttyS07 and ttyS08. These four entries correspond to the four new ports for my CTI host adapter. (Right now, we are assuming a four-port card. You may have fewer or more ports, depending on the type of card you have). I’ve written down the four entries on a sheet of paper, seeing how my memory is a little short. Now I would like to make the nodes. From the command line, I type in the four following entries:

# mknod -m 600 /dev/ttyS05 c 4 69
# mknod -m 600 /dev/ttyS06 c 4 70
# mknod -m 600 /dev/ttyS06 c 4 71
# mknod -m 600 /dev/ttyS07 c 4 72

and optionally execute:

# mknod -m 600 /dev/cua12 c 5 69
# mknod -m 600 /dev/cua13 c 5 70
# mknod -m 600 /dev/cua14 c 5 71
# mknod -m 600 /dev/cua15 c 5 72

With the nodes in place, this finishes off our installation

Multiport Support

NOTE: Multiport support is not necessary for your boards to operate properly. This may safely be skipped. It is only a performance tweak available for users with older systems. Newer PCs do not gain much performance from this tweak.

Check {log_path}/messages again. Each serial port will have a line; all the ports on each board will be listed in sequence. An eight port board might look like:

ttyS4 at port 0x300 (irq = 5) is a ST16654
ttyS5 at port 0x308 (irq = 5) is a ST16654
ttyS6 at port 0x310 (irq = 5) is a ST16654
ttyS7 at port 0x318 (irq = 5) is a ST16654
ttyS8 at port 0x320 (irq = 5) is a ST16654
ttyS9 at port 0x328 (irq = 5) is a ST16654
ttyS10 at port 0x330 (irq = 5) is a ST16654
ttyS11 at port 0x338 (irq = 5) is a ST16654

“port” in the above listing is really short for “port address”. To avoid confusion, I will refer to the port address as the “address” instead.

Your board will have a table of the port addresses in the manual that came with it. You will need to look up the address that the board has been configured for; the line will also tell you what address the status port is at.

{mask} is determined by the following table:

Number of ports {mask}
2, 0x03
4, 0x0f
8, 0xff

setserial is used to inform the driver about the status port, in the following manner:
# setserial {port} set_multiport portX {status port address} maskX {mask} matchX 0x0
where {port} is any one port on a given board (using the first port is usually the best way), {status port address} is the address of the status port as determined above, {mask} is the appropriate mask value for the board from the table above, and X is a multiport setting number between 1 and 4.

The multiport setting number will usually be 1, but can be other values. There may be other multiport settings on the irq that your board is using, set by other boards in your system, including other Connect Tech boards.
# setserial {port} get_setserial
where {port} is a port on a board that you are going to use the status port on, will reveal if there are other multiport settings in effect already. If so, take care to choose X to be the lowest empty setting number.

This needs be done only once per board that you wish to have the status port used on.

Example:
You have two boards installed, an 8 port and a 2 port. The ports on each board are:
ttyS4 at port 0x300 (irq = 5) is a ST16654
.
.
ttyS11 at port 0x338 (irq = 5) is a ST16654
ttyS12 at port 0x200 (irq = 10) is a ST16654
ttyS13 at port 0x208 (irq = 10) is a ST16654

Check to see if any other multiport settings are already in use:
# setserial /dev/ttyS4 get_multiport

Multiport config for irq 5:
Port Monitor = 0x0
Port1 = 0x1bf, mask=0xf, match=0xf
Port2 = 0x0, mask=0x0, match=0x0
Port3 = 0x0, mask=0x0, match=0x0
Port4 = 0x0, mask=0x0, match=0x0
One multiport setting is already in use by another board.

This works on a per irq basis, so each irq that is used by a board needs to be checked:
# setserial /dev/ttyS12 get_multiport

Multiport config for irq 10:
Port Monitor = 0x0
Port1 = 0x0, mask=0x0, match=0x0
Port2 = 0x0, mask=0x0, match=0x0
Port3 = 0x0, mask=0x0, match=0x0
Port4 = 0x0, mask=0x0, match=0x0
No multiport settings are in use.

The commands to enable use of the status port on each board would be:
# setserial /dev/ttyS4 set_multiport port2 0x340 mask2 0xff match2 0x00
# setserial /dev/ttyS12 set_multiport port1 0x240 mask1 0x03 match1 0x00

Check that the settings are in place:
# setserial /dev/ttyS4 get_multiport

Multiport config for irq 5:
Port Monitor = 0x0
Port1 = 0x1bf, mask=0xf, match=0xf
Port2 = 0x340, mask=0xff, match=0x0
Port3 = 0x0, mask=0x0, match=0x0
Port4 = 0x0, mask=0x0, match=0x0
# setserial /dev/ttyS12 get_multiport

Multiport config for irq 10:
Port Monitor = 0x0
Port1 = 0x240, mask=0x3, match=0x0
Port2 = 0x0, mask=0x0, match=0x0
Port3 = 0x0, mask=0x0, match=0x0
Port4 = 0x0, mask=0x0, match=0x0
# man setserial

may be of help also.

RS-485 Line Modes Support

The utility set485 can be used to set the line mode interactively or from a startup script. Settings stick until changed or the system is rebooted.

The Linux header file ioctls.h now contains definitions for TIOCSER485GET and TIOCSER485SET. These ioctls can be used on Connect Tech 485 capable boards to set the line mode. The mode (passed as an integer) can be one of TIOCSER485FULLDUPLEX, TIOCSER485HALFDUPLEX or TIOCSER485SLAVEMULTIPLEX for full or half duplex or slave multidrop mode, respectively.

The Linux 2.6 standard serial driver does not have advanced RS485 mode support as of yet. If you require this functionality please contact [email protected] for the latest status of patches available.

Go to Top