summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
Commit message (Collapse)AuthorAgeFilesLines
* 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 :-)
* Put a FYI in the compatability shims so that people are aware that theypeter2000-01-291-0/+1
| | | | | | | | | are using an old unconverted driver. Most (if not all) of the drivers for common hardware are newbus these days. However, we don't want to encourage people to take the easy way out and write new drivers using the shims. This is just passive "encouragement". Reviewed by: phk
* Show the port/mem/irq of pci devices too.peter2000-01-081-3/+37
|
* Make the usb and ide/ata device identification a little saner. Rather thanpeter1999-12-101-14/+7
| | | | | | attaching to the device via chip*, use the newbus nomatch method to report the device. This leaves them unattached so that a driver can be easily loaded to grab them later.
* [ repository copy of sys/pci/pci_ioctl.h to sys/sys/pciio.h happened in theken1999-12-081-1/+1
| | | | | | | | | | | | | | | | | background ] Rename sys/pci/pci_ioctl.h to sys/sys/pciio.h to make it easier for userland programs to use this interface. Reformat the file, and add a BSD-style copyright to it. Add a new man page for pci(4). The PCIOCGETCONF, PCIOCREAD, and PCIOCWRITE ioctls are documented, but the PCIOCATTACHED ioctl is not documented because it is not implemented. Change includes of <pci/pci_ioctl.h> to <sys/pciio.h> or remove them altogether. In many cases, pci_ioctl.h was unused. Reviewed by: steve
* Raise the pci compat driver match priority a bit so that it's notpeter1999-12-051-1/+1
| | | | quite so close to the chip* drivers.
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-12-031-2/+2
| | | | | | | | | | | | | | | | 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
* Make the pci driver compat shim return a preference for probepeter1999-11-301-1/+2
| | | | | | | rather than an "it's mine!" so that other newbus-aware drivers can bid for the device too. This should allow the sym driver to out-bid the ncr driver for devices it supports without having to modify ncr.c at all. ncr would then function as a catch-all.
* Feh, kind of went wrong the previous commit. dev should child (in somen_hibma1999-11-221-5/+5
| | | | cases) plus a typo.
* Move the pretty printing of the description for USB controllers ton_hibma1999-11-221-2/+15
| | | | | | | | | pci_probe_nomatch, so it won't be in the way when loading USB as a module. The reason for them being there in the first place is that every motherboard comes with USB kit and this way it looks more pretty (peter). The real solution will be to define some method of detaching a driver after it has attached.
* 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.
* now that a map's base addr is 64-bits, the alpha multi-hose hack needsgallatin1999-11-031-4/+4
| | | | | to be cast to 64-bits in pci_add_map. This should allow XP1000s and DS20s to boot -current again.
* Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for thephk1999-10-301-2/+2
| | | | | | | | | "rw" argument, rather than hijacking B_{READ|WRITE}. Fix two bugs (physio & cam) resulting by the confusion caused by this. Submitted by: Tor.Egge@fast.no Reviewed by: alc, ken (partly)
* Don't test boolean return against != 1.phk1999-10-291-4/+4
| | | | Don't needlessly assign the error variable in an if statement.
* Fix some resource allocation peculiarities of the intpm device.dfr1999-10-281-65/+103
|
* Make sure we add an interrupt resource if intline!=255.dfr1999-10-261-1/+1
|
* Correct a stupid type which prevented us from working with any devicedfr1999-10-171-1/+1
| | | | which needed port resources.
* * Implement bus_set/get/delete_resource for pci.dfr1999-10-141-256/+141
| | | | | | | * Change the hack used on the alpha for mapping devices into DENSE or BWX memory spaces to a simpler one. Its still a hack and should be a seperate api to explicitly map the resource. * Add $FreeBSD$ as necessary.
* allow pci_ioctl to work with multi-hose alphas.gallatin1999-10-121-2/+2
| | | | | | | | Rather than teaching pci_ioctl about hoses, we just pass down a magic number & let the platform code figure out what the hose is based on what the bus number is. concept approved by dfr
* A band-aid to prevent multi-hose alpha chipsets (aka tsunami) fromgallatin1999-10-031-0/+4
| | | | | panic'ing because the hose is not filled in. We should probably extend the pciioctl interface to take hoses into account..
* Backout part of the changes made in 1.111roger1999-10-011-9/+1
| | | | | | | | | | | | | | | | | | For unknown devices the output will now be pci0: unknown card (vendor=0x109e, dev=0x0878) at 14.1 irq 19 instead of pci0: unknown card DD^0878 (vendor=0x109e, dev=0x0878) at 14.1 irq 19 Before this change, the code used to take the PCI vendor id and translate it into a three letter ASCII name. For PnP devices, the vendor id _does_ map to a nice ASCII name (eg Creative Labs PnP ID maps to "CTL", ESS PnP ID maps to "ESS") But there is no such mapping for PCI devices, as can be seen by the example above where the Brooktree PCI vendor ID maps to "DD^" The PCI Special Interest Group confirmed they do not have any mappings from vendor ID to ASCII.
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* Handle for passthru resource release correctly.luoqi1999-09-031-5/+4
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-22/+7
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Alter the behavior of sys/kern/subr_bus.c:device_print_child()mdodd1999-07-291-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 support for SYS_RES_DENSE and SYS_RES_BWX resource types. These aredfr1999-07-281-1/+13
| | | | | | | | | equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual() address of the resource is initialised to point into either dense-mapped or bwx-mapped space respectively, allowing direct memory pointers to be used to device memory. Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>
* Case matters.mdodd1999-07-271-3/+3
| | | | DEv_METHOD to DEV_METHOD.
OpenPOWER on IntegriCloud