summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pcireg.h
Commit message (Collapse)AuthorAgeFilesLines
* - Fix a small bit slip in PCIM_PCAP_D[0-2]PME defines.sepotvin2007-09-191-3/+5
| | | | | | | | - Add the definitions for D3PME_COLD and D3PME_HOT capabilities. Reviewed by: njl (mentor), imp Approved by: re (kensmith) MFC after: 1 week
* Change PCIM_CIS_ASI_TUPLE to _CONFIG.imp2007-05-161-3/+5
| | | | | | Add PCI_MAX_BAR_0 minor style nit. Add PCIM_CIS_CONFIG_MASK
* - HT 2.00b added a new flag to the MSI mapping HT capability to indicatejhb2007-04-251-0/+2
| | | | | | | | | | | that the MSI mapping window is fixed at 0xfee00000 and the capability does not include two more dwords used to program the address. Supporting this mostly results in quieting spurious warnings during boot about non-default MSI mapping windows. - HT 2.00b also added a new HT capability type, so support that in pciconf. MFC after: 3 days Tested by: jmg
* Add constants for the fields in a BAR. Also, add two new macrosjhb2007-03-311-0/+13
| | | | | | | PCI_BAR_(IO|MEM)() that return true if the passed in value from a BAR is for an IO or memory BAR, respectively. Reviewed by: imp
* - Add missing constants for subclasses.jhb2007-03-311-5/+31
| | | | - Add a few progif constants as well.
* - Flesh out list of UART simple comms programming interfaces.jhb2007-03-051-1/+15
| | | | | | | - Add list of PIC base peripheral programming interfaces. - Add VPD capability register offsets. MFC after: 3 days
* Add constants for the PCIY_VENDOR (vendor-specific), PCIY_DEBUG (EHCIjhb2007-02-021-0/+22
| | | | debug port), and PCIY_EXPRESS (PCI-express) capabilities.
* - Change the PCI-X registers constants to be relative to the PCI-X PCIjhb2007-01-191-15/+71
| | | | | | | | | capability rather than hardcoded offsets for a particular card. While I'm here, expand the constants some. - Change the ahd(4) driver to use pci_find_extcap() to locate the PCI-X capability to keep up with the first change. Reviewed by: scottl, gibbs (earlier version)
* Fix the subvendor ID for PCI-PCI bridges.jhb2007-01-161-3/+4
| | | | | | | | | | | - Retire the PCI_SUB*_1 constants and don't try to read a subvendor ID out of them. There isn't a standard subvendor ID field for PCI-PCI bridges. Instead, the dword at offset 0x34 is actually mostly reserved except for the LSB which is the capabilities pointer. - Add support for the PCI-PCI bridge subvendor ID capability (13) and use it to set the subvendor ID for PCI-PCI bridges. MFC after: 1 month
* Replace #define<space> with #define<tab> so the code is consistent withjhb2006-12-141-333/+333
| | | | style(9) and avoids mixing the two formats.
* - Add constants for HT PCI capability registers including the variousjhb2006-12-121-0/+21
| | | | | | | subtypes of HT capabilities. - Add constants for the MSI mapping window HT PCI capability. - On i386 and amd64, enable the MSI mapping window on any HT bridges we encounter and report any non-standard mapping window addresses.
* First cut at MI support for PCI Message Signalled Interrupts (MSI):jhb2006-11-131-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add 3 new functions to the pci_if interface along with suitable wrappers to provide the device driver visible API: - pci_alloc_msi(dev, int *count) backed by PCI_ALLOC_MSI(). '*count' here is an in and out parameter. The driver stores the desired number of messages in '*count' before calling the function. On success, '*count' holds the number of messages allocated to the device. Also on success, the driver can access the messages as SYS_RES_IRQ resources starting at rid 1. Note that the legacy INTx interrupt resource will not be available when using MSI. Note that this function will allocate either MSI or MSI-X messages depending on the devices capabilities and the 'hw.pci.enable_msix' and 'hw.pci.enable_msi' tunables. Also note that the driver should activate the memory resource that holds the MSI-X table and pending bit array (PBA) before calling this function if the device supports MSI-X. - pci_release_msi(dev) backed by PCI_RELEASE_MSI(). This function releases the messages allocated for this device. All of the SYS_RES_IRQ resources need to be released for this function to succeed. - pci_msi_count(dev) backed by PCI_MSI_COUNT(). This function returns the maximum number of MSI or MSI-X messages supported by this device. MSI-X is preferred if present, but this function will honor the 'hw.pci.enable_msix' and 'hw.pci.enable_msi' tunables. This function should return the largest value that pci_alloc_msi() can return (assuming the MD code is able to allocate sufficient backing resources for all of the messages). - Add default implementations for these 3 methods to the pci_driver generic PCI bus driver. (The various other PCI bus drivers such as for ACPI and OFW will inherit these default implementations.) This default implementation depends on 4 new pcib_if methods that bubble up through the PCI bridges to the MD code to allocate IRQ values and perform any needed MD setup code needed: - PCIB_ALLOC_MSI() attempts to allocate a group of MSI messages. - PCIB_RELEASE_MSI() releases a group of MSI messages. - PCIB_ALLOC_MSIX() attempts to allocate a single MSI-X message. - PCIB_RELEASE_MSIX() releases a single MSI-X message. - Add default implementations for these 4 methods that just pass the request up to the parent bus's parent bridge driver and use the default implementation in the various MI PCI bridge drivers. - Add MI functions for use by MD code when managing MSI and MSI-X interrupts: - pci_enable_msi(dev, address, data) programs the MSI capability address and data registers for a group of MSI messages - pci_enable_msix(dev, index, address, data) initializes a single MSI-X message in the MSI-X table - pci_mask_msix(dev, index) masks a single MSI-X message - pci_unmask_msix(dev, index) unmasks a single MSI-X message - pci_pending_msix(dev, index) returns true if the specified MSI-X message is currently pending - Save the MSI capability address and data registers in the pci_cfgreg block in a PCI devices ivars and restore the values when a device is resumed. Note that the MSI-X table is not currently restored during resume. - Add constants for MSI-X register offsets and fields. - Record interesting data about any MSI-X capability blocks we come across in the pci_cfgreg block in the ivars for PCI devices. Tested on: em (i386, MSI), bce (amd64/i386, MSI), mpt (amd64, MSI-X) Reviewed by: scottl, grehan, jfv MFC after: 2 months
* Add a define for the Standard SD Host Controller Base Peripheral.imp2006-05-301-0/+1
|
* Make RID2BAR actually return a number that can be plugged into PCIR_BAR()imp2005-12-301-1/+1
| | | | | | rather than a bitmask. Submitted by: ru@
* Add a macro to map from BAR to rid # (inverse of PCIR_BARS).imp2005-12-291-0/+1
|
* Add a new method PCI_FIND_EXTCAP() to the pci bus interface that is usedjhb2005-12-201-0/+5
| | | | | | | to search for a specific extended capability. If the specified capability is found for the given device, then the function returns success and optionally returns the offset of that capability. If the capability is not found, the function returns an error.
* Use symbolic name rather thanhard coding the cap pointer offset forimp2005-10-291-0/+1
| | | | type two devices.
* Add PCIM_BIOS_ADDR_MASK tooimp2005-10-281-0/+1
|
* Some cardbus CIS definitions moved here since they are PCI registers.imp2005-10-281-1/+12
|
* As threatened by BURN_BRIDGES, restire PCIR_MAPS and PCIR_HEADERTYPEimp2005-06-051-6/+0
|
* Add defines for the Bridge Control Register bits.marcel2005-04-291-0/+13
| | | | Obtained from: jhb@
* fix misspelling of 0x30...jmg2005-04-011-1/+1
| | | | Spotted by: reviewing MFC commit
* fix a copy/paste typo for scanner/gameport...jmg2005-03-261-2/+2
| | | | Spotted by: Michal Mertl <mime@traveller.cz>
* add some additional pci classes and sub-classes..jmg2005-03-261-2/+36
| | | | Reviewed by: imp (almost 6 months ago)
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Teach the PCI code to parse MSI extended capabilities. Re-arrange thescottl2003-09-141-1/+1
| | | | pcicfg struct a bit to hold extcap structures instead of structure members.
* Expand the extended capabilities list and add definitions for MSI.scottl2003-09-141-7/+42
|
* Bring back PCIR_HEADERTYPE as an alias for PCIR_HDRTYPE under BURN_BRIDGESjhb2003-09-031-0/+3
| | | | | | for backwards compat. The old name will be gone in 6.0, but will be around in 5.x. This will help unbreak 3rd party code, e.g. the nvidia DRM module.
* - Deprecate PCIR_MAPS under BURN_BRIDGES (meaning it will be gone in 6.0)jhb2003-09-021-1/+5
| | | | | | | | and replace it with the more intuitive name PCIR_BARS. - Add a PCIR_BAR(x) macro that returns the config space register offset of the 32-bit BAR x. MFC after: 3 days
* - Rename PCIx_HEADERTYPE* to PCIx_HDRTYPE* so the constants aren't so long.jhb2003-08-281-4/+5
| | | | | | | | | | | - Add a new PCIM_HDRTYPE constant for the field in PCIR_HDRTYPE that holds the header type. - Replace several magic numbers with appropriate constants for the header type register and a couple of PCI_FUNCMAX. - Merge to amd64 the fix to the i386 bridge code to skip devices with unknown header types. Requested by: imp (1, 2)
* Add constants for capability IDs and header types.jhb2003-08-281-0/+14
| | | | Submitted by: Samy Al Bahra <samy@kerneled.com>
* Define PCI_MAXHDRTYPE to be 2. We know about header types 0, 1 and 2.imp2003-08-011-9/+1
| | | | | Update the MI device scanning code to use PCI_MAXHDRTYPE rather than the hard coded 2.
* Add constants for USB programming interfaces. These are already defineddes2003-04-231-0/+3
| | | | | | (with other names) in the USB driver sources, but I felt that pcireg.h should have a complete list - at least of classes and interfaces that we know about and use.
* Add some PCI-X register definitions.gibbs2002-06-051-1/+18
| | | | | PCIM_CMD_SERREN -> PCIM_CMD_SERRESPEN to be consistent with the PERR definition.
* Add PCIR_CAP_PTR as a define for the location of the capabilitygibbs2000-12-201-0/+1
| | | | pointer of type 0 devices. This is required by my last aic7xxx change.
* Next round of PCI subsystem updates:msmith2000-12-131-30/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* - We have access to our own device_t here, so use pci_read_configmsmith2000-12-121-5/+8
| | | | | | | | | | | | | | rather than finding our parent pcib and using its PCI_READ_CONFIG method. - Fix the defines for the 32-bit I/O decode registers, and properly process the 16-bit versions. Now we will correctly check that I/O resources behind the bridge are going to be decoded. - Bring the quirk for the Orion PCI:PCI bridge in here (since it seems to want to set the secondary/supplementary bus numbers). - Use PCI_SLOTMAX rather than a magic number.
* Add definition for PCIS_SERIALBUS_SMBUS PCI device subclass.archie2000-10-021-2/+1
| | | | Remove cut & paste leftovers.
* Add PCIM_CMD_MWRICEN, the bit in the command register in PCI spacegibbs2000-09-161-0/+1
| | | | that enables memory write and invalidate cycles on a bus master.
* Encapsulate the old PCI compatability support and APIs completely underpeter2000-05-281-6/+7
| | | | | | "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.
* Added PCIR_BIOS (0x30).yokota2000-01-101-0/+2
|
* Add the 16550 programming interface code for PCIS_SIMPLECOMM_UART.peter1999-10-091-0/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-2/+2
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* ahc_pci.c:gibbs1998-10-071-1/+2
| | | | | | | | | | | | | Disable DPARCKEN in the DSCOMMAND0 register on the aic7890/91/96/97. Parity checking is broken for some chip/MB combinations and this is the work around recommended by Adaptec. dpt_pci.c: Remove a superflous '{' that prevented DPT_ALLOW_MEMIO from working. pcireg.h: Add a definition for Parity Error Reponse bit in the PCI Space command register.
* Addition of support of the slightly rogue Promise IDE interface(Dyson), supportdyson1997-09-201-1/+2
| | | | | | | | | | | of multiple PCI IDE controllers(Dyson), and some updates and cleanups from John Hood, who originally made our IDE DMA stuff work :-). I have run tests with 7 IDE drives connected to my system, all in DMA mode, with no errors. Modulo any bugs, this stuff makes IDE look really good (within it's limitations.) Submitted by: John Hood <cgull@smoke.marlboro.vt.us>
* PCI_CLASS_MASS_STORAGE (under PCI_COMPAT) was used in a driver in LINTpeter1997-06-011-1/+2
| | | | still (stallion.c).
* Add one more compatibility define to make the Adaptec driver compilese1997-05-281-1/+2
| | | | with option AHC_ALLOW_MEMIO again ....
* Define command register enable bits, which are required for a consitencyse1997-05-281-1/+4
| | | | test added to pci_compat.c
* Completely replace the PCI bus driver code to make it better reflectse1997-05-261-202/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reality. There will be a new call interface, but for now the file pci_compat.c (which is to be deleted, after all drivers are converted) provides an emulation of the old PCI bus driver functions. The only change that might be visible to drivers is, that the type pcici_t (which had been meant to be just a handle, whose exact definition should not be relied on), has been converted into a pcicfgregs* . The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t and has been converted to just call the PCI drivers functions to access configuration space register, instead of inventing its own ... This code is by no means complete, but assumed to be fully operational, and brings the official code base more in line with my development code. A new generic device descriptor data type has to be agreed on. The PCI code will then use that data type to provide new functionality: 1) userconfig support 2) "wired" PCI devices 3) conflicts checking against ISA/EISA 4) maps will depend on the command register enable bits 5) PCI to Anything bridges can be defined as devices, and are probed like any "standard" PCI device. The following features are currently missing, but will be added back, soon: 1) unknown device probe message 2) suppression of "mirrored" devices caused by ancient, broken chip-sets This code relies on generic shared interrupt support just commited to kern_intr.c (plus the modifications of isa.c and isa_device.h).
OpenPOWER on IntegriCloud