summaryrefslogtreecommitdiffstats
path: root/sys/isa/isa_common.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow device hints to wire the unit numbers of devices.jhb2008-11-181-64/+69
| | | | | | | | | | | | | | | | | | | | - 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
* MFp4:imp2008-11-021-3/+19
| | | | | | Make the ISA bus keep track of more PNP details. Plus a minor style fix while I'm here. More could be done here, but except for some SBCs that don't have ACPI, there's limited value to anybody in doing so.
* MFp4 (my newcard tree):imp2008-08-241-54/+0
| | | | | ISACFGATTR_MULTI is unused. Retire it, and a function that has no side effects used to compute it.
* When trying to allocate a PnP BIOS memory resource, the code loops tryingjhb2007-04-171-1/+1
| | | | | | | to move up the start address until the allocation succeeds. If the alignment of the resource was 0, then the code would keep trying the same request in an infinite loop and hang. Force the request to always move start up by at least 1 byte each time through the loop.
* Make the ISAPNP code optional and only enable it on i386 and pc98 (usedmarius2006-06-121-0/+6
| | | | | | | | | for CBUS-PNP cards there) by default, as there are no amd64 and sparc64 machines with ISA slots and which therefore could make use of this code known to exist. For sparc64 this additionally allows to get rid of the compat shims for in{b,w,l}()/out{b,w,l}() etc and the associated hacks. OK'ed by: imp, peter
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-121-3/+0
|
* Add pnp and location info for the ISA bus. The pnp info is theimp2005-08-011-0/+25
| | | | | | | | primary vendor id for this device. The location is empty because ISA doesn't give one a way to generally locate a card. PNP BIOS entries do provide a way to locate cards, as do isa pnp cards. These locations will be added as soon as the code to remember them is written.
* Use STAILQ in preference to SLIST for the resources. Insert new resourcesimp2005-03-181-5/+5
| | | | | | | | | last in the list rather than first. This makes the resouces print in the 4.x order rather than the 5.x order (eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x). This also means that the pci code will once again print the resources in BAR ascending order.
* Protect against wrapping. This appaers to fix some hangs that peopleimp2005-01-231-1/+1
| | | | | | | | | have seen in the isa pnp case where a resource buts up against 0xffffffff. This would only impact when the board was booted without ACPI. Submitted by: Ed Maste (freebsd-stable <20050103145720.GA90754@sandvine.com>) MFC After: 5 days
* Formatting nitsimp2004-12-271-6/+6
|
* Get rid of #ifdef for legacy system. Move that into the MD code.imp2004-12-241-6/+5
| | | | Export minimal symbols to allow this to happen.
* A few style(9) changes before more extensive changes:imp2004-12-241-60/+55
| | | | | | | o u_intXX_t -> uintXX_t o use 8 character tabs o proper wrapping o return (value);
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-12/+12
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* - Make the isab devclass global to allow for multiple ISA bridge drivers.jhb2003-07-081-0/+17
| | | | | | | - Factor out code common to all ISA bridge drivers attach methods into a isab_attach() function. - Rename the PCI-ISA bridge driver's attach function to pci_isab_attach() and have it call isab_attach().
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Create a 'legacy' node for AMD64 as well as i386. While we'll neverpeter2003-04-301-1/+1
| | | | | | have to use it since all AMD64 machines are supposed to have acpi etc, I'm using it during development so I can avoid the acpi code for now. Yes, this is cheating.
* Add a module version number.mdodd2003-04-151-0/+1
|
* - Use __BUS_ACCESSOR() to define the ISA ivar accessor functions instead ofjhb2002-10-151-4/+4
| | | | | | | | homerolling our own version. - Rename the enum for memsize from ISA_IVAR_MSIZE to ISA_IVAR_MEMSIZE since using 'MSIZE' in the macro invocation of ISA_ACCESSOR() conflicts with the 'MSIZE' kernel option. The accessor function is still isa_get_msize().
* Don't leak memory in case device_add_child_ordered() returns NULL.phk2002-09-301-3/+6
| | | | Found by: FlexeLint
* Argh, isa(4), eisa(4) and mca(4) now attach to legacy(4) instead ofjhb2002-09-261-2/+2
| | | | | | | nexus(4) in the case of machines w/o equivalent bridges on a PCI bus. Reported by: winter Pointy hat to: jhb
* Fix style bugs:alfred2002-02-241-2/+3
| | | | | | | Missing `const' qualifier. Initialization in declaration. Submitted by: mike
* Give a little more information as to why pnp configuration of a devicealfred2002-02-241-1/+7
| | | | | | may have failed. Submitted by: Terry Lambert <tlambert2@mindspring.com>
* Use the new resource_list_print_type() function.tmm2001-12-211-40/+5
| | | | | Pass the bus device to isa_init() (this is needed for the sparc64 version).
* Rework the ISA PnP driver pnp and the PnP resource parser to fixyokota2001-09-051-2/+92
| | | | | | | | | | | | | | | | | | | | | | | | the following bugs. - When constructing a resource configuration, respect the order in which resource descriptors are read, in order to establish the correct mapping between the descriptors and configuration registers. "Plug and Play ISA Specification, Version 1.0a", Sec 4.6.1, May 5, 1994. "Clarifications to the Plug and Play ISA Specification, Version 1.0a", Sec 6.2.1, Dec. 10, 1994. - Do not ignore null (empty) descriptors; they are valid descriptors acting as filler. "Clarifications to the Plug and Play ISA Specification, Version 1.0a", Sec 6.2.1. - Correctly set up logical device configuration registers for null resources. "Clarifications to the Plug and Play ISA Specification, Version 1.0a" - Handle null resources properly in the resource allocator for the ISA bus.
* Add a new field, id_config_attr to the struct isa_device.yokota2001-09-031-0/+8
| | | | | It will be later used to store some flags to control PnP device configurations.
* Safety-check against empty PnP ID lists.msmith2001-08-301-1/+1
|
* DO NOT ALLOCATE 2+K OBJECTS ON THE KERNEL STACK!!!!julian2001-08-101-12/+25
| | | | found by: Getting my u-area overwritten
* It's possible for an ISA bus to be hung off an EISA bridge, so we need tomsmith2000-12-121-0/+1
| | | | reflect that here.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Staticize some malloc M_ instances.phk2000-12-081-1/+1
|
* Reduce code duplication by using the GET_RESOURCE_LIST bus method and relatedmdodd2000-11-281-26/+12
| | | | | | | | generic resource_list management functions. I'll deal with the EISA bits later. Not objected to by: new-bus
* Don't assume that any ISA device that fails to probe is a PnP device,jhb2000-07-121-9/+11
| | | | | | | | | | | | | instead, use the bus_print_child_* functions to display the error message. Also, since this is more of a warning than an error, hide it behind bootverbose. Similarly, if isa_assign_resources() fails to allocate resources to a device, use bus_print_child_header() instead of device_printf(), and display the resources that could not be allocated if bootverbose is true. Approved by: msmith Help from: mdodd
* Replace the unknown driver with a nomatch method in the isa driver.dfr2000-06-251-71/+70
| | | | | This allows ISA PnP drivers to be dynamically loaded after the kernel has booted.
* 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
* 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.
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-12-031-1/+5
| | | | | | | | | | | | | | | | 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
* 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.
* 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 struct resource_list* argument to resource_list_alloc anddfr1999-10-121-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | resource_list_release. This removes the dependancy on the layout of ivars. * Move set_resource, get_resource and delete_resource from isa_if.m to bus_if.m. * Simplify driver code by providing wrappers to those methods: bus_set_resource(dev, type, rid, start, count); bus_get_resource(dev, type, rid, startp, countp); bus_get_resource_start(dev, type, rid); bus_get_resource_count(dev, type, rid); bus_delete_resource(dev, type, rid); * Delete isa_get_rsrc and use bus_get_resource_start instead. * Fix a stupid typo in isa_alloc_resource reported by Takahashi Yoshihiro <nyan@FreeBSD.org>. * Print a diagnostic message if we can't assign resources to a PnP device. * Change device_print_prettyname() so that it doesn't print "(no driver assigned)-1" for anonymous devices.
* Disable pnp devices before running heuristic probes. This allows us todfr1999-10-031-2/+16
| | | | | 'hide' those devices from those probes so that they don't get probed and then re-probed later when the pnp probe is run.
* Change isa_get/set_flags() to device_get/set_flags().dfr1999-09-071-12/+3
|
* Only set the description if there is one in the matching isa_pnp_id.dfr1999-09-041-1/+2
|
* This represents essentially a complete rewrite of the ISA PnP code. Thedfr1999-09-011-19/+535
| | | | | | | | new system is integrated with the ISA bus code more cleanly and allows the future addition of more enumerators such as PnPBIOS and ACPI. This commit also enables the new pcm driver since it is somewhat tied to the new PnP code.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix a typo.mdodd1999-07-291-5/+5
| | | | | | Back out a few lines that I haven't dealt with properly yet. Snickered at by: Mike Smith
* Alter the behavior of sys/kern/subr_bus.c:device_print_child()mdodd1999-07-291-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - device_print_child() either lets the BUS_PRINT_CHILD method produce the entire device announcement message or it prints "foo0: not found\n" Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on the previous behavior of device_print_child() (printing the "foo0: <FooDevice 1.1>" bit of the announce message.) Provide bus_print_child_header() and bus_print_child_footer() to actually print the output for bus_generic_print_child(). These functions should be used whenever possible (unless you can just use bus_generic_print_child()) The BUS_PRINT_CHILD method now returns int instead of void. Modify everything else that defines or uses a BUS_PRINT_CHILD method to comply with the above changes. - Devices are 'on' a bus, not 'at' it. - If a custom BUS_PRINT_CHILD method does the same thing as bus_generic_print_child(), use bus_generic_print_child() - Use device_get_nameunit() instead of both device_get_name() and device_get_unit() - All BUS_PRINT_CHILD methods return the number of characters output. Reviewed by: dfr, peter
* * Add ivars for ISA pnp.dfr1999-05-301-2/+49
| | | | | | * Move isa_dma* declarations to isavar.h. * Add a method ISA_DELETE_RESOURCE() to the ISA interface. * Tidy up include protection defines.
* * Change device_add_child_after() to device_add_child_ordered() which isdfr1999-05-281-6/+3
| | | | | | | easier to use and more flexible. * Change BUS_ADD_CHILD to take an order argument instead of a place. * Define a partial ordering for isa devices so that sensitive devices are probed before non-sensitive ones.
* * Factor out the common code between the isa bus drivers for i386 and alpha.dfr1999-05-221-0/+395
* Re-work the resource allocation code to use helper functions in subr_bus.c. * Add simple isa interface for manipulating the resource ranges which can be allocated and remove the code from isa_write_ivar() which was previously used for this purpose.
OpenPOWER on IntegriCloud