summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
Commit message (Collapse)AuthorAgeFilesLines
* Update for the KDB framework:marcel2004-07-101-8/+6
| | | | | | 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.
* Add support for uart(4) being a debug port for the GDB backend.marcel2004-07-101-0/+101
|
* Define the tty methods as typedefs.phk2004-06-301-2/+1
| | | | | | Change the return type for t_break to void. Add t_ioctl (more about this later).
* Use generic support for BREAK and modem control ioctls.phk2004-06-251-65/+27
|
* Use the new serial port definitions for modemsignals.phk2004-06-246-105/+92
|
* save a few redundant lines by moving the retry loop further backwards.phk2004-06-231-7/+1
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-162-4/+4
| | | | Bump __FreeBSD_version accordingly.
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-8/+8
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* Make the remaining serial drivers call ttyioctl() rather than callingphk2004-06-041-5/+2
| | | | the linedisc directly.
* Add missing <sys/module.h> includes currently relying on nested includephk2004-06-031-0/+1
| | | | in <sys/kernel.h>
* Fix disordering of pccarddevs.h noticed by bde. Also remove a fewimp2004-05-271-2/+2
| | | | | | redundant includes and fix some of the include disordering. Submitted by: bde
* It seems that clearing the MCR_IE bit in the modem control registertmm2004-05-261-22/+23
| | | | | | | | | | | | | | | | | 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
* Move to generating pccarddevs.h on the fly, both for the kernel andimp2004-05-261-1/+1
| | | | | | | the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment.
* - Initialize uart_bus_space_io and uart_bus_space_mem.nyan2004-05-161-7/+7
| | | | - Fix wrong comment.
* Fix hangs caused by z8530_bus_ipend() returning UART_IPEND_TXIDLEmarcel2004-05-041-1/+7
| | | | | | | | | | | | | | | | | | 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
* When the interrupt cannot be INTR_FAST, it still is INTR_MPSAFE.marcel2004-05-041-2/+2
| | | | Mark it as such.
* Don't mask TCD in IMR0 when we initialize the channel. Doing so makesmarcel2004-04-251-1/+1
| | | | | it impossible to check the interrupt status bit when we try to get a character in the low level console code.
* To quote submitter:marcel2004-04-041-8/+24
| | | | | | | | | | | | | | | "... 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
* In uart_ebus_probe(), match "su_pnp" besides "su" for ns8250 familymarcel2004-04-031-2/+4
| | | | | | | | 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
* In ns8250_putc() insert a barrier between writing the character andmarcel2004-04-021-0/+1
| | | | checking for transmitter empty.
* Allow the selection of a debug port with hw.uart.dbgport. Unlikemarcel2004-04-021-46/+84
| | | | | other architectures (like ia64), the variable has to be set to an OpenFirmware device name.
* Call kbd_attach() only when KBD_INSTALL_CDEV is enabled as the functionmarcel2004-04-021-0/+2
| | | | is only defined in that case.
* Fix braino in previous commit: getenv() can return NULL.marcel2004-03-201-0/+2
|
* Introduce the hw.uart.console and hw.uart.dbgport environment variablesmarcel2004-03-208-57/+304
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Device megapatch 4/6:phk2004-02-211-1/+2
| | | | | | | | 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.
* Device megapatch 3/6:phk2004-02-211-4/+0
| | | | | | | | | | | | 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.
* Use standard style for cdevsw initializtionphk2004-02-141-9/+9
|
* Test the return value of UART_PARAM(). Invalid line parameters did notmarcel2004-02-141-1/+2
| | | | | | | result in an error before. PR: kern/60284 Submitted by: Thomas Sandford <freebsduser@paradisegreen.co.uk>
* Sometimes cardbus attachments don't attach, so while we track downimp2003-11-281-0/+1
| | | | | | | | 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@)
* Add a uart attachment/syscons keyboard driver for sun keyboards. In theoryjake2003-11-113-0/+738
| | | | | this will work with any uart backend, currently supported hardware uses either ns8250 or z8530.
* Allow uart to attach to keyboards that are not the firmware's notion ofjake2003-11-111-13/+34
| | | | | stdin, such as when using a serial console. We must recognize these devices here so that we can override the tty attach routine.
* Remove explicit cardbus attachments from drivers where this is identicaldfr2003-11-031-1/+0
| | | | | | | 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
* Include pccard/pccard_cis.h here tooimp2003-10-071-1/+2
|
* Don't explicitly initialize d_maj in the cdevsw with MAJOR_AUTO, asmarcel2003-09-281-1/+0
| | | | | per the intentions of conf.h, rev 1.176. This change is a no-op as MAJOR_AUTO equals to 0.
* Set the baud rate to 1200 if the device is a keyboard.jake2003-09-281-1/+4
|
* Catch up with the console interface change: the use of makedev() hasmarcel2003-09-261-3/+2
| | | | | | | been abandoned in favor of a (device) name-based approach. Submitted by: phk Tested on: alpha
* Revert the introduction of iobase in struct uart_bas. Both the SAB82532marcel2003-09-2617-61/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't return to search another ports even if bus_space_map() fails.nyan2003-09-235-6/+6
|
* Initialize iobase, bsh and bst.nyan2003-09-231-0/+4
|
* Compare base address instead of bus_handle.nyan2003-09-231-1/+1
|
* - Keep the base address in struct uart_bas for sab82532 and z8530 modules.nyan2003-09-2311-51/+17
| | | | - Remove buggy uart_cpu_busaddr() function.
* Remove unneeded includes.nyan2003-09-231-5/+0
|
* Use bus_space_map() to initialize a bus_handle.nyan2003-09-235-9/+17
|
* In uart_intr() loop until all interrupts have been handled. Previouslymarcel2003-09-174-19/+57
| | | | | | | | | | | | | | 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.
* Add locking to the hardware drivers. I intended to figure out moremarcel2003-09-177-27/+117
| | | | | | | | | | 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.
* Remove inclusion of <sys/timepps.h>. It's included in "uart_bus.h"marcel2003-09-151-1/+0
| | | | to avoid having to include it in almost all other source files.
* Remove useless #ifdef PC98.takawata2003-09-151-3/+1
| | | | Submitted by: nyan
* Add uart pccard bus attachment,based on sio_pccard.c .takawata2003-09-141-0/+109
| | | | | | Wrote at: Hakone. Powered by: Warner Losh's scotch whisky. Tested by: nork
* Add support for automatic hardware flow control for 16[679]50 UARTs.marcel2003-09-131-1/+37
| | | | | | 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.
OpenPOWER on IntegriCloud