3 Stallion Multiport Serial Driver Readme
4 ---------------------------------------
8 Author: Greg Ungerer (gerg@stallion.oz.au)
14 This is a FreeBSD driver for some of the Stallion Technologies range of
15 multiport serial boards. This driver is still very new, so it should be
16 considered to be of very alpha quality.
18 This driver has not been developed by Stallion Technologies. I developed it
19 in my spare time in the hope that it would be useful. As such there is no
20 warranty or support of any form. What this means is that this driver is not
21 officially supported by Stallion Technologies, so don't ring their support
22 if you can't get it working. They will probably not be able to help you.
23 Instead email me if you have problems or bug reports and I will do what I
24 can... (Sorry to sound so heavy handed, but I need to stress that this driver
25 is not officially supported in any way.)
27 This package actually contains two drivers. One is for the true Stallion
28 intelligent multiport boards, and the other is for the smart range of boards.
30 All host driver source is included in this package, and is copyrighted under
31 a BSD style copyright. The board "firmware" code in this package is copyright
32 Stallion Technologies (the files cdk.sys and 2681.sys).
35 1.1 SMART MULTIPORT BOARD DRIVER
37 This driver supports the EasyIO and EasyConnection 8/32 range of boards.
38 These boards are not classic intelligent multiport boards, but are host
39 based multiport boards that use high performance Cirrus Logic CL-CD1400 RISC
40 UART's (they have built in FIFO's, automatic flow control and some other
43 The EasyIO range of cards comes in 3 forms, the EasyIO-4, EasyIO-8 and the
44 EasyIO-8M. All of these are non-expandable, low cost, ISA, multiport boards
45 with 4, 8 and 8 RS-232C ports respectively. Each EasyIO board requires 8
46 bytes of I/O address space and 1 interrupt. On an EISA system it is possible
47 to share 1 interrupt between multiple boards. The EasyIO-4 has 10 pin RJ
48 connectors, and the EasyIO-8 comes with a dongle cable with either 10 pin RJ
49 connectors or DB-25 connectors. The EasyIO-8M has 6 pin RJ connectors.
51 The EasyConnection 8/32 family of boards is a relatively low cost modular
52 range of multiport serial boards. The EasyConnection 8/32 boards can be
53 configured to have from 8 to 32 serial ports by plugging in external serial
54 port modules that contain either 8 or 16 ports each. There is a wide range
55 of external modules available that offer: DB-25 connectors, RJ-45 connectors
56 (both with RS-232 D and E compatible drivers), and also RS-422 and RS-485
57 ports. The EasyConnection 8/32 boards come in ISA, PCI and MCA bus versions.
58 The board takes the form of a host adapter card, with an external connector
59 cable that plugs into the external modules. The external modules just clip
60 together to add ports (BTW, they are NOT hot pluggable). Each ISA
61 EasyConnection 8/32 board requires two separate I/O address ranges, one two
62 bytes in size and a secondary region of 32 bytes. Each PCI EasyConnection
63 8/32 requires two regions of I/O address space, normally these will be
64 automatically allocated by the system BIOS at system power on time. Each MCA
65 EasyConnection board requires one I/O address region 64 bytes in size. All
66 board types also require one interrupt. On EISA systems multiple boards can
67 share one interrupt. The secondary I/O range of the ISA board (the 32 byte
68 range) can be shared between multiple boards on any bus type.
71 1.2 INTELLIGENT MULTIPORT BOARD DRIVER
73 This driver is for Stallion's range of true intelligent multiport boards.
74 It supports the EasyConnection 8/64, ONboard, Brumby and original Stallion
75 families of multiport boards. The EasyConnection 8/64 and ONboard boards come
76 in ISA, EISA and Microchannel bus versions. The Brumby and Stallion boards
77 are only available in ISA versions.
79 The EasyConnection 8/64 family of boards is a medium cost, high performance,
80 modular range of intelligent multiport serial boards. The EasyConnection 8/64
81 boards can be configured to have from 8 to 64 serial ports by plugging in
82 external serial port modules that contain either 8 or 16 ports each (these
83 modules are the same used by the EasyConnection 8/32 board). There is a wide
84 range of external modules available that offer: DB-25 connectors, RJ-45
85 connectors (both with RS-232 D and E compatible drivers), and also RS-422 and
86 RS-485 ports. The board takes the form of a host adapter card, with an external
87 connector cable that plugs into the external modules. The external modules
88 just clip together to add ports (BTW, they are NOT hot pluggable). Each
89 EasyConnection 8/64 board requires 4 bytes of I/O address space and a region
90 of memory space. The size of the memory region required depends on the exact
91 board type. The EISA version requires 64 Kbytes of address space (that can
92 reside anywhere in the 4 Gigabyte physical address space). The ISA and MCA
93 boards require 4 Kbytes of address space (which must reside in the lower
94 1 Mbyte of physical address space - typically in the c8000 to e0000 range).
95 No interrupts are required. The physical memory region of multiple
96 EasyConnection 8/64 boards can be shared, but each board must have a separate
99 The ONboard family of boards are traditional intelligent multiport serial
100 boards. They are Stallion's older range of boards with a limited expansion
101 capability. They come in 4, 8, 12, 16 and 32 port versions. The board uses
102 the same base card (which has 4 ports on it) and is expanded to more ports
103 via a mezzanine board that attaches directly onto the board. External panels
104 plug into the ONboard providing RS-232C ports with DB-25 plugs. An RS-422
105 DB-25 dual interface panel is also available. The ISA and microchannel
106 ONboards require 16 bytes of I/O address space and 64K bytes of memory
107 space. The memory space can be anywhere in the 16 Mbyte ISA bus address
108 range. No interrupt is required. The EISA ONboard requires 64 Kbytes of
109 memory space that can be anywhere in the 4 Gigabyte physical address space.
110 All ONboard boards can share their memory region with other ONboards (or
111 EasyConnection 8/64 boards).
113 The Brumby family of boards are traditional, low cost intelligent multiport
114 serial boards. They are non-expandable and come in 4, 8 and 16 port versions.
115 They are only available for the ISA bus. The serial ports are all on DB-25
116 "dongle" cables that attach to the rear of the board. Each Brumby board
117 requires 16 bytes of I/O address space and 16 Kbytes of memory space. No
118 interrupts are required.
120 The original Stallion boards are old. They went out of production some years
121 back. They offer limited expandability and are available in 8 or 16 port
122 configurations. An external panel houses 16 RS-232C ports with DB-9
123 connectors. They require 16 bytes of I/O address space, and either 64K or
124 128K of memory space. No interrupt is required. I will not actively support
125 these boards, although they will work with the driver.
127 That's the boards supported by the second driver. The ONboard, Brumby and
128 Stallion boards are Stallion's older range of intelligent multiports - so
129 there are lots of them around. They only support a maximum baud rate of
130 38400. The EasyConnection 8/64 is a true high performance intelligent
131 multiport board, having much greater throughput than any of Stallion's
132 older boards. It also supports speeds up to 115200 baud.
135 1.3 HOW TO GET BOARDS
137 Stallion Technologies has offices all over the world, as well as many more
138 distributors and resellers. To find out about local availability please
139 contact the nearest Stallion office and they can give you all the information
142 Stallion Technologies Sales and Support Offices
143 ===============================================
145 Stallion Technologies Pty. Ltd.
147 Toowong, QLD 4066, Australia
150 Email: support@stallion.oz.au
152 Stallion Technologies Inc.
153 2880 Research Park Drive,
154 Soquel, CA 95073, USA.
157 Email: support@staltec.com
159 Stallion Technologies Deutschland GmbH.
160 Martin-Behaim-Strasse 12
166 Another good source of information about the Stallion range of boards and
167 local availability is on the Stallion Web page. Check it out at
168 http://www.stallion.com.
174 This driver, as is, will work on a FreeBSD 2.1 system. It will run on
175 a 2.0.5 system, or -current version systems by changing a define in the
178 You will need to build a new kernel to use this driver. So the first thing
179 you need is to have the full kernel source. Most people will have this
180 (I hope!). The following assumes that the kernel source is in /usr/src/sys.
182 The drivers can support up to 8 boards. For the smart board driver any
183 combination of EasyIO and EasyConnection 8/32 boards can be installed. For
184 the intelligent any combination of EasyConnection 8/64, ONboard, Brumby or
185 original Stallion. So there is a theoretical maximum of 512 ports.
186 (Off-course I have not tested a system with this many!)
189 [[[ The install instructions are obsolete, it is now standard ]]]
190 [[[ Skip forward to item 4, editing your kernel config file ]]]
192 2.1 Instructions to install:
194 1. Copy the driver source files into the kernel source tree.
196 cp stallion.c istallion.c cdk.h comstats.h /usr/src/sys/i386/isa
197 cp scd1400.h /usr/src/sys/i386/isa/ic
199 Note: if you are NOT using FreeBSD 2.1.0 then you will need to edit the
200 stallion.c and istallion.c files and change the VFREEBSD define to match
203 2. Skip to next step if on a FreeBSD kernel later than 2.1.0.
204 Add a character device switch table entry for the driver that you which
205 to use into the cdevsw table structure. This involves adding some code
206 into the kernel conf.c file.
208 If you are using an EasyIO or EasyConnection 8/32 then you need to use
209 the stallion.c driver. All other board types (EasyConnection 8/64,
210 ONboard, Brumby, Stallion) use the istallion.c driver. You can also have
211 a mix of boards using both drivers. You will need to use a different
212 major device number for the second driver though (not the default 72 -
213 see below for more details on this).
215 2.1. If using the stallion.c driver then do:
217 cd /usr/src/sys/i386/i386
219 - add the following lines (in 2.1 I put them at line 729):
221 /* Stallion Multiport Serial Driver */
230 d_ttycv_t stldevtotty;
231 #define stlreset nxreset
232 #define stlmmap nxmmap
233 #define stlstrategy nxstrategy
235 #define stlopen nxopen
236 #define stlclose nxclose
237 #define stlread nxread
238 #define stlwrite nxwrite
239 #define stlioctl nxioctl
240 #define stlstop nxstop
241 #define stlreset nxreset
242 #define stlmmap nxmmap
243 #define stlstrategy nxstrategy
244 #define stldevtotty nxdevtotty
248 - and then inside the actual cdevsw structure definition, at the
249 last entry add (this is now line 1384 in the 2.1 conf.c):
251 { stlopen, stlclose, stlread, stlwrite, /*72*/
252 stlioctl, stlstop, stlreset, stldevtotty,/*stallion*/
253 ttselect, stlmmap, stlstrategy },
255 - the line above used major number 72, but this may be different
256 on your system. Take note of what major number you are using.
258 - save the file and exit vi.
261 2.2. If using the istallion.c driver then do:
263 cd /usr/src/sys/i386/i386
265 - add the following lines (in 2.1 I put them at line 729):
267 /* Stallion Intelligent Multiport Serial Driver */
276 d_ttycv_t stlidevtotty;
277 #define stlireset nxreset
278 #define stlimmap nxmmap
279 #define stlistrategy nxstrategy
281 #define stliopen nxopen
282 #define stliclose nxclose
283 #define stliread nxread
284 #define stliwrite nxwrite
285 #define stliioctl nxioctl
286 #define stlistop nxstop
287 #define stlireset nxreset
288 #define stlimmap nxmmap
289 #define stlistrategy nxstrategy
290 #define stlidevtotty nxdevtotty
294 - and then inside the actual cdevsw structure definition, at the
295 last entry add (this is now line 1384 in the 2.1 conf.c):
297 { stliopen, stliclose, stliread, stliwrite, /*72*/
298 stliioctl, stlistop, stlireset, stlidevtotty,/*istallion*/
299 ttselect, stlimmap, stlistrategy },
301 - the line above used major number 72, but this may be different
302 on your system. Take note of what major number you are using.
304 - save the file and exit vi.
306 3. Add the driver source files to the kernel files list:
308 cd /usr/src/sys/i386/conf
310 - add the following definition lines into the list (it is stored
311 alphabetically, so insert them appropriately):
313 i386/isa/istallion.c optional stli device-driver
315 i386/isa/stallion.c optional stl device-driver
317 - save the file and exit vi.
319 4. Add board probe entries into the kernel configuration file:
321 cd /usr/src/sys/i386/conf
323 - if you already have a kernel config that you use then you
324 could just use that (instead of MYKERNEL)
326 - if only using ECH-PCI boards then you don't need to enter a
327 configuration line, the kernel will automatically detect
328 the board at boot up, so skip to step 5.
329 - enter a line for each board that you want to use. For stallion.c
330 boards entries should look like:
332 device stl0 at isa? port 0x2a0 tty irq 10
334 For istallion.c boards, the entries should look like:
336 device stli0 at isa? port 0x2a0 tty iomem 0xcc000 iosiz 0x1000 flags 23
338 (I suggest you put them after the sio? entries)
339 (Don't enter lines for ECH-PCI boards)
340 - change the entry resources as required. For the Stallion.c
341 entries this may involve changing the port address or irq.
342 For the istallion.c entries this may involve changing the port
343 address, iomem address, iosiz value and the flags. Select from
344 the following table for appropriate flags and iosiz values for
347 EasyConnection 8/64 ISA: flags 23 iosiz 0x1000
348 EasyConnection 8/64 EISA: flags 24 iosiz 0x10000
349 EasyConnection 8/64 MCA: flags 25 iosiz 0x1000
350 ONboard ISA: flags 4 iosiz 0x10000
351 ONboard EISA: flags 7 iosiz 0x10000
352 ONboard MCA: flags 3 iosiz 0x10000
353 Brumby: flags 2 iosiz 0x4000
354 Stallion: flags 1 iosiz 0x10000
356 - save the file and exit
358 5. Build a new kernel using this configuration.
360 cd /usr/src/sys/i386/conf
362 cd ../../compile/MYKERNEL
368 And there you have it! It is a little bit of effort to get it in there...
370 Once you have a new kernel built reboot to start it up. On startup the
371 Stallion board probes will report on whether the boards were found or not.
372 For each board found the driver will print out the type of board found,
373 and how many panels and ports it has.
375 If a board is not found by the driver but is actually in the system then the
376 most likely problem is that the IO address is incorrect. The easiest thing to
377 do is change the DIP switches on the board to the desired address and reboot.
379 On EasyIO and EasyConnection 8/32 boards the IRQ is software programmable,
380 so if there is a conflict you may need to change the IRQ used for a board in
381 the MYKERNEL configuration file and rebuild the kernel.
383 Note that the secondary IO address of the EasyConnection 8/32 boards is hard
384 coded into the stallion.c driver code. It is currently set to IO address
385 0x280. If you need to use a different address then you will need to edit this
386 file and change the variable named stl_ioshared.
388 On intelligent boards it is possible that the board shared memory region is
389 clashing with that of some other device. Check for this and change the device
390 or kernel configuration as required.
393 2.2 INTELLIGENT DRIVER OPERATION
395 The intelligent boards also need to have their "firmware" code downloaded
396 to them. This is done via a user level application supplied in the driver
397 package called "stlload". Compile this program where ever you dropped the
398 package files, by typing "make". In its simplest form you can then type
400 in this directory and that will download board 0 (assuming board 0 is an
401 EasyConnection 8/64 board). To download to an ONboard, Brumby or Stallion do:
402 ./stlload -i 2681.sys
404 Normally you would want all boards to be downloaded as part of the standard
405 system startup. To achieve this, add one of the lines above into the
406 /etc/rc.serial file. To download each board just add the "-b <brd-number>"
407 option to the line. You will need to download code for every board. You should
408 probably move the stlload program into a system directory, such as /usr/sbin.
409 Also, the default location of the cdk.sys image file in the stlload
410 down-loader is /usr/lib/stallion. Create that directory and put the cdk.sys
411 and 2681.sys files in it. (It's a convenient place to put them anyway). As an
412 example your /etc/rc.serial file might have the following lines added to it
413 (if you had 3 boards):
414 /usr/sbin/stlload -b 0 -i /usr/lib/stallion/cdk.sys
415 /usr/sbin/stlload -b 1 -i /usr/lib/stallion/2681.sys
416 /usr/sbin/stlload -b 2 -i /usr/lib/stallion/2681.sys
418 The image files cdk.sys and 2681.sys are specific to the board types. The
419 cdk.sys will only function correctly on an EasyConnection 8/64 board. Similarly
420 the 2681.sys image will only operate on ONboard, Brumby and Stallion boards.
421 If you load the wrong image file into a board it will fail to start up, and
422 of course the ports will not be operational!
428 Once the driver is installed you will need to setup some device nodes to
429 access the serial ports. Use the supplied "mkdevnods" script to automatically
430 create all required device entries for your boards. To make device nodes for
431 more than 1 board then just supply the number of boards you are using as a
432 command line parameter to mkdevnods and it will create nodes for that number
433 of boards. By default it will create device nodes for 1 board only.
435 Note that if the driver is not installed at character major number 72 then
436 you will need to edit the mkdevnods script and modify the STL_SERIALMAJOR
437 variable to the major number you are using.
439 Device nodes created for the normal serial port devices are named /dev/ttyEX
440 where X is the port number. (The second boards ports will start from ttyE64,
441 the third boards from ttyE128, etc). It will also create a set of modem call
442 out devices named cueX where again X is the port number.
444 For the most part the Stallion driver tries to emulate the standard PC system
445 com ports and the standard sio serial driver. The idea is that you should
446 be able to use Stallion board ports and com ports inter-changeably without
447 modifying anything but the device name. Anything that doesn't work like that
448 should be considered a bug in this driver!
450 Since this driver tries to emulate the standard serial ports as much as
451 possible then most system utilities should work as they do for the standard
452 com ports. Most importantly "stty" works as expected and "comcontrol" can be
453 used just like for the serial ports.
455 This driver should work with anything that works on standard com serial ports.
456 Having said that, I have used it on at least the following types of "things"
458 a) standard dumb terminals (using getty)
459 b) modems (using cu, etc)
460 c) ppp (through pppd, kernel ppp)
466 Be aware that these drivers are still very new, so there is sure to be some
467 bugs in them. Please email me any feedback on bugs, problems, or even good
468 experiences with these drivers!
470 You can use both drivers at once if you have a mix of board types installed
471 in a system. However to do this you will need to change the major number used
472 by one of the drivers. Currently both drivers use default major number 72 for
473 their devices. Change one driver to use some other major number (how this is
474 achieved will depend on the kernel version you are using), and then modify the
475 mkdevnods script to make device nodes based on those new major numbers. For
476 example, you could change the stallion.c driver to use major number 73. You
477 will also need to create device nodes with different names for the ports, for
480 Currently the intelligent board driver (istallion.c) does not have the
481 ability to share a boards memory region with other boards (you can only do
482 this on EasyConnection 8/64 and ONboards normally anyway). It also does
483 not currently support any memory address ranges above the low 1Mb region.
484 These will be fixed in a future release of the driver.
486 Finding a free physical memory address range can be a problem. The older
487 boards like the Stallion and ONboard need large areas (64K or even 128K), so
488 they can be very difficult to get into a system. If you have 16 Mb of RAM
489 then you have no choice but to put them somewhere in the 640K -> 1Mb range.
490 ONboards require 64K, so typically 0xd0000 is good, or 0xe0000 on some
491 systems. If you have an original Stallion board, "V4.0" or Rev.O, then you
492 need a 64K memory address space, so again 0xd0000 and 0xe0000 are good. Older
493 Stallion boards are a much bigger problem. They need 128K of address space and
494 must be on a 128K boundary. If you don't have a VGA card then 0xc0000 might be
495 usable - there is really no other place you can put them below 1Mb.
497 Both the ONboard and old Stallion boards can use higher memory addresses as
498 well, but you must have less than 16Mb of RAM to be able to use them. Usual
499 high memory addresses used include 0xec0000 and 0xf00000.
501 The Brumby boards only require 16Kb of address space, so you can usually
502 squeeze them in somewhere. Common addresses are 0xc8000, 0xcc000, or in
503 the 0xd0000 range. EasyConnection 8/64 boards are even better, they only
504 require 4Kb of address space, again usually 0xc8000, 0xcc000 or 0xd0000
507 If you are using an EasyConnection 8/64-EI or ONboard/E then usually the
508 0xd0000 or 0xe0000 ranges are the best options below 1Mb. If neither of
509 them can be used then the high memory support to use the really high address
510 ranges is the best option. Typically the 2Gb range is convenient for them,
511 and gets them well out of the way.
513 The ports of the EasyIO-8M board do not have DCD or DTR signals. So these
514 ports cannot be used as real modem devices. Generally when using these
515 ports you should only use the cueX devices.
517 There is a new utility in this package that reports statistics on the
518 serial ports. You will need to have the ncurses library installed on your
521 To build the statistics display program type:
523 Once compiled simply run it (you will need to be root) and it will display
524 a port summary for the first board and panel installed. Use the digits to
525 select different board numbers, or 'n' to cycle through the panels on a
526 board. To look at detailed port information then hit 'p', that will display
527 detailed port 0 information. Use the digits and letters 'a' through 'f' to
528 select the different ports (on this board and panel).
534 This driver is loosely based on the code of the FreeBSD sio serial driver.
535 A big thanks to Stallion Technologies for the use of their equipment.