summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.phk2006-05-261-10/+2
| | | | | Use polling behaviour for gdb_getc() where convenient, this edges us closer to the console code.
* Remove definitions of uart_[gs]etdreg. They are not used anymore andmarcel2006-05-231-6/+0
| | | | were in fact wrong.
* The lcr variable in ns8250_probe is now unused. Remove it.benno2006-05-231-1/+1
| | | | Missed by: benno
* Allow uart(4)'s ns8250 driver to work with devices whose regshift is > 0.benno2006-05-231-24/+16
| | | | | | | | | | | | | - 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
* o A divisor of 0 is perfectly valid. Reserve -1 for an invalidmarcel2006-05-121-7/+15
| | | | | | | 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.
* First pass at removing Alpha kernel support.jhb2006-05-111-143/+0
|
* Rewrite of puc(4). Significant changes are:marcel2006-04-281-25/+13
| | | | | | | | | | | | | | | | | | | | 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.
* Implement the ipend() method of the serdev I/F.marcel2006-04-282-0/+10
|
* o Add 5 Timedia single port serial cards.marcel2006-04-271-8/+25
| | | | o While here, break long lines.
* Use 115200 and not 9600 as the initial baudrate. This speeds upmarcel2006-04-271-1/+1
| | | | detection of the FIFO size. Especially for large FIFOs.
* o Add 2 HP Diva single port UARTs.marcel2006-04-271-0/+2
|
* o Add 2 NEC cardsmarcel2006-04-261-29/+47
| | | | | | | 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.
* MFp4: Calculate the divisor before setting the DLAB bit. Thismarcel2006-04-231-2/+2
| | | | | prevents that there's a control flow that leaves the DLAB bit set.
* In z8530_divisor() return 0 if the calculated divisor is less than 0.marcel2006-04-041-1/+1
| | | | This happens when the baudrate is too high for the given RCLK.
* Remove unused variable 'error'. Forgotten in previous commit.marcel2006-04-021-1/+0
|
* Don't claim a SAB82532. We have scc(4) for that.marcel2006-04-021-5/+0
|
* Eliminate the sc_hasfifo flag from the softc. It was only used bymarcel2006-04-022-4/+3
| | | | | | | 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.
OpenPOWER on IntegriCloud