summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
Commit message (Collapse)AuthorAgeFilesLines
* MFC r318974: uart: add AMT SOL PCI IDemaste2017-06-031-0/+1
| | | | | | | I adjusted the description to be similar to existing AMT entries. PR: 219384 Approved by: re (gjb)
* MFC r317659, r317752:mav2017-05-162-10/+14
| | | | | | | 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.
* MFC r314918, r314919:ian2017-03-162-1/+3
| | | | | | | | | 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
* MFC r304970:jhibbits2016-11-061-4/+4
| | | | | | | | | | | | 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
* MFC r302523,r302528:mmel2016-11-051-4/+4
| | | | | | | | | | | 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.
* sys/dev: minor spelling fixes.pfg2016-05-033-6/+6
| | | | Most affect comments, very few have user-visible effects.
* Stop including machine/fdt.h from the fdt uart code, it's unneeded.andrew2016-04-261-3/+0
| | | | Sponsored by: ABT Systems Ltd
* Do not include fdt.h on RISC-V.br2016-04-261-1/+1
|
* sys: use our nitems() macro when param.h is available.pfg2016-04-211-1/+1
| | | | | | This should cover all the remaining cases in the kernel. Discussed in: freebsd-current
* Remove slightly used const values that can be replaced with nitems().pfg2016-04-211-2/+1
| | | | Suggested by: jhb
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-101-1/+1
| | | | Found with devel/coccinelle.
* Move support for Synopsys Designware APB UART out of ns8250 and into ajmcneill2016-04-012-12/+284
| | | | | | | | | 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
* Add ns16550a compatible string in UART 8250 driverwma2016-02-261-0/+1
| | | | | | | | | 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
* Stop using the global fdtbus_bs_tag and instead use the tag from the softcian2016-02-231-4/+3
| | | | that was set up properly at init time.
* This code no longer references fdtbus_bs_tag, no need for a special externian2016-02-231-4/+0
| | | | declaration of it for aarch64.
* Now that we have OF_decode_addr(), with proper MD implementations, to obtainian2016-02-231-7/+6
| | | | | | | | 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.
* Allow callers of OF_decode_addr to get the size of the found mapping. Thisandrew2016-02-162-2/+2
| | | | | | | | | | | | | | 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
* UART: Fix spurious interrupts generated by ns8250 and lpc drivers:mmel2016-02-122-4/+6
| | | | | - don't enable transmitter empty interrupt before filling TX FIFO. - add missing uart_barrier() call in interrupt service routine
* Explicitly include <sys/systm.h>. Previously we were pulling it in due toandrew2016-02-101-0/+1
| | | | header pollution.
* - Make the code consistent with itself style-wise and bring it closermarius2016-01-251-8/+18
| | | | | | to style(9). - Mark unused arguments as such. - Make the ttystates table const.
* Fix busy-detect when using DesignWare UARTzbb2016-01-201-2/+5
| | | | | | | | | | | | | 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
* Add compatibility string for dw-apb-uart in ns8250 driverzbb2016-01-201-0/+1
| | | | | | | | | | | 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
* Fix tty_drain() and, thus, TIOCDRAIN of the current tty(4) incarnationmarius2016-01-191-0/+13
| | | | | | | | | | | | | 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
* Use OF_decode_addr() to create a bus_space tag and handle for the consoleian2016-01-181-12/+1
| | | | | | | | | 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
* Restore uart PPS signal capture polarity to its historical norm, and add anian2016-01-124-67/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingimp2015-12-111-1/+5
| | | | | | | | | 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
* Remove a duplicate definition.kevlo2015-12-051-1/+0
|
* uart(4) - make the 8250 uart baudrate tolerance build time tweakable.adrian2015-11-181-2/+13
| | | | | | | | | | 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.
* Add ID for Intel Panther Point KT Controllermav2015-09-131-0/+1
| | | | | | | Found on ASUS P8Q77-M motherboard. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks
* Allow us to set the console device tree node. This is needed as not allandrew2015-09-081-10/+18
| | | | | | | | | | | | | | | | | | | 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
* Add support for the Broadcom TruManage integrated serial port.marcel2015-08-121-0/+2
| | | | PR: 191266
* Use bus_alloc_resource_any(), rather than bus_alloc_resource()marcel2015-08-121-7/+6
| | | | | with start 0 and end ~0. This avoids confusion WRT to what the value of length can or should be.
* Style fix, no functional changes -- do the braces for switches correctly.ian2015-08-111-6/+3
|
* Correct the polarity of the PPS assert and clear events with respect to theian2015-08-101-1/+7
| | | | | | | | | | | | 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.
* Allow the choice of PPS signal captured by uart(4) to be runtime-configured,ian2015-08-102-15/+111
| | | | | | | | | | | | | | 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
* Provide the tty-layer mutex when initializing the pps api. This allowsian2015-08-083-7/+22
| | | | | | | | | | 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.)
* - Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signalingmarius2015-07-242-9/+16
| | | | | | | | | | | | | | | | | | | 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
* If uart interrupts are not functioning then schedule the callout to do theneel2015-07-161-2/+10
| | | | | | | | | 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]
* Add new UART device presented on newer AMT enabled systems/laptops.sbruno2015-06-221-0/+1
| | | | | | | Tested on Dell Latitude E7240. MFC after: 2 weeks Relnotes: yes
* Add support for the Intel Atom E3800 series SoC (aka Bay Trail).marcel2015-06-201-1/+6
| | | | Sponsored by: XipLink, Inc
* Actually check the DTS node value to enable the uart quirks.loos2015-05-301-4/+4
| | | | | 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.
* Switch TI platform support code from using FreeBSD's custom-baked DTSgonzo2015-05-221-21/+10
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for the uart classes to set their default register shift value.andrew2015-04-1114-25/+39
| | | | | | | | | | | 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
* Get the fdt uart driver working on arm64, there is no machine/fdt.h, andandrew2015-04-072-1/+13
| | | | | | the default shift should be 2 for the SoCs we support. Sponsored by: The FreeBSD Foundation
* Fix uart_fdt_get_clock. It should have beed using the cell variable passedandrew2015-04-071-9/+6
| | | | in, not value on the stack.
* Move uart_fdt_get_clock and uart_fdt_get_shift to uart_bus_fdt.c, we mayandrew2015-04-042-29/+29
| | | | not build uart_cpu_fdt.c in all configs.
* Remove the extra copy of uart_fdt_get_clock and uart_fdt_get_shift. Whileandrew2015-04-043-37/+6
| | | | | | here also use OF_getencprop in uart_fdt_get_clock. Sponsored by: The FreeBSD Foundation
* Use OF_getencprop over OF_getprop and fdt32_to_cpu. The latter may giveandrew2015-04-042-8/+4
| | | | | | us the wrong data in the failure case if shift was not zero. Sponsored by: The FreeBSD Foundation
* And it turns out someone beat me to it....eadler2015-03-301-2/+0
| | | | PR: 199013
* Add support for "MosChip MCS9922 PCIe to Peripheral Controller" to uarteadler2015-03-301-0/+2
| | | | | | Submitted by: <mlsemon35@gmail.com> PR: 199013 MFC After: 1 month
OpenPOWER on IntegriCloud