summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant checking of sc_leaving (uart_intr() already handles this).marius2010-05-021-1/+1
| | | | Approved by: marcel
* Add sbbc(4), a driver for the BootBus controller found in Serengeti andmarius2010-04-102-0/+12
| | | | | | | | | | 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).
* Add PCI ID for MCS9901.delphij2010-03-011-0/+2
| | | | | | Submitted by: gcooper PR: kern/144397 MFC after: 1 month
* Recognize the NS16552 found in PCIe-based sun4u machines.marius2009-12-232-2/+3
|
* Support the tablet in (at least) the Toshiba Portege M200 Tablet PC.gavin2009-12-211-0/+1
| | | | | | | | | | 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
* Add ID for NetMos NM9820 Serial Port chip, found on CardBus serial adapter.mav2009-12-081-0/+1
|
* Add support for the NetMos NM9865 family of Serial/Parallel ports.marcel2009-12-071-0/+1
| | | | | Obtained from: NetMos MCS9865 v1.0.0.1 driver MFC after: 3 days
* Remove unneeded includes of <sys/termios.h>.ed2009-11-282-2/+0
|
* Fix RTS/CTS flow control, broken by the TTY overhaul. The new TTYmarcel2009-10-023-27/+55
| | | | | | | | | 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
* Fix serial console on Apple Xserve G5 by falling back to input-device-1nwhitehorn2009-07-231-9/+32
| | | | | | | | | | 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)
* Move the memory layout definitions and logic from mvreg.h to mvwin.hmarcel2009-06-121-0/+1
| | | | | | | | 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.
* Last minute TTY API change: remove mutex argument from tty_alloc().ed2009-05-291-1/+1
| | | | | | | | | | 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.
* Don't use pmap_kextact() when comparing bus handles for Book-E.marcel2009-04-081-0/+4
| | | | | | | 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).
* Fix hangs caused by hardware that signals receive errorsmarcel2009-04-081-6/+9
| | | | | | | | | (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
* Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge modenwhitehorn2009-04-041-7/+19
| | | | | | | | | | 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
* remove now-redunant cardbus attachment.imp2009-03-091-1/+0
|
* Add support for the single-port NetMos NM9835 serial adapter. The puc(4)jhb2009-03-051-0/+1
| | | | | | | | | 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
* Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. Thekaiw2009-02-111-0/+1
| | | | card is a multifunction PCI and report itself as two logical devices.
* De-hard code UART speed setting for Marvell SOCs when hw.uart.console is notraj2009-01-081-1/+2
| | | | specified. Instead, let uart(4) fall back to whatever speed firmware has set.
* Minor style(9) compliance change.kan2008-12-271-1/+2
|
* Cast to uintptr_t before casting to void*. This allows themarcel2008-11-221-3/+3
| | | | | | | QUICC backend to be built on LP64 platforms. This makes it possible to include the QUICC backend in the kernel module. PR: 127120
* Fix detaching of uart(4) devices.ed2008-10-231-0/+13
| | | | | | | | | | | | | | 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
* Introduce basic support for Marvell families of system-on-chip ARM devices:raj2008-10-132-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Use bus_space_compare() rather than i386_memio_compare() directly.nyan2008-09-071-1/+1
|
* Add the 2nd CCU and PnP devices support on pc98.nyan2008-08-253-16/+68
| | | | | Reviewed by: imp Obtained from: //depot/projects/uart with some fixes
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.ed2008-08-202-95/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* The XScale PXA255 has three generally ns16x50 compatible UARTs. One of thebenno2008-05-301-5/+31
| | | | | | | | | | | | | | | 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
* Expand kdb_alt_break a little, most commonly used with the optionpeter2008-05-041-3/+17
| | | | | | | | | | | | | | | | | | | 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.
* add device hints to control the rx FIFO interrupt level on 16550A partssam2008-03-122-1/+18
| | | | | | | PR: kern/121421 Submitted by: UEMURA Tetsuya Reviewed by: marcel MFC after: 2 weeks
* Support for Freescale QUad Integrated Communications Controller.raj2008-03-032-0/+490
| | | | | | | | | | | | | 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
* Initial support for Freescale PowerQUICC III MPC85xx system-on-chip family.raj2008-03-033-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a new 'why' argument to kdb_enter(), and a set of constants to userwatson2007-12-251-2/+3
| | | | | | | | | 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.
* Redefine bus_space_tag_t on PowerPC from a 32-bit integral tomarcel2007-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* The HP Diva RMP3 uses BAR 0x14.marcel2007-05-171-1/+1
|
* Fix bugs in the Sun -> AT keycode translation table which caused themarius2007-05-011-3/+3
| | | | Props key to act as Again and the Paste and Copy keys to be inverted.
* Add PCI IDs for the HP RMP3 serial port. This is often used asmarcel2007-04-051-0/+1
| | | | | | the serial console. MFC after: 1 week
* Don't use a time-limiting loop that's defined in terms of the baudratemarcel2007-04-031-13/+7
| | | | | | | | | | | | | | | 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.
* Don't expose the uart_ops structure directly, but instead havemarcel2007-04-0215-63/+165
| | | | | | | | | | | | 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.
* For embedded UARTs compatible with the ns8250 family it is possiblemarcel2007-03-281-1/+3
| | | | | | | | | 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.
* When we match UARTs found during bus-enumeration with UARTs used formarcel2007-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-6/+8
| | | | | | | | | | | | | 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@
* - Add a uart_rxready() and corresponding device-specific implementationsmarius2007-01-185-35/+35
| | | | | | | | | | | | | | | 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
* - In sunkbd_probe_keyboard() don't bother to determine the keyboard layoutmarius2006-11-022-85/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Fix our ioctl(2) implementation when the argument is "int". Newru2006-09-271-1/+24
| | | | | | | | | | | | | 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
* Do not try to call keyboard callback unless keyboard is active and busy.emax2006-09-181-4/+6
| | | | | | | This should fix 'kbdcontrol -K < /dev/console' panic on sparc64 with sunkbd(4). PR: sparc64/96798 MFC after: 1 week
* Properly propagate overrun conditions to the TTY layer.marcel2006-07-271-0/+2
| | | | MFC after: 3 days
* On PowerPC the clock for the BRG comes from RTxC, not PCLK. Add amarcel2006-07-261-3/+10
| | | | | quick hack to deal with this. We may need to formalize this better and have this information come from the bus attachments.
* Implement UART_IOCTL_BAUD for the Z8530. This allows a serial consolemarcel2006-07-261-1/+7
| | | | | on PowerPC use the current setting of the hardware and not second guess what the OFW does on various machines.
* Implement uart_cpu_eqres() and uart_cpu_getdev(). This allowsmarcel2006-07-261-3/+56
| | | | FreeBSD to use a serial console, as per the OFW settings.
* Convert to new console apiphk2006-05-261-11/+2
|
OpenPOWER on IntegriCloud