summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_pcib.c
Commit message (Collapse)AuthorAgeFilesLines
* Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). Thisjhb2010-08-171-0/+11
| | | | | | | | | | method is used by the PCI bus driver to query the power management system to determine the proper device state to be used for a device during suspend and resume. For the ACPI PCI bridge drivers this calls acpi_device_pwr_for_sleep(). This removes ACPI-specific knowledge from the PCI and PCI-PCI bridge drivers. Reviewed by: jkim
* - Retire acpi_pcib_resume(). It is has just been an alias forjhb2010-08-051-7/+0
| | | | | | | | | bus_generic_resume() since the pci_link(4) driver was added. - Change the ACPI PCI-PCI bridge driver to inherit most of its methods from the generic PCI-PCI bridge driver. In particular, this will now restore PCI config registers for ACPI PCI-PCI bridges. Tested by: Oleg Sharoyko osharoiko of gmail
* Import ACPICA 20090521.jkim2009-06-051-1/+3
|
* Remove unused variable.ganbold2008-11-251-2/+1
| | | | | | | Found with: Coverity Prevent(tm) CID: 3678 Approved by: njl
* Force any hardwire-routed interrupts to level trigger and active lowjhb2005-12-031-2/+4
| | | | | | | | | | polarity. Some machines route PCI IRQs to an ISA IRQ but fail to include an interrupt override entry to set the polarity and trigger of the given ISA IRQ in their MADT table. PR: usb/74989 Reported by: Julien Gabel jpeg at thilelli dot net MFC after: 1 week
* Add a missing newline to a printf.jhb2005-12-021-1/+1
| | | | MFC after: 1 week
* Work around at least one busted BIOS. If we get a source index in a _PRTjhb2005-11-071-1/+12
| | | | | | | | | | entry that is not zero, assume that it is really a hard-wired IRQ (commonly used for APIC routing) and not a source index. In practice, we've only ever seen source indices of 0 for legitimate non-hard-wired _PRT entries. Reviewed by: njl Tested by: Alex Lyashkov shadow at psoft dot net MFC after: 2 weeks
* Canonize the include of acpi.h.obrien2005-09-111-1/+1
|
* - If we fail to find an entry in the PRT, output a warning message.jhb2005-03-081-3/+6
| | | | | | | - Fix a bug in the same condition where we forgot to drop the ACPI pcib lock. This fixes hangs after the pcib0 attach on some machines. Tested by: sos (2)
* Consistently use pcib for a printf.njl2005-01-271-1/+1
|
* For the sake of consistency, look up link devices relative to the rootjhb2005-01-181-2/+1
| | | | | | | | object (/) rather than the pci bus object when walking the _PRT to force attach devices. We already look up relative to the root object when doing interrupt routing. Suggested by: njl
* Remove trailing whitespace.njl2004-12-271-1/+1
|
* Rework the ACPI PCI link code.jhb2004-11-231-54/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use a new-bus device driver for the ACPI PCI link devices. The devices are called pci_linkX. The driver includes suspend/resume support so that the ACPI bridge drivers no longer have to poke the links to get them to handle suspend/resume. Also, the code to handle which IRQs a link is routed to and choosing an IRQ when a link is not already routed is all contained in the link driver. The PCI bridge drivers now ask the link driver which IRQ to use once they determine that a _PRT entry does not use a hardwired interrupt number. - The new link driver includes support for multiple IRQ resources per link device as well as preserving any non-IRQ resources when adjusting the IRQ that a link is routed to. - The entire approach to routing when using a link device is now link-centric rather than pci bus/device/pin specific. Thus, when using a tunable to override the default IRQ settings, one now uses a single tunable to route an entire link rather than routing a single device that uses the link (which has great foot-shooting potential if the user tries to route the same link to two different IRQs using two different pci bus/device/pin hints). For example, to adjust the IRQ that \_SB_.LNKA uses, one would set 'hw.pci.link.LNKA.irq=10' from the loader. - As a side effect of having the link driver, unused link devices will now be disabled when they are probed. - The algorithm for choosing an IRQ for a link that doesn't already have an IRQ assigned is now much closer to the one used in $PIR routing. When a link is routed via an ISA IRQ, only known-good IRQs that the BIOS has already used are used for routing instead of using probabilities to guess at which IRQs are probably not used by an ISA device. One change from $PIR is that the SCI is always considered a viable ISA IRQ, so that if the BIOS does not setup any IRQs the kernel will degenerate to routing all interrupts over the SCI. For non ISA IRQs, interrupts are picked from the possible pool using a simplistic weighting algorithm. Tested by: ru, scottl, others on acpi@ Reviewed by: njl
* Only warn about missing _PRT tables if bootverbose is set. I've yet to seejhb2004-11-111-2/+4
| | | | | | | a bridge without a _PRT were a _PRT was needed. Instead, the warning in dmesg is a false warning and only serves to cause unnecessary concern. MFC after: 1 week
* MPSAFE lockingnjl2004-08-131-0/+9
| | | | | * Serialize calls to acpi_pcib_route_interrupt(). * Note that acpi_pcib_attach() should not be called concurrently.
* Only print the link name if there is a link. For the hardwired case, don'tnjl2004-08-121-4/+7
| | | | | | | bother printing it. This fixes a panic and acpi_name() has been more robust as well. Bug from: Tai-hwa Liang <avatar-at-mmlab.cse.yzu.edu.tw>
* Fix the PRT entry code in acpi_pci_link to always add the entry, even ifnjl2004-08-121-1/+4
| | | | | | | | | | | | | there is no irq link. Since we now use the stored copy of PRT, not the one that used to be passed into acpi_pcib_route_interrupt(), we need it in the list. [1] Fix a bug in acpi_pci_find_prt() where we weren't checking the bus, thus choosing the wrong PRT entry to use for routing the link. Also, add a printf for the case where the PRT entry is not found as this should not happen. Tested by: marcel [1]
* Re-work ACPI PCI IRQ routing (_PRT, link devices). The old approach wasnjl2004-08-111-263/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incomplete in that the PRT routing was not aware of link programming. Fix this by doing all routing through the link devices. The new algorithm for setting up links is: 1. Read _CRS to get current setting. If invalid (not in _PRS), then set to 0. 2. Attempt to call _DIS on the link. If successful, mark the link as not routed. Otherwise, assume it still is. Then when a routing request occurs: 3. Update weights for all IRQs 4. Attempt to route the initial IRQ if valid 5. If that fails, walk through the sorted list, attempting to route IRQs. 6. Configure the trigger/polarity based on _PRS. Other changes: * Add acpi_pci_find_prt() to look up the PRT entry for a given device and acpi_pci_link_route() to select/route the best IRQ for it. * Remove duplicated code in acpi_pcib_route_interrupt() that picked the first IRQ from _PRS. * Remove unneeded arguments from acpi_pcib_resume() and friends. * Ignore _STA on link devices but report if it seems strange. * Add a prt_source handle to the PRT structure since the ACPI struct ACPI_PCI_ROUTING_TABLE uses a fixed-size entry for it. We'll need to dynamically size this object if we want to use it the same way ACPI-CA does. Null-terminate the source. Tested by: Luo Hong <luohong99_at_mails.tsinghua.edu.cn>, Jeffrey Katcher <jmkatcher_at_yahoo.com> Info from: jhb, Len Brown (Intel)
* Trim a few things from the dmesg output and stick them under bootverbose tojhb2004-07-011-9/+12
| | | | | | | cut down on the clutter including PCI interrupt routing, MTRR, pcibios, etc. Discussed with: USENIX Cabal
* - Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources arejhb2004-06-231-0/+5
| | | | | | | | | | | | | | | | | actually used. For most ACPI devices this means deferring the call until bus_alloc_resource(). - Add a function acpi_config_intr() to call BUS_CONFIG_INTR() for an ACPI IRQ resource using the trigger mode and polarity information stored in the ACPI resource object. - Add a function acpi_lookup_irq_resource() to lookup the ACPI IRQ resource that corresponds to a specified rid and new-bus resource. - Have the ACPI PCI bridge driver call BUS_CONFIG_INTR() on interrupts that it routes through link devices. - Remove needactivate variable from acpi_alloc_resource() by changing the function not modify the flags variable but just mask off RF_ACTIVE when calling rman_reserve_resource(). Reviewed by: njl (1, an earlier version)
* - Use PCI_INVALID_IRQ macro rather than a magic number.jhb2004-06-071-2/+1
| | | | - Remove obsolete comment about APIC_IO routing.
* Make unnecessary globals static and remove unused includes.njl2004-05-061-2/+0
| | | | Pointed out by: cscout
* Add a temporary workaround for acpi_AppendBufferResource() returning withnjl2004-04-191-0/+5
| | | | | | | a NULL crsbuf pointer. This shouldn't happen if it returns AE_OK. We'll figure out why this is happening later. Submitted by: Bruno Ducrot <ducrot@poupinou.org>
* Use the correct length for appending an extended irq resource. This maynjl2004-03-221-1/+1
| | | | have broken APIC routing. This bug has been present since rev 1.33.
* Shorten some printfs to fit better. No other functional changes.njl2004-03-221-6/+6
|
* Whitespace and comment changes. No MD5 change to the object file.njl2004-03-221-53/+62
|
* Fix loop termination condition for parsing resources in _PRS buffers.njl2004-03-201-19/+18
| | | | | | This completes the effort to handle dependent functions, which are used in some machines for irq link resources. Also, clean up some nearby comments while I'm at it.
* Support the DPF (start dependent function) resource type in parsing _PRS.njl2004-03-181-10/+21
| | | | | | This should fix this error people get attaching cardbus controllers: pcib0: _PRS resource entry has unsupported type 2
* Initialize acpi buffer structs early in order to avoid freeingkan2003-12-181-3/+3
| | | | unallocated pointers later in done: section.
* Add support for multiple CIDs since _CID can contain a package of values.njl2003-12-181-8/+16
| | | | | | | | | Implement this in acpi_MatchHid() and acpi_isa_get_compatid(). This should fix mouse support for some users. Move all users of AcpiGetObjectInfo() to use dynamic storage instead of a devinfo on the stack. This is necessary since ACPI-CA needs to allocate different sized arrays for the CompatList.
* Fix a typo in my patches to support extended IRQ resources that broke thejhb2003-11-201-1/+1
| | | | | | type checking for _PRS for a link device's interrupt resources. Approved by: re (scottl)
* Improve support for extended IRQ resources:jhb2003-11-141-20/+47
| | | | | | | | | | | | | | | - For acpi_pci_link_entry_dump(), add a few helper functions to display the trigger mode, polarity, and sharemode of an individual IRQ resource. These functions are then called for both regular and extended IRQ resources. - In acpi_pci_link_set_irq(), use the same type of IRQ resource (regular vs. extended) for the new current resource as the type of the resources from _PRS. - When routing an interrupt don't ignore extended IRQ resources. Also, use the same type of IRQ resource (regular vs. extended) for the new current resource when as the type of the resource from _PRS. Tested by: peter
* Use __FBSDID().obrien2003-08-241-2/+4
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Update code to work with 0619 distnjl2003-07-131-3/+4
| | | | | | | | * Use ACPI_BUFFER as the type for AcpiGetObjectInfo * Remove AcpiEnableEvent/AcpiClearEvent for ACPI_EVENT_FIXED (power/sleep buttons) as they are no longer needed * Change calls to use the new GPE functions * Add AcpiOs*Lock functions
* Add a missing newline to the end of a device_printf().jhb2002-10-291-1/+1
| | | | Reported by: Michael G. Petry <petry@NetMasters.Com>
* Add code for ACPI PCI link object manipulation.iwasaki2002-10-051-0/+8
| | | | | | | | | This allocate the best IRQ to boot-disable devices (have IRQ 0). Allocated IRQ will be used for PCI interrupt routing when ACPI is enabled. Note that verbose messaging enabled for the time being so that people can easily notice the strange behavior if it happened.
* Fix printf format errors on 64 bit systems where sizes are longpeter2002-10-041-2/+4
| | | | instead of just int.
* Display the name of the acpi node that we do not find the pci interruptpeter2002-10-041-2/+3
| | | | routing table for.
* Now that we only probe host-PCI bridges once, we no longer have to check tojhb2002-09-231-12/+0
| | | | see if we have been probed before by checking for a pciX bus device.
* Make the printf messages when routing interrupts more consistent in thejhb2002-09-051-5/+6
| | | | various PCI bridge drivers.
* Overhaul the ACPI PCI bridge driver a bit:jhb2002-08-261-244/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add an ACPI PCI-PCI bridge driver (the previous driver just handled Host-PCI bridges) that is a PCI driver that is a subclass of the generic PCI-PCI bridge driver. It overrides probe, attach, read_ivar, and pci_route_interrupt. - The probe routine only succeeds if our parent is an ACPI PCI bus which we test for by seeing if we can read our ACPI_HANDLE as an ivar. - The attach routine saves a copy of our handle and calls the new acpi_pcib_attach_common() function described below. - The read_ivar routine handles normal PCI-PCI bridge ivars and adds an ivar to return the ACPI_HANDLE of the bus this bridge represents. - The route_interrupt routine fetches the _PRT (PCI Interrupt Routing Table) from the bridge device's softc and passes it off to acpi_pcib_route_interrupt() to route the interrupt. - Split the old ACPI Host-PCI bridge driver into two pieces. Part of the attach routine and most of the route_interrupt routine remain in acpi_pcib.c and are shared by both ACPI PCI bridge drivers. - The attach routine verifies the PCI bridge is present, reads in the _PRT for the bridge, and attaches the child PCI bus. - The route_interrupt routine uses the passed in _PRT to route a PCI interrupt. The rest of the driver is the ACPI Host-PCI bridge specific bits that live in acpi_pcib_acpi.c. - We no longer duplicate pcib_maxslots but use it directly. - The driver now uses the pcib devclass instead of its own devclass. This means that PCI busses are now only children of pcib devices. - Allow the ACPI_HANDLE for the child PCI bus to be read as an ivar of the child bus. - Fetch the _PRT for routing PCI interrupts directly from our softc instead of walking the devclass to find ourself and then fetch our own softc. With this change and the new ACPI PCI bus driver, ACPI can now properly route interrupts for devices behind PCI-PCI bridges. That is, the Itanium2 with like 10 PCI busses can now boot ok and route all the PCI interrupts. Hopefully this will also fix problems people are having with CardBus bridges behind PCI-PCI bridges not properly routing interrupts when ACPI is used. Tested on: i386, ia64
* In acpi_pcib_route_interrupt(), the code claims to check to see if a PCIjhb2002-08-261-2/+2
| | | | | | | LNK device (interrupt source provider sort of) is present before using it, but the code actually tested the status (_STA) of the PCI bridge device doing the routing, not the actual LNK device. Fix it to check the status of the LNK device.
* Brutally deal with __func__ being 'const char *' on gcc-3.1.peter2002-05-191-2/+2
|
* Fix error introduced in the 20020217 update, where GetPossibleResourcesmsmith2002-03-211-1/+1
| | | | | | was spammed with GetCurrentResources. Submitted by: Munehiro Matsuda <haro@h4.dion.ne.jp>
* Match namespace cleanup changes in ACPI CA 20020217 update.msmith2002-02-231-19/+37
| | | | | | | Use ACPI_SUCCESS/ACPI_FAILURE consistently. The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER. Use _ADR as well as _BBN to get our bus number.
* Staticise devclasses and some unnecessarily global variables.msmith2002-01-081-1/+1
|
* Make the interrupt routing a bit less chatty unless bootverbose is set.dfr2001-10-071-3/+5
|
* Fix a stack trashing bug when int != sizeof(pointer)peter2001-10-061-1/+3
| | | | This fixes the ia64 boot! We have scsi disks!
* Update usage of AcpiEnableEvent to reflect a new argument.msmith2001-10-041-4/+3
| | | | | | | | Fix acpi_DeviceIsPresent to check for valid _STA data and to check the "present" and "functioning" bits. Use acpi_DeviceIsPresent in acpi_pcib rather than rolling our own (also broken) version.
OpenPOWER on IntegriCloud