This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.1'.
[unix-history] / share / man / man4 / man4.i386 / sio.4
... / ...
CommitLineData
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Systems Programming Group of the University of Utah Computer
6.\" Science Department.
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" from: @(#)dca.4 5.2 (Berkeley) 3/27/91
36.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
37.\" $Id: sio.4,v 1.9 1994/03/18 13:40:01 ache Exp $
38.\"
39.Dd February 9, 1994
40.Dt SIO 4 i386
41.Os FreeBSD
42.Sh NAME
43.Nm sio
44.Nd
45fast interrupt driven asynchronous serial communications interface
46.Sh SYNOPSIS
47For standard ports:
48.Cd "device sio0 at isa? port" \&"IO_COM1\&" tty irq 4 vector siointr
49.Cd "device sio1 at isa? port" \&"IO_COM2\&" tty irq 3 vector siointr
50.Cd "device sio2 at isa? port" \&"IO_COM3\&" tty irq 5 vector siointr
51.Cd "device sio3 at isa? port" \&"IO_COM4\&" tty irq 9 vector siointr
52.sp
53For multiport cards:
54.Cd "options" \&"COM_MULTIPORT\&"
55.Cd "device sio4 at isa? port 0x2a0 tty irq 12 flags 0x401 vector siointr"
56.Cd "device sio5 at isa? port 0x2a8 tty flags 0x401 vector siointr"
57.Cd "device sio6 at isa? port 0x2b0 tty flags 0x401 vector siointr"
58.Cd "device sio7 at isa? port 0x2b8 tty flags 0x401 vector siointr"
59.sp
60For bidirectional use of ports:
61.Cd "options" \&"COM_BIDIR\&"
62.sp
63For control FIFO trigger:
64.Cd "options" \&"FIFO_TRIGGER=FIFO_TRIGGER_14\&"
65.sp
66Use 0x02 bit in flags field to disable FIFO on specified port.
67.Sh DESCRIPTION
68The
69.Nm sio
70driver provides support for NS8250-, NS16450-, NS16550 and NS16550A-based
71.Tn EIA
72.Tn RS-232C
73.Pf ( Tn CCITT
74.Tn V.24 )
75communications interfaces. The NS8250 and NS16450 have single character
76buffers, the NS16550A has a 16 character FIFO buffer.
77.Pp
78Input and output for each line may set to one of following baud rates;
7950, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600,
8019200, 38400, 57600, or 115200. Your hardware may limit your baud
81rate choices.
82.Pp
83The driver supports `multiport' cards.
84Multiport cards are those that have one or more groups of ports
85that share a common IRQ and Interrupt Request register set per group.
86Frequently 4 ports share 1 IRQ, some 8 port cards have 2 groups of 4 ports,
87thus using 2 IRQs.
88Some cards allow the first 2 serial ports to have seperate IRQs per port
89(as per DOS PC standard).
90.sp
91The
92.Nm flags
93keyword specifies for each
94.Nm device sio
95line in the kernel configuration file,
96whether the port is part of an IRQ sharing group, & if so,
97which port is the master device for
98the group (ie which port has the IRQ control registers).
99The master device is the port which
100has registers through which all interrupts of the port group are funneled.
101All ports of a port group report pending interrupts using this
102single register.
103.sp
104The master device is an integer embedded in the high byte of the
105.Nm flags
106bitfield, so all sio entries in the kernel config file that are part of a
107multiport card must include the correct
108.Nm flags
109specification.
110The bitwise assignment allows multiple port groups to
111be configured in one system. It does
112.Nm not
113imply that more than one port group (or card) can share
114the same physical interrupt line!
115.Pp
116In the synopsis the
117.Nm flags 0x401
118means that the 5th port (sio4) is the master
119device (so the MSB of the flags), and that the ports are part of a
120multiport card (the LSB of the flags, actually only the LS
121.Nm bit
122).
123F.e. if you have only two standard ports in addition to multiport
124card, this
125.Nm flags
126will be
127.Nm 0x201
128(assuming the control port is
129.Nm sio2
130).
131.Pp
132Which port is the master device depends on the card type. Consult
133the hardware documentation of your card.
134.Pp
135Serial ports controlled by the
136.Nm sio
137driver can be used for both dialin and dialout. Use
138.Xr comcontrol 8
139to enable/disable bidirectional use of the
140.Nm sio
141ports. The minor number of the dialout
142port is 128 higher than that of the corresponding dialin port. Use
143.Xr stty 1
144to enable or disable modem control as required by your setup.
145.Pp
146While testing new cards & resolving card config DIP header &
147.Nm sio flags
148settings, to avoid coms. failure from lack of full modem DC level
149settings on ports,
150you are recommended to temporarily use syntax such as:
151.Nm stty -f /dev/tty03 clocal
152or open
153.Nm /dev/cua03
154if you have bidirectional mode active
155to force serial port to open without
156.Nm O_NONBLOCK
157flag.
158.Sh FILES
159.Bl -tag -width /dev/tty0? -compact
160.It Pa /dev/tty0?
161for hardwired terminals
162.El
163or
164.Bl -tag -width /dev/tty0? -compact
165.It Pa /dev/ttyd?
166for dialin ports (and dialout when bidirectional usage disabled)
167.It Pa /dev/cua0?
168for dialout ports when bidirectional usage enabled
169.El
170.Pp
171The devices numbers are made from the set [0-9a-z] so that more than
17210 ports can be supported.
173/dev/tty0? and /dev/ttyd? are mutually exclusive, if you have
174/dev/tty0? corresponding /dev/ttyd? must be removed and vice versa.
175.Sh DIAGNOSTICS
176.Bl -diag
177.It sio%d: silo overflow.
178The single-character input
179.Dq silo
180has overflowed and incoming data has been lost.
181.\".It com%d: weird interrupt: %x.
182.\"The device has generated an unexpected interrupt
183.\"with the code listed.
184.El
185.Sh SEE ALSO
186.Xr tty 4 ,
187.Xr comcontrol 8 ,
188.Xr stty 1 .
189.Sh HISTORY
190The
191.Nm
192driver is derived from the
193.Nm HP9000/300
194.Nm dca
195driver and is
196.Ud
197.Sh BUGS
198Data loss is not near as likely on busy systems as they are with the
199.Xr com 4
200driver but they still can occur at very high baud rates on slow systems. The
201use of NS16550A's helps lot to handle high baud rates.
202.Pp
203Stay away from NS16550 (so without the trailing A). These are early
204implementations of the chip with non-functional FIFO hardware.
205.Pp
206The constants which define the locations
207of the various serial ports are holdovers from
208.Nm DOS .
209As shown, hex addresses can be and for clarity probably should be used instead.
210.Pp
211As usual, you get what you pay for; cheap NS16550 clones generally don't work.
212.Pp
213The multiport example is based on an AST/4 card, your
214mileage may vary however. Note that on the AST/4 the card's dipswitches should
215.Nm not
216be set to use interrupt sharing. AST/4-like interrupt sharing is only used when
217.Nm multiple
218AST/4 cards are installed in the same system. The sio driver does not
219support more than 1 AST/4 on one IRQ.