]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/sio.4
sys/{x86,amd64}: remove one of doubled ;s
[FreeBSD/FreeBSD.git] / share / man / man4 / sio.4
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. Neither the name of the University nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\"     from: @(#)dca.4 5.2 (Berkeley) 3/27/91
32 .\"     from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
33 .\" $FreeBSD$
34 .\"
35 .Dd August 30, 2006
36 .Dt SIO 4
37 .Os
38 .Sh NAME
39 .Nm sio
40 .Nd "fast interrupt driven asynchronous serial communications interface"
41 .Sh SYNOPSIS
42 For standard ISA ports:
43 .Bd -ragged -offset indent -compact
44 .Cd "device sio"
45 .Pp
46 In
47 .Pa /boot/device.hints :
48 .Cd hint.sio.0.at="isa"
49 .Cd hint.sio.0.port="0x3f8"
50 .Cd hint.sio.0.flags="0x10"
51 .Cd hint.sio.0.irq="4"
52 .Cd hint.sio.1.at="isa"
53 .Cd hint.sio.1.port="0x2f8"
54 .Cd hint.sio.1.flags="0x0"
55 .Cd hint.sio.1.irq="3"
56 .Ed
57 .Pp
58 For AST compatible multiport cards with 4 ports:
59 .Bd -ragged -offset indent -compact
60 .Cd "options COM_MULTIPORT"
61 .Cd "device sio"
62 .Pp
63 In
64 .Pa /boot/device.hints :
65 .Cd hint.sio.4.at="isa"
66 .Cd hint.sio.4.port="0x2a0"
67 .Cd hint.sio.4.flags="0x701"
68 .Cd hint.sio.5.at="isa"
69 .Cd hint.sio.5.port="0x2a8"
70 .Cd hint.sio.5.flags="0x701"
71 .Cd hint.sio.6.at="isa"
72 .Cd hint.sio.6.port="0x2b0"
73 .Cd hint.sio.6.flags="0x701"
74 .Cd hint.sio.7.at="isa"
75 .Cd hint.sio.7.port="0x2b8"
76 .Cd hint.sio.7.flags="0x701"
77 .Cd hint.sio.7.irq="12"
78 .Ed
79 .Pp
80 For Boca Board compatible multiport cards with 8 ports:
81 .Bd -ragged -offset indent -compact
82 .Cd "options COM_MULTIPORT"
83 .Cd "device sio"
84 .Pp
85 In
86 .Pa /boot/device.hints :
87 .Cd hint.sio.4.at="isa"
88 .Cd hint.sio.4.port="0x100"
89 .Cd hint.sio.4.flags="0xb05"
90 .Cd "..."
91 .Cd hint.sio.11.at="isa"
92 .Cd hint.sio.11.port="0x138"
93 .Cd hint.sio.11.flags="0xb05"
94 .Cd hint.sio.11.irq="12"
95 .Ed
96 .Pp
97 For Netmos Nm9845 multiport cards with 6 ports:
98 .Bd -ragged -offset indent -compact
99 .Cd "options COM_MULTIPORT"
100 .Cd "device sio"
101 .Pp
102 In
103 .Pa /boot/device.hints :
104 .Cd hint.sio.4.at="isa"
105 .Cd hint.sio.4.port="0xb000"
106 .Cd hint.sio.4.flags="0x901"
107 .Cd hint.sio.5.at="isa"
108 .Cd hint.sio.5.port="0xb400"
109 .Cd hint.sio.5.flags="0x901"
110 .Cd hint.sio.6.at="isa"
111 .Cd hint.sio.6.port="0xb800"
112 .Cd hint.sio.6.flags="0x901"
113 .Cd hint.sio.7.at="isa"
114 .Cd hint.sio.7.port="0xbc00"
115 .Cd hint.sio.7.flags="0x901"
116 .Cd hint.sio.8.at="isa"
117 .Cd hint.sio.8.port="0xc000"
118 .Cd hint.sio.8.flags="0x901"
119 .Cd hint.sio.9.at="isa"
120 .Cd hint.sio.9.port="0xac00"
121 .Cd hint.sio.9.flags="0x901"
122 .Cd hint.sio.9.irq="12"
123 .Ed
124 .Pp
125 For Hayes ESP cards:
126 .Bd -ragged -offset indent -compact
127 .Cd "options COM_ESP"
128 .Cd "device sio"
129 .Cd "..."
130 .Ed
131 .Pp
132 For single port PCI and PCCARD cards:
133 .Bd -ragged -offset indent -compact
134 .Cd "device sio"
135 .Pp
136 No lines are required in
137 .Pa /boot/device.hints
138 for these cards.
139 .Ed
140 .Pp
141 For dual port PCI cards that share an interrupt:
142 .Bd -ragged -offset indent -compact
143 .Cd "device sio"
144 .Cd "options COM_MULTIPORT"
145 .Pp
146 In
147 .Pa /boot/device.hints :
148 .Cd hint.sio.2.flags="0x201"
149 .Cd hint.sio.3.flags="0x201"
150 .Ed
151 .Pp
152 Meaning of
153 .Ar flags :
154 .Bl -tag -offset indent -compact -width 0x000000
155 .It 0x00001
156 shared IRQs
157 .It 0x00002
158 disable FIFO
159 .It 0x00004
160 no AST/4 compatible IRQ control register
161 .It 0x00008
162 recover sooner from lost output interrupts
163 .It 0x00010
164 device is potential system console
165 .It 0x00020
166 device is forced to become system console
167 .It 0x00040
168 device is reserved for low-level IO (e.g.\& for remote kernel debugging)
169 .It 0x00080
170 use this port for remote kernel debugging
171 .It 0x0 Ns Em ?? Ns 00
172 minor number of master port
173 .It 0x10000
174 PPS timestamping on CTS instead of DCD
175 .It 0x20000
176 device is assumed to use a 16650A-type (extended FIFO) chip
177 .El
178 .Sh DESCRIPTION
179 The
180 .Nm
181 driver provides support for NS8250-, NS16450-, NS16550 and NS16550A-based
182 .Tn EIA
183 .Tn RS-232C
184 .Pf ( Tn CCITT
185 .Tn V.24 )
186 communications interfaces.
187 The NS8250 and NS16450 have single character
188 buffers, the NS16550A has 16 character FIFO input and output buffers.
189 .Pp
190 Input and output for each line may set to one of following baud rates;
191 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600,
192 19200, 28800, 38400, 57600, or 115200.
193 Your hardware may limit your baud rate choices.
194 .Pp
195 The driver supports `multiport' cards.
196 Multiport cards are those that have one or more groups of ports
197 that share an Interrupt Request (IRQ) line per group.
198 Shared IRQs on different cards are not supported.
199 Frequently 4 ports share 1 IRQ; some 8 port cards have 2 groups of 4 ports,
200 thus using 2 IRQs.
201 Some cards allow the first 2 serial ports to have separate IRQs per port
202 (as per DOS PC standard).
203 .Pp
204 Some cards have an IRQ control register for each group.
205 Some cards require special initialization related to such registers.
206 Only AST/4 compatible IRQ control registers are supported.
207 Some cards have an IRQ status register for each group.
208 The driver does not require or use such registers yet.
209 To work, the control and status registers for a group, if any,
210 must be mapped to the scratch register (register 7)
211 of a port in the group.
212 Such a port is called a
213 .Em master
214 port.
215 .Pp
216 The driver supports controller based PCI modems.
217 The 3Com FaxModem PCI and the Advantec 56k Voice Messaging PCI
218 FaxModem are the only cards supported.
219 WinModems, softmodems, hfc modems and any other modems that are not
220 controller based are not supported.
221 .Pp
222 The
223 .Em flags
224 keyword may be used on each
225 .Em device sio
226 line in the kernel configuration file
227 to disable the FIFO on 16550A UARTs
228 (see the synopsis).
229 Disabling the FIFO should rarely be necessary.
230 .Pp
231 The
232 .Em flags
233 keyword
234 .Em must
235 be used for all ports that are part of an IRQ sharing group.
236 One bit specifies IRQ sharing; another bit specifies whether the port does
237 .Em not
238 require AST/4 compatible initialization.
239 The minor number of the device corresponding a master port
240 for the group is encoded as a bitfield in the high byte.
241 The same master port must be specified for all ports in a group.
242 .Pp
243 The
244 .Em irq
245 specification must be given for master ports
246 and for ports that are not part of an IRQ sharing group,
247 and not for other ports.
248 .Pp
249 In the synopsis,
250 .Em flags 0x701
251 means that the 8th port (sio7) is the master
252 port, and that the port is on a multiport card with shared IRQs
253 and an AST/4 compatible IRQ control register.
254 .Pp
255 .Em flags 0xb05
256 means that the 12th port (sio11) is the master
257 port, and that the port is on a multiport card with shared IRQs
258 and no special IRQ control register.
259 .Pp
260 Which port is the master port depends on the card type.
261 Consult the hardware documentation of your card.
262 Since IRQ status registers are never used,
263 and IRQ control registers are only used for AST/4 compatible cards,
264 and some cards map the control/status registers to all ports in a group,
265 any port in a group will sometimes do for the master port.
266 Choose a port containing an IRQ status register for forwards compatibility,
267 and the highest possible port for consistency.
268 .Pp
269 Serial ports controlled by the
270 .Nm
271 driver can be used for both `callin' and `callout'.
272 For each port there is a callin device and a callout device.
273 The minor number of the callout device is 128 higher
274 than that of the corresponding callin port.
275 The callin device is general purpose.
276 Processes opening it normally wait for carrier
277 and for the callout device to become inactive.
278 The callout device is used to steal the port from
279 processes waiting for carrier on the callin device.
280 Processes opening it do not wait for carrier
281 and put any processes waiting for carrier on the callin device into
282 a deeper sleep so that they do not conflict with the callout session.
283 The callout device is abused for handling programs that are supposed
284 to work on general ports and need to open the port without waiting
285 but are too stupid to do so.
286 .Pp
287 The
288 .Nm
289 driver also supports an initial-state and a lock-state control
290 device for each of the callin and the callout "data" devices.
291 The termios settings of a data device are copied
292 from those of the corresponding initial-state device
293 on first opens and are not inherited from previous opens.
294 Use
295 .Xr stty 1
296 in the normal way on the initial-state devices to program
297 initial termios states suitable for your setup.
298 .Pp
299 The lock termios state acts as flags to disable changing
300 the termios state.
301 E.g., to lock a flag variable such as CRTSCTS, use
302 .Em stty crtscts
303 on the lock-state device.
304 Speeds and special characters
305 may be locked by setting the corresponding value in the lock-state
306 device to any nonzero value.
307 E.g., to lock a speed to 115200, use
308 .Dq Li stty 115200
309 on the initial-state device and
310 .Dq Li stty 1
311 on the lock-state device.
312 .Pp
313 Correct programs talking to correctly wired external devices
314 work with almost arbitrary initial states and almost no locking,
315 but other setups may benefit from changing some of the default
316 initial state and locking the state.
317 In particular, the initial states for non (POSIX) standard flags
318 should be set to suit the devices attached and may need to be
319 locked to prevent buggy programs from changing them.
320 E.g., CRTSCTS should be locked on for devices that support
321 RTS/CTS handshaking at all times and off for devices that do not
322 support it at all.
323 CLOCAL should be locked on for devices that do not support carrier.
324 HUPCL may be locked off if you do not
325 want to hang up for some reason.
326 In general, very bad things happen
327 if something is locked to the wrong state, and things should not
328 be locked for devices that support more than one setting.
329 The CLOCAL flag on callin ports should be locked off for logins
330 to avoid certain security holes, but this needs to be done by
331 getty if the callin port is used for anything else.
332 .Sh FILES
333 .Bl -tag -width /dev/ttyd?.init -compact
334 .It Pa /dev/ttyd?
335 for callin ports
336 .It Pa /dev/ttyd?.init
337 .It Pa /dev/ttyd?.lock
338 corresponding callin initial-state and lock-state devices
339 .Pp
340 .It Pa /dev/cuad?
341 for callout ports
342 .It Pa /dev/cuad?.init
343 .It Pa /dev/cuad?.lock
344 corresponding callout initial-state and lock-state devices
345 .El
346 .Pp
347 .Bl -tag -width /etc/rc.d/serial -compact
348 .It Pa /etc/rc.d/serial
349 examples of setting the initial-state and lock-state devices
350 .El
351 .Pp
352 The device numbers are made from the set [0-9a-v] so that more than
353 10 ports can be supported.
354 .Sh DIAGNOSTICS
355 .Bl -diag
356 .It sio%d: silo overflow.
357 Problem in the interrupt handler.
358 .El
359 .Bl -diag
360 .It sio%d: interrupt-level buffer overflow.
361 Problem in the bottom half of the driver.
362 .El
363 .Bl -diag
364 .It sio%d: tty-level buffer overflow.
365 Problem in the application.
366 Input has arrived faster than the given module could process it
367 and some has been lost.
368 .El
369 .\" .Bl -diag
370 .\" .It sio%d: reduced fifo trigger level to %d.
371 .\" Attempting to avoid further silo overflows.
372 .\" .El
373 .Sh SEE ALSO
374 .Xr stty 1 ,
375 .Xr termios 4 ,
376 .Xr tty 4 ,
377 .Xr comcontrol 8
378 .Sh HISTORY
379 The
380 .Nm
381 driver is derived from the
382 .Tn HP9000/300
383 .Xr dca 4
384 driver and is
385 .Ud
386 .Sh BUGS
387 Data loss may occur at very high baud rates on slow systems,
388 or with too many ports on any system,
389 or on heavily loaded systems when crtscts cannot be used.
390 The use of NS16550A's reduces system load and helps to avoid data loss.
391 .Pp
392 Stay away from plain NS16550's.
393 These are early implementations of the chip with non-functional FIFO hardware.
394 .Pp
395 The constants which define the locations
396 of the various serial ports are holdovers from
397 .Tn DOS .
398 As shown, hex addresses can be and for clarity probably should be used instead.
399 .Pp
400 Note that on the AST/4 the card's dipswitches should
401 .Em not
402 be set to use interrupt sharing.
403 AST/4-like interrupt sharing is only used when
404 .Em multiple
405 AST/4 cards are installed in the same system.
406 The
407 .Nm
408 driver does not support more than 1 AST/4 on one IRQ.
409 .Pp
410 The examples in the synopsis are too vendor-specific.