aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sio
Commit message (Collapse)AuthorAgeFilesLines
* Copy releng/8.2 to release/8.2.0 for 8.2-RELEASE.release/8.2.0_cvsKen Smith2011-02-167-7/+7
| | | | | | Approved by: re (implicit) This commit was manufactured to restore the state of the 8.2-RELEASE image.
* remove now-redunant cardbus attachment.Warner Losh2009-03-091-1/+0
| | | | Notes: svn path=/head/; revision=189575
* Allow device hints to wire the unit numbers of devices.John Baldwin2008-11-182-60/+0
| | | | | | | | | | | | | | | | | | | | | | | - An "at" hint now reserves a device name. - A new BUS_HINT_DEVICE_UNIT method is added to the bus interface. When determining the unit number of a device, this method is invoked to let the bus driver specify the unit of a device given a specific devclass. This is the only way a device can be given a name reserved via an "at" hint. - Implement BUS_HINT_DEVICE_UNIT() for the acpi(4) and isa(4) bus drivers. Both of these busses implement this by comparing the resources for a given hint device with the resources enumerated by ACPI/PnPBIOS and wire a unit if the hint resources are a subset of the "real" resources. - Use bus_hinted_children() for adding hinted devices on isa(4) busses now instead of doing it by hand. - Remove the unit kludging from sio(4) as it is no longer necessary. Prodding from: peter, imp OK'd by: marcel MFC after: 1 month Notes: svn path=/head/; revision=185059
* Add a note about a bug in how sio manages its softc. This wasWarner Losh2008-10-081-0/+15
| | | | | | | | discovered by Dorr H. Clark. I'm not at all sure how to fix it, but wanted to document it at the very least... Notes: svn path=/head/; revision=183692
* Expand kdb_alt_break a little, most commonly used with the optionPeter Wemm2008-05-041-3/+23
| | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=178766
* Add a new 'why' argument to kdb_enter(), and a set of constants to useRobert Watson2007-12-251-2/+4
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=174898
* Stop serial console and gdb serial port from getting all screwed up.Julian Elischer2007-12-051-1/+1
| | | | | | | | | PR: 65278 MFC in: 3 days Submitted by: ups@ Notes: svn path=/head/; revision=174283
* Allow the sio acpi attachment to be disabled (ie: use hints only). ThisPeter Wemm2007-11-301-0/+4
| | | | | | | | | | | | | hack means you can get the units and flags to match up more easily with serial consoles on machines with acpi tables that cause the com ports to be probed in the wrong order (and hence get the wrong sio unit number). This replaces the common alternative hack of editing the code to comment out the acpi attachment. This could go away entirely when device wiring patches are committed. Notes: svn path=/head/; revision=174116
* Add sio_puc_kludge_unit() to stop sio devices originating from pucPeter Wemm2007-11-301-0/+29
| | | | | | | | | | stomping on the units intended for the motherboard sio ports. This is no real substitute for the not-yet-committed device wiring enhancements. Code taken from sio's pci attachment. Notes: svn path=/head/; revision=174115
* Spelling fix for interupt -> interruptKevin Lo2007-10-121-1/+1
| | | | Notes: svn path=/head/; revision=172568
* o Revert last. The chip is already supported by puc(4).Maxim Konovalov2007-03-291-1/+0
| | | | | | | Pointed out by: marcel, Joseph Terner Notes: svn path=/head/; revision=168015
* o Add MosChip 9835 PCI Dual UART PCI id.Maxim Konovalov2007-03-281-0/+1
| | | | | | | | | PR: kern/110967 Submitted by: Joseph Terner MFC after: 1 month Notes: svn path=/head/; revision=168002
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-5/+7
| | | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=166901
* Only treat positive values as errors...John-Mark Gurney2006-09-141-1/+1
| | | | | | | | Pointed out by: wsk Message-ID: <45060FC4.2090308@gddsn.org.cn> Notes: svn path=/head/; revision=162294
* Restore the status quo before my last commit. Prior to it, sio tookWarner Losh2006-07-171-2/+2
| | | | | | | | | | | | precedence uart. With my last change, it became a tie, and uart seems to always win on my amd64. This was not my intention, so have sio be just a tiny bit more preferred than uart. Note: I'm not making any judgement on the merits of uart winning. I'm just saying that if we want to change it, we do it on purpose. Notes: svn path=/head/; revision=160420
* Have sio return BIS_PROBE_DEFAULT like all the other drivers in theWarner Losh2006-06-301-2/+2
| | | | | | | | | | | | | | | tree... John Baldwin noted that sio might pass values between probe and attach via softc. It appears that sio does leave the hardware in a known state after probing, so other drivers that try to probe might leave it in a worse state. It doesn't seem to pass any data in softc, however, that I could find... I think we should not be probing for anything but nonPnP isa, but that's a change for another day. Submitted by: Frank Behrens PR: 87845 Notes: svn path=/head/; revision=160046
* Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.Poul-Henning Kamp2006-05-261-8/+2
| | | | | | | | Use polling behaviour for gdb_getc() where convenient, this edges us closer to the console code. Notes: svn path=/head/; revision=158950
* Convert to use CONSOLE_DRIVER() macro:Poul-Henning Kamp2006-05-261-43/+9
| | | | | | | Remove cngetc, rename cncheckc to cngetc (fix GDB console accordingly) Notes: svn path=/head/; revision=158947
* Insert a '_' in the console function names to be more consistent withPoul-Henning Kamp2006-05-261-17/+17
| | | | | | | the future. Notes: svn path=/head/; revision=158943
* Rewrite of puc(4). Significant changes are:Marcel Moolenaar2006-04-281-11/+18
| | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=158124
* - Use bus_setup_intr() and bus_teardown_intr() to register device driverJohn Baldwin2006-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. Notes: svn path=/head/; revision=155921
* Use __DEVOLATILE to cast conspeed.Warner Losh2005-12-071-1/+1
| | | | Notes: svn path=/head/; revision=153195
* Reorganize the interrupt handling code a bit to make a few things cleanerJohn Baldwin2005-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel) Notes: svn path=/head/; revision=151658
* Eliminate two unused arguments to ttycreate().Poul-Henning Kamp2005-10-161-1/+1
| | | | Notes: svn path=/head/; revision=151383
* 'PC Card' instead of other variantsWarner Losh2005-09-221-2/+2
| | | | Notes: svn path=/head/; revision=150460
* Last change to this file actually removed the oldcard compat code.Warner Losh2005-09-191-2/+1
| | | | | | | This change removes one last K&Rism. Notes: svn path=/head/; revision=150307
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh2005-09-191-21/+9
| | | | | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. Notes: svn path=/head/; revision=150306
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-295-5/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Oops, revert a commit that snuck in with the earlier critical sectionJohn Baldwin2005-04-051-1/+0
| | | | | | | | | changes. Noticed by: bde Notes: svn path=/head/; revision=144677
* Divorce critical sections from spinlocks. Critical sections as denoted byJohn Baldwin2005-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | critical_enter() and critical_exit() are now solely a mechanism for deferring kernel preemptions. They no longer have any affect on interrupts. This means that standalone critical sections are now very cheap as they are simply unlocked integer increments and decrements for the common case. Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter() and spinlock_exit(). This KPI is responsible for providing whatever MD guarantees are needed to ensure that a thread holding a spin lock won't be preempted by any other code that will try to lock the same lock. For now all archs continue to block interrupts in a "spinlock section" as they did formerly in all critical sections. Note that I've also taken this opportunity to push a few things into MD code rather than MI. For example, critical_fork_exit() no longer exists. Instead, MD code ensures that new threads have the correct state when they are created. Also, we no longer try to fixup the idlethreads for APs in MI code. Instead, each arch sets the initial curthread and adjusts the state of the idle thread it borrows in order to perform the initial context switch. This change is largely a big NOP, but the cleaner separation it provides will allow for more efficient alternative locking schemes in other parts of the kernel (bare critical sections rather than per-CPU spin mutexes for per-CPU data for example). Reviewed by: grehan, cognet, arch@, others Tested on: i386, alpha, sparc64, powerpc, arm, possibly more Notes: svn path=/head/; revision=144637
* Simplify the "and if we're in the debugger, don't use locks" logic,Robert Watson2005-02-081-9/+5
| | | | | | | | | correcting some misthinking. Discussed with (really this time): bde Notes: svn path=/head/; revision=141530
* When entering siocnputc() with (kdb_active), don't acquire (orRobert Watson2005-02-031-5/+9
| | | | | | | | | | | | | | release) the sio spin mutex, as use of synchronization primitives in the debugger can result in substantial problems. With this patch in place entering the debugger via a serial console is made substantially more reliable. MFC after: 1 week Tested by: kris Discussed with: bde Notes: svn path=/head/; revision=141186
* puc handles this card, so remove it from here.Warner Losh2005-01-111-1/+0
| | | | | | | PR: 48468 Notes: svn path=/head/; revision=140024
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-062-2/+2
| | | | Notes: svn path=/head/; revision=139749
* Remove local hacks to set flags now that the device probe does this for us.Nate Lawson2004-10-141-4/+0
| | | | | | | | | | Tested on every device except sio_pci and the pc98 fd.c. Perhaps something similar should be done for the "disabled" hints also. MFC after: 2 weeks Notes: svn path=/head/; revision=136520
* Use generic tty code instead of local stuff.Poul-Henning Kamp2004-10-131-521/+79
| | | | | | | NB: device names are now consistent: {cua,tty}d$(port)[.lock,.init] Notes: svn path=/head/; revision=136478
* Use ttyconsolemode() to set the console tty modes.Poul-Henning Kamp2004-10-121-8/+1
| | | | Notes: svn path=/head/; revision=136450
* MFpc98: Check a pointer is NULL, remove unused variable.Yoshihiro Takahashi2004-09-201-3/+4
| | | | Notes: svn path=/head/; revision=135516
* Fix an issue with ng_tty which (ab)used the tty->t_sc field which isPoul-Henning Kamp2004-09-171-4/+6
| | | | | | | | | reserved for the device drivers: Add a t_lsc field for line discipline private use. Notes: svn path=/head/; revision=135406
* Use ttyalloc() instead of ttymalloc(NULL)Poul-Henning Kamp2004-09-171-1/+1
| | | | Notes: svn path=/head/; revision=135367
* Allocate tty at attach time rather than open time.Poul-Henning Kamp2004-09-161-49/+43
| | | | | | | | | | | Use the init/lock*in/out fields in struct tty and remove them from our softc. Use tty->t_sc to find out softc when convenient. Mostly OK'ed by: bde Notes: svn path=/head/; revision=135329
* If you insert a pccard modem and then eject it, you get a panic. ThisWarner Losh2004-07-221-1/+2
| | | | | | | | | | happens because the sio device was never opened and com->tp is therefore NULL. ttygone can't swallow a NULL, so guard against that possibility. Other places in this function make similar checks, so I believe this is correct. Notes: svn path=/head/; revision=132561
* Preparation commit for the tty cleanups that will follow in the nearPoul-Henning Kamp2004-07-151-2/+2
| | | | | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming. Notes: svn path=/head/; revision=132226
* Introduce ttygone() which indicates that the hardware is detached.Poul-Henning Kamp2004-07-111-38/+5
| | | | | | | Move dtrwait logic to the generic TTY level. Notes: svn path=/head/; revision=131981
* Update for the KDB framework. Sanitize the alpha console code now thatMarcel Moolenaar2004-07-101-209/+76
| | | | | | | | | | | | | | | | | | | | | it's in the way even more. Basicly: remove all alpha specific console support from gfb(4), sio(4) and syscons(4). Rewrite the alpha console initialization to be identical to all other platforms. In a nutshell: call cninit(). The platform specific code now only sets or clears RB_SERIAL and thus automaticly causes the right console to be selected. sio.c: o Replace the remote GDB hacks and use the GDB debug port interface instead. o Make debugging code conditional upon KDB instead of DDB. o Call kdb_alt_break() instead of db_alt_break(). o Call kdb_enter() instead of breakpoint(). o Remove the ugly compatibility of using the console as the debug port. Notes: svn path=/head/; revision=131939
* Define the tty methods as typedefs.Poul-Henning Kamp2004-06-301-3/+2
| | | | | | | | | Change the return type for t_break to void. Add t_ioctl (more about this later). Notes: svn path=/head/; revision=131373
* - Shorten the names for the TTY related swi interrupt handlers as theJohn Baldwin2004-06-281-2/+2
| | | | | | | | | | | 'tty:' prefix is largely redundant. - Fix the priority of the low-priority TTY SWIs that are hung off of the softclock thread. Submitted by: bde (2) Notes: svn path=/head/; revision=131242
* Guard against us having no tty pointer.Poul-Henning Kamp2004-06-271-1/+2
| | | | Notes: svn path=/head/; revision=131185
* Pick the hotchar out of the tty structure instead of caching privatePoul-Henning Kamp2004-06-261-6/+5
| | | | | | | | | | | copies. No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a change in ldisc is insane so no locking of the hotchar field is necessary. Notes: svn path=/head/; revision=131134
* Use generic support for modemcontrol and BREAK ioctls.Poul-Henning Kamp2004-06-251-79/+64
| | | | Notes: svn path=/head/; revision=131094