summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_pcib_acpi.c
Commit message (Collapse)AuthorAgeFilesLines
* - Assume a bus number of zero if evaluating _BBN fails, not if it succeeds.jhb2002-11-251-9/+8
| | | | | | | | This was effectively rendering _BBN useless. - Cleanup handling of the busok variable a bit. Submitted by: marcel (1) Approved by: re (rwatson)
* According to the ACPI spec, the bus number of the child PCI bus of a hostjhb2002-11-221-7/+52
| | | | | | | | | | | | | | | | | | | | | | to PCI bridge can be read be evaluating the _BBN method of the host to PCI device. Unfortunately, there appear to be some lazy/ignorant/moronic/ whatever BIOS writers that return 0 for _BBN for all host to PCI bridges in the system. On a system with a single host to PCI bridge this is not a problem as the child bus of that single bridge will be bus 0 anyway. However, on systems with multiple host to PCI bridges and l/i/m/w BIOS writers this is a major problem resulting in all but the first host to PCI bridge failing to attach. So, this adds a workaround. If the _BBN of a host to PCI bridge is zero and pcib0 already exists and is not us, the we use _ADR to look up our PCI function and slot (we currently assume we are on bus 0) and use that to call host_pcib_get_busno() to try and extract our bus number from config registers on the host to PCI bridge device. If that fails, then we make an evil assumption that ACPI's _SB_ namespace lays out the host to PCI bridges in ascending order and use our pcib unit number as our bus number. Approved by: re
* Make sure that ACPI PCI driver probe routine call pci_cfgregopen()iwasaki2002-10-051-0/+3
| | | | | | before start accessing PCI config space. Reviewed by: jhb
* Add code for ACPI PCI link object manipulation.iwasaki2002-10-051-1/+10
| | | | | | | | | 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.
* Overhaul the ACPI PCI bridge driver a bit:jhb2002-08-261-344/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* Updates to match the ACPI CA 20010816 import:msmith2001-08-261-3/+5
| | | | | - New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size. - New debug level/subsystem codes.
* Shoud build resources in the _CRS buffer. Oops.msmith2001-08-031-1/+1
| | | | Submitted by: "neckpain@nettaxi.com" <neckpain@nettaxi.com>
* The current resource buffer returned from an interrupt link devicemsmith2001-07-301-7/+20
| | | | | | | in the case where there are no interrupts routed for it does not contain enough space to use it to route an interrupt. In the case where we need to route an interrupt, throw away the returned buffer and create a new one containing the interrupt we want.
* Convert from acpi_strerror() to AcpiFormatException()msmith2001-07-211-6/+6
| | | | Fix dangling include of the dear departed acpi_ecreg.h
* Oops, have to use AcpiSetCurrentResources, not invoke the _SRS methodmsmith2001-07-071-4/+1
| | | | directly.
* Implement PCI interrupt routing using the ACPI data attached to themsmith2001-07-051-5/+255
| | | | | | | | | PCI bus object. This should deal both with already-routed interrupts as well as devices that need an interrupt routed. Note that it *doesn't* deal with interlocked interrupt dependancies, nor does it select between interrupt options in a smart way. These are optimisations that need further work.
* Update for new debug layer constant names in the ACPI CA 20010615msmith2001-06-291-1/+1
| | | | import.
* - Updates for new constant naming in the ACPI CA 20010518 update.msmith2001-05-291-3/+3
| | | | | | | | | | | - Use __func__ instead of __FUNCTION. - Support power-off to S3 or S5 (takawata) - Enable ACPI debugging earlier (with a sysinit) - Fix a deadlock in the EC code (takawata) - Improve arithmetic and reduce the risk of spurious wakeup in AcpiOsSleep. - Add AcpiOsGetThreadId. - Simplify mutex code (still disabled).
* ACPI_NUMBER becomes ACPI_INTEGER. acpi_EvaluateNumber becomesmsmith2001-01-311-2/+2
| | | | | | | | | | | acpi_EvaluateInteger. Use acpi_EvaluateInteger instead of doing things the hard way where possible. AcpiSetSystemSleepState (unofficial) becomes AcpiEnterSleepState. Use the AcpiGbl_FADT pointer rather than searching for the FADT.
* Hack in interrupt routing support (using the core $PIR support, not usingmsmith2000-12-291-3/+5
| | | | | ACPICA properly). This makes it possible to use ACPICA in conjunction with CardBus before I get around to implementing ACPI/PCI interrupt routing.
* - Convert a lot of homebrew debugging output to use the ACPI CA debuggingmsmith2000-12-081-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | infrastructure. It's not perfect, but it's a lot better than what we've been using so far. The following rules apply to this: o BSD component names should be capitalised o Layer names should be taken from the non-CA set for now. We may elect to add some new BSD-specific layers later. - Make it possible to turn off selective debugging flags or layers by listing them in debug.acpi.layer or debug.acpi.level prefixed with !. - Fully implement support for avoiding nodes in the ACPI namespace. Nodes may be listed in the debug.acpi.avoid environment variable; these nodes and all their children will be ignored (although still scanned over) by ACPI functions which scan the namespace. Multiple nodes can be specified, separated by whitespace. - Implement support for selectively disabling ACPI subsystem components via the debug.acpi.disable environment variable. The following components can be disabled: o bus creation/scanning of the ACPI 'bus' o children attachment of children to the ACPI 'bus' o button the acpi_button control-method button driver o ec the acpi_ec embedded-controller driver o isa acpi replacement of PnP BIOS for ISA device discovery o lid the control-method lid switch driver o pci pci root-bus discovery o processor CPU power/speed management o thermal system temperature detection and control o timer ACPI timecounter Multiple components may be disabled by specifying their name(s) separated by whitespace. - Add support for ioctl registration. ACPI subsystem components may register ioctl handlers with the /dev/acpi generic ioctl handler, allowing us to avoid the need for a multitude of /dev/acpi* control devices, etc.
* Revert attach() back to the old behaviour of calling bus_generic_attach().scottl2000-12-021-4/+5
| | | | | | | The new way doesn't seem to work reliably and was causing devices to not be seen. Approved by: msmith
* Update to work with the new ACPI CA snapshot.msmith2000-12-011-13/+16
| | | | | | | | | | - Use ACPI_PHYSICAL_ADDRESS - RSDT -> XSDT - FACP -> FADT - No APIC table support - Don't install a global EC handler; this has bad side-effects (it invokes _REG in *all* EC spaces in the namespace!) - Check for PCI bus instances already existing before adding them
* Initial FreeBSD OSPM (operating system power management) modules formsmith2000-10-281-0/+236
ACPICA. Most of these are still works in progress. Support exists for: - Fixed feature and control method power, lid and sleep buttons. - Detection of ISA PnP devices using ACPI namespace. - Detection of PCI root busses using ACPI namespace. - CPU throttling and sleep states (incomplete) - Thermal monitoring and cooling control (incomplete) - Interface to platform embedded controllers (mostly complete) - ACPI timer (incomplete) - Simple userland control of sleep states. - Shutdown and poweroff.
OpenPOWER on IntegriCloud