summaryrefslogtreecommitdiffstats
path: root/sys/isa
Commit message (Collapse)AuthorAgeFilesLines
* Fixed regressions in rev.1.274:bde2000-02-151-11/+15
| | | | | | | | | | | | | | | | 1) Non-AST4 multiport cards were broken by bypassing the code that changes `idev' to the multiport master device. 2) AST4 multiport cards apparently were broken by inverting the test for the master device having an irq. 3) Error handling for nonexistent master devices was broken by removing a check for a null pointer. 4) `int' error codes returned by bus_get_resource() were assigned directly to the boolean variable com->no_irq. Probably harmless, since the boolean is implemented as a u_char. Submitted by: part 1) by Chris Radek <cradek@in221.inetnebr.com> part 2) by yokota Approved by: jkh
* When allocating resources in the following cases:msmith2000-02-111-5/+5
| | | | | | | | | | | | | | | | | | | | - trying for a fit for a PnP configuration from a device - soaking up resources from a configuration that were not allocated by the driver do not attempt to activate them. Only a device driver that is aware of the nature of the resource and its suitability can be certain that activating a resource, particularly a memory resource, is a safe thing to do. This was prompted by the discovery that many systems report all physical memory through a PNP0c02 device; activating this resource maps all physical memory into the kernel's virtual space, either blowing out the kernel pagetable or in the worst case causing a panic in pmap_mapdev() if the system has too much physical memory. Authorised by: jkh Reviewed by: dfr
* Use config's conditional compilation rather than using #ifdefs that makepeter2000-01-295-30/+3
| | | | | modular compilation harder. I'm doing this because people seem to like cut/pasting examples of bad practices in existing code.
* Remove #include "ppc.h" and #if NPPC > 0 - this is always true as it ispeter2000-01-291-4/+0
| | | | 'optional ppc' in conf/files*
* "Completed" the previous fix. Return ENOMEM on memory allocation failurebde2000-01-291-1/+8
| | | | | in sioattach(), not ENXIO. Free resources before returning early in sioprobe() and sioattach().
* * Don't use ivars to access resources, bus_set/get_resource is much better.dfr2000-01-251-10/+26
| | | | * First approximation of making this work on alpha (not working yet).
* Return ENXIO on error, not 0. Seems to have been skipped when convertingn_hibma2000-01-231-1/+1
| | | | | | to newbus. Reviewed by: bde
* Add another four device ID's for isa pnp modems. The USR's seem to usepeter2000-01-181-0/+7
| | | | | | | the same vendor and logical ID. The rest I am not sure whether they are vendor or logical, but it won't hurt if I've put a vendor ID here as merely will not match. These came from the old sio-pnp code, hence the uncertainty about which ID it is.
* Add ADS7182 as a known Joystick.peter2000-01-181-0/+1
|
* Don't mark unallocated resources as active; the goal is to reserve them,msmith2000-01-181-1/+1
| | | | | | and there may be a good reason for them being unallocated (eg. they're nonsensical or not useful). The goal here is simply to reserve them against accidental use by other code.
* Don't do device_set_desc() until after checking for PnP probes. Otherwisepeter2000-01-141-3/+4
| | | | | | | | things like sound cards can get called "Parallel port". A note to the unwary; the isa-pnp devices in the system are probed like PCI - each device ID is passed to *all* isa probe routines to find the best match. If the driver is not prepared to deal with this, it must abort in this scenario or it will try and claim all PnP devices.
* Port of ppbus standalone framework to the newbus system.nsouch2000-01-142-318/+529
| | | | | | | | | | | | | | | | | | | | | Note1: the correct interrupt level is invoked correctly for each driver. For this purpose, drivers request the bus before being able to call BUS_SETUP_INTR and BUS_TEARDOWN_INTR call is forced by the ppbus core when drivers release it. Thus, when BUS_SETUP_INTR is called at ppbus driver level, ppbus checks that the caller owns the bus and stores the interrupt handler cookie (in order to unregister it later). Printing is impossible while plip link is up is still TRUE. vpo (ZIP driver) and lpt are make in such a way that using the ZIP and printing concurrently is permitted is also TRUE. Note2: specific chipset detection is not done by default. PPC_PROBE_CHIPSET is now needed to force chipset detection. If set, the flags 0x40 still avoid detection at boot. Port of the pcf(4) driver to the newbus system (was previously directly connected to the rootbus and attached by a bogus pcf_isa_probe function).
* Make this compile on alphagallatin2000-01-131-1/+1
|
* Make the mouse cursor char code configurable via the CONS_MOUSECTLyokota2000-01-121-9/+9
| | | | | | ioctl. By popular demand.
* Add a new mechanism, cndbctl(), to tell the console driver thatyokota2000-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | ddb is entered. Don't refer to `in_Debugger' to see if we are in the debugger. (The variable used to be static in Debugger() and wasn't updated if ddb is entered via traps and panic anyway.) - Don't refer to `in_Debugger'. - Add `db_active' to i386/i386/db_interface.d (as in alpha/alpha/db_interface.c). - Remove cnpollc() stub from ddb/db_input.c. - Add the dbctl function to syscons, pcvt, and sio. (The function for pcvt and sio is noop at the moment.) Jointly developed by: bde and me (The final version was tweaked by me and not reviewed by bde. Thus, if there is any error in this commit, that is entirely of mine, not his.) Some changes were obtained from: NetBSD
* Removed some more vestiges of ft.bde2000-01-091-5/+2
| | | | Fixed some style bugs.
* Futher cleanup.. "device_print_prettyname(); printf()" -> device_printf()peter2000-01-082-55/+47
| | | | | | | | | It seems that the IDE system uses 0x3f6 for itself, which conflicts with fdc's default 0x3f0-3f7 allocation range. Sigh. Work around this. Use bus_set_resource() rather than allocating specific areas, it makes the code a little cleaner. Based on work by: dfr
* Merge most of FDC_YE into the mainline driver.imp2000-01-063-78/+32
| | | | | | | | | | | | | | | | | o Rename FDC_PCMCIA to FDC_NODMA to allow systems that don't have dma for floppies. o Remove all but two FDC_YE ifdefs. They aren't needed. o Move defines for YE_DATAPORT to fdreg.h. Not fixed: o The pccard probe/attach. However, motivated individuals can more easily add this now. This is a merge of changes I've had in my tree for a long time. These fixes were tested on my VAIO with its normal floppy. Please let me know if I broke anything. Prodded by: Peter Wemm <peter@freebsd.org>
* Make the evil broken pnpbios compensation slightly less evil.peter2000-01-051-15/+20
| | | | | | | This is the hack that compensates for when bios vendors "forget" to include the fdc control (0x3f7) port in their io port mappings. Instead of accessing ports outside of a range allocated to a handle, simply allocate the port directly. It even shows up in the probe..
* Patch up some of the evilness left over from the early newbus porting.peter2000-01-052-83/+154
| | | | | | | | | | In particular: - Don't leave resources allocated in the probe routine. Allocate them during probe and release them. Probe's job is to identify devices only. - Don't abuse the ivars pointer.. (!). Create real ivars and use the proper access system. (the bus_read_ivar method) - Don't add the children until attach() has successfully grabbed the hardware, otherwise there are potential leaks if attach fails.
* ISA device drivers use the ISA source interrupt number in locations wheretegge2000-01-041-9/+27
| | | | | | | | | | | | | | the low level interrupt handler number should be used. Change setup_apic_irq_mapping() to allocate low level interrupt handler X (Xintr${X}) for any ISA interrupt X mentioned in the MP table. Remove an assumption in the driver for the system clock (clock.c) that interrupts mentioned in the MP table as delivered to IOAPIC #0 intpin Y is handled by low level interrupt handler Y (Xintr${Y}) but don't assume that low level interrupt handler 0 (Xintr0) is used. Don't allocate two low level interrupt handlers for the system clock. Reviewed by: NOKUBI Hirotaka <hnokubi@yyy.or.jp>
* Recognize the CSC0101 ID for the Thinkpad series.peter1999-12-301-0/+1
| | | | | PR: 15633 Submitted by: gibbs
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-293-5/+5
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Added following modes:kato1999-12-281-8/+21
| | | | | | | | | | | 5in HD 2 heads, 77 cylinders, 8 sectors/track, 1024 bytes/sector 5/3.5in DD 2 heads, 80 cylinders, 8 sectors/track, 512 bytes/sector Meanings of the rogrammer-readeble fd name were explained by Brian Fundakowski Feldman and Peter Wemm in hackers list and NOKUBI Hirotaka. Reviewed by: nyan
* Recognize the GVC0505 (GVC 56k Faxmodem) as a sio device.peter1999-12-271-0/+1
| | | | Obtained from: Dan J Fraser <dfraser@capybara.org> (for NetBSD)
* Fixed races accessing the RTC. The races apparently causedbde1999-12-251-4/+16
| | | | | | | | | | | | | | | apm_default_resume() to sometimes set a very wrong time. (1) Accesses to the RTC index and data registers were not atomic enough. Interrupts were not masked. This was only good enough until an interrupt handler (rtcintr()) started accessing the RTC in FreeBSD-2.0. (2) Access to the block of time registers in inittodr() was not atomic enough. inittodr() has 244us to read the time registers. Interrupts were not masked. This was only good enough until something (apm) started calling inittodr() after boot time in FreeBSD-2.0. The fix for (2) also makes the timecounter update more atomic, although this is currently unimportant due to the low resolution of the RTC. Problem reported by: mckay
* Extract a list of extra isa pnp modem ID's from NetBSD and OpenBSD. Somepeter1999-12-211-7/+47
| | | | | | | of these are bound to have a PNP05xx compatid, but there's no easy way to tell. Since it's just an ID list and uses the pnp header's description strings rather than encoding strings here, it doesn't seem to be too expensive to err on the safe side.
* Add a flag to disable FIFO probing. The code seems to have a chance ofjoerg1999-12-211-1/+3
| | | | | | | | | | | | | misdetecting FIFO capabilities, at least on my girlfriend's Thinkpad 755, the driver doesn't work using the FIFO. While i was at it, i (partially) fixed option FCC_YE since it would no longer have compiled at all under -current. I've also made an attempt to document the device driver flags value (ab-)used internally by this option. RELENG_3 candidate, but with a slightly different patch there (will go to jkh in email).
* Add SUP2070 (Diamond SupraExpress 56i)peter1999-12-201-0/+2
| | | | | | | Submitted by: Kenneth Wayne Culver <culverk@wam.umd.edu> Add MOT4560 Obtained from: wollman
* Remove references to register_intr() etc in comments.peter1999-12-201-1/+1
|
* Removed unnecessary include files.nyan1999-12-201-1/+0
|
* - Add the device resume method. It supercedes the existing resumeyokota1999-12-151-36/+18
| | | | | | routine which hooks the apm driver. - Rename the PSM_HOOKAPM option to PSM_HOOKRESUME. - Delete unnecessary #include.
* Make this kld'able (#include "joy.h" no longer required as there are nopeter1999-12-121-3/+0
| | | | references to NJOY any more after newbusification)
* o Make pccard work at all by including card.himp1999-12-101-12/+18
| | | | | | | | | | | | | o fix return type of sio_pccard_detach o don't free softc in deatch, since that is done by newbus o disconnect interrupt we used to have. Add cookie to com so that we can tear down the interrupt on unload o Set gone earlier, but likely doesn't matter This makes sio pccards work again. Cards that are active when ejects may not work (but they might, softc goes away quickly). These changes are unreviewed by bde. I'll make any style changes he wants.
* Fix a pair of silly warnings that I introduced (that would have beenpeter1999-12-061-7/+7
| | | | nasty on an Alpha or some other sizeof(int) != sizeof(long) machine).
* Add a truely evil workaround (hack!) for some unfortunate BIOSpeter1999-12-061-6/+23
| | | | | | | | | | | programming practices. It seems that newer fdc chips have an alternative way of setting the transfer speed (including high speed modes for floppy tape) that doesn't use the control register (which we don't support - we use the old way only). So, they (the BIOS programmers) sometimes leave out the 0x3f6 control register from the PnP ports descriptor(!!). "Hey, it works with windows, so what's the problem?" :-( Anyway, this hack tries to compensate for that. This was discussed with dfr (who did the pnp attachment).
* Use bus_get_resource() instead of bus_get_resource_start() as the latterpeter1999-12-061-17/+24
| | | | | | | | | returns "0" on failure, which is indistinguishable from (say) irq 0. This should stop a couple of stray messages that turn up. Also, if a BUS_SETUP_INTR() fails with INTR_TYPE_FAST, try falling back to a normal interrupt. This might help pccard folks with a shared slot interrupt. This whole thing needs to be revisited.
* newbusify and port the joy driver to the Alpha. It now attaches to thepeter1999-12-051-134/+126
| | | | | | | | joystick port on PnP sound cards that have a suitable device ID on them. Doug Rabson added timer code so it didn't have to beat on the isa timer. Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-12-034-4/+10
| | | | | | | | | | | | | | | | device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr
* Fix the hang on card eject problem and maybe the hang on suspendimp1999-12-011-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | problem. o Create new timeout routine so we don't detach the card inside a ISR but instead drop back to spl0 via a timeout of 0. o Actually delete the child of the pccard device rather than just faking it badly. o Fix sio, ed and ep to have pccard detach routines that are int rather than void. o Fix ep and ed pccard detach routines to use if_detach rather than just if_down. if_detach destroys the device, while if_down just marks it down. In this incarnation of the pccard things, we map the disable the slot action to detach the driver, which removes the driver from the device tree. When that is done, a panic would soon follow as the ifconfig tried to down the device. Didn't fix: o Should cache the pccard dev child's pointer in struct slot o remove now unused parts of struct slot o Any driver using softc after detach has been called. sio's softc used to be statically allocated, so you could check sc->gone, but that is now gone. o Didn't remove gone from softc of drivers that use the old pccard method. Didn't test: o ed driver changes o sio driver changes on pccards o suspend (no laptop or apm support on my desktop)
* Allow a DMA channel of 0. This gets the on-board mss audio device workinggallatin1999-11-221-1/+1
| | | | | | on Digital AlphaStations 200 and 500 machines (and probably others as well). Submitted by: dfr
* Allow NULL for startp and/or countp in bus_get_resource() so that you canpeter1999-11-201-2/+4
| | | | get one of the two without having to use a dummy variable.
* Argh, don't turn the IIR test on unless it's a pccard. These tests messpeter1999-11-181-24/+20
| | | | up the subsequent probes.
* Merge some typo fixes from dev/sio/sio.c (siostop -> comstop)peter1999-11-181-47/+93
| | | | | | | | | | | | | | | Remove EXTRA_SIO/NSIOTOT and make it fully dynamic (from dev/sio/sio.c) Make sio work for pccard here - pccardd doesn't activate interrupts until after prove has succeeded. Mark the initial reset of likely sio ports as broken as it depended on config supplying a list of locations to probe, devices are now proved standalone. Optimize a bit of COM_NOAST4() logic. Use bus_get_resource_start() etc rather than using isa-centric calls. Reactivate the IIR_TXRDYBUG test, I've got a card here with it. Try to be a bit smarter about activating interrupts (ie: don't panic if polled) Fix some style bugs that have crept in over time (there are still more).
* Tidy up a few loose ends in the fifo setup code.peter1999-11-181-20/+1
| | | | | | Don't use NFDC as an arbitary limit, it is not required and goes against using PnP fdc devices (eg: when PNPBIOS is turned on, the motherboard devices (sio, fdc, etc etc) are detected via PnP, not config(8).)
* Reorganise the code so that I can add custom identify drivers dynamicallydfr1999-11-111-1/+71
| | | | | | | | during autoconfig to support strange hardware (such as the Yamaha DS-1) which implements 'legacy' ISA devices as well as a PCI device. This will allow the PCI driver for the YMF724 to add the legacy devices to the ISA bus and will allow the PnP system to automatically allocate the resources for those devices.
* Add code to support ISA PnP.dfr1999-11-112-46/+128
|
* Use cdevsw_add() (temporarily) to avoid DEV_DRIVER_MODULE(), since thepeter1999-11-081-1/+2
| | | | make_dev()'s that are there are not enough.
* Use DEVICE_MODULE() directly instead of DEV_DRIVER_MODULE. psm.c usespeter1999-11-081-1/+1
| | | | make_dev() already.
* i8254_restore is called from apm_default_resume() to reloadiwasaki1999-10-301-0/+22
| | | | | | | | | | | | the countdown register. this should not be necessary but there are broken laptops that do not restore the countdown register on resume. when it happnes, it messes up the hardclock interval and system clock, which leads to the infamous "calcru: negative time" problem. Submitted by: kjc, iwasaki Reviewed by: Steve O'Hara-Smith <steveo@eircom.net> and committers. Obtained from: PAO3
OpenPOWER on IntegriCloud