summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pci.c
Commit message (Collapse)AuthorAgeFilesLines
* Add 5th parameter to pci_read_device specifying the size of the objectimp2002-03-131-5/+4
| | | | to create.
* Use the pci.c code wherever possible, rather than copying all the pciimp2002-02-271-54/+49
| | | | | | | | | | | | | | code into cardbus and s/pci/cardbus. This exposes a few pci_* functions that are now static. This work is similar to work Justin posted to the mobile list about a year or two ago, which I have neglected since then. This is a subset of his current work with the multiple inheritance newbus architecutre. When completed, that will eliminate the need for pci/pci_private.h. Similar work is needed for the cardbus_cis and pccard_cis code as well.
* Implement 2 small helper functions:mdodd2002-01-101-0/+35
| | | | | pci_find_bsf() - Find a device_t by bus/slot/function. pci_find_device() - Find a device_t by vendor/device ID.
* Use the new resource_list_print_type() function to print resource listtmm2001-12-211-34/+3
| | | | | contents, and the new __BUS_ACCESSOR macro to construct the accessor functions.
* Add support for the Intel 82443MX chipsetpirzyk2001-12-211-1/+2
| | | | | PR: kern/33032 MFC after: 1 month
* Don't put variable declarations in header files, put prototypes.mdodd2001-12-191-0/+2
| | | | 'pci_devq' provides useful information now.
* Add PCI_ENABLE_IO_MODES option, for BIOSen that neglect this.jlemon2001-10-251-0/+1
| | | | Submitted by: Andrew R. Reiter arr@watson.org
* Re-route interrupts on ia64 so that we can get the I/O SAPIC interruptdfr2001-10-051-1/+12
| | | | | numbers (the BIOS leaves legacy PIC interrupt numbers in the intline registers).
* Small nit: Make both prints use 'at device %d.%d'.n_hibma2001-09-011-1/+1
|
* Ugggg. I thought I'd already committed this to -current:imp2001-08-271-1/+1
| | | | | If the intline is 0 or 255, then it needs an interrupt routed. Some Sony laptops improperly flag devices that need an interrupt with 0 :-(.
* Backout previous revision. While it fixed many platforms, it brokegallatin2001-05-311-5/+1
| | | | | | | all alphas with devices behind ppb's. I'm working on a better solution now. Note that all alphas that use per-platform interrupt mapping are broken again (as they have been for several months)
* finally fix intr routing on alphas such as the as500 after months ofgallatin2001-05-271-1/+5
| | | | | | | | | | | | | | | | | | | breakage: - call PCIB_ROUTE_INTERRUPT() regardless of how valid the intline looks. Some alphas leave garbage in the intline and leave the intr mapping to OS platform support routines that map slots/buses to intlines - Down in the alpha pci code, first try platform.pci_intr_route() and if it doesn't exist or returns garbage, just read the intline out of config space. tested on AS500 (garbage in intline) and UP1000 (PC-like, intline is valid) Note that a nice little hack like the APIC_IO section of pci_cfgregread() is not workable. This is because the calling interface for alpha_pci_route_interrupt() requires us to figure out the bus/slot/etc from a device_t. At pci_read_device() time, we don't have a device_t for the bus/slot/func in question.
* The serverworks OSB4 pci->isa bridge has the same mapping register atpeter2001-03-151-3/+3
| | | | offset 0x90 for the SMBus device as the PIIX4.
* Slightly reimplement some recently added helper functions as methods, sopeter2001-02-271-29/+46
| | | | | that drivers are not reaching into the internals of the pci bus. There are no driver changes, the public interface is the same.
* Fix typo: wierd -> weird.asmodai2001-02-061-1/+1
| | | | There is no such thing as wierd in the english language.
* Sanity check ptr for legal values so it is less likelymjacob2001-01-011-0/+6
| | | | | | (but not impossible) to get stuck in an infinite loop. Obtained from: msmith@freebsd.org
* Remove a redundant prototype.msmith2000-12-131-1/+0
|
* Don't try to free the now-nonexistent hdrspec field. This one snuck bymsmith2000-12-131-2/+0
| | | | me in the previous round of patches. Oops.
* Next round of PCI subsystem updates:msmith2000-12-131-541/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Break out the /dev/pci driver into a separate file. - Kill the COMPAT_OLDPCI support. - Make the EISA bridge attach a bit more like the old code; explicitly check for the existence of eisa0/isa0 and only attach if they don't already exist. Only make one bus_generic_attach() pass over the bridge, once both busses are attached. Note that the stupid Intel bridge's class is entirely unpredictable. - Add prototypes and re-layout the core PCI modules in line with current coding standards (not a major whitespace change, just moving the module data to the top of the file). - Remove redundant type-2 bridge support from the core PCI code; the PCI-CardBus code does this itself internally. Remove the now entirely redundant header-class-specific support, as well as the secondary and subordinate bus number fields. These are bridge attributes now. - Add support for PCI Extended Capabilities. - Add support for PCI Power Management. The interface currently allows a driver to query and set the power state of a device. - Add helper functions to allow drivers to enable/disable busmastering and the decoding of I/O and memory ranges. - Use PCI_SLOTMAX and PCI_FUNCMAX rather than magic numbers in some places. - Make the PCI-PCI bridge code a little more paranoid about valid I/O and memory decodes. - Add some more PCI register definitions for the command and status registers. Correct another bogus definition for type-1 bridges.
* Cosmetic nit; separate slot/function with '.' not ':'msmith2000-12-091-1/+1
|
* - Fix the device database parsing code so that it actually works.msmith2000-12-091-9/+29
| | | | | | | | | | - Improve the formatting for devices identified by the database. - Fix the pcib_route_interrupt method definition, as an old version snuck in here somehow 8( - Remove a couple of the vendor/device IDs for PCI:ISA bridges which correctly identify themselves. Submitted by: peter
* Next phase in the PCI subsystem cleanup.msmith2000-12-081-131/+221
| | | | | | | | | | | | | | | | | | | | - Move PCI core code to dev/pci. - Split bridge code out into separate modules. - Remove the descriptive strings from the bridge drivers. If you want to know what a device is, use pciconf. Add support for broadly identifying devices based on class/subclass, and for parsing a preloaded device identification database so that if you want to waste the memory, you can identify *anything* we know about. - Remove machine-dependant code from the core PCI code. APIC interrupt mapping is performed by shadowing the intline register in machine- dependant code. - Bring interrupt routing support to the Alpha (although many platforms don't yet support routing or mapping interrupts entirely correctly). This resulted in spamming <sys/bus.h> into more places than it really should have gone. - Put sys/dev on the kernel/modules include path. This avoids having to change *all* the pci*.h includes.
* Reduce code duplication by using the GET_RESOURCE_LIST bus method and relatedmdodd2000-11-281-45/+18
| | | | | | | | generic resource_list management functions. I'll deal with the EISA bits later. Not objected to by: new-bus
* fix warning compile error about unused variabledarrenr2000-10-291-0/+2
|
* Fix params passed to pci_porten() and pci_memen().phk2000-10-291-2/+2
|
* Unconditionally turning on the I/O and memory enable bits in the PCImsmith2000-10-281-1/+14
| | | | | | | command register is too aggressive. Revert to the previous behaviour, but leave the new behaviour available as an undocumented option. It's not clear what the Right, Right Thing is to do here, but the more conservative approach is safer.
* Allow PCI busses to be connected to host bridges detected by ACPI as well.msmith2000-10-281-0/+1
|
* Write the routed interrupt back to PCI configuration space.msmith2000-10-191-1/+1
|
* The previous commit broke kernel builds on alpha (and probably ia64).gallatin2000-10-161-0/+2
| | | | | | #ifdef away the offending code until somebody with more newbus fu than me can figure out where to put a default function that returns 255 without touching each alpha chipset driver..
* When a pci device hasn't had an interrupt routed to it (signified byimp2000-10-161-0/+19
| | | | | | | the intline of 255) go ahead and route the interrupt when we allocate an interrupt. Submitted by: msmith
* Validate the PCI bus number that we fetch from our parent, since there's nomsmith2000-10-091-2/+5
| | | | guarantee that everything attached to *it* is a PCI bus.
* When dumping the 'found devices' list in verbose mode, actually show thepeter2000-09-051-0/+2
| | | | | | bus/slot/function numbers. The old PCI code used other markers or something, but without it here under the new pci code it is very hard to tell which device is which (this only affects bootverbose mode).
* If a base address register has been set up by the BIOS, but the relevantmsmith2000-09-011-6/+13
| | | | | | | enable bit hasn't been set in the command register, set the bit and honour the register. It seems that quite a few lazy BIOS writers aren't bothering to do this, which upsets the existing code and causes us to miss out on properly-configured devices.
* Remove duplicate static definition of pci_devclasspeter2000-08-311-1/+0
|
* * Completely rewrite the alpha busspace to hide the implementation fromdfr2000-08-281-177/+174
| | | | | | | | | | | | the drivers. * Remove legacy inx/outx support from chipset and replace with macros which call busspace. * Rework pci config accesses to route through the pcib device instead of calling a MD function directly. With these changes it is possible to cleanly support machines which have more than one independantly numbered PCI busses. As a bonus, the new busspace implementation should be measurably faster than the old one.
* Nuke the useless chip driver. It gets in the way when you want to loaddfr2000-06-091-0/+1
| | | | a functional driver for the device.
* Encapsulate the old PCI compatability support and APIs completely underpeter2000-05-281-104/+2
| | | | | | "options COMPAT_OLDPCI". This option already existed, but now also tidies up the declarations in #include <pci/pci*.h>. It is amazing how much stuff was using the old pre-FreeBSD 3.x names and going silently undetected.
* Back out the previous change to the queue(3) interface.jake2000-05-261-3/+3
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-3/+3
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Print the correct value for the map type on a verbose boot.dfr2000-05-181-1/+1
| | | | | PR: kern/18662 Submitted by: tamaru@ap.t.u-tokyo.ac.jp
* Update 'hose' (actually, MCPCIA instance #) for Alpha Rawhide systems.mjacob2000-05-071-1/+5
| | | | | We have *got* to fix this bogosity of trying to steal part of the PCI address space for this stuff.
* Fixed the type of some ivar access functions. Ivars have type uintptr_t,bde2000-04-301-1/+1
| | | | | | | not u_long. On i386's with 64-bit longs, returning u_longs indirectly in (more than) the space reserved for uintptr_t's tended to corrupt the previous frame pointer in the stack frame, so it was not easy to debug. The type mismatches are hidden by the bogus cast in DEVMETHOD().
* Remove unneeded <sys/buf.h> includes.phk2000-04-181-1/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* * Factor out the object system from new-bus so that it can be used bydfr2000-04-081-1/+1
| | | | | | | | | | non-device code. * Re-implement the method dispatch to improve efficiency. The new system takes about 40ns for a method dispatch on a 300Mhz PII which is only 10ns slower than a direct function call on the same hardware. This changes the new-bus ABI slightly so make sure you re-compile any driver modules which you use.
* Connect the ISA and PCI compatability shims to an option. In this casepeter2000-03-191-2/+5
| | | | | | | | it's options COMPAT_OLDISA and COMPAT_OLDPCI. This is meant to be a fairly strong incentive to update the older drivers to newbus, but doesn't (quite) leave anybody hanging with no hardware support. I was talking with a few folks and I was encouraged to simply break or disable the shims but that was a bit too drastic for my liking.
* Print the PCI resources even if they are disabled. This shows more clearlyn_hibma2000-03-181-6/+12
| | | | when the BIOS is forgetful about initialising the USB controllers.
* Alpha 8200 port: Until we fix things better, determine which alpha CPUmjacob2000-03-151-9/+37
| | | | | | | platform we're running on so we know how many bits to reserve at the top end for the 'hose' value. It turns out that there's *just* enough room to support all possible hoses on TurboLaser. Reviewed by: gallatin@freebsd.org, dfr@free3bsd.org
* o No need to print the vendor/device ID for things that matched succesfully.billf2000-02-221-5/+13
| | | | | | | o ``<device name>'' versus ``device name'' for things that fall under nomatch. Reviewed by: dfr (in principle) Approved by: Baron von Hubbard
* Remove the vga-pci driver. It serves no purpose and it hides the hardwaredfr2000-02-191-4/+3
| | | | | | | | from useful drivers such as the 3D DRI drivers I will be porting for hardware accelerated OpenGL. The hardware will still be reported during boot using the nomatch system. Approved by: jkh
* Spell "pci_delete_resource" correctly.peter2000-02-011-1/+1
| | | | Approved by: jkh (who must be very sick of requests now :-)
OpenPOWER on IntegriCloud