The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2003 Marcel Moolenaar
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\"
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2020-07-11 20:56:57 +00:00
|
|
|
.Dd July 11, 2020
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.Dt UART 4
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm uart
|
|
|
|
.Nd driver for Universal Asynchronous Receiver/Transmitter (UART) devices
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Cd "device uart"
|
|
|
|
.Pp
|
|
|
|
.Cd "device puc"
|
|
|
|
.Cd "device uart"
|
2006-03-30 18:39:24 +00:00
|
|
|
.Pp
|
|
|
|
.Cd "device scc"
|
|
|
|
.Cd "device uart"
|
2008-03-12 19:09:58 +00:00
|
|
|
.Pp
|
|
|
|
In
|
|
|
|
.Pa /boot/device.hints :
|
|
|
|
.Cd hint.uart.0.disabled="1"
|
|
|
|
.Cd hint.uart.0.baud="38400"
|
|
|
|
.Cd hint.uart.0.port="0x3f8"
|
|
|
|
.Cd hint.uart.0.flags="0x10"
|
|
|
|
.Pp
|
|
|
|
With
|
|
|
|
.Ar flags
|
|
|
|
encoded as:
|
|
|
|
.Bl -tag -compact -width 0x000000
|
|
|
|
.It 0x00010
|
|
|
|
device is potential system console
|
|
|
|
.It 0x00080
|
|
|
|
use this port for remote kernel debugging
|
|
|
|
.It 0x00100
|
|
|
|
set RX FIFO trigger level to ``low'' (NS8250 only)
|
|
|
|
.It 0x00200
|
|
|
|
set RX FIFO trigger level to ``medium low'' (NS8250 only)
|
|
|
|
.It 0x00400
|
|
|
|
set RX FIFO trigger level to ``medium high'' (default, NS8250 only)
|
|
|
|
.It 0x00800
|
|
|
|
set RX FIFO trigger level to ``high'' (NS8250 only)
|
|
|
|
.El
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.\"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
device driver provides support for various classes of UARTs implementing the
|
|
|
|
EIA RS-232C (CCITT V.24) serial communications interface.
|
2004-06-21 17:42:49 +00:00
|
|
|
Each such interface is controlled by a separate and independent instance of
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
the
|
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
The primary support for devices that contain multiple serial interfaces or
|
|
|
|
that contain other functionality besides one or more serial interfaces is
|
|
|
|
provided by the
|
2006-03-30 18:39:24 +00:00
|
|
|
.Xr puc 4 ,
|
|
|
|
or
|
|
|
|
.Xr scc 4
|
|
|
|
device drivers.
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
However, the serial interfaces of those devices that are managed by the
|
2006-03-30 18:39:24 +00:00
|
|
|
.Xr puc 4 ,
|
|
|
|
or
|
|
|
|
.Xr scc 4
|
|
|
|
driver are each independently controlled by the
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
As such, the
|
2006-03-30 18:39:24 +00:00
|
|
|
.Xr puc 4 ,
|
|
|
|
or
|
|
|
|
.Xr scc 4
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
driver provides umbrella functionality for the
|
|
|
|
.Nm
|
|
|
|
driver and hides the complexities that are inherent when elementary components
|
|
|
|
are packaged together.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver has a modular design to allow it to be used on differing hardware and
|
|
|
|
for various purposes.
|
|
|
|
In the following sections the components are discussed in detail.
|
|
|
|
Options are described in the section that covers the component to which each
|
|
|
|
option applies.
|
|
|
|
.\"
|
|
|
|
.Ss CORE COMPONENT
|
|
|
|
At the heart of the
|
|
|
|
.Nm
|
2003-09-06 23:46:29 +00:00
|
|
|
driver is the core component.
|
|
|
|
It contains the bus attachments and the low-level interrupt handler.
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.\"
|
|
|
|
.Ss HARDWARE DRIVERS
|
|
|
|
The core component and the kernel interfaces talk to the hardware through the
|
|
|
|
hardware interface.
|
|
|
|
This interface serves as an abstraction of the hardware and allows varying
|
|
|
|
UARTs to be used for serial communications.
|
|
|
|
.\"
|
|
|
|
.Ss SYSTEM DEVICES
|
|
|
|
System devices are UARTs that have a special purpose by way of hardware
|
|
|
|
design or software setup.
|
|
|
|
For example, Sun UltraSparc machines use UARTs as their keyboard interface.
|
|
|
|
Such an UART cannot be used for general purpose communications.
|
|
|
|
Likewise, when the kernel is configured for a serial console, the
|
|
|
|
corresponding UART will in turn be a system device so that the kernel can
|
|
|
|
output boot messages early on in the boot process.
|
|
|
|
.\"
|
|
|
|
.Ss KERNEL INTERFACES
|
|
|
|
The last but not least of the components is the kernel interface.
|
|
|
|
This component ultimately determines how the UART is made visible to the
|
|
|
|
kernel in particular and to users in general.
|
|
|
|
The default kernel interface is the TTY interface.
|
|
|
|
This allows the UART to be used for terminals, modems and serial line IP
|
|
|
|
applications.
|
|
|
|
System devices, with the notable exception of serial consoles, generally
|
|
|
|
have specialized kernel interfaces.
|
|
|
|
.\"
|
2006-02-07 03:27:06 +00:00
|
|
|
.Sh HARDWARE
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver supports the following classes of UARTs:
|
|
|
|
.Pp
|
|
|
|
.Bl -bullet -compact
|
|
|
|
.It
|
|
|
|
NS8250: standard hardware based on the 8250, 16450, 16550, 16650, 16750 or
|
2006-03-30 18:39:24 +00:00
|
|
|
the 16950 UARTs.
|
2006-02-07 03:27:06 +00:00
|
|
|
.It
|
2006-03-30 18:39:24 +00:00
|
|
|
SCC: serial communications controllers supported by the
|
|
|
|
.Xr scc 4
|
|
|
|
device driver.
|
2006-02-07 03:27:06 +00:00
|
|
|
.El
|
|
|
|
.\"
|
2015-08-10 20:08:09 +00:00
|
|
|
.Sh Pulse Per Second (PPS) Timing Interface
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver can capture PPS timing information as defined in RFC 2783.
|
|
|
|
The API, accessed via
|
2016-02-29 17:37:35 +00:00
|
|
|
.Xr ioctl 2 ,
|
2015-08-10 20:08:09 +00:00
|
|
|
is available on the tty device.
|
|
|
|
To use the PPS capture feature with
|
|
|
|
.Xr ntpd 8 ,
|
2016-01-12 18:42:00 +00:00
|
|
|
symlink the tty callout device
|
|
|
|
.Va /dev/cuau?
|
|
|
|
to
|
2015-08-10 20:08:09 +00:00
|
|
|
.Va /dev/pps0.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Va hw.uart.pps_mode
|
|
|
|
tunable configures the PPS capture mode for all uart devices;
|
|
|
|
it can be set in
|
|
|
|
.Xr loader.conf 5 .
|
|
|
|
The
|
|
|
|
.Va dev.uart.0.pps_mode
|
|
|
|
sysctl configures the PPS capture mode for a specific uart device;
|
|
|
|
it can be set in
|
|
|
|
.Xr loader.conf 5
|
|
|
|
or
|
|
|
|
.Xr sysctl.conf 5 .
|
2016-01-12 18:42:00 +00:00
|
|
|
.Pp
|
2015-08-10 20:08:09 +00:00
|
|
|
The following capture modes are available:
|
|
|
|
.Bl -tag -compact -offset "mmmm" -width "mmmm"
|
2016-01-12 18:42:00 +00:00
|
|
|
.It 0x00
|
2015-08-10 20:08:09 +00:00
|
|
|
Capture disabled.
|
2016-01-12 18:42:00 +00:00
|
|
|
.It 0x01
|
2015-08-10 20:08:09 +00:00
|
|
|
Capture pulses on the CTS line.
|
2016-01-12 18:42:00 +00:00
|
|
|
.It 0x02
|
|
|
|
Capture pulses on the DCD line.
|
|
|
|
.El
|
|
|
|
.Pp
|
2016-03-31 15:16:22 +00:00
|
|
|
The following values may be ORed with the capture mode to configure
|
2016-01-12 18:42:00 +00:00
|
|
|
capture processing options:
|
|
|
|
.Bl -tag -compact -offset "mmmm" -width "mmmm"
|
|
|
|
.It 0x10
|
|
|
|
Invert the pulse (RS-232 logic low = ASSERT, high = CLEAR).
|
|
|
|
.It 0x20
|
|
|
|
Attempt to capture narrow pulses.
|
2015-08-10 20:08:09 +00:00
|
|
|
.El
|
2016-01-12 18:42:00 +00:00
|
|
|
.Pp
|
|
|
|
Add the narrow pulse option when the incoming PPS pulse width is small
|
|
|
|
enough to prevent reliable capture in normal mode.
|
|
|
|
In narrow mode the driver uses the hardware's ability to latch a line
|
|
|
|
state change; not all hardware has this capability.
|
|
|
|
The hardware latch provides a reliable indication that a pulse occurred,
|
|
|
|
but prevents distinguishing between the CLEAR and ASSERT edges of the pulse.
|
|
|
|
For each detected pulse, the driver synthesizes both an ASSERT and a CLEAR
|
|
|
|
event, using the same timestamp for each.
|
|
|
|
To prevent spurious events when the hardware is intermittently able to
|
|
|
|
see both edges of a pulse, the driver will not generate a new pair of
|
|
|
|
events within a half second of the prior pair.
|
|
|
|
Both normal and narrow pulse modes work with
|
|
|
|
.Xr ntpd 8 .
|
|
|
|
.Pp
|
|
|
|
Add the invert option when the connection to the uart device uses TTL
|
|
|
|
level signals, or when the PPS source emits inverted pulses.
|
|
|
|
RFC 2783 defines an ASSERT event as a higher-voltage line level, and a CLEAR
|
|
|
|
event as a lower-voltage line level, in the context of the RS-232 protocol.
|
|
|
|
The modem control signals on a TTL-level connection are typically
|
|
|
|
inverted from the RS-232 levels.
|
|
|
|
For example, carrier presence is indicated by a high signal on an RS-232
|
|
|
|
DCD line, and by a low signal on a TTL DCD line.
|
|
|
|
This is due to the use of inverting line driver buffers to convert between
|
|
|
|
TTL and RS-232 line levels in most hardware designs.
|
|
|
|
Generally speaking, a connection to a DB-9 style connector is an RS-232
|
|
|
|
level signal at up to 12 volts.
|
|
|
|
A connection to header pins or an edge-connector on an embedded board
|
|
|
|
is typically a TTL signal at 3.3 or 5 volts.
|
2018-08-14 13:52:10 +00:00
|
|
|
.Sh Special Devices
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver also supports an initial-state and a lock-state control
|
|
|
|
device for each of the callin and the callout "data" devices.
|
|
|
|
The termios settings of a data device are copied
|
|
|
|
from those of the corresponding initial-state device
|
|
|
|
on first opens and are not inherited from previous opens.
|
|
|
|
Use
|
|
|
|
.Xr stty 1
|
|
|
|
in the normal way on the initial-state devices to program
|
|
|
|
initial termios states suitable for your setup.
|
|
|
|
.Pp
|
|
|
|
The lock termios state acts as flags to disable changing
|
|
|
|
the termios state.
|
|
|
|
E.g., to lock a flag variable such as CRTSCTS, use
|
|
|
|
.Em stty crtscts
|
|
|
|
on the lock-state device.
|
|
|
|
Speeds and special characters
|
|
|
|
may be locked by setting the corresponding value in the lock-state
|
|
|
|
device to any nonzero value.
|
|
|
|
E.g., to lock a speed to 115200, use
|
|
|
|
.Dq Li stty 115200
|
|
|
|
on the initial-state device and
|
|
|
|
.Dq Li stty 1
|
|
|
|
on the lock-state device.
|
|
|
|
.Pp
|
|
|
|
Correct programs talking to correctly wired external devices
|
|
|
|
work with almost arbitrary initial states and almost no locking,
|
|
|
|
but other setups may benefit from changing some of the default
|
|
|
|
initial state and locking the state.
|
|
|
|
In particular, the initial states for non (POSIX) standard flags
|
|
|
|
should be set to suit the devices attached and may need to be
|
|
|
|
locked to prevent buggy programs from changing them.
|
|
|
|
E.g., CRTSCTS should be locked on for devices that support
|
|
|
|
RTS/CTS handshaking at all times and off for devices that do not
|
|
|
|
support it at all.
|
|
|
|
CLOCAL should be locked on for devices that do not support carrier.
|
|
|
|
HUPCL may be locked off if you do not
|
|
|
|
want to hang up for some reason.
|
|
|
|
In general, very bad things happen
|
|
|
|
if something is locked to the wrong state, and things should not
|
|
|
|
be locked for devices that support more than one setting.
|
|
|
|
The CLOCAL flag on callin ports should be locked off for logins
|
|
|
|
to avoid certain security holes, but this needs to be done by
|
|
|
|
getty if the callin port is used for anything else.
|
2006-03-30 02:27:25 +00:00
|
|
|
.Sh FILES
|
2017-04-26 19:51:10 +00:00
|
|
|
.Bl -tag -width "/dev/ttyu?.init" -compact
|
2006-03-30 02:27:25 +00:00
|
|
|
.It Pa /dev/ttyu?
|
|
|
|
for callin ports
|
|
|
|
.It Pa /dev/ttyu?.init
|
|
|
|
.It Pa /dev/ttyu?.lock
|
|
|
|
corresponding callin initial-state and lock-state devices
|
|
|
|
.Pp
|
2017-05-09 08:31:34 +00:00
|
|
|
.It Pa /dev/cuau?
|
2006-03-30 02:27:25 +00:00
|
|
|
for callout ports
|
|
|
|
.It Pa /dev/cuau?.init
|
|
|
|
.It Pa /dev/cuau?.lock
|
|
|
|
corresponding callout initial-state and lock-state devices
|
|
|
|
.El
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.Sh SEE ALSO
|
2020-07-11 20:56:57 +00:00
|
|
|
.Xr cu 1 ,
|
2006-03-30 18:39:24 +00:00
|
|
|
.Xr puc 4 ,
|
2020-07-11 20:56:57 +00:00
|
|
|
.Xr scc 4 ,
|
|
|
|
.Xr ttys 5
|
The uart(4) driver is an universal driver for various UART hardware.
It improves on sio(4) in the following areas:
o Fully newbusified to allow for memory mapped I/O. This is a must
for ia64 and sparc64,
o Machine dependent code to take full advantage of machine and firm-
ware specific ways to define serial consoles and/or debug ports.
o Hardware abstraction layer to allow the driver to be used with
various UARTs, such as the well-known ns8250 family of UARTs, the
Siemens sab82532 or the Zilog Z8530. This is especially important
for pc98 and sparc64 where it's common to have different UARTs,
o The notion of system devices to unkludge low-level consoles and
remote gdb ports and provides the mechanics necessary to support
the keyboard on sparc64 (which is UART based).
o The notion of a kernel interface so that a UART can be tied to
something other than the well-known TTY interface. This is needed
on sparc64 to present the user with a device and ioctl handling
suitable for a keyboard, but also allows us to cleanly hide an
UART when used as a debug port.
Following is a list of features and bugs/flaws specific to the ns8250
family of UARTs as compared to their support in sio(4):
o The uart(4) driver determines the FIFO size and automaticly takes
advantages of larger FIFOs and/or additional features. Note that
since I don't have sufficient access to 16[679]5x UARTs, hardware
flow control has not been enabled. This is almost trivial to do,
provided one can test. The downside of this is that broken UARTs
are more likely to not work correctly with uart(4). The need for
tunables or knobs may be large enough to warrant their creation.
o The uart(4) driver does not share the same bumpy history as sio(4)
and will therefore not provide the necessary hooks, tweaks, quirks
or work-arounds to deal with once common hardware. To that extend,
uart(4) supports a subset of the UARTs that sio(4) supports. The
question before us is whether the subset is sufficient for current
hardware.
o There is no support for multiport UARTs in uart(4). The decision
behind this is that uart(4) deals with one EIA RS232-C interface.
Packaging of multiple interfaces in a single chip or on a single
expansion board is beyond the scope of uart(4) and is now mostly
left for puc(4) to deal with. Lack of hardware made it impossible
to actually implement such a dependency other than is present for
the dual channel SAB82532 and Z8350 SCCs.
The current list of missing features is:
o No configuration capabilities. A set of tunables and sysctls is
being worked out. There are likely not going to be any or much
compile-time knobs. Such configuration does not fit well with
current hardware.
o No support for the PPS API. This is partly dependent on the
ability to configure uart(4) and partly dependent on having
sufficient information to implement it properly.
As usual, the manpage is present but lacks the attention the
software has gotten.
2003-09-06 23:13:47 +00:00
|
|
|
.\"
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
device driver first appeared in
|
|
|
|
.Fx 5.2 .
|
2003-09-06 23:46:29 +00:00
|
|
|
.Sh AUTHORS
|
2006-03-30 18:39:24 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
device driver and this manual page were written by
|
2014-06-26 21:46:14 +00:00
|
|
|
.An Marcel Moolenaar Aq Mt marcel@xcllnt.net .
|