summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Don't hold the hardware mutex across getc(). It can wait indefinitelymarcel2006-04-014-20/+45
| | | | | for a character to be received. Instead let getc() do any necesary locking.
* Allow uart(4) to be built on PowerPC.marcel2006-03-311-0/+54
|
* Add support for scc(4).marcel2006-03-306-82/+191
|
* Add scc(4), a driver for serial communications controllers. Thesemarcel2006-03-301-0/+115
| | | | | | | | | 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.
* Don't open if we're going away.marcel2006-03-301-0/+4
|
* Replace our local UART_SIGMASK_* with the global SER_MASK_*.marcel2006-02-245-10/+5
|
* When we probe a SAB82532, return BUS_PROBE_GENERIC. This allows puc(4)marcel2006-02-241-1/+3
| | | | | or scc(4) to grab the device by default. In fact, we probably shouldn't even claim the device at all...
* MFp4:marcel2006-02-247-52/+37
| | | | | Stop using our local UART_IPEND_* and instead use the global SER_INT_* as defined in <sys/serial.h>.
* - Use bus_setup_intr() and bus_teardown_intr() to register device driverjhb2006-02-221-2/+2
| | | | | | | | | | 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.
* - Add support for using LOM (Lights Out Management) and RSC (Remote Systemmarius2006-02-042-13/+33
| | | | | | | | | | | | | | | | | | | | | | | 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
* Make uart_getenv() not be ns8250 dependent. This will allow, in the future,imp2005-12-126-1/+5
| | | | | | 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...
* In uart_bus_probe() return BUS_PROBE_DEFAULT when the probe ismarcel2005-10-281-1/+1
| | | | successful.
* o Style(9) nitsmarcel2005-10-281-10/+9
| | | | | | | | | 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.
* Allow uart_bus_probe() to return the predefined BUS_PROBE_*marcel2005-10-281-3/+1
| | | | | constants. In this case: just return what uart_bus_probe() returns.
* - Use swi_remove() to teardown swi handlers rather thanjhb2005-10-261-1/+1
| | | | | intr_event_remove_handler(). - Remove tty: prefix from a couple of swi handler names.
* Remove PCI IDs for multiport cards:marcel2005-10-261-10/+15
| | | | | | | | | | | 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).
OpenPOWER on IntegriCloud