summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/com.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Re-commit Exar XR17V35x serial port support previously backed out:jcs2020-08-141-3/+18
| | | | | | | | | | | | | | | The Exar XR17V354 has 4 ports that have a 256-byte FIFO, use a frequency of 125Mhz, and have a unique sleep register. A custom interrupt handler is setup in puc for these ports so it can check a register which reports which ports triggered the interrupt, rather than having to run comintr for every port every time. To avoid probing for these ports in com_attach_subr which requires access to registers that may be reserved on certain platforms, pass the sc_uarttype from com_puc_attach since the port type is already known based on the puc device vendor/id. Input from kettenis, tested in snaps
* Update the console device always when attaching the real deviceyasuoka2020-03-091-3/+3
| | | | | | | driver. The information by the driver is supposed more reliable than the information which was set up earlier. ok patrick
* Detach timeouts and the softint handler before freeing memory.mpi2020-02-051-5/+5
| | | | | | | | | | | | As more and more teardown functions include barriers, or any kind of context change, it is unsafe to continue to assume that such code paths are atomic. So a good practise is to only free descriptor when we're sure that no other context can access them. Found while looking at visa@'s ttkqflush() replacement diff. The same pattern is present in many USB drivers as found with Peter Stuge. ok visa@
* ttysleep(): drop unused timeout parametercheloha2019-07-191-3/+3
| | | | | | | | All callers sleep indefinitely. With help from visa@. ok visa@, ratchov@, kn@
* Add support for register shift/io-width to the console code as well.kettenis2018-05-141-50/+62
| | | | ok visa@, patrick@
* Revert previous commit; the XR17V35X probe that was added accesses registerskettenis2018-05-021-26/+4
| | | | | that aren't guaranteed to be there and may even belong to a different device. This triggers a fault on hppa machines like the C3000 for example.
* The Exar XR17V354 has 4 com ports that have a 256-byte FIFO, use ajcs2018-04-151-4/+26
| | | | | | | | | frequency of 125Mhz, and have a unique sleep register. A custom interrupt handler is setup in puc for these ports so it can check a register which reports which ports triggered the interrupt, rather than having to run comintr for every port every time. ok mlarkin deraadt
* Add support for register shift/io-width. This allows us to support UARTskettenis2018-04-021-166/+165
| | | | | | | | | that are mostly NS16550 compatible but use 32-bit instead of 8-bit registers such as the Synopsys Designware UARTs found on many armv7, arm64 and amd64 SoCs. tested by florian@, blum@ ok deraadt@
* Remove almost unused `flags' argument of suser().mpi2018-02-191-3/+3
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* Rename Debugger() into db_enter().mpi2017-04-301-2/+2
| | | | | | | Using a name with the 'db_' prefix makes it invisible from the dynamic profiler. ok deraadt@, kettenis@, visa@
* Unifdef KGDB.mpi2017-04-301-148/+9
| | | | | | It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@
* remove some more sparc remnants. ok deraadttedu2016-09-041-5/+1
|
* de-zaurus com.cjsg2016-09-031-146/+1
| | | | "looks correct" deraadt@ guenther@ on an earlier rev
* Only probe the UART type if sc_uarttype is set to COM_UART_UNKNOWN.kettenis2016-08-161-6/+14
| | | | | | | | This allows glue drivers to set the type based on other information (such as Oopen Firmware or device tree properties) without going through to risky code paths. ok deraadt@, visa@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* wrap a long linederaadt2014-04-131-2/+3
|
* At resume, do not spin flushing characters in from the chip. There shouldn'tderaadt2013-12-091-5/+1
| | | | | | | | | be any characters. If the chip is not actually there for some reason, we'd be spinning so early in the resume sequence, we'd probably go mad trying to find the reason.. ok kettenis request: people with serial ports on their laptops, try to run a "cu" over a suspend/resume cycle, and see if you see "input noise"
* At suspend/resume time cope with timeouts, DTR on resume in a busderaadt2013-12-091-1/+11
| | | | | bus-independent fashion. ok kettenis
* No need to treat amd64 specially; always return CN_HIGHPRI.kettenis2013-02-141-5/+1
| | | | ok miod@
* Narrow the spltty/splx pair in com_activate to only enclose the minimumderaadt2012-10-171-3/+3
| | | | operation which requires it.
* Better detection of the st16650 v1 (with the broken fifo). Gets rid ofkettenis2012-08-251-2/+5
| | | | | | false positives like the DUART on the MPC8347 as found on socppc. ok deraadt@
* Turns out the v445 isn't happy at all if we touch the registers that dealkettenis2012-08-251-31/+35
| | | | | | | | | with sleep mode. So skip the wakeup code as well if we are a serial console. The port on the v445 almost certainly isn't a real st16650 and probably doesn't implement sleep mode (perhaps someone cut the soft core down a bit too much?). But it is indistinguishable from it, so we have to deal with it. ok deraadt@
* Skip putting a port in sleep mode when it is used as serial console. In thatkettenis2012-08-191-17/+19
| | | | | | | | case the kernel will still be using the port even after the last process closes it. And on machines like the v445 the firmware won't be happy if the console port is in sleep mode when the kernel reboots or halts. ok miod@
* Remove unused variable.kettenis2012-05-121-3/+1
| | | | ok mpi@, miod@
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-4/+1
| | | | | | | | that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
* Fix a problem found where one SOC has a uart implementation that causes busdrahn2011-05-221-2/+3
| | | | | errors if the fifo is read when the fifo is empty. Dont read an empty fifo. ok deraaadt@ fgsch@
* only read from the UART if there is something to read. fix beagle, otherwisefgsch2011-03-231-2/+3
| | | | | it will crash with 'External Non-Linefetch Abort (S)'. similar diff provided by drahn@. tested by jasper@, deraadt@ ok.
* ansify function definitions, and constify a few arrays while there.miod2010-08-281-5/+3
| | | | no functional change.
* Add resume support for serial consoles.kettenis2010-08-071-2/+7
| | | | Tested by sthen@, ok deraadt@
* Initial stab at making com@puc suspend and resume properly. Works finekettenis2010-08-061-1/+105
| | | | | | | for using cu(1) between two OpenBSD machines. Probably doesn't work for serial consoles but we don't support those on puc(4) anyway. ok deraadt@
* Move common code for waking up writers on a tty into a function.nicm2010-07-021-10/+4
| | | | ok deraadt matthew millert
* Allow tty drivers to request larger buffers at attach time using aderaadt2010-06-281-2/+2
| | | | | | | | max-baud-rate hint. Adjust TTYHOG (the nearly full logic) to this new situation. The larger buffers are required by the very high speed KDDI devices in Japan (CF com, or USB ucom) so those are the only two drivers which currently ask for a larger buffer size. ok yasuoka miod
* Use a more moderate fifo trigger level (4) for moderately quickckuethe2010-06-281-1/+3
| | | | (sub-38400) port speeds. Inspired by netbsd. ok fgsch krw deraadt miod
* Don't #include <sys/user.h> into files that don't need the stuffguenther2010-06-261-2/+1
| | | | | | | | it defines. In some cases, this means pulling in uvm.h or pcb.h instead, but most of the inclusions were just noise. Tested on alpha, amd64, armish, hppa, i386, macpcc, sgi, sparc64, and vax, mostly by krw and naddy. ok krw@
* Some of the line disciplines want to check for suser. Better to pass themtedu2010-04-121-3/+3
| | | | a process instead of using curproc. ok deraadt
* Every selwakeup() should have a matching KNOTE() (even if kqueue isn'tnicm2009-11-091-2/+1
| | | | | | | | | | supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and remove it from any occurences where both are used, except one for kqueue itself and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag). Based on a diff from tedu. ok deraadt
* Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.kettenis2009-11-041-28/+4
| | | | ok jsing@, miod@
* Call selwakeup()/KNOTE() even if the queue has emptied completely.nicm2009-11-011-3/+3
| | | | ok miod
* Use suser when possible. Suggested by miod@.fgsch2009-10-311-2/+2
| | | | miod@ deraadt@ ok.
* Add missing KNOTE() calls after selwakeup(), until we decide if the KNOTE()deraadt2009-10-311-1/+2
| | | | | | | calls can go directly into selwakeup() safely long discussion with nicm, murmers of consent from tedu and miod, noone else seems to care of kqueue is busted as long as it makes their sockets move data fast... pretty sad.
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-2/+2
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* Actual final round of timeout_add(to, n * hz) -> timeout_add_sec(to, n)blambert2009-01-111-2/+2
| | | | | | | conversions. ok kettenis@ ok krw@ (possibly for the second time :)
* pccom can finally die; ok kettenis dlg drahn, tested by okanderaadt2008-11-231-3/+349
|
* Second pass of simple timeout_add -> timeout_add_sec conversionsblambert2008-10-151-3/+3
| | | | | | | This should take care of the simpler ones (i.e., timeout values of integer multiples of hz). ok krw@, art@
* Make serial console on non-primary ports work to on i386.kettenis2008-06-081-2/+3
| | | | tested by jbg@, "it is right" deraadt@
* the code that parses arguments from the boot loader on amd64 wasnt checkingdlg2008-04-251-2/+2
| | | | | | | | | what type of console was specified, so when a glass console was used it was still configuring serial bits. this makes it so serial config only occurs for serial console devices. found by jolan@, thib@, and maybe sthen@ sorry guys
* MD_ISA_IOT is not defined anywhere so get rid of it.jsing2008-04-241-5/+1
| | | | Spotted by drahn@, ok dlg@
* Keep order of "#if defined..." consistent.jsing2008-04-241-2/+2
| | | | ok dlg@
* Clean up comments.jsing2008-04-241-14/+16
|