365480 |
08-Sep-2020 |
jhb |
MFC 359900: Export a sysctl count of RX FIFO overrun events.
uart(4) backends currently detect RX FIFO overrun errors and report them to the uart(4) core layer. They are then reported to the generic TTY layer which promptly ignores them. As a result, there is currently no good way to determine if a uart is experiencing RX FIFO overruns. One could add a generic per-tty counter, but there did not appear to be a good way to export those. Instead, add a sysctl under the uart(4) sysctl tree to export the count of overruns. |
365476 |
08-Sep-2020 |
jhb |
MFC 359899: Correct baud rate error calculation.
Shifting right by 1 is not the same as dividing by 2 for signed values. In particular, dividing a signed value by 2 gives the integer ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always gives the floor (-5 >> 1 == -3).
An embedded board with a 25 Mhz base clock results in an error of -30.5% when used with a baud rate of 115200. Using division, this truncates to -30% and is permitted. Using the shift, this fails and is rejected causing TIOCSETA requests to fail with EINVAL and breaking getty(8).
Using division gives the same error range for both over and under baud rates and also makes the code match the behavior documented in the existing comment about supporting boards with 25 Mhz clocks. |
358552 |
02-Mar-2020 |
jhibbits |
MFC r358431:
Add Denverton UART PCI ID
Sponsored by: Juniper Networks, Inc |
356923 |
20-Jan-2020 |
loos |
MFC r336623 by mmacy:
Fixes the interrupt storm in UART during the boot on ARMADA38X. The missing attribution of ns8250->busy_detect breaks the UART support.
Original commit log:
Add busy detect quirk to list of console options
This change allows one to set the busy_detect flag required by the synopsys UART at the loader prompt. This is needed by the EPYC 3000 SoC.
This will give users a working console up to the point where getty is required: hw.uart.console="mm:0xfedc9000,rs:2,bd:1"
Sponsored by: Rubicon Communications, LLC (Netgate) |
356013 |
22-Dec-2019 |
kevans |
MFC r355796-r355797, r355799: kbd: defaults for get_fkeystr/diag
The genkbd version of these remains exposed for stable branches, but keyboard drivers that just want to use the defaults can simply not provide their own. There shouldn't be any unset in the wild.
r355796: kbd: provide default implementations of get_fkeystr/diag
Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set.
r355797: chrome_kb: remove default get_fkeystr/diag implementations
This file was missed in r355796, but no harm would have come from this.
r355799: kbd: patch linker set methods, too
This is needed after r355796. Some double-registration of kbd drivers needs to be sorted out, then this sysinit will simply add these drivers into the normal list and kill off any other bits in the driver that are aware of the linker set, for simplicity. |
356007 |
22-Dec-2019 |
kevans |
MFC r355794: keyboard switch definitions: standardize on c99 initializers |
352862 |
29-Sep-2019 |
mav |
MFC r352369: Relax TX draining in ns8250_bus_transmit().
Since TX interrupt is generated when THRE is set, wait for TEMT set means wait for full character transmission time. At low speeds that may take awhile, burning CPU time while holding sc_hwmtx lock, also congested.
This is partial revert of r317659. |
340145 |
04-Nov-2018 |
mmacy |
Backport of r338074 - generalize uart_bus_probe and add SNPS support to x86
Submitted by: Rajesh Kumar Differential Revision: https://reviews.freebsd.org/D17381 |
335659 |
26-Jun-2018 |
avg |
MFC r334340: add support for console resuming, implement it for uart, use on x86 |
331886 |
02-Apr-2018 |
gonzo |
MFC r308533 by andrew:
Use ofw_bus_node_is_compatible in more drivers used on arm.
Sponsored by: ABT Systems Ltd |
331885 |
02-Apr-2018 |
gonzo |
MFC r303100 by andrew:
We will be switching to a new arm64 uart cpu driver that handles both FDT and ACPI. As such pull out what will be the common parts of the FDT cpu detection to a new function that can be shared between them.
Reviewed by: manu Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7262 |
331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
329121 |
11-Feb-2018 |
eadler |
MFC r308926:
Add Intel Atom Cherryview SOC HSUART support
PR: 207910 Submitted by: johannes@brilliantservice.co.jp |
322460 |
13-Aug-2017 |
emaste |
MFC r215837: uart: add AX99100 chipset support
PR: 215837 |
319512 |
03-Jun-2017 |
emaste |
MFC r318974: uart: add AMT SOL PCI ID
I adjusted the description to be similar to existing AMT entries.
PR: 219384 Approved by: re (gjb) |
318328 |
16-May-2017 |
mav |
MFC r317659, r317752: Make some UART consoles to not spin wait for data to be sent.
At least with Tx FIFO enabled it shows me ~10% reduction of verbose boot time with serial console at 115200 baud. |
315367 |
16-Mar-2017 |
ian |
MFC r314918, r314919:
Add the pnp id for a Wacom 'WACF00e' tablet.
Update the comment for the Wacom WACF00e to make it clear it's not an accidental duplicate of WACF004.
PR: 217306 |
308373 |
06-Nov-2016 |
jhibbits |
MFC r304970:
Check all compatible strings on uart devices in powerpc
Summary: Some device trees put "fsl,ns16650" first in the compatible list. This causes the probe code to choke, even though the device is compatible with ns16650, and has it listed later in the tree.
Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D7676 |
308324 |
05-Nov-2016 |
mmel |
MFC r302523,r302528:
r302523: Add clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but operates on a specific OF node instead of the pass in device's OF node. r302528: EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions. In some cases, the driver must handle given properties located in specific OF subnode. Instead of creating duplicate set of function, add 'node' as argument to existing functions, defaulting it to device OF node. |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
298955 |
03-May-2016 |
pfg |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
298637 |
26-Apr-2016 |
andrew |
Stop including machine/fdt.h from the fdt uart code, it's unneeded.
Sponsored by: ABT Systems Ltd
|
298632 |
26-Apr-2016 |
br |
Do not include fdt.h on RISC-V.
|
298431 |
21-Apr-2016 |
pfg |
sys: use our nitems() macro when param.h is available.
This should cover all the remaining cases in the kernel.
Discussed in: freebsd-current
|
298411 |
21-Apr-2016 |
pfg |
Remove slightly used const values that can be replaced with nitems().
Suggested by: jhb
|
297793 |
10-Apr-2016 |
pfg |
Cleanup unnecessary semicolons from the kernel.
Found with devel/coccinelle.
|
297496 |
01-Apr-2016 |
jmcneill |
Move support for Synopsys Designware APB UART out of ns8250 and into a separate driver. Add support for activating clock and hwreset resources for these devices when the EXT_RESOURCES option is present.
Reviewed by: andrew, mmel, Emmanuel Vadot <manu@bidouilliste.com> Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5749
|
296082 |
26-Feb-2016 |
wma |
Add ns16550a compatible string in UART 8250 driver
Obtained from: Semihalf Submitted by: Michal Stanek <mst@semihalf.com> Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: imp, wma Differential revision: https://reviews.freebsd.org/D5404
|
295911 |
23-Feb-2016 |
ian |
Stop using the global fdtbus_bs_tag and instead use the tag from the softc that was set up properly at init time.
|
295910 |
23-Feb-2016 |
ian |
This code no longer references fdtbus_bs_tag, no need for a special extern declaration of it for aarch64.
|
295909 |
23-Feb-2016 |
ian |
Now that we have OF_decode_addr(), with proper MD implementations, to obtain the bus space tag and handle for a uart console, use the values returned by that routine to set the global uart_bus_space_mem, instead of assuming that there will be a global variable named fdtbus_bs_tag to set it from.
Also, use OF_getencprop() instead calling fdt32_to_cpu() separately.
|
295662 |
16-Feb-2016 |
andrew |
Allow callers of OF_decode_addr to get the size of the found mapping. This will allow for code that uses the old fdt_get_range and fdt_regsize functions to find a range, map it, access, then unmap to replace this, up to and including the map, with a call to OF_decode_addr.
As this function should only be used in the early boot code the unmap is mostly do document we no longer need the mapping as it's a no-op, at least on arm.
Reviewed by: jhibbits Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5258
|
295557 |
12-Feb-2016 |
mmel |
UART: Fix spurious interrupts generated by ns8250 and lpc drivers: - don't enable transmitter empty interrupt before filling TX FIFO. - add missing uart_barrier() call in interrupt service routine
|
295474 |
10-Feb-2016 |
andrew |
Explicitly include <sys/systm.h>. Previously we were pulling it in due to header pollution.
|
294753 |
25-Jan-2016 |
marius |
- Make the code consistent with itself style-wise and bring it closer to style(9). - Mark unused arguments as such. - Make the ttystates table const.
|
294424 |
20-Jan-2016 |
zbb |
Fix busy-detect when using DesignWare UART
uart_dev_ns8250 now relies on compatible property instead of additional 'busy-detect' cell. All drivers with compatible = "snps,dw-apb-uart" have busy detection turned on. DTS files of devices affected by the change were modified and 'busy-detect' property was removed.
Reviewed by: andrew, ian, imp Obtained from: Semihalf Sponsored by: Stormshield Submitted by: Bartosz Szczepanek <bsz@semihalf.com> Differential revision: https://reviews.freebsd.org/D4218
|
294423 |
20-Jan-2016 |
zbb |
Add compatibility string for dw-apb-uart in ns8250 driver
This compatibility string is used in .dts file of Armada38x and isrequired for driver attachment.
Reviewed by: andrew, ian, imp Obtained from: Semihalf Sponsored by: Stormshield Submitted by: Michal Stanek <mst@semihalf.com> Differential revision: https://reviews.freebsd.org/D4216
|
294362 |
19-Jan-2016 |
marius |
Fix tty_drain() and, thus, TIOCDRAIN of the current tty(4) incarnation to actually wait until the TX FIFOs of UARTs have be drained before returning. This is done by bringing the equivalent of the TS_BUSY flag found in the previous implementation back in an ABI-preserving way. Reported and tested by: Patrick Powell
Most likely, drivers for USB-serial-adapters likewise incorporating TX FIFOs as well as other terminal devices that buffer output in some form should also provide implementations of tsw_busy.
MFC after: 3 days
|
294280 |
18-Jan-2016 |
ian |
Use OF_decode_addr() to create a bus_space tag and handle for the console on FDT/OFW platforms.
After the refactoring of the powerpc code so that OF_decode_addr() is usable on all FDT/OFW platforms, this switches uart(4) to using it.
Differential Revision: https://reviews.freebsd.org/D4675
|
293781 |
12-Jan-2016 |
ian |
Restore uart PPS signal capture polarity to its historical norm, and add an option to invert the polarity in software. Also add an option to capture very narrow pulses by using the hardware's MSR delta-bit capability of latching line state changes.
This effectively reverts the mistake I made in r286595 which was based on empirical measurements made on hardware using TTL-level signaling, in which the logic levels are inverted from RS-232. Thus, this re-syncs the polarity with the requirements of RFC 2783, which is writen in terms of RS-232 signaling.
Narrow-pulse mode uses the ability of most ns8250 and similar chips to provide a delta indication in the modem status register. The hardware is able to notice and latch the change when the pulse width is shorter than interrupt latency, which results in the signal no longer being asserted by time the interrupt service code runs. When running in this mode we get notified only that "a pulse happened" so the driver synthesizes both an ASSERT and a CLEAR event (with the same timestamp for each). When the pulse width is about equal to the interrupt latency the driver may intermittantly see both edges of the pulse. To prevent generating spurious events, the driver implements a half-second lockout period after generating an event before it will generate another.
Differential Revision: https://reviews.freebsd.org/D4477
|
292079 |
11-Dec-2015 |
imp |
Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO building block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number.
Differential Review: https://reviews.freebsd.org/D3461
|
291859 |
05-Dec-2015 |
kevlo |
Remove a duplicate definition.
|
291010 |
18-Nov-2015 |
adrian |
uart(4) - make the 8250 uart baudrate tolerance build time tweakable.
It turns out on a 16550 w/ a 25MHz SoC reference clock you get a little over 3% error at 115200 baud, which causes this to fail.
Just .. cope. Things cope these days.
Default to 30 (3.0%) as before, but allow UART_DEV_TOLERANCE_PCT to be set at build time to change that.
|
287747 |
13-Sep-2015 |
mav |
Add ID for Intel Panther Point KT Controller
Found on ASUS P8Q77-M motherboard.
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
|
287565 |
08-Sep-2015 |
andrew |
Allow us to set the console device tree node. This is needed as not all vendor supplied device trees contain the needed properties for us to select the correct uart to use as the kernel console.
An example of this would be to add the following to loader.conf. hw.fdt.console="/smb/uart@f7113000"
The intention of this is slightly different than the existing hw.uart.console option. The new option will mean the boot serial configuration will be derived from the device node, while the existing option expects the user to configure all this themselves.
Further work is planned to allow the uart configuration to be set based on the stdout-path property devicetree bindings.
Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D3559
|
286668 |
12-Aug-2015 |
marcel |
Add support for the Broadcom TruManage integrated serial port.
PR: 191266
|
286653 |
12-Aug-2015 |
marcel |
Use bus_alloc_resource_any(), rather than bus_alloc_resource() with start 0 and end ~0. This avoids confusion WRT to what the value of length can or should be.
|
286613 |
11-Aug-2015 |
ian |
Style fix, no functional changes -- do the braces for switches correctly.
|
286595 |
10-Aug-2015 |
ian |
Correct the polarity of the PPS assert and clear events with respect to the electrical signals on the serial port. Virtually all devices which output a PPS signal generate a brief higher-voltage pulse, the leading edge of which is the on-time point.
Both DCD and CTS are active-low signals on the wire, meaning the assertion of their status bits in the modem status register corresponds to the lower voltage level on the wire. So when the status bit transitions to not-set, create a PPS assert event; when the status bit transitions to set, create a PPS clear event.
|
286591 |
10-Aug-2015 |
ian |
Allow the choice of PPS signal captured by uart(4) to be runtime-configured, eliminating the need to build a custom kernel to use the CTS signal.
The historical UART_PPS_ON_CTS kernel option is still honored, but now it can be overridden at runtime using a tunable to configure all uart devices (hw.uart.pps_mode) or specific devices (dev.uart.#.pps_mode). The per- device config is both a tunable and a writable sysctl.
This syncs the PPS capabilities of uart(4) with the enhancements recently recently added to ucom(4) for capturing from USB serial devices.
Relnotes: yes
|
286469 |
08-Aug-2015 |
ian |
Provide the tty-layer mutex when initializing the pps api. This allows time_pps_fetch() to be used in blocking mode.
Also, don't init the pps api for system devices (consoles) that provide a custom attach routine. The device may actually be a keyboard or other non- tty device. If it wants to do pps processing (unlikely) it must handle everything for itself. (In reality, only a sun keyboard uses a custom attach routine, and it doesn't make a good pps device.)
|
285843 |
24-Jul-2015 |
marius |
- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling uart_bus_attach() during its test that 20 iterations weren't sufficient for clearing all pending interrupts, assuming this means that hardware is broken and doesn't deassert interrupts. However, under pressure, 20 iterations also can be insufficient for clearing all pending interrupts, leading to a panic as intr_event_handle() tries to schedule an interrupt handler not registered. Solve this by introducing a flag that is set in test mode and otherwise restores pre-r253161 behavior of uart_intr(). The approach of additionally registering uart_intr() as handler as suggested in PR 194979 is not taken as that in turn would abuse special pccard and pccbb handling code of intr_event_handle(). [1] - Const'ify uart_driver_name. - Fix some minor style bugs.
PR: 194979 [1] Reviewed by: marcel (earlier version) MFC after: 3 days
|
285619 |
16-Jul-2015 |
neel |
If uart interrupts are not functioning then schedule the callout to do the polling at device attach time [1].
Add tunables 'debug.uart_force_poll' and 'debug.uart_poll_freq' to control uart polling.
Submitted by: Aleksey Kuleshov (rndfax@yandex.ru) [1]
|
284702 |
22-Jun-2015 |
sbruno |
Add new UART device presented on newer AMT enabled systems/laptops.
Tested on Dell Latitude E7240.
MFC after: 2 weeks Relnotes: yes
|
284623 |
20-Jun-2015 |
marcel |
Add support for the Intel Atom E3800 series SoC (aka Bay Trail).
Sponsored by: XipLink, Inc
|
283773 |
30-May-2015 |
loos |
Actually check the DTS node value to enable the uart quirks.
Without this fix, you cannot disable the quirks by setting it to 0, just the presence of the FDT node was enough to enable it.
|
283276 |
22-May-2015 |
gonzo |
Switch TI platform support code from using FreeBSD's custom-baked DTS files to vendor-provided ones. It should make easier to adopt platform code to new revisions of hardware and to use DTS overlays for various Beaglebone extensions (shields/capes).
Original dts filenames were not changed, they're now wrappers over dts files provided by TI. So make sure you update .dtb files on your devices as part of kernel update
GPIO addressing was changed: instead of one global /dev/gpioc0 there are per-bank instances of /dev/gpiocX. Each bank has 32 pins so for instance pin 121 on /dev/gpioc0 in old addressing scheme is now pin 25 on /dev/gpioc3
On Pandaboard serial console devices was changed from /dev/ttyu0 to /dev/ttyu2 so you'll have to update /etc/ttys to get login prompt on serial port in multiuser mode. Single user mode serial console should work as-is
Differential Revision: https://reviews.freebsd.org/D2146 Reviewed by: rpaulo, ian, Michal Meloun, Svatopluk Kraus
|
281438 |
11-Apr-2015 |
andrew |
Add support for the uart classes to set their default register shift value. This is needed with the pl011 driver. Before this change it would default to a shift of 0, however the hardware places the registers at 4-byte addresses meaning the value should be 2.
This patch fixes this for the pl011 when configured using the fdt. The other drivers have a default value of 0 to keep this a no-op.
MFC after: 1 week
|
281204 |
07-Apr-2015 |
andrew |
Get the fdt uart driver working on arm64, there is no machine/fdt.h, and the default shift should be 2 for the SoCs we support.
Sponsored by: The FreeBSD Foundation
|
281200 |
07-Apr-2015 |
andrew |
Fix uart_fdt_get_clock. It should have beed using the cell variable passed in, not value on the stack.
|
281077 |
04-Apr-2015 |
andrew |
Move uart_fdt_get_clock and uart_fdt_get_shift to uart_bus_fdt.c, we may not build uart_cpu_fdt.c in all configs.
|
281074 |
04-Apr-2015 |
andrew |
Remove the extra copy of uart_fdt_get_clock and uart_fdt_get_shift. While here also use OF_getencprop in uart_fdt_get_clock.
Sponsored by: The FreeBSD Foundation
|
281073 |
04-Apr-2015 |
andrew |
Use OF_getencprop over OF_getprop and fdt32_to_cpu. The latter may give us the wrong data in the failure case if shift was not zero.
Sponsored by: The FreeBSD Foundation
|
280844 |
30-Mar-2015 |
eadler |
And it turns out someone beat me to it....
PR: 199013
|
280843 |
30-Mar-2015 |
eadler |
Add support for "MosChip MCS9922 PCIe to Peripheral Controller" to uart
Submitted by: <mlsemon35@gmail.com> PR: 199013 MFC After: 1 month
|
279724 |
07-Mar-2015 |
ian |
Move the uart_class definitions and fdt compat data into the individual uart implementations, and export them using the new linker-set mechanism.
Differential Revision: https://reviews.freebsd.org/D1993 Submitted by: Michal Meloun
|
279723 |
07-Mar-2015 |
ian |
Define new linker set, UART_FDT_CLASS_AND_DEVICE, for registering full (class and device) FDT UART. Define second one, UART_FDT_CLASS, for UART class only.
This paves the way for declaring uart_class data and ofw/fdt compat data with a uart implementation, rather than needing a big global table of compat data and weak-symbol declarations of every existing implementation.
Differential Revision: https://reviews.freebsd.org/D1992 Submitted by: Michal Meloun
|
279561 |
03-Mar-2015 |
andrew |
Fix the pl011 driver to work when the uart will write in zero cycles. This is the case, depending on the options, in some of the ARM hardware simulators. In these cases we don't get an interrupt so will need to schedule the task to write more data to the uart.
MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
279239 |
24-Feb-2015 |
br |
Enable 'receive timeout' interrupt allowing us to not loose 'rx buffer full' event.
This fixes operation on ARMv8 Foundation Model.
Sponsored by: DARPA, AFRL
|
278292 |
05-Feb-2015 |
jhb |
Add the device ID for the AMT serial port on my Thinkpad T400.
MFC after: 1 week
|
277132 |
13-Jan-2015 |
br |
Rename Exynos UART driver. No functional change.
Submitted by: Michal Meloun <meloun@miracle.cz>
|
277043 |
12-Jan-2015 |
grehan |
Add PCI ID for the Oxford Semiconductor OXPCIe952 device.
Seen on the StarTech "1 Port Native ExpressCard RS232 Serial AdapterCard with 16950 UART"
Reported and tested by: Michael Dexter MFC after: 1 week
|
276351 |
28-Dec-2014 |
marius |
Don't use a sub-device/-vendor wildcard for probing MCS9922 as other chips with the same device and vendor IDs actually may provide different functionality. While at it, canonicalize the description to match other MosChip UARTs.
PR: 186891 MFC after: 3 days
|
275101 |
26-Nov-2014 |
mav |
Add bunch of PCI IDs of Intel Wildcat Point (9 Series) chipsets.
MFC after: 1 week
|
274452 |
12-Nov-2014 |
zbb |
Make uart_bus_fdt a decendant of ofwbus
This will allow to attach UART drivers lying directly on the root node instead of simple-bus compatible bus only.
Obtained from: Semihalf Sponsored by: The FreeBSD Foundation
|
274451 |
12-Nov-2014 |
zbb |
Make PL011 UART to wait on putc only when TX FIFO is full
Instead of waiting for empty TX FIFO it is more reasonable to block on full FIFO. As soon as FIFO slot is free the character can be transmitted. In case of TX FIFO disabled, TXFF bit indicates that transmit register is not empty.
Obtained from: Semihalf Reviewed by: andrew, emaste Sponsored by: The FreeBSD Foundation
|
273761 |
28-Oct-2014 |
araujo |
Drop __DECONST as well as few fixes of style(9).
Phabric: D1012 Suggested by: mjg, jhb Reviewed by: mjg, jhb Sponsored by: QNAP Systems Inc.
|
273576 |
24-Oct-2014 |
araujo |
Fix a leaked Storage Variable.
Phabric: D981 Submitted by: myself Reported by: Coverity CID: 1248848 Reworked by: kevlo Reviewed by: marcel, davide, ray, kevlo Approved by: marcel, kevlo
|
273174 |
16-Oct-2014 |
davide |
Follow up to r225617. In order to maximize the re-usability of kernel code in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols.
Submitted by: kmacy Tested by: make universe
|
273004 |
12-Oct-2014 |
ian |
Use the FIFOs in the imx5/imx6 uart hardware instead of interrupting on each byte sent or received.
|
272602 |
06-Oct-2014 |
ganbold |
Use documented compat string for msm uart. Whilst here use tab instead of spaces.
Approved by: stas (mentor)
|
272399 |
02-Oct-2014 |
ganbold |
Add uart driver for Qualcomm MSM 7000/8000 series chips. It is working on IFC6410 board which has Qualcomm Snapdragon SoC.
Approved by: stas (mentor)
|
272334 |
30-Sep-2014 |
ian |
Return the actual baud rate programmed in the hardware rather than 115200. This allows the "3wire" entry in /etc/ttys (with no speed specified) to work.
|
269131 |
26-Jul-2014 |
marcel |
Do not fail the low-level device probe simply because the kernel doesn't have support for the Z8530. Embedded PowerPC platforms typically don't. Fail when the device class we actually need is not present.
Obtained from: Juniper Networks, Inc.
|
268351 |
07-Jul-2014 |
marcel |
Remove ia64.
This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation
This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h
Discussed at: BSDcan
|
267992 |
28-Jun-2014 |
hselasky |
Pull in r267961 and r267973 again. Fix for issues reported will follow.
|
267985 |
27-Jun-2014 |
gjb |
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as:
1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
|
267961 |
27-Jun-2014 |
hselasky |
Extend the meaning of the CTLFLAG_TUN flag to automatically check if there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel.
Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change.
MFC after: 2 weeks Sponsored by: Mellanox Technologies
|
267712 |
22-Jun-2014 |
jmg |
add support for MosChip MCS9922... This is found on an ExpressCard..
tested to work w/ cu talking to itself (the two ports connected via null modem cable)...
|
266858 |
29-May-2014 |
cognet |
In uart_bus_grab(), use the ier_mask instead of a custom hack for XScale.
Suggested by: jmg
|
266855 |
29-May-2014 |
cognet |
In the grab function, keep the bit 6 on in the IER, on XScale, using 0 turns the UART off, which is unfortunate if one want to use it as a console.
|
266744 |
27-May-2014 |
sbruno |
Add PCI ID for AMT based serial interface found on the Lenovo T61.
uart2: <Intel AMT - PM965/GM965 KT Controller> port 0x1830-0x1837 mem 0xfe024000-0xfe024fff irq 17 at device 3.3 on pci0 uart2: console (115200,n,8,1)
Tested as tty and serial console. Seems "fine"
|
264985 |
26-Apr-2014 |
ian |
Reword a comment block a bit; no functional changes.
|
264983 |
26-Apr-2014 |
ian |
Flesh out imx_uart_init() so that we're not relying on u-boot to init the hardware (meaning uarts other than the console will work).
|
264981 |
26-Apr-2014 |
ian |
The freescale imx uart driver works for the whole i.MX family, so rename the header file to not have "5xx" in the name.
|
264257 |
08-Apr-2014 |
marius |
Distinguish between the different variants and configurations of Sunix {MIO,SER}5xxxx chips instead of treating all of them as PUC_PORT_2S. Among others, this fixes the hang seen when trying to probe the none- existent second UART on an actually 1-port chip.
Obtained from: NetBSD (BAR layouts) MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH
|
264218 |
07-Apr-2014 |
rpaulo |
Use a more professional device description.
|
264175 |
05-Apr-2014 |
marcel |
Do not prevent processes from making changes to the baudrate or the CLOCAL and HUPCL control flags. There are legit reasons for allowing those to be changed. When /etc/ttys has the "3wire" type (without a baudrate) for the serial port that is the low-level console, then this change has no effect.
Obtained from: Juniper Networks, Inc.
|
262996 |
11-Mar-2014 |
marcel |
Pass the actual baudrate to tty_init_console(). This defines the initial baudrate of the device special file, and makes sure that on open(2) the UART is programmed with the correct baudrate. This then eliminates the need in uart_tty_param() to override the speed setting.
|
262932 |
08-Mar-2014 |
imp |
Back out r262921. I don't know what I was thinking, but it is lame.
|
262921 |
08-Mar-2014 |
imp |
Set the baud rate if it isn't 0 (meaning it has been specified) not only if it is 0 (meaning that it hasn't been specified and is likely to turn off the UART's transmitter).
|
262920 |
08-Mar-2014 |
imp |
Make clock optional on uart nodes. It is a FreeBSD-specific extention, and won't be present in vendor supplied dts files.
|
261410 |
02-Feb-2014 |
ian |
Follow r261352 by updating all drivers which are children of simplebus to check the status property in their probe routines.
Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings.
Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper.
|
261092 |
24-Jan-2014 |
imp |
clock-frequency is a FreeBSD-specific extention. Make it optional and allow the client uart drivers to decide if a frequency is required.
|
261083 |
23-Jan-2014 |
imp |
Add Atmel serial drivers.
|
260911 |
20-Jan-2014 |
imp |
Don't lock in the generic grab just to lock again in the specific grabs. (I committed the wrong version of uart_core.c, which still had this).
Pointy hat: imp
|
260890 |
19-Jan-2014 |
imp |
Introduce grab and ungrab upcalls. When the kernel desires to grab the console, it calls the grab functions. These functions should turn off the RX interrupts, and any others that interfere. This makes mountroot prompt work again. If there's more generalized need other than prompting, many of these routines should be expanded to do those new things.
Should have been part of r260889, but waasn't due to command line typo.
Reviewed by: bde (with reservations)
|
260327 |
05-Jan-2014 |
nwhitehorn |
Retire machine/fdt.h as a header used by MI code, as its function is now obsolete. This involves the following pieces: - Remove it entirely on PowerPC, where it is not used by MD code either - Remove all references to machine/fdt.h in non-architecture-specific code (aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat non-arch-specific). - Fix code relying on header pollution from machine/fdt.h includes - Legacy fdtbus.c (still used on x86 FDT systems) now passes resource requests to its parent (nexus). This allows x86 FDT devices to allocate both memory and IO requests and removes the last notionally MI use of fdtbus_bs_tag. - On those architectures that retain a machine/fdt.h, unused bits like FDT_MAP_IRQ and FDT_INTR_MAX have been removed.
|
260326 |
05-Jan-2014 |
ian |
Convert from using fdt_immr style to arm_devmap_add_entry() to make static device mappings.
This SoC relied heavily on the fact that all devices were static-mapped at a fixed address, and it (rather bogusly) used bus_space read and write calls passing hard-coded virtual addresses instead of proper bus handles, relying on the fact that the virtual addresses of the mappings were known at compile time, and relying on the implementation details of arm bus_space never changing. All such usage was replaced with calls to bus_space_map() to obtain a proper bus handle for the read/write calls.
This required adjusting some of the #define values that map out hardware registers, and some of them were renamed in the process to make it clear which were defining absolute physical addresses and which were defining offsets. (The ones that just define offsets don't appear to be referenced and probably serve no value other than perhaps documentation.)
|
259838 |
24-Dec-2013 |
marcel |
Add another HP iLO serial (console) port, found on Itanium servers.
Derived from information provided by: felip.nadal@hob.de
|
259685 |
21-Dec-2013 |
imp |
Plumb the cn_grab and cn_ungrab routines down into the uart clients. Mask RX interrupts while grabbed on the atmel serial driver. This UART interrupts every character. When interrupts are enabled at the mountroot> prompt, this means the ISR eats the characters. Rather than try to create a cooperative buffering system for the low level kernel console, instead just mask out the ISR. For NS8250 and decsendents this isn't needed, since interrupts only happen after 14 or more characters (depending on the fifo settings). Plumb such that these are optional so there's no change in behavior for all the other UART clients. ddb worked on this platform because all interrupts were disabled while it was running, so this problem wasn't noticed. The mountroot> issue has been around for a very very long time.
MFC after: 3 days
|
258806 |
01-Dec-2013 |
nwhitehorn |
Real OF systems have an ihandle under /chosen/stdout, not a phandle. Use the right type.
|
258798 |
01-Dec-2013 |
nwhitehorn |
Make uart_cpu_powerpc work on both FDT and OFW systems. This is the last remaining modification required to build kernels that work with both on PowerPC.
|
258057 |
12-Nov-2013 |
br |
Add support for Freescale Vybrid Family VF600 heterogeneous ARM Cortex-A5/M4 SoC (M4 core is not used in this work).
Support includes device drivers for: - NAND Flash Controller (NFC) - USB Enhanced Host Controller Interface (EHCI) - General-Purpose Input/Output (GPIO) - Universal Asynchronous Receiver/Transmitter (UART)
Also supported: - Generic Interrupt Controller (GIC) - MPCore timer - ffec ethernet driver
Reviewed by: ray Approved by: cognet (mentor)
|
257808 |
07-Nov-2013 |
sbruno |
Add new AMT serial port PCI ID on Intel Lynx Point chipset
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
|
257556 |
02-Nov-2013 |
ian |
Arrange for uart_cpu_fdt's probe() routine to use the same table of compat strings as uart_bus_fdt's probe().
The bus code uses ofw_bus_search_compatible() and that's not an option in cpu (console) code -- it runs way before the ofw routines are usable. So the console probe has its own loop to search the table, but now at least there's only one table to be maintained when new devices are added.
|
257480 |
01-Nov-2013 |
ian |
Convert the if/else list of compatible devices to the table-driven ofw_bus_search_compatible() routine. In addition to converting existing strings to table entries, also add compat strings for the whole imx family.
|
257195 |
26-Oct-2013 |
nwhitehorn |
Try even harder to find a console before giving up.
|
257183 |
26-Oct-2013 |
nwhitehorn |
Be a bit more flexible in how we find the console from the properties on /chosen, following the list of allowed console properties in ePAPR. Also do not require that stdin be defined and equal to stdout: stdin is nonstandard (for ePAPR) and console in an unexpected place is after all better than no console.
|
257170 |
26-Oct-2013 |
zbb |
Wait for DesignWare UART transfers completion before accessing line control
When using DW UART with BUSY detection it is necessary to wait until all serial transfers are finished before manipulating the line control. LCR will not be affected when UART is busy. In addition, if Divisor Latch Access Bit is being set in order to modify UART divisors: 1. We will get BUSY interrupt if interrupts are enabled. 2. Because LCR will not be affected the THR and (even worse) IER contents will be corrupted. This will lead to console hang.
Approved by: cognet (mentor)
|
257157 |
26-Oct-2013 |
nwhitehorn |
machine/pmap.h is included by vm/pmap.h, so is redundant here. Thanks to Alan Cox for pointing this out.
|
257144 |
26-Oct-2013 |
nwhitehorn |
Fix build after r257111 by including headers with definition of pmap_kextract().
|
257111 |
25-Oct-2013 |
ray |
Test UARTs physical address instead of virtual.
|
257045 |
24-Oct-2013 |
ray |
Fix crossed fingers output. Only comment changed.
|
256815 |
20-Oct-2013 |
ian |
Calculate the baud rate divisor rather than using a hard-coded value.
Submitted by: Steven Lawrance <stl@koffein.net>
|
255074 |
30-Aug-2013 |
marcel |
A final test with unmodified code has shown that a delay of 150ms is not giving us a 100% success rate. Bump the delay to 200ms as that seems to do the trick.
Note that during testing the delay was added to uart_bus_attach() in uart_core.c. While having the delay in a different place can change the behaviour, it was not expected. Having to bump the delay with another 50ms could therefore be an indication that the problem can not be solved with delays.
Reported by: kevlo@ Tested by: kevlo@
|
255031 |
29-Aug-2013 |
marcel |
Work-around a timing problem with the ITE IT8513E now that the core calls ns8250_bus_ipend() almost immediately after ns8250_bus_attach(). As it appears, a line break condition is being signalled for almost all received characters due to this. A delay of 150ms seems enough to allow the H/W to settle and to avoid the problem. More analysis is needed, but for now a regression has been addressed.
Reported by: kevlo@ Tested by: kevlo@
|
254598 |
21-Aug-2013 |
ian |
Add support for uarts other than the serial console in TI OMAP SoCs.
The TI uart hardware is ns16550-compatible, except that before it can be used the clocks and power have to be enabled and a non-standard mode control register has to be set to put the device in uart mode (as opposed to irDa or other serial protocols). This adds the extra code in an extension to the standard ns8250 probe routine, and the rest of the driver is just the standard ns8250 code.
|
254597 |
21-Aug-2013 |
ian |
Make the uart ns8250 high-level interface public rather than static. This makes it easier to implement new drivers which are "mostly ns8250" but with some small difference such as needing to enable clocks or poke a non-standard register at probe or attach time.
|
254590 |
21-Aug-2013 |
ian |
Use an if/else sequence rather than unrelated if statements, so that a device compatible with multiple drivers matches the more specific driver first and doesn't overwrite it later with the more generic. Move the generic ns16550 to the end of the list.
|
254589 |
21-Aug-2013 |
ian |
Check for generic ns16550 after all other types. A device may be compatible with 16550 but also have a more specific/capable driver earlier in the list.
|
254534 |
19-Aug-2013 |
ian |
Allow UART_POLL_FREQ to be set as a kernel option as well as via tunable (the code was already set up for this, just needs to be in conf/options).
Also, if reporting that polling is being used, report the frequency too.
|
253654 |
25-Jul-2013 |
marcel |
Set the device description after we call uart_probe(). In uart_probe() we call device-specific probe functions, which can (and typically will) set the device description based on low-level device probe information. In the end we never actually used the device description that we so carefully maintained in the PCI match table. By setting the device description after we call uart_probe(), we'll print the more user- friendly description by default.
|
253161 |
10-Jul-2013 |
marcel |
Protect against broken hardware. In this particular case, protect against H/W not de-asserting the interrupt at all. On x86, and because of the following conditions, this results in a hard hang with interrupts disabled: 1. The uart(4) driver uses a spin lock to protect against concurrent access to the H/W. Spin locks disable and restore interrupts. 2. Restoring the interrupt on x86 always writes the flags register. Even if we're restoring the interrupt from disabled to disabled. 3. The x86 CPU has a short window in which interrupts are enabled when the flags register is written. 4. The uart(4) driver registers a fast interrupt by default.
To catch this case, we first try to clear any pending H/W interrupts and in particular, before setting up the interrupt. This makes sure the interrupt is masked on the PIC. The interrupt handler now has a limit set on the number of iterations it'll go through to clear interrupt conditions. If the limit is hit, the handler will return FILTER_SCHEDULE_THREAD. The attach function will check for this return code and avoid setting up the interrupt and foce polling in that case.
Obtained from: Juniper Networks, Inc.
|
252394 |
29-Jun-2013 |
ray |
Teach UART to attach Exynos/s3/s5 class driver.
Submitted by: Ruslan Bukin <br@bsdpad.com> Reviewed by: gonzo
|
250840 |
21-May-2013 |
marcel |
Add basic support for FDT to i386 & amd64. This change includes: 1. Common headers for fdt.h and ofw_machdep.h under x86/include with indirections under i386/include and amd64/include. 2. New modinfo for loader provided FDT blob. 3. Common x86_init_fdt() called from hammer_time() on amd64 and init386() on i386. 4. Split-off FDT specific low-level console functions from FDT bus methods for the uart(4) driver. The low-level console logic has been moved to uart_cpu_fdt.c and is used for arm, mips & powerpc only. The FDT bus methods are shared across all architectures. 5. Add dev/fdt/fdt_x86.c to hold the fdt_fixup_table[] and the fdt_pic_table[] arrays. Both are empty right now.
FDT addresses are I/O ports on x86. Since the core FDT code does not handle different address spaces, adding support for both I/O ports and memory addresses requires some thought and discussion. It may be better to use a compile-time option that controls this.
Obtained from: Juniper Networks, Inc.
|
250576 |
12-May-2013 |
eadler |
Fix several typos
PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
|
249999 |
27-Apr-2013 |
wkoszek |
Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port.
Submitted by: Thomas Skibo <ThomasSkibo (at) sbcglobal.net> Tested by: wkoszek (ZedBoard) Reviewed by: wkoszek, freebsd-arm@ (no objections raised)
|
249803 |
23-Apr-2013 |
eadler |
Add support for Intel C600/X79 Series Chipset KT Controller.
PR: kern/177072 Submitted by: Kurt Lidl <lidl@pix.net>
|
249765 |
22-Apr-2013 |
nyan |
Build uart_dev_lpc.c on arm only. This fixes pc98 build.
|
248965 |
01-Apr-2013 |
ian |
Fix low-level uart drivers that set their fifo sizes in the softc too late.
uart(4) allocates send and receiver buffers in attach() before it calls the low-level driver's attach routine. Many low-level drivers set the fifo sizes in their attach routine, which is too late. Other drivers set them in the probe() routine, so that they're available when uart(4) allocates buffers. This fixes the ones that were setting the values too late by moving the code to probe().
|
248963 |
31-Mar-2013 |
ian |
Accommodate uart devices with large FIFOs (or DMA buffers which amount to the same thing) by allocating the uart(4) rx buffer based on the device's rxfifosz rather than using a hard-coded size of 384 bytes.
The historical 384 byte size is 3 times the largest hard-coded fifo size in the tree, so use that ratio as a guide and allocate the buffer as three times rxfifosz, but never smaller than the historical size.
|
248557 |
20-Mar-2013 |
ray |
Integrate Efika MX project back to home.
Sponsored by: The FreeBSD Foundation
|
247519 |
01-Mar-2013 |
ganbold |
Add support for A10 uart. A10 uart is derived from Synopsys DesignWare uart and requires to read Uart Status Register when IIR_BUSY has detected. Also this change includes FDT check, where it checks device specific properties defined in dts and sets the busy_detect variable. broken_txfifo is also needed to be set in order to make it work for A10 uart case.
Reviewed by: marcel@ Approved by: gonzo@
|
246300 |
03-Feb-2013 |
marius |
- Make pci_ns8250_ids[] const. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers.
MFC after: 1 week
|
246243 |
02-Feb-2013 |
avg |
uart: add resume method and enable it for attachments on the most common x86 buses
Otherwise the uart hardware could be in such a state after the resume where IER is cleared and thus no interrupts are generated.
This behavior is observed and tested with QEMU, so I am comitting this change to help with my debugging. There has been no feedback from users of serial ports on real hardware.
MFC after: 20 days
|
246016 |
27-Jan-2013 |
cperciva |
Add a loader tunable "hw.broken_txfifo" which enables a workaround for a bug in old versions of QEMU (and Xen, and other places using QEMU code). On those buggy emulated UARTs, the "TX idle" interrupt gets lost; with this workaround, we spinwait for the TX to happen and then send ourselves the interrupt. It's ugly but it works, while minimizing the impact on the code for the !broken_txfifo case.
MFC after: 2 weeks
|
244171 |
13-Dec-2012 |
gonzo |
Prevent possible usage of uninitialized pbase variable by checking return value of fdt_get_range
|
243000 |
13-Nov-2012 |
eadler |
Add support for CIR1000 - Cirrus Logic V34 to the uart driver
Approved by: cperciva (implicit) MFC after: 1 week
|
242583 |
04-Nov-2012 |
eadler |
Add support for a few more devices:
PNP0510 and FUJ02E5 for a "Wacom Tablet at FuS Lifebook T" PNP0502 and PNP0511 for some other generic devices.
PR: kern/173357 Submitted by: Andrey Zakharchenko <avz@jscc.ru> Approved by: cperciva (implicit) MFC after: 1 week
|
242333 |
30-Oct-2012 |
gonzo |
Separate interrupts enable/disable logic from setting port parameters. Otherwise setting baud rate in TTY mode effectively disables TX/RX interrupts and renders port unusable.
|
239919 |
30-Aug-2012 |
gonzo |
Add PrimeCell UART (PL011) driver
Obtained from: Semihalf
|
239278 |
15-Aug-2012 |
gonzo |
Merging of projects/armv6, part 8
r235162:
Initial LPC32x0 support. Includes DTS file for Embedded Artists EA3250 board.
Peripherals currently supported: - Serial ports - Interrupt controller - Timers - Ethernet - USB host - Framebuffer (in conjunction with SSD1289 LCD controller) - RTC - SPI - GPIO
Submitted by: Jakub Wojciech Klama <jceel@freebsd.org>
|
239274 |
15-Aug-2012 |
gonzo |
Merging of projects/armv6, part 4
r233822: Remove useless and wrong piece of code in fdt_get_range() which i overwrites passed phandle_t node. Modify debug printf in fdt_reg_to_rl() to be consistent (that is, print start and end *virtual* addresses).
r230560: Handle "ranges;" Make fdt_reg_to_rl() responsible for mapping the device memory, instead on just hoping that there's only one simplebus, and using fdt_immr_va as the base VA.
r230315 Add a function to get the PA from range, instead of (ab)using fdt_immr_pa, and use it for the UART driver
|
234194 |
12-Apr-2012 |
grehan |
Complete polled-mode operation by using a callout if the device will be used in polled-mode. The callout invokes uart_intr, which rearms the timeout. Implemented for bhyve, but generically useful for e.g. embedded bringup when the interrupt controller hasn't been setup, or if it's not deemed worthy to wire an interrupt line from a serial port.
Submitted by: neel Reviewed by: marcel Obtained from: NetApp MFC after: 3 weeks
|
234118 |
11-Apr-2012 |
marcel |
uart_cpu_amd64.c and uart_cpu_i386.c (under sys/dev/uart) are identical now that the bus spaces are unified under sys/x86. Replace them with a single uart_cpu_x86.c. o delete uart_cpu_i386.c o move uart_cpu_amd64.c to uart_cpu_x86.c o update files.amd64 and files.i386 accordingly.
|
232967 |
14-Mar-2012 |
kib |
Add PCI Id for the AMT SOL UART on G4x series Intel chipsets.
Submitted by: admin zahost ru MFC after: 3 days
|
232639 |
07-Mar-2012 |
remko |
Add support for the MosChip MCS9904 four serial ports controller.
PR: 165804 Submitted by: Eugene Grosbein MFC after: 1 week
|
230327 |
19-Jan-2012 |
eadler |
Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card
PR: kern/131933 Submitted by: Alex Keda <admin@lissyara.su> Approved by: jhb Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 1 week
|
229971 |
11-Jan-2012 |
kib |
Add PCI Id for the AMT SOL UART on 5 series Intel chipsets.
MFC after: 1 week
|
229379 |
03-Jan-2012 |
kevlo |
Add support for Intel EG20T serial ports
|
229272 |
02-Jan-2012 |
ed |
Use strchr() and strrchr().
It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it.
For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel.
|
228983 |
30-Dec-2011 |
marcel |
Actually set the baudrate from the FDT.
|
228947 |
29-Dec-2011 |
kib |
Add PCI Id for the Intel AMT serial interface as found on my DQ67OW.
MFC after: 1 week
|
228631 |
17-Dec-2011 |
avg |
kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.
Current intended meaning of the calls is that the kernel takes control of console input. In the future the semantics may be extended to mean that the calling thread takes full ownership of the console (e.g. console output from other threads could be suspended).
Inspired by: bde MFC after: 2 months
|
228468 |
13-Dec-2011 |
ed |
Replace __const by const in all non-contributed source code.
As C1X is close to being released, there is no need to wrap around a feature that is already part of C90. Most of these files already use `const' in different placed as well.
|
228201 |
02-Dec-2011 |
jchandra |
Fix OF_finddevice error return value in case of FDT.
According to the open firmware standard, finddevice call has to return a phandle with value of -1 in case of error.
This commit is to: - Fix the FDT implementation of this interface (ofw_fdt_finddevice) to return (phandle_t)-1 in case of error, instead of 0 as it does now. - Fix up the callers of OF_finddevice() to compare the return value with -1 instead of 0 to check for errors. - Since phandle_t is unsigned, the return value of OF_finddevice should be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases as well.
Reported by: nwhitehorn
Reviewed by: raj Approved by: raj, nwhitehorn
|
227293 |
07-Nov-2011 |
ed |
Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
|
227032 |
02-Nov-2011 |
cognet |
Disable the TX ready interrupts once we received one, some UART won't clear the IIR_TXRDY bit upon reading.
Reviewed by: marcel
|
225214 |
27-Aug-2011 |
rwatson |
Follow up to r225203 refining break-to-debugger run-time configuration improvements:
(1) Implement new model in previously missed at91 UART driver (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h to opt_kdb.h (spotted by np) (3) Garbage collect now-unused opt_comconsole.h
MFC after: 3 weeks Approved by: re (bz)
|
225203 |
26-Aug-2011 |
rwatson |
Attempt to make break-to-debugger and alternative break-to-debugger more accessible:
(1) Always compile in support for breaking into the debugger if options KDB is present in the kernel.
(2) Disable both by default, but allow them to be enabled via tunables and sysctls debug.kdb.break_to_debugger and debug.kdb.alt_break_to_debugger.
(3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue to behave as before -- only now instead of compiling in break-to-debugger support, they change the default values of the above sysctls to enable those features by default. Current kernel configurations should, therefore, continue to behave as expected.
(4) Migrate alternative break-to-debugger state machine logic out of individual device drivers into centralised KDB code. This has a number of upsides, but also one downside: it's now tricky to release sio spin locks when entering the debugger, so we don't. However, similar logic does not exist in other device drivers, including uart.
(5) dcons requires some special handling; unlike other console types, it allows overriding KDB's own debugger selection, so we need a new interface to KDB to allow that to work.
GENERIC kernels in -CURRENT will now support break-to-debugger as long as appropriate boot/run-time options are set, which should improve the debuggability of BETA kernels significantly.
MFC after: 3 weeks Reviewed by: kib, nwhitehorn Approved by: re (bz)
|
224126 |
17-Jul-2011 |
ed |
Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP.
Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls to support wide characters. I created a patch to add ABI compatibility for the old calls, but I didn't get any feedback to that.
It seems now people are upgrading from 8 to 9 they experience this issue, so add it anyway.
|
223874 |
08-Jul-2011 |
jhb |
Add device ID for the Davicom 56PDV PCI Modem.
PR: kern/75132 Submitted by: Mike Tancsa @ Sentex (older patch against puc(4)) MFC after: 1 week
|
223672 |
29-Jun-2011 |
hselasky |
Add support for a MosChip PCI express serial port adapter.
MFC after: 1 week
|
222317 |
26-May-2011 |
marcel |
Ignore MCR[6] during the probe to fix a false negative. Bit 6 of the MCR register on the Sunix Sun1699 chip tends to be set but doesn't seem to have a function. That is, FreeBSD just works (provided the correct RCLK is used) regardless.
PR: kern/129663 Diagnostics: Eygene Ryabinkin <rea-fbsd at codelabs.ru> MFC after: 3 days
|
221960 |
15-May-2011 |
marius |
Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900.
|
218909 |
21-Feb-2011 |
brucec |
Fix typos - remove duplicate "the".
PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
|
217800 |
24-Jan-2011 |
marcel |
In uart_tty_outwakeup(), check CTS/RTS flow control settings and prevent sending data when CTS is de-asserted. In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal changed, knowing that uart_tty_outwakeup() will do the right thing for flow control. This avoids redundant conditionals.
PR: kern/148644 Submitted by: John Wehle <john@feith.com> MFC after: 3 days
|
217520 |
17-Jan-2011 |
marcel |
Check the environment for system devices before using the FDT. This allows overriding the FDT, and allows specifying a debug port.
|
216592 |
20-Dec-2010 |
tijl |
Merge amd64 and i386 bus.h and move the resulting header to x86. Replace the original amd64 and i386 headers with stubs.
Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere.
Reviewed by: imp (previous version), jhb Approved by: kib (mentor)
|
215034 |
09-Nov-2010 |
brucec |
Fix typos.
PR: bin/148894 Submitted by: olgeni
|
210247 |
19-Jul-2010 |
raj |
Eliminate FDT_IMMR_VA define.
This removes platform dependencies from <machine>/fdt.h for the benfit of portability.
|
209908 |
11-Jul-2010 |
raj |
Convert Freescale PowerPC platforms to FDT convention.
The following systems are affected:
- MPC8555CDS - MPC8572DS
This overhaul covers the following major changes:
- All integrated peripherals drivers for Freescale MPC85XX SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values).
- This includes: LBC, PCI / PCI-Express, I2C, DS1553, OpenPIC, TSEC, SEC, QUICC, UART, CFI.
- Thanks to the common FDT infrastrucutre (fdtbus, simplebus) we retire ocpbus(4) driver, which was based on hard-coded config data.
Note that world for these platforms has to be built WITH_FDT.
Reviewed by: imp Sponsored by: The FreeBSD Foundation
|
209131 |
13-Jun-2010 |
raj |
Convert Marvell ARM platforms to FDT convention.
The following systems are involved:
- DB-88F5182 - DB-88F5281 - DB-88F6281 - DB-78100 - SheevaPlug
This overhaul covers the following major changes:
- All integrated peripherals drivers for Marvell ARM SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values).
- Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say good by to obio / mbus drivers and numerous hard-coded config data.
Note that world needs to be built WITH_FDT for the affected platforms.
Reviewed by: imp Sponsored by: The FreeBSD Foundation.
|
208748 |
02-Jun-2010 |
raj |
FDT (simplebus) compatible attachment for uart(4).
This will be a single uart(4) attachment code shared by all FDT-enabled platforms.
Reviewed by: imp Sponsored by: The FreeBSD Foundation
|
207533 |
02-May-2010 |
marius |
Remove redundant checking of sc_leaving (uart_intr() already handles this).
Approved by: marcel
|
206451 |
10-Apr-2010 |
marius |
Add sbbc(4), a driver for the BootBus controller found in Serengeti and StarCat systems which provides time-of-day services for both as well as console service for Serengeti, i.e. Sun Fire V1280. While the latter is described with a device type of serial in the OFW device tree, it isn't actually an UART. Nevertheless the console service is handled by uart(4) as this allowed to re-use quite a bit of MD and MI code. Actually, this idea is stolen from Linux which interfaces the sun4v hypervisor console with the Linux counterpart of uart(4).
|
204533 |
01-Mar-2010 |
delphij |
Add PCI ID for MCS9901.
Submitted by: gcooper PR: kern/144397 MFC after: 1 month
|
200926 |
23-Dec-2009 |
marius |
Recognize the NS16552 found in PCIe-based sun4u machines.
|
200820 |
21-Dec-2009 |
gavin |
Support the tablet in (at least) the Toshiba Portege M200 Tablet PC. This device only appears on the ACPI bus, so isn't caught by the current entry for it in the uart(4) ISA attachment.
PR: kern/140172 Reviewed by: jhb, marcel Approved by: ed (mentor) MFC after: 2 weeks
|
200257 |
08-Dec-2009 |
mav |
Add ID for NetMos NM9820 Serial Port chip, found on CardBus serial adapter.
|
200230 |
07-Dec-2009 |
marcel |
Add support for the NetMos NM9865 family of Serial/Parallel ports.
Obtained from: NetMos MCS9865 v1.0.0.1 driver MFC after: 3 days
|
199872 |
28-Nov-2009 |
ed |
Remove unneeded includes of <sys/termios.h>.
|
197721 |
02-Oct-2009 |
marcel |
Fix RTS/CTS flow control, broken by the TTY overhaul. The new TTY interface is fairly simple WRT dealing with flow control, but needed 2 new RX buffer functions with "get-char-from-buf" separated from "advance-buf-pointer" so that the pointer could be advanced only when ttydisc_rint() succeeded.
MFC after: 1 week
|
195831 |
23-Jul-2009 |
nwhitehorn |
Fix serial console on Apple Xserve G5 by falling back to input-device-1 if input-device is unavailable. The Xserve G5 defaults to using screen/keyboard for output-device/input-device even if these are not installed, and then falls back to serial ports at boot time.
Reviewed by: marcel Hardware from: grehan Approved by: re (kib)
|
194072 |
12-Jun-2009 |
marcel |
Move the memory layout definitions and logic from mvreg.h to mvwin.h so that it isn't exposured unless needed. In particular this means that it's easier to tune the memory layout based on board details. While here, remove inclusion of <machine/intr.h> from mvreg.h. This also contains exposure to SoC specifics in MI drivers, because NIRQ depends on the SoC.
|
193018 |
29-May-2009 |
ed |
Last minute TTY API change: remove mutex argument from tty_alloc().
I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed.
The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future.
|
190860 |
08-Apr-2009 |
marcel |
Don't use pmap_kextact() when comparing bus handles for Book-E. We typically wire translation to devices with TLB1 entries and pmap_kextract() does not know about those and returns 0. This causes false positives (read: all serial ports suddenly become the console).
|
190834 |
08-Apr-2009 |
marcel |
Fix hangs caused by hardware that signals receive errors (framing, parity, etc), but does not indicate characters being received. Since no chracters have been received, ignore the line errors.
PR: 131006 MFC after: 3 days
|
190681 |
04-Apr-2009 |
nwhitehorn |
Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge mode provided, for example, on the PowerPC 970 (G5), as well as on related CPUs like the POWER3 and POWER4.
This also adds support for various built-in hardware found on Apple G5 hardware (e.g. the IBM CPC925 northbridge).
Reviewed by: grehan
|
189575 |
09-Mar-2009 |
imp |
remove now-redunant cardbus attachment.
|
189407 |
05-Mar-2009 |
jhb |
Add support for the single-port NetMos NM9835 serial adapter. The puc(4) entry is a specific entry to override the generic NetMos entry so that puc(4) will leave this device alone and let uart(4) claim it.
Submitted by: Navdeep Parhar nparhar @ gmail Reviewed by: marcel MFC after: 1 week
|
188472 |
11-Feb-2009 |
kaiw |
Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. The card is a multifunction PCI and report itself as two logical devices.
|
186900 |
08-Jan-2009 |
raj |
De-hard code UART speed setting for Marvell SOCs when hw.uart.console is not specified. Instead, let uart(4) fall back to whatever speed firmware has set.
|
186521 |
27-Dec-2008 |
kan |
Minor style(9) compliance change.
|
185187 |
22-Nov-2008 |
marcel |
Cast to uintptr_t before casting to void*. This allows the QUICC backend to be built on LP64 platforms. This makes it possible to include the QUICC backend in the kernel module.
PR: 127120
|
184208 |
23-Oct-2008 |
ed |
Fix detaching of uart(4) devices.
With our new TTY layer we use a two step device destruction procedure. The TTY first gets abandoned by the device driver. When the TTY layer notices all threads have left the TTY layer, it deallocates the TTY.
This means that the device unit number should not be reused before a callback from the TTY layer to the device driver has been made. newbus doesn't seem to support this concept (yet), so right now just add a destructor with a big comment in it. It's not ideal, but at least it's better than panicing.
Reported by: rnoland
|
183840 |
13-Oct-2008 |
raj |
Introduce basic support for Marvell families of system-on-chip ARM devices:
* Orion - 88F5181 - 88F5182 - 88F5281
* Kirkwood - 88F6281
* Discovery - MV78100
The above families of SOCs are built around CPU cores compliant with ARMv5TE instruction set architecture definition. They share a number of integrated peripherals. This commit brings support for the following basic elements:
* GPIO * Interrupt controller * L1, L2 cache * Timers, watchdog, RTC * TWSI (I2C) * UART
Other peripherals drivers will be introduced separately.
Reviewed by: imp, marcel, stass (Thanks guys!) Obtained from: Marvell, Semihalf
|
182837 |
07-Sep-2008 |
nyan |
Use bus_space_compare() rather than i386_memio_compare() directly.
|
182159 |
25-Aug-2008 |
nyan |
Add the 2nd CCU and PnP devices support on pc98.
Reviewed by: imp Obtained from: //depot/projects/uart with some fixes
|
181905 |
20-Aug-2008 |
ed |
Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following:
- Improved driver model:
The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers.
If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver.
- Improved hotplugging:
With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc).
The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly.
- Improved performance:
One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters.
Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING.
Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
|
179420 |
30-May-2008 |
benno |
The XScale PXA255 has three generally ns16x50 compatible UARTs. One of the variations from normal 16x50 behaviour however is the the use of a normally unused bit of IER to control RX timeout interrupts independently of the generally used RXRDY bit. If this bit is not enabled, we only ever get interrupts when the FIFO is full, never before. This is not very useful when the UART is being used as a console.
In order to support this without causing potential problems on more "normal" 16x50 variants, this change introduces two hints for the uart device, ier_mask and ier_rxbits. These can be used to override which bits get set and cleared when we're enabling and disabling RX interrupts.
Reviewed by: marcel
|
178766 |
04-May-2008 |
peter |
Expand kdb_alt_break a little, most commonly used with the option ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons).
We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it.
The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot.
I've taken my best guess at what the !x86 and non-sio code changes should be.
This also makes sio release its spinlock before calling KDB/DDB.
|
177117 |
12-Mar-2008 |
sam |
add device hints to control the rx FIFO interrupt level on 16550A parts
PR: kern/121421 Submitted by: UEMURA Tetsuya Reviewed by: marcel MFC after: 2 weeks
|
176772 |
03-Mar-2008 |
raj |
Support for Freescale QUad Integrated Communications Controller.
The QUICC engine is found on various Freescale parts including MPC85xx, and provides multiple generic time-division serial channel resources, which are in turn muxed/demuxed by the Serial Communications Controller (SCC).
Along with core QUICC/SCC functionality a uart(4)-compliant device driver is provided which allows for serial ports over QUICC/SCC.
Approved by: cognet (mentor) Obtained from: Juniper MFp4: e500
|
176771 |
03-Mar-2008 |
raj |
Initial support for Freescale PowerQUICC III MPC85xx system-on-chip family.
The PQ3 is a high performance integrated communications processing system based on the e500 core, which is an embedded RISC processor that implements the 32-bit Book E definition of the PowerPC architecture. For details refer to: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8555E
This port was tested and successfully run on the following members of the PQ3 family: MPC8533, MPC8541, MPC8548, MPC8555.
The following major integrated peripherals are supported:
* On-chip peripherals bus * OpenPIC interrupt controller * UART * Ethernet (TSEC) * Host/PCI bridge * QUICC engine (SCC functionality)
This commit brings the main functionality and will be followed by individual drivers that are logically separate from this base.
Approved by: cognet (mentor) Obtained from: Juniper, Semihalf MFp4: e500
|
174898 |
25-Dec-2007 |
rwatson |
Add a new 'why' argument to kdb_enter(), and a set of constants to use for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run.
Assign approximate why values to all current consumers of the kdb_enter() interface.
|
174782 |
19-Dec-2007 |
marcel |
Redefine bus_space_tag_t on PowerPC from a 32-bit integral to a pointer to struct bus_space. The structure contains function pointers that do the actual bus space access.
The reason for this change is that previously all bus space accesses were little endian (i.e. had an explicit byte-swap for multi-byte accesses), because all busses on Macs are little endian. The upcoming support for Book E, and in particular the E500 core, requires support for big-endian busses because all embedded peripherals are in the native byte-order.
With this change, there's no distinction between I/O port space and memory mapped I/O. PowerPC doesn't have I/O port space. Busses assign tags based on the byte-order only. For that purpose, two global structures exist (bs_be_tag and bs_le_tag), of which the address can be taken to get a valid tag.
Obtained from: Juniper, Semihalf
|
169646 |
17-May-2007 |
marcel |
The HP Diva RMP3 uses BAR 0x14.
|
169173 |
01-May-2007 |
marius |
Fix bugs in the Sun -> AT keycode translation table which caused the Props key to act as Again and the Paste and Copy keys to be inverted.
|
168391 |
05-Apr-2007 |
marcel |
Add PCI IDs for the HP RMP3 serial port. This is often used as the serial console.
MFC after: 1 week
|
168285 |
03-Apr-2007 |
marcel |
Don't use a time-limiting loop that's defined in terms of the baudrate in the putc() method. Likewise, in the getc() method, don't check for received characters with an interval defined in terms of the baudrate. In both cases it works equally well to implement a fixed delay. More importantly, it avoids calculating a delay that's roughly 1/10th the time it takes to send/receive a character. The calculation is costly and happens for every character sent or received, affecting low-level console or debug port performance significantly. Secondly, when the RCLK is not available or unreliable, the delays could disrupt normal operation.
The fixed delay is 1/10th the time it takes to send a character at 230400 bps.
|
168281 |
02-Apr-2007 |
marcel |
Don't expose the uart_ops structure directly, but instead have it obtained through the uart_class structure. This allows us to declare the uart_class structure as weak and as such allows us to reference it even when it's not compiled-in. It also allows is to get the uart_ops structure by name, which makes it possible to implement the dt tag handling in uart_getenv(). The side-effect of all this is that we're using the uart_class structure more consistently which means that we now also have access to the size of the bus space block needed by the hardware when we map the bus space, eliminating any hardcoding.
|
168000 |
28-Mar-2007 |
marcel |
For embedded UARTs compatible with the ns8250 family it is possible that the driver clock is identical to the processor or bus clock. This is the case for the PowerQUICC processor. When the clock is high enough, overflows happen in the calculation of the time it takes to send 1/10 of a character, used in delay loops. Fix the overflows so as to fix bugs in the delay loops that can cause either insufficient delays or excessive delays.
|
167999 |
28-Mar-2007 |
marcel |
When we match UARTs found during bus-enumeration with UARTs used for system devices (i.e. console, debug port or keyboard), don't stop after the first match. Find them all and keep track of the last. The reason for this change is that the low-level console is always added to the list of system devices first, with other devices added later. Since new devices are added to the list at the head, we have the console always at the end. When a debug port is using the same UART as the console, we would previously mark the "newbus" UART as a debug port instead of as a console. This would later result in a panic because no "newbus" device was associated with the console. By matching all possible system devices we would mark the "newbus" UART as a console and not as a debug port. While it is arguably better to be able to mark a "newbus" UART as both console and debug port, this fix is lightweight and allows a single UART to be used as the console as well as a debug port with only the aesthetic bug of not telling the user about it also being a debug port.
Now that we match all possible system devices, update the rclk of the system devices with the rclk that was obtained through the bus attachment. It is generally true that clock information is more reliable when obtained from the parent bus than by means of some hardcoded or assumed value used early in the boot. This by virtue of having more context information.
MFC after: 1 month
|
166901 |
23-Feb-2007 |
piso |
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()
o add an int return code to all fast handlers
o retire INTR_FAST/IH_FAST
For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current
Reviewed by: many Approved by: re@
|
166100 |
18-Jan-2007 |
marius |
- Add a uart_rxready() and corresponding device-specific implementations that can be used to check whether receive data is ready, i.e. whether the subsequent call of uart_poll() should return a char, and unlike uart_poll() doesn't actually receive data. - Remove the device-specific implementations of uart_poll() and implement uart_poll() in terms of uart_getc() and the newly added uart_rxready() in order to minimize code duplication. - In sunkbd(4) take advantage of uart_rxready() and use it to implement the polled mode part of sunkbd_check() so we don't need to buffer a potentially read char in the softc. - Fix some mis-indentation in sunkbd_read_char().
Discussed with: marcel
|
163890 |
02-Nov-2006 |
marius |
- In sunkbd_probe_keyboard() don't bother to determine the keyboard layout as we have no use for that info. Instead let this function return the keyboard ID and verify at its invocation in sunkbd_configure() that we're talking to a Sun type 4/5/6 keyboard, i.e. a keyboard supported by this driver. - Add an option SUNKBD_EMULATE_ATKBD whose code is based on the respective code in ukbd(4) and like UKBD_EMULATE_ATSCANCODE causes this driver to emit AT keyboard/KB_101 compatible scan codes in K_RAW mode as assumed by kbdmux(4). Unlike UKBD_EMULATE_ATSCANCODE, SUNKBD_EMULATE_ATKBD also triggers the use of AT keyboard maps and thus allows to use the map files in share/syscons/keymaps with this driver at the cost of an additional translation (in ukbd(4) this just is the way of operation). - Implement an option SUNKBD_DFLT_KEYMAP, which like the equivalent options of the other keyboard drivers allows to specify the default in-kernel keyboard map. For obvious reasons this made to only work when also using SUNKBD_EMULATE_ATKBD. - Implement sunkbd_check(), sunkbd_check_char() and sunkbd_clear_state(), which are also required for interoperability with kbdmux(4). - Implement K_CODE mode and FreeBSD keypad compose. - As a minor hack define KBD_DFLT_KEYMAP also in the !SUNKBD_EMULATE_ATKBD case so we can obtain fkey_tab from <dev/kbd/kbdtables.h> rather than having to duplicate it and #ifdef some more code. - Don't use the TX-buffer for writing the two command bytes for setting the keyboard LEDs as this consequently requires a hardware FIFO that is at least two bytes in depth, which the NMOS-variant of the Zilog SCCs doesn't have. Thus use an inlined version of uart_putc() to consecutively write the command bytes (a cleaner approach would be to do this via the soft interrupt handler but that variant wouldn't work while in ddb(4)). [1] - Fix some minor style(9) bugs.
PR: 90316 [1] Reviewed by: marcel [1]
|
162711 |
27-Sep-2006 |
ru |
Fix our ioctl(2) implementation when the argument is "int". New ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls.
Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64.
Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week
|
162424 |
18-Sep-2006 |
emax |
Do not try to call keyboard callback unless keyboard is active and busy. This should fix 'kbdcontrol -K < /dev/console' panic on sparc64 with sunkbd(4).
PR: sparc64/96798 MFC after: 1 week
|
160731 |
27-Jul-2006 |
marcel |
Properly propagate overrun conditions to the TTY layer.
MFC after: 3 days
|
160717 |
26-Jul-2006 |
marcel |
On PowerPC the clock for the BRG comes from RTxC, not PCLK. Add a quick hack to deal with this. We may need to formalize this better and have this information come from the bus attachments.
|
160716 |
26-Jul-2006 |
marcel |
Implement UART_IOCTL_BAUD for the Z8530. This allows a serial console on PowerPC use the current setting of the hardware and not second guess what the OFW does on various machines.
|
160715 |
26-Jul-2006 |
marcel |
Implement uart_cpu_eqres() and uart_cpu_getdev(). This allows FreeBSD to use a serial console, as per the OFW settings.
|
158960 |
26-May-2006 |
phk |
Convert to new console api
|
158950 |
26-May-2006 |
phk |
Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.
Use polling behaviour for gdb_getc() where convenient, this edges us closer to the console code.
|
158862 |
23-May-2006 |
marcel |
Remove definitions of uart_[gs]etdreg. They are not used anymore and were in fact wrong.
|
158849 |
23-May-2006 |
benno |
The lcr variable in ns8250_probe is now unused. Remove it.
Missed by: benno
|
158844 |
23-May-2006 |
benno |
Allow uart(4)'s ns8250 driver to work with devices whose regshift is > 0.
- Rename REG_DL to REG_DLL and REG_DLH. - Always treat DLL and DLH as two separate 8-bit registers instead of one 16-bit register.
Additionally, remove the probe for the high 4 bits of IER being 0 and don't assume we can always read/write 0 to/from those bits.
These changes allow uart(4) to drive the UARTs on the Intel XScale PXA255.
Reviewed by: marcel
|
158504 |
12-May-2006 |
marcel |
o A divisor of 0 is perfectly valid. Reserve -1 for an invalid divisor. This allows us to set the line speed to the maximum of 1/4 of the device clock. o Disable the baudrate generator before programming the line settings, including baudrate, and enable it afterwards.
|
158458 |
11-May-2006 |
jhb |
First pass at removing Alpha kernel support.
|
158124 |
28-Apr-2006 |
marcel |
Rewrite of puc(4). Significant changes are: o Properly use rman(9) to manage resources. This eliminates the need to puc-specific hacks to rman. It also allows devinfo(8) to be used to find out the specific assignment of resources to serial/parallel ports. o Compress the PCI device "database" by optimizing for the common case and to use a procedural interface to handle the exceptions. The procedural interface also generalizes the need to setup the hardware (program chipsets, program clock frequencies). o Eliminate the need for PUC_FASTINTR. Serdev devices are fast by default and non-serdev devices are handled by the bus. o Use the serdev I/F to collect interrupt status and to handle interrupts across ports in priority order. o Sync the PCI device configuration to include devices found in NetBSD and not yet merged to FreeBSD. o Add support for Quatech 2, 4 and 8 port UARTs. o Add support for a couple dozen Timedia serial cards as found in Linux.
|
158119 |
28-Apr-2006 |
marcel |
Implement the ipend() method of the serdev I/F.
|
158078 |
27-Apr-2006 |
marcel |
o Add 5 Timedia single port serial cards. o While here, break long lines.
|
158069 |
27-Apr-2006 |
marcel |
Use 115200 and not 9600 as the initial baudrate. This speeds up detection of the FIFO size. Especially for large FIFOs.
|
158064 |
27-Apr-2006 |
marcel |
o Add 2 HP Diva single port UARTs.
|
158058 |
26-Apr-2006 |
marcel |
o Add 2 NEC cards o Add 2 Dell cards o Add Quatech card o Add support for non-standard rclk values. o Update descriptions to match PCI id database.
|
157989 |
23-Apr-2006 |
marcel |
MFp4: Calculate the divisor before setting the DLAB bit. This prevents that there's a control flow that leaves the DLAB bit set.
|
157451 |
04-Apr-2006 |
marcel |
In z8530_divisor() return 0 if the calculated divisor is less than 0. This happens when the baudrate is too high for the given RCLK.
|
157420 |
02-Apr-2006 |
marcel |
Remove unused variable 'error'. Forgotten in previous commit.
|
157419 |
02-Apr-2006 |
marcel |
Don't claim a SAB82532. We have scc(4) for that.
|
157418 |
02-Apr-2006 |
marcel |
Eliminate the sc_hasfifo flag from the softc. It was only used by the NS8250 class driver. The UART has FIFOs if sc_rxfifosz>1, so test for that instead. While here properly initialize sc_rxfifosz and sc_txfifosz in the case the UART doesn't have FIFOs.
|
157380 |
01-Apr-2006 |
marcel |
Don't hold the hardware mutex across getc(). It can wait indefinitely for a character to be received. Instead let getc() do any necesary locking.
|
157317 |
31-Mar-2006 |
marcel |
Allow uart(4) to be built on PowerPC.
|
157300 |
30-Mar-2006 |
marcel |
Add support for scc(4).
|
157299 |
30-Mar-2006 |
marcel |
Add scc(4), a driver for serial communications controllers. These controllers typically have multiple channels and support a number of serial communications protocols. The scc(4) driver is itself an umbrella driver that delegates the control over each channel and mode to a subordinate driver (like uart(4)). The scc(4) driver supports the Siemens SAB 82532 and the Zilog Z8530 and replaces puc(4) for these devices.
|
157277 |
30-Mar-2006 |
marcel |
Don't open if we're going away.
|
155973 |
24-Feb-2006 |
marcel |
Replace our local UART_SIGMASK_* with the global SER_MASK_*.
|
155972 |
24-Feb-2006 |
marcel |
When we probe a SAB82532, return BUS_PROBE_GENERIC. This allows puc(4) or scc(4) to grab the device by default. In fact, we probably shouldn't even claim the device at all...
|
155971 |
24-Feb-2006 |
marcel |
MFp4: Stop using our local UART_IPEND_* and instead use the global SER_INT_* as defined in <sys/serial.h>.
|
155921 |
22-Feb-2006 |
jhb |
- Use bus_setup_intr() and bus_teardown_intr() to register device driver interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR(). Uses of the BUS_*() versions in the implementation of foo_intr methods in bus drivers were not changed. Mostly this just means that some drivers might start printing diagnostic messages like [FAST] when appropriate as well as honoring mpsafenet=0. - Fix two more of the ppbus drivers' identify routines to function correctly in the mythical case of a machine with more than one ppbus.
|
155322 |
04-Feb-2006 |
marius |
- Add support for using LOM (Lights Out Management) and RSC (Remote System Control) devices as console. These are microcontrollers which are either on-board or part of an add-on card and provide terminal server, remote power switch and monitoring functionality. For console usage these are connected to the rest of the system via a SCC or an UART. This commit adds support for the following variants (corresponds to what 'input-device' and 'output-device' have to be set to): rsc found on-board in E250 and supposedly some Netra, connected via a SAB82532, com. parameters can be determined via OFW rsc-console RSC card found in E280R, Fire V4x0, Fire V8x0, connected via a NS16550, hardwired to 115200 8N1 lom-console LOMlite2 card found in Netra 20/T4, connected via a NS16550, hardwired to 9600 8N1
- Add my copyright to uart_cpu_sparc64.c as I've rewritten about one third of that file over time.
Tested on: E250, E280R Thanks to: dwhite@ for providing access to an E280R OK'ed by: marcel MFC after: 1 week
|
153363 |
12-Dec-2005 |
imp |
Make uart_getenv() not be ns8250 dependent. This will allow, in the future, compilation of kernels without ns8250 support but using the uart framework. These kernels will be for machines where size matters more, so including code that can never be executed is undesriable...
|
151792 |
28-Oct-2005 |
marcel |
In uart_bus_probe() return BUS_PROBE_DEFAULT when the probe is successful.
|
151791 |
28-Oct-2005 |
marcel |
o Style(9) nits o Fix typo in comment o s/-100/BUS_PROBE_GENERIC/ o s/err/error/ for consistency o Remove non-applicable comment o Allow uart_bus_probe() to return the predefined BUS_PROBE_* contants. In this case: explicitly test for error > 0.
|
151790 |
28-Oct-2005 |
marcel |
Allow uart_bus_probe() to return the predefined BUS_PROBE_* constants. In this case: just return what uart_bus_probe() returns.
|
151700 |
26-Oct-2005 |
jhb |
- Use swi_remove() to teardown swi handlers rather than intr_event_remove_handler(). - Remove tty: prefix from a couple of swi handler names.
|
151682 |
26-Oct-2005 |
marcel |
Remove PCI IDs for multiport cards: o Oxford Semiconductor PCI Dual Port Serial o Netmos Nm9845 PCI Bridge with Dual UART
Add PCI IDs for single-port cards: o Various SIIG Cyber Serial o Oxford Semiconductor OXCB950 UART
Update description as per puc(4).
|
151658 |
25-Oct-2005 |
jhb |
Reorganize the interrupt handling code a bit to make a few things cleaner and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes)
Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel)
|
151383 |
16-Oct-2005 |
phk |
Eliminate two unused arguments to ttycreate().
|
150440 |
21-Sep-2005 |
imp |
Remove OLDCARD shims
|
149111 |
15-Aug-2005 |
marius |
- Change the code that determines whether to use a serial console and which serial device to use in that case respectively to not rely on the OFW names of the input/output and stdin/stdout devices. Instead check whether input and output refers to the same device and is of type serial (uart(4) was already doing this) and for the fallback to a serial console in case a keyboard is the selected input device but unplugged do the same for stdin and stdout in case the input device is nonexistent (PS/2 and USB keyboards) or has a 'keyboard' property (RS232 keyboards). Additionally also check whether the OFW did a fallback to a serial console in the same way in case the output device is nonexistent. While at it save on some variables and for sys/boot/sparc64/loader/metadata.c move the code in question to a new function md_bootserial() so it can be kept in sync with uart_cpu_getdev_console() more easily. This fixes selecting a serial console and the appropriate device when using a device path for the 'input-device' and 'output-device' OFW environment variables instead of an alias for the serial device to use or when using a screen alias that additionally denotes a video mode (like e.g. 'screen:r1024x768x60') but no keyboard is plugged in (amongst others). It also makes the code select a serial console in case the OFW did the same due to a misconfiguration like both 'input-device' and 'output-device' set to 'keyboard' or to a nonexisting device (whether the OFW does a fallback to a serial console in case of a misconfiguration or one ends up with just no console at all highly depends on the OBP version however). - Reduce the size of buffers that only ever need to hold the string 'serial' accordingly. Double the size of buffers that may need to hold a device path as e.g. '/pci@8,700000/ebus@5/serial@1,400000:a' exceeds 32 chars. - Remove the package handle of the '/options' node from the argument list of uart_cpu_getdev_dbgport() as it's unused there and future use is also unlikely.
MFC after: 1 week
|
148824 |
07-Aug-2005 |
marius |
Recognize the SAB82532 in USIII machines.
|
147423 |
16-Jun-2005 |
marcel |
Some chipset drivers redefine the busspace_isa_{io|mem} tags. This not only means that it's possible (though unlikely) that we hand out differing tags for the same bus space, it also means that the tags we handed out are not used during bus enumeration. Both affect our ability to compare tags. Fix the first by initializing our tags only once. Fix the second by testing if one of the tags to compare is our tag and the other is a busspace_isa_{io|mem} tag and declare them equal if so.
This fixes using uart(4) as the serial console on a ds10. That is, the low-level console worked, but we could not match the resources to one of the UARTs found during bus enumeration, which prevented uart(4) from becoming the console in single- or multi-user mode.
Approved by: re (kensmith) MFC after: 2 days Thanks to: all involved in getting a ds10 to me; directly or indirectly. Special thanks to: Dave Knight, ISC (for not scratching my Porsche :-)
|
146975 |
04-Jun-2005 |
marius |
Replace the band-aid for allowing to call sunkbd_configure() multiple times which was added in the last revision with what should be a proper solution as long as keyboards that were pluggged in after the kernel has fully booted aren't supported. I.e. when sunkbd_configure() is called for the high-level console probe make sure that the keyboard is both successfully configured (i.e. also probed) and attached. The band- aid left the possibility to attach the keyboard device to the high-level console without attaching the keyboard device itself when the keyboard is plugged in after uart(4) attached but before syscons(4) does.
|
146974 |
04-Jun-2005 |
marius |
On AXi and AXmp boards the NS16550 (used to connect keyboard and mouse) share their IRQ lines with the i8042. Any IRQ activity (typically during attach) on the NS16550 used to connect the keyboard when actually the PS/2 keyboard is selected in OFW causes interaction with the OBP i8042 driver resulting in a hang (and vice versa). As RS232 keyboards and mice obviously aren't meant to be used in parallel with PS/2 ones on these boards don't attach to these NS16550 in case the RS232 keyboard isn't selected in order to prevent such hangs.
Ok'ed by: marcel
|
146972 |
04-Jun-2005 |
marius |
Change the semantics of uart_cpu_getdev_keyboard() to only match SCCs/ UARTs used to connect keyboards and not also PS/2 keyboards and only return their package handle in case the keyboard is the preferred one according to the OFW but otherwise still regardless of whether the keyboard is used for stdin or not. This is simply achieved by looking at the 'keyboard' alias and returning the corresponding package handle in case it refers to a SCC/UART. This is change is done in order to give the keyboard which the OFW or the user selected in OFW on boards that support additional types of keyboards besides the RS232 ones also preference in FreeBSD. It will be also used to determine on Sun AXi and Sun AXmp boards whether a PS/2 or a RS232 is to be used as these are sort of mutual exclusive there (see upcoming commit to uart_bus_ebus.c). Note that Tatung AXi boards have the same issue but the former code happened to already give the PS/2 keyboard preference by not identifying the respective UART as keyboard system device there because the PS/2 keyboard node precedes the keyboard UART one in the OFW device tree of these boards (which isn't the case for the Sun AXi).
Ok'ed by: marcel
|
146475 |
21-May-2005 |
marius |
- Sprinkle some KBD_IS_* and KBD_*_DONE macros in sunkbd_configure() as a band-aid allowing to call this function savely multiple times, e.g. during sckbdprobe() and sc_probe_unit(). Otherwise calling it a second time results in a non-working keyboard. This needs a lot of more work to actually do the right thing and work like expected. - Let sunkbd_configure() return the number of the found keyboards, i.e. 1 in case probing succeeds, as it's expected. The return values of the keyboard configure functions however currently aren't checked so this doesn't make a difference at the moment. - Use FBSDID.
|
146013 |
08-May-2005 |
marcel |
In uart_cnprobe(), fill in the cn_name field of the consdev structure. The core console code checks this field when a console is added and emits a warning if it's empty. In practice the warning is harmless for uart(4), because the cn_name is filled in as soon as the device name is known; which is when the device is enumerated. To avoid the warning, to avoid possible complications caused by emitting the warning without there (possibly) being a console selected yet and to avoid complications when the UART isn't found during bus enumeration, we just preset the cn_name field here to the name of the driver.
|
145603 |
27-Apr-2005 |
marcel |
Make the Z8530 more reliable as low-level console by making use of the fact that access to RR0 does not need a prior write to the register index because the index always reverts to 0 after the indexed register has been accessed.
Typically when a RR or WR is to accessed, one programs the index (which is a write to the control register), followed by a read or write to the actual indexed register (a read pr write to the same control register). When this non-atomic sequence is interrupted after having written the index and low-level console I/O is done in that situation, the write to program the index will actually write to the indexed register and nuke state. This almost always yields a wedge.
By not programming the index register and instead just reading from RR0, the worst case scenario is non-fatal. For if we don't actually read from RR0 but some other register we get an invalid status, which may lead us to conclude that the transit data register is empty when it's not or that the receive data register contains data when it doesn't. Hence, we may lose an output character or get a sporadic input character, but given the situation this is a non-issue.
Full serialization is not possible due to the fact that this code needs to work from DDB and before mutex initialization has happened.
In collaboration with: kris@, marius@ Tested by: kris@ MFC after: 1 day X-MFC: 5.4-RELEASE candidate
|
143468 |
12-Mar-2005 |
marius |
In uart_cpu_getdev_console() when determinig whether we should use a serial console anyway because input-device is set to keyboard and output-device is set to screen but no keyboard is plugged in don't assume that a device node for the input-device alias exists. While this is true for RS232 keyboards (the node of the SCC and UART respectively which controls the keyboard doesn't disappear when no keyboard is plugged in) this assumption breaks for USB keyboards. It's most likely also not true for PS/2 keyboards but OFW doesn't reliably switch to a serial console when the potential keyboard is a PS/2 one which isn't plugged in so this couldn't be verified properly.
Reported by: Will Andrews <will@csociety.org>, obrien MFC after: 1 week
|
143025 |
02-Mar-2005 |
marius |
- Allocate the interrupt resource as RF_SHAREABLE allowing uart(4) to work with shared IRQs in case the bus code, MD interrupt code, etc. permits. Together with sys/sparc64/sparc64/intr_machdep.c rev. 1.21 this fixes an endless loop in uart_intr() when using the second NS16550 on the ISA bus of sparc64 machines. - Destroy the hardware mutex on detach and in case attaching fails.
Approved by: marcel
|
141753 |
12-Feb-2005 |
marius |
- Re-write OF_decode_addr() with a bus-neutral approach, adding support for nodes hanging off of Central (untested), FireHose (untested) and PCI (tested) busses. - Add an additional parameter to OF_decode_addr() which specifies the index of the register bank to decode.
These should allow to eventually add support for the Z8530 hanging off of FireHose to uart(4) and to write support for PCI-based graphics adapters.
Suggested by: tmm (back in '03)
|
141081 |
31-Jan-2005 |
marcel |
Add the keyboard system device before we probe for the keyboard. The presence or absence of a keyboard does not change whether an UART is designed as a keyboard port or not and thus whether we can use the port as a TTY or not. We now call sunkbd_attach() even when we didn't previously find a keyboard. Emit a useful message stating that no keyboard was found, but don't do anything else.
MFC after: 5 days
|
141069 |
30-Jan-2005 |
marcel |
Fix a logic bug that caused DSR to never be deasserted.
MFC after: 5 days
|
141032 |
30-Jan-2005 |
marcel |
o Fix the various interrupt related problems caused by reverse engineering the pending interrupt sources from the current state of the controller. For channel A we can always read the interrupt pending register (RR3). For channel B we can read the interrupt vector register (RR2) because it contains the modified vector and thus includes the interrupt source. Since we currently need puc(4) for the Z8530, we know that the interrupt handler for both channels will be called and thus that RR3 will always be read at least once, even if ch A has no pending interrupt. NOTE: The modified interrupt vector has no value that represent a lack of pending interrupt for channel B. That is, the value read when no interrupts are pending is the same as the value for the special receive condition. Fortunately, we don't actually have to depend on that interrupt source. This does mean that we need to properly handle the overflow condition, when we read received character from the chip. o The DSR signal is represented by the SYNC bit in the external status register (RR0). We now properly track DSR. o It's save to enable the external/status interrupt source. We now get interrupts when line signals (DSR, DCD or CTS) change.
Problems fixes: o interrupt storms. o blocked open(2). o lack of (hardware) flow control. o unable to report DSR.
MFC after: 5 days
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
138543 |
08-Dec-2004 |
marcel |
Don't obtain the HCDP address directly from the bootinfo structure. Use a function to keep the details at arms length from uart(4).
|
138157 |
28-Nov-2004 |
marius |
- Don't blindly use the return value of uart_cpu_channel() to calculate the address of a channel on a SCC, it returns 0 on failure. [1] - Hardcode channel 1 for the keyboard on Z8530, the information present in the Open Firmware device tree doesn't allow to determine this via uart_cpu_channel(). This makes the keyboard (if one backs out rev. 1.5 of sys/dev/puc/puc_sbus.c and has both keyboard and mouse plugged in to avoid the hang that revision works around) and consequently syscons(4) on Ultra 2 work. There's a problem with the keyboard LEDs similar to the one on Ultra 60 (LEDs don't get lit under X) though, instead of lighting just a specific single one all get lit and can't be turned off again. [1] - Add comments about what uart_cpu_channel() and uart_cpu_getdev_keyboard() do and their constraints. - Improve the comments about what uart_cpu_getdev_[console,dbgport]() do, they don't return an address (as in bus) but an Open Firmware package handle.
Reviewed by: marcel (modulo the comments) [1]
|
137972 |
21-Nov-2004 |
nyan |
uart_i8251_ops is gone.
|
137957 |
21-Nov-2004 |
marcel |
o Support for the i8251 wasn't there. Remove the files. o Remove the headers with IC register definitions. The headers are now taken from sys/dev/ic
|
137956 |
21-Nov-2004 |
marcel |
Include the header with the register definitions from sys/dev/ic. They are shared now.
|
137949 |
20-Nov-2004 |
marcel |
Include the common <dev/ic/ns16550.h> instead of the private <dev/uart_dev_ns8250.h>. The latter can be removed now.
|
137826 |
17-Nov-2004 |
marius |
Remove the whole uart_cpu_identify() stuff again. Now that it's no longer used on sparc64 they are only stubs on all architectures and it doesn't look like if we would need it in the near future again.
Ok'ed by: marcel
|
137819 |
17-Nov-2004 |
marius |
o sparc64/isa/isa.c: - The claim in the commit log of rev. 1.11 of dev/uart/uart_cpu_sparc64.c etc. that UARTs are the only relevant ISA devices on sparc64 turned out to be false. While there are sparc64 models where UARTs are the only devices on the ISA bus there are in fact also low-cost models where all devices traditionally found on the EBus are hooked up to the ISA bus. There are also models that use a mix between EBus and ISA devices with things like an AT keyboard controller and other rather interesting devices that we might want to support in the futute hook up to the ISA bus. In order to not need to add sparc64 specific device_identify methods to all of the respective ISA drivers and also not add OFW specific code to the common ISA code make the sparc64 ISA bus code fake up PnP devices so most ISA drivers probe their devices without further changes. Unfortunately Sun doesn't adhere to the ISA bindings defined in IEEE 1275-1994 for the properties of most of the ISA devices which would allow to obtain the vendor and logical IDs from their properties. So we we just use a simple table which maps the name properties to PnP IDs. This could be done in a more sophisticated way but I courrently don't see the need for this. [1] - Add the children with fully mapped and specified resources (in the OFW sense) similar to what is done in the EBus code for the IRQ resources of the children as adjusting the resources and the resource list entries respectively in isa_alloc_resource() as done perviously causes trouble with drivers which use rman_get_start(), pass-through or allocate and release resources multiple times, etc. Adjusting the resources might be better off in a bus_activate_resource method but the common ISA code currently doesn't allow for an isa_activate_resource(). [2] With this change: - ppbus(4) and lpt(4) attach and work (modulo ECP mode, which requires real ISADMA code but it currently only consists of stubs on sparc64). - atkbdc(4) and atkbdc(4) attach, no further testing done. - fdc(4) itself attaches but causes a hang while attaching fd0 also when is DMA disabled, further work in fdc(4) is required here as e.g. fd0 uses the address of fd1 on sparc64 (not sure if sparc64 supports more than one floppy drive at all). All of these drivers previously caused panics in the sparc64 ISA code. - Minor changes, e.g. use __FBSDID, remove a dupe word in a comment and declare one global variable which isn't used outside of isa.c static. o dev/uart/uart_cpu_sparc64.c and modules/uart/Makefile: - Remove the code for registering the UARTs on the ISA bus from the sparc64 uart_cpu_identify() again and rely on probing them via PnP.
Original idea by: tmm [1] No objections by: tmm [1], [2]
|
137709 |
15-Nov-2004 |
marcel |
Be slightly more paranoid about using the divisor in a division and the calculated baudrate. Neither should be 0.
|
137707 |
14-Nov-2004 |
marcel |
Implement UART_IOCTL_BAUD. Consequently, when the baudrate was unset for the console, we emit the actual baudrate during bus enumeration.
|
137706 |
14-Nov-2004 |
marcel |
Add UART_IOCTL_BAUD to allow us to query the hardware about the current baudrate setting. Use this ioctl() when we don't know the baudrate of the sysdev (as represented by a 0 value). When the ioctl() fails, e.g. when the backend hasn't implemented it or the hardware doesn't provide the means to determine its current baudrate setting, we invalidate the baudrate setting by setting it to -1. None of the backends currently implement the new ioctl().
|
137704 |
14-Nov-2004 |
marcel |
Make sure the baudrate specified with the BR tag is somewhat sane. A baudrate we consider insane is silently replaced with 0. When the baudrate is 0, we will not try to program the hardware. Instead we leave the communication speed unaltered, maximizing the chance to have a working console. Obviously this means we allow specifying a 0 baudrate for exactly that purpose.
|
136453 |
12-Oct-2004 |
phk |
Remove asserts which are not correct if the port is a tty.
|
136421 |
12-Oct-2004 |
phk |
Use generic tty code instead of (comparatively little) local copies.
|
135429 |
18-Sep-2004 |
phk |
Use tty->t_sc to find out softc.
|
135367 |
17-Sep-2004 |
phk |
Use ttyalloc() instead of ttymalloc(NULL)
|
134312 |
25-Aug-2004 |
marius |
Don't call uart_bus_probe() for non-matching PnP-devices. Trying to probe the keyboard controller with uart_bus_probe() caused a hang here on an i386 machine.
Approved by: marcel
|
133738 |
15-Aug-2004 |
marius |
Fix a style(9) bug (variable definitions inside a nested scope) a patch of mine introduced in revision 1.10.
Approved by: marcel Prodded by: marcel
|
133735 |
14-Aug-2004 |
marius |
- Introduce an uart_cpu_identify() which is implemented in uart_cpu_<arch>.c and that can be used as an identify function for all kinds of busses on a certain platform. Expect for sparc64 these are only stubs right now. [1] - For sparc64, add code to its uart_cpu_identify() for registering the on- board ISA UARTs and their resources based on information obtained from Open Firmware. It would be better if this would be done in the OFW ISA code. However, due to the common FreeBSD ISA code and PNP-IDs not always being present in the properties of the ISA nodes there seems to be no good way to implement that. Therefore special casing UARTs as the sole really relevant ISA devices on sparc64 seemed reasonable. [2]
Approved by: marcel Discussed with: marcel [1], tmm [2] Tested by: make universe
|
133589 |
12-Aug-2004 |
marius |
- Introduce an ofw_bus kobj-interface for retrieving the OFW node and a subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit.
Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386
|
133220 |
06-Aug-2004 |
marcel |
Do not use hardware flow control for the moment. There are some issues with it that need to be understood better before they can be resolved. This takes time and time is already in short supply.
Reported & tested by: glebius@
|
132650 |
26-Jul-2004 |
marcel |
When sizing the FIFO, don't count all the way up to 1030 if any FIFO size larger than 128 is considered an incompatible size. Stop counting when we reach 130 in the loop.
|
132226 |
15-Jul-2004 |
phk |
Preparation commit for the tty cleanups that will follow in the near future:
rename ttyopen() -> tty_open() and ttyclose() -> tty_close().
We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
|
131921 |
10-Jul-2004 |
marcel |
Update for the KDB framework: o Call kdb_enter() instead of breakpoint(). o Call kdb_alt_break() instead of db_alt_break(). o Make debugging code conditional upon KDB instead of DDB.
|
131901 |
10-Jul-2004 |
marcel |
Add support for uart(4) being a debug port for the GDB backend.
|
131373 |
30-Jun-2004 |
phk |
Define the tty methods as typedefs.
Change the return type for t_break to void.
Add t_ioctl (more about this later).
|
131095 |
25-Jun-2004 |
phk |
Use generic support for BREAK and modem control ioctls.
|
131043 |
24-Jun-2004 |
phk |
Use the new serial port definitions for modemsignals.
|
130969 |
23-Jun-2004 |
phk |
save a few redundant lines by moving the retry loop further backwards.
|
130585 |
16-Jun-2004 |
phk |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
130077 |
04-Jun-2004 |
phk |
Machine generated patch which changes linedisc calls from accessing linesw[] directly to using the ttyld...() functions
The ttyld...() functions ar inline so there is no performance hit.
|
130057 |
04-Jun-2004 |
phk |
Make the remaining serial drivers call ttyioctl() rather than calling the linedisc directly.
|
130026 |
03-Jun-2004 |
phk |
Add missing <sys/module.h> includes currently relying on nested include in <sys/kernel.h>
|
129764 |
27-May-2004 |
imp |
Fix disordering of pccarddevs.h noticed by bde. Also remove a few redundant includes and fix some of the include disordering.
Submitted by: bde
|
129757 |
26-May-2004 |
tmm |
It seems that clearing the MCR_IE bit in the modem control register does not reliably prevent the triggering of interrupts for all supported configurations. Thus, the FIFO size probe could cause an interrupt, which could lead to an interrupt storm in the shared interrupt case.
To prevent this, change ns8250_bus_probe() to use the overflow bit in the line status register instead of the RX ready bit in the interrupt identification register to detect whether the FIFO has filled up. This allows us to clear all bits in the interrupt enable register during the probe, which should prevent interrupts reliably. Additionally, the detected FIFO size may be a bit more accurate, because the overflow bit is only set when the FIFO did actually fill up, while interrupts would trigger a bit early.
Reviewed and tested on a lot of hardware by: marcel
|
129740 |
26-May-2004 |
imp |
Move to generating pccarddevs.h on the fly, both for the kernel and the modules.
Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment.
|
129276 |
16-May-2004 |
nyan |
- Initialize uart_bus_space_io and uart_bus_space_mem. - Fix wrong comment.
|
128911 |
04-May-2004 |
marcel |
Fix hangs caused by z8530_bus_ipend() returning UART_IPEND_TXIDLE not as a pending interrupt status, but as a matter of status quo. Consequently, when there's no data to be transmitted the condition is not cleared and uart_intr() is stuck in an infinite loop trying to clear the UART_IPEND_TXIDLE status. The z8530_bus_ipend() function is changed to return idle only once after having sent any data.
The root cause for this problem is that we cannot use the interrupt status bits of the SCC itself. The register that holds the interrupt status can only be accessed by channel A and holds the status for both channels. Using the interrupt status register would complicate the driver because we need to synchronize access to the SCC between the channels.
Elementary testing: marius
|
128909 |
04-May-2004 |
marcel |
When the interrupt cannot be INTR_FAST, it still is INTR_MPSAFE. Mark it as such.
|
128631 |
25-Apr-2004 |
marcel |
Don't mask TCD in IMR0 when we initialize the channel. Doing so makes it impossible to check the interrupt status bit when we try to get a character in the low level console code.
|
127825 |
04-Apr-2004 |
marcel |
To quote submitter: "... uart_cpu_sparc64.c currently only looks at /options if ttyX is the selected console. However, there's one case where it should additionally look at /chosen. If "keyboard" is the selected input- device and "screen" the output-device (both via /options) but the keyboard is unplugged, OF automatically switches to ttya for the console. It even prints a line telling so on "screen". Solaris respects this behaviour and uses ttya as the console in this case and people probably expect FreeBSD to do the same (it's also very handy to temporarily switch consoles)..."
Submitted by: Marius Strobl <marius@alchemy.franken.de> Has no doubt the change is correct: marcel
|
127817 |
03-Apr-2004 |
marcel |
In uart_ebus_probe(), match "su_pnp" besides "su" for ns8250 family of UARTs. We already did this in uart_cpu_getdev(). While here, also check the compat name for "su" or "su16550".
Both changes submitted by: Marius Strobl <marius@alchemy.franken.de> Does not doubt the correctness of the second change: marcel
|
127742 |
02-Apr-2004 |
marcel |
In ns8250_putc() insert a barrier between writing the character and checking for transmitter empty.
|
127741 |
02-Apr-2004 |
marcel |
Allow the selection of a debug port with hw.uart.dbgport. Unlike other architectures (like ia64), the variable has to be set to an OpenFirmware device name.
|
127740 |
02-Apr-2004 |
marcel |
Call kbd_attach() only when KBD_INSTALL_CDEV is enabled as the function is only defined in that case.
|
127226 |
20-Mar-2004 |
marcel |
Fix braino in previous commit: getenv() can return NULL.
|
127215 |
20-Mar-2004 |
marcel |
Introduce the hw.uart.console and hw.uart.dbgport environment variables to select a serial console and debug port (resp). On ia64 these replace the use of hints completely and take precedence over hints on alpha, amd64 and i386. On sparc64 these variables are not yet recognised.
The reasons for introducing these variables are: 1. Hints have side-effects. They reserve the unit number for use by isa or acpi devices and therefore cannot be used to select a pci device. Also, the use of a unit number to select a device prior to bus enumeration is nonsense. The new variables have no side- effects and are not based on unit numbers. 2. Hints don't have the expression power to allow the sysadmin to select UARTs that are not legacy PC devices and need the support of compile-time constants to give the sysadmin some level of flexibility.
The hw.uart.console and hw.uart.dbgport variables specify a list of attributes. An attribute is a tag-value pair, seperated by a colon. Attributes are seperated by a comma. Where possible, tags are the same as those in /etc/remote (only br and pa in practice). Details can be found in the manpage (not part of this commit).
Not tested on: amd64, pc98
|
127135 |
17-Mar-2004 |
njl |
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
|
126080 |
21-Feb-2004 |
phk |
Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
126078 |
21-Feb-2004 |
phk |
Device megapatch 3/6:
Add missing D_TTY flags to various drivers.
Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer.
Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
|
125809 |
14-Feb-2004 |
phk |
Use standard style for cdevsw initializtion
|
125797 |
14-Feb-2004 |
marcel |
Test the return value of UART_PARAM(). Invalid line parameters did not result in an error before.
PR: kern/60284 Submitted by: Thomas Sandford <freebsduser@paradisegreen.co.uk>
|
123019 |
28-Nov-2003 |
imp |
Sometimes cardbus attachments don't attach, so while we track down this problem put these lines back in. While they should be unnecessary, they appear to be sometimes necessary.
Reviewed in concept: dfr Approved by: re (scottl@)
|
122470 |
11-Nov-2003 |
jake |
Add a uart attachment/syscons keyboard driver for sun keyboards. In theory this will work with any uart backend, currently supported hardware uses either ns8250 or z8530.
|
122466 |
11-Nov-2003 |
jake |
Allow uart to attach to keyboards that are not the firmware's notion of stdin, such as when using a serial console. We must recognize these devices here so that we can override the tty attach routine.
|
121939 |
03-Nov-2003 |
dfr |
Remove explicit cardbus attachments from drivers where this is identical to the pci attachment. Cardbus is a derived class of pci so all pci drivers are automatically available for matching against cardbus devices.
Reviewed by: imp
|
120871 |
07-Oct-2003 |
imp |
Include pccard/pccard_cis.h here too
|
120558 |
28-Sep-2003 |
marcel |
Don't explicitly initialize d_maj in the cdevsw with MAJOR_AUTO, as per the intentions of conf.h, rev 1.176. This change is a no-op as MAJOR_AUTO equals to 0.
|
120545 |
28-Sep-2003 |
jake |
Set the baud rate to 1200 if the device is a keyboard.
|
120487 |
26-Sep-2003 |
marcel |
Catch up with the console interface change: the use of makedev() has been abandoned in favor of a (device) name-based approach.
Submitted by: phk Tested on: alpha
|
120452 |
26-Sep-2003 |
marcel |
Revert the introduction of iobase in struct uart_bas. Both the SAB82532 and the Z8530 drivers used the I/O address as a quick and dirty way to determine which channel they operated on, but formalizing this by introducing iobase is not a solution. How for example would a driver know which channel it controls for a multi-channel UART that only has a single I/O range?
Instead, add an explicit field, called chan, to struct uart_bas that holds the channel within a device, or 0 otherwise. The chan field is initialized both by the system device probing (i.e. a system console) or it is passed down to uart_bus_probe() by any of the bus front-ends. As such, it impacts all platforms and bus drivers and makes it a rather large commit.
Remove the use of iobase in uart_cpu_eqres() for pc98. It is expected that platforms have the capability to compare tag and handle pairs for equality; as to determine whether two pairs access the same device or not. The use of iobase for pc98 makes it impossible to formalize this and turn it into a real newbus function later. This commit reverts uart_cpu_eqres() for pc98 to an unimplemented function. It has to be reimplemented using only the tag and handle fields in struct uart_bas.
Rewrite the SAB82532 and Z8530 drivers to use the chan field in struct uart_bas. Remove the IS_CHANNEL_A and IS_CHANNEL_B macros. We don't need to abstract anything anymore.
Discussed with: nyan Tested on: i386, ia64, sparc64
|
120381 |
23-Sep-2003 |
nyan |
Don't return to search another ports even if bus_space_map() fails.
|
120380 |
23-Sep-2003 |
nyan |
Initialize iobase, bsh and bst.
|
120379 |
23-Sep-2003 |
nyan |
Compare base address instead of bus_handle.
|
120378 |
23-Sep-2003 |
nyan |
- Keep the base address in struct uart_bas for sab82532 and z8530 modules. - Remove buggy uart_cpu_busaddr() function.
|
120377 |
23-Sep-2003 |
nyan |
Remove unneeded includes.
|
120376 |
23-Sep-2003 |
nyan |
Use bus_space_map() to initialize a bus_handle.
|
120146 |
17-Sep-2003 |
marcel |
In uart_intr() loop until all interrupts have been handled. Previously an UART interface could get stuck when a new interrupt condition arose while servicing a previous interrupt. Since an interrupt was already pending, no new interrupt would be triggered.
Avoid infinite recursion by flushing the Rx FIFO and marking an overrun condition when we could not move the data from the Rx FIFO to the receive buffer in toto. Failure to flush the Rx FIFO would leave the Rx ready condition pending.
Note that the SAB 82532 already did this due to the nature of the chip.
|
120143 |
17-Sep-2003 |
marcel |
Add locking to the hardware drivers. I intended to figure out more precisely where locking would be needed before adding it, but it seems uart(4) draws slightly too much attention to have it without locking for too long. The lock added is a spinlock that protects access to the underlying hardware. As a first and obvious stab at this, each method of the hardware interface grabs the lock. Roughly speaking this serializes the methods. Exceptions are the probe, attach and detach methods.
|
120083 |
15-Sep-2003 |
marcel |
Remove inclusion of <sys/timepps.h>. It's included in "uart_bus.h" to avoid having to include it in almost all other source files.
|
120081 |
15-Sep-2003 |
takawata |
Remove useless #ifdef PC98.
Submitted by: nyan
|
120056 |
14-Sep-2003 |
takawata |
Add uart pccard bus attachment,based on sio_pccard.c .
Wrote at: Hakone. Powered by: Warner Losh's scotch whisky. Tested by: nork
|
120022 |
13-Sep-2003 |
marcel |
Add support for automatic hardware flow control for 16[679]50 UARTs. We simply use the detected FIFO size to determine whether we have a post 16550 UART or not. The support lacks proper serialization of hardware access for now.
|
120009 |
12-Sep-2003 |
tmm |
When determining the device class to use for the serial console, check the "compatible" property too in the ns8250 case. This gets the serial console to work on Blade 100s, where the device name is just "serial".
Reviewed by: marcel
|
119996 |
11-Sep-2003 |
marcel |
Add support for using uart(4) for pulse capturing for the Pulse Per Second (PPS) timing interface. The support is non-optional and by default uses the DCD line signal as the pulse input. A compile-time option (UART_PPS_ON_CTS) can be used to have uart(4) use the CTS line signal.
Include <sys/timepps.h> in uart_bus.h to avoid having to add the inclusion of that header in all source files.
Reviewed by: phk
|
119979 |
11-Sep-2003 |
imp |
Minor commentary cleanup, since I didn't understand the comments that I wrote.
|
119978 |
11-Sep-2003 |
imp |
Fix compile on pc98. Maybe this is correct.
|
119943 |
10-Sep-2003 |
marcel |
If we failed to size the Rx FIFO, assume the worst. This however is not a size of 1. Since we already know there is a FIFO, we can safely assume that it is at least 16 bytes. Note that all this is mostly academic anyway. We don't use the size of the Rx FIFO currently. If we add support for hardware flow control, we only care about Rx FIFO sizes larger than 16.
|
119866 |
07-Sep-2003 |
marcel |
Remove the assumption that a bus_space_handle_t is an I/O address from the SAB82532 and the Z8530 hardware drivers by introducing uart_cpu_busaddr(). The assumption is not true on pc98 where bus_space_handle_t is a pointer to a structure. The uart_cpu_busaddr() function will return the bus address corresponding the tag and handle given to it by the BAS.
WARNING: the intend of the function is STRICTLY to allow hardware drivers to determine which logical channel they control and is NOT to be used for actual I/O. It is therefore EXPLICITLY allowed that uart_cpu_busaddr() returns only the lower 8 bits of the address and garbage in all other bits. No mistakes...
|
119822 |
07-Sep-2003 |
imp |
Better stab at MD code for pc98. The 8251 stuff is a total lie (ns8250 copied and s/ns8250/i8251/g), but there for linkage purposes. Real code to follow, once I get past some boot issues on my pc98 boxes with recent current.
|
119815 |
06-Sep-2003 |
marcel |
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.
|