History log of /freebsd-current/sys/dev/acpica/acpi_pcib.c
Revision Date Author Comments
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# d4d6ad3f 18-Nov-2018 Jayachandran C. <jchandra@FreeBSD.org>

acpica: rework INTRNG interrupts

On arm64 (where INTRNG is enabled), the interrupts have to be mapped
with ACPI_BUS_MAP_INTR() before adding them as resources to devices.

The earlier code did the mapping before calling acpi_set_resource(),
which bypassed code that checked for PCI link interrupts.

To fix this, move the call to map interrupts into acpi_set_resource()
and that requires additional work to lookup interrupt properties.
The changes here are to:
* extend acpi_lookup_irq_handler() to lookup an irq in the ACPI
resources
* create a helper function acpi_map_intr() which uses the updated
acpi_lookup_irq_handler() to look up an irq, and then map it
with ACPI_BUS_MAP_INTR()
* use acpi_map_intr() in acpi_pcib_route_interrupt() to map
pci link interrupts.

With these changes, we can drop the ifdefs in acpi_resource.c, and
we can also drop the call for mapping interrupts in generic_timer.c

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17790


# 8d791e5a 09-May-2016 John Baldwin <jhb@FreeBSD.org>

Add a new bus method to fetch device-specific CPU sets.

bus_get_cpus() returns a specified set of CPUs for a device. It accepts
an enum for the second parameter that indicates the type of cpuset to
request. Currently two valus are supported:

- LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to
the device when DEVICE_NUMA is enabled)
- INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core)

For systems that do not support NUMA (or if it is not enabled in the kernel
config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus'
by default. The idea is that INTR_CPUS should always return a valid set.

Device drivers which want to use per-CPU interrupts should start using
INTR_CPUS instead of simply assigning interrupts to all available CPUs.
In the future we may wish to add tunables to control the policy of
INTR_CPUS (e.g. should it be local-only or global, should it ignore
SMT threads or not).

The x86 nexus driver exposes the internal set of interrupt CPUs from the
the x86 interrupt code via INTR_CPUS.

The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable
LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and
the global INTR_CPUS set from the nexus driver with the per-domain set from
_PXM to generate a local INTR_CPUS set for child devices.

Compared to the r298933, this version uses 'struct _cpuset' in
<sys/bus.h> instead of 'cpuset_t' to avoid requiring <sys/param.h>
(<sys/_cpuset.h> still requires <sys/param.h> for MAXCPU even though
<sys/_bitset.h> does not after recent changes).


# 8a08b7d3 02-May-2016 John Baldwin <jhb@FreeBSD.org>

Revert bus_get_cpus() for now.

I really thought I had run this through the tinderbox before committing,
but many places need <sys/types.h> -> <sys/param.h> for <sys/bus.h> now.


# bc153c69 02-May-2016 John Baldwin <jhb@FreeBSD.org>

Add a new bus method to fetch device-specific CPU sets.

bus_get_cpus() returns a specified set of CPUs for a device. It accepts
an enum for the second parameter that indicates the type of cpuset to
request. Currently two valus are supported:

- LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to
the device when DEVICE_NUMA is enabled)
- INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core)

For systems that do not support NUMA (or if it is not enabled in the kernel
config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus'
by default. The idea is that INTR_CPUS should always return a valid set.

Device drivers which want to use per-CPU interrupts should start using
INTR_CPUS instead of simply assigning interrupts to all available CPUs.
In the future we may wish to add tunables to control the policy of
INTR_CPUS (e.g. should it be local-only or global, should it ignore
SMT threads or not).

The x86 nexus driver exposes the internal set of interrupt CPUs from the
the x86 interrupt code via INTR_CPUS.

The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable
LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and
the global INTR_CPUS set from the nexus driver with the per-domain set from
_PXM to generate a local INTR_CPUS set for child devices.

Reviewed by: wblock (manpage)
Differential Revision: https://reviews.freebsd.org/D5519


# 67e7d085 27-Apr-2016 John Baldwin <jhb@FreeBSD.org>

Add a pcib_attach_child() method to manage adding the child "pci" device.

This allows the PCI-PCI bridge driver to save a reference to the child
device in its softc.

Note that this required moving the "pci" device creation out of
acpi_pcib_attach(). Instead, acpi_pcib_attach() is renamed to
acpi_pcib_fetch_prt() as it's sole action now is to fetch the PCI
interrupt routing table.

Differential Revision: https://reviews.freebsd.org/D6021


# 18c72666 16-Sep-2015 Zbigniew Bodek <zbb@FreeBSD.org>

Add domain support to PCI bus allocation

When the system has more than a single PCI domain, the bus numbers
are not unique, thus they cannot be used for "pci" device numbering.
Change bus numbers to -1 (i.e. to-be-determined automatically)
wherever the code did not care about domains.

Reviewed by: jhb
Obtained from: Semihalf
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3406


# d19b0f3e 16-Feb-2015 Konstantin Belousov <kib@FreeBSD.org>

Array cannot be NULL, remove always true comparision. ACPI spec
identifies the tested condition for _PRT as "BYTE value of 0", so the
remaining part of the conditionals is sufficient.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 8f4c2e52 03-Jul-2013 John Baldwin <jhb@FreeBSD.org>

Don't perform the acpi_DeviceIsPresent() check for PCI-PCI bridges. If
we are probing a PCI-PCI bridge it is because we found one by enumerating
the devices on a PCI bus, so the bridge is definitely present. A few
BIOSes report incorrect status (_STA) for some bridges that claimed they
were not present when in fact they were.

While here, move this check earlier for Host-PCI bridges so attach fails
before doing any work that needs to be torn down.

PR: kern/91594
Tested by: Jack Vogel @ Intel
MFC after: 1 week


# c4f70e51 28-Jan-2013 Jung-uk Kim <jkim@FreeBSD.org>

Fix two misusages of return_*() macros for ACPICA.

Noticed by: avg


# fb29cf37 28-Jan-2013 Jung-uk Kim <jkim@FreeBSD.org>

Fix white spaces for style consistency.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 62508c53 17-Aug-2010 John Baldwin <jhb@FreeBSD.org>

Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). This
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


# 7d23a9b3 05-Aug-2010 John Baldwin <jhb@FreeBSD.org>

- Retire acpi_pcib_resume(). It is has just been an alias for
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


# 129d3046 05-Jun-2009 Jung-uk Kim <jkim@FreeBSD.org>

Import ACPICA 20090521.


# aaac7452 02-Jun-2009 Jung-uk Kim <jkim@FreeBSD.org>

Chase ACPICA API changes (for kernel and boot loader).


# d78d9a64 25-Nov-2008 Ganbold Tsagaankhuu <ganbold@FreeBSD.org>

Remove unused variable.

Found with: Coverity Prevent(tm)
CID: 3678

Approved by: njl


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# d37d99c4 03-Dec-2005 John Baldwin <jhb@FreeBSD.org>

Force any hardwire-routed interrupts to level trigger and active low
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


# 80f049d3 02-Dec-2005 John Baldwin <jhb@FreeBSD.org>

Add a missing newline to a printf.

MFC after: 1 week


# f25bdd3b 07-Nov-2005 John Baldwin <jhb@FreeBSD.org>

Work around at least one busted BIOS. If we get a source index in a _PRT
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


# 2a191126 11-Sep-2005 David E. O'Brien <obrien@FreeBSD.org>

Canonize the include of acpi.h.


# 18e6466b 08-Mar-2005 John Baldwin <jhb@FreeBSD.org>

- If we fail to find an entry in the PRT, output a warning message.
- 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)


# 286fceb5 27-Jan-2005 Nate Lawson <njl@FreeBSD.org>

Consistently use pcib for a printf.


# 5e15a081 18-Jan-2005 John Baldwin <jhb@FreeBSD.org>

For the sake of consistency, look up link devices relative to the root
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


# d05fa56b 26-Dec-2004 Nate Lawson <njl@FreeBSD.org>

Remove trailing whitespace.


# 5e1ba6d4 23-Nov-2004 John Baldwin <jhb@FreeBSD.org>

Rework the ACPI PCI link code.
- 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


# 20447d54 11-Nov-2004 John Baldwin <jhb@FreeBSD.org>

Only warn about missing _PRT tables if bootverbose is set. I've yet to see
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


# bbf7c27a 13-Aug-2004 Nate Lawson <njl@FreeBSD.org>

MPSAFE locking

* Serialize calls to acpi_pcib_route_interrupt().
* Note that acpi_pcib_attach() should not be called concurrently.


# 12f57103 12-Aug-2004 Nate Lawson <njl@FreeBSD.org>

Only print the link name if there is a link. For the hardwired case, don't
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>


# 310953d9 11-Aug-2004 Nate Lawson <njl@FreeBSD.org>

Fix the PRT entry code in acpi_pci_link to always add the entry, even if
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]


# e4116e93 11-Aug-2004 Nate Lawson <njl@FreeBSD.org>

Re-work ACPI PCI IRQ routing (_PRT, link devices). The old approach was
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)


# 39981fed 01-Jul-2004 John Baldwin <jhb@FreeBSD.org>

Trim a few things from the dmesg output and stick them under bootverbose to
cut down on the clutter including PCI interrupt routing, MTRR, pcibios,
etc.

Discussed with: USENIX Cabal


# 95957f62 23-Jun-2004 John Baldwin <jhb@FreeBSD.org>

- Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources are
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)


# 4dc4ea26 07-Jun-2004 John Baldwin <jhb@FreeBSD.org>

- Use PCI_INVALID_IRQ macro rather than a magic number.
- Remove obsolete comment about APIC_IO routing.


# 869ec176 05-May-2004 Nate Lawson <njl@FreeBSD.org>

Make unnecessary globals static and remove unused includes.

Pointed out by: cscout


# 4ed2b85d 19-Apr-2004 Nate Lawson <njl@FreeBSD.org>

Add a temporary workaround for acpi_AppendBufferResource() returning with
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>


# e548abe7 22-Mar-2004 Nate Lawson <njl@FreeBSD.org>

Use the correct length for appending an extended irq resource. This may
have broken APIC routing. This bug has been present since rev 1.33.


# 3dc52520 22-Mar-2004 Nate Lawson <njl@FreeBSD.org>

Shorten some printfs to fit better. No other functional changes.


# 3304735d 22-Mar-2004 Nate Lawson <njl@FreeBSD.org>

Whitespace and comment changes. No MD5 change to the object file.


# 8e1624b6 20-Mar-2004 Nate Lawson <njl@FreeBSD.org>

Fix loop termination condition for parsing resources in _PRS buffers.
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.


# d19b6e67 17-Mar-2004 Nate Lawson <njl@FreeBSD.org>

Support the DPF (start dependent function) resource type in parsing _PRS.
This should fix this error people get attaching cardbus controllers:

pcib0: _PRS resource entry has unsupported type 2


# 2b26028d 18-Dec-2003 Alexander Kabaev <kan@FreeBSD.org>

Initialize acpi buffer structs early in order to avoid freeing
unallocated pointers later in done: section.


# 1e4925e8 17-Dec-2003 Nate Lawson <njl@FreeBSD.org>

Add support for multiple CIDs since _CID can contain a package of values.
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.


# 3500189b 20-Nov-2003 John Baldwin <jhb@FreeBSD.org>

Fix a typo in my patches to support extended IRQ resources that broke the
type checking for _PRS for a link device's interrupt resources.

Approved by: re (scottl)


# 3d9644ef 14-Nov-2003 John Baldwin <jhb@FreeBSD.org>

Improve support for extended IRQ resources:
- 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


# aad970f1 24-Aug-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID().
Also some minor style cleanups.


# cace7a2a 22-Aug-2003 Warner Losh <imp@FreeBSD.org>

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


# 6fca9360 13-Jul-2003 Nate Lawson <njl@FreeBSD.org>

Update code to work with 0619 dist

* 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


# ebc4ae3b 29-Oct-2002 John Baldwin <jhb@FreeBSD.org>

Add a missing newline to the end of a device_printf().

Reported by: Michael G. Petry <petry@NetMasters.Com>


# ba835e3f 04-Oct-2002 Mitsuru IWASAKI <iwasaki@FreeBSD.org>

Add code for ACPI PCI link object manipulation.
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.


# 0b57bf8a 03-Oct-2002 Peter Wemm <peter@FreeBSD.org>

Fix printf format errors on 64 bit systems where sizes are long
instead of just int.


# f144391b 03-Oct-2002 Peter Wemm <peter@FreeBSD.org>

Display the name of the acpi node that we do not find the pci interrupt
routing table for.


# b8581e0d 23-Sep-2002 John Baldwin <jhb@FreeBSD.org>

Now that we only probe host-PCI bridges once, we no longer have to check to
see if we have been probed before by checking for a pciX bus device.


# c6a121ab 05-Sep-2002 John Baldwin <jhb@FreeBSD.org>

Make the printf messages when routing interrupts more consistent in the
various PCI bridge drivers.


# 2ccfc932 26-Aug-2002 John Baldwin <jhb@FreeBSD.org>

Overhaul the ACPI PCI bridge driver a bit:
- 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


# 473f1ca9 26-Aug-2002 John Baldwin <jhb@FreeBSD.org>

In acpi_pcib_route_interrupt(), the code claims to check to see if a PCI
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.


# b4a05238 19-May-2002 Peter Wemm <peter@FreeBSD.org>

Brutally deal with __func__ being 'const char *' on gcc-3.1.


# 0a702a9b 20-Mar-2002 Mike Smith <msmith@FreeBSD.org>

Fix error introduced in the 20020217 update, where GetPossibleResources
was spammed with GetCurrentResources.

Submitted by: Munehiro Matsuda <haro@h4.dion.ne.jp>


# c1b1f787 22-Feb-2002 Mike Smith <msmith@FreeBSD.org>

Match namespace cleanup changes in ACPI CA 20020217 update.
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.


# 3273b005 07-Jan-2002 Mike Smith <msmith@FreeBSD.org>

Staticise devclasses and some unnecessarily global variables.


# a067d210 07-Oct-2001 Doug Rabson <dfr@FreeBSD.org>

Make the interrupt routing a bit less chatty unless bootverbose is set.


# 555143d0 05-Oct-2001 Peter Wemm <peter@FreeBSD.org>

Fix a stack trashing bug when int != sizeof(pointer)
This fixes the ia64 boot! We have scsi disks!


# 43896e91 04-Oct-2001 Mike Smith <msmith@FreeBSD.org>

Update usage of AcpiEnableEvent to reflect a new argument.

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.


# 4c1cdee6 26-Aug-2001 Mike Smith <msmith@FreeBSD.org>

Updates to match the ACPI CA 20010816 import:

- New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size.
- New debug level/subsystem codes.


# d93b034f 03-Aug-2001 Mike Smith <msmith@FreeBSD.org>

Shoud build resources in the _CRS buffer. Oops.

Submitted by: "neckpain@nettaxi.com" <neckpain@nettaxi.com>


# f16527bb 30-Jul-2001 Mike Smith <msmith@FreeBSD.org>

The current resource buffer returned from an interrupt link device
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.


# bfae45aa 21-Jul-2001 Mike Smith <msmith@FreeBSD.org>

Convert from acpi_strerror() to AcpiFormatException()

Fix dangling include of the dear departed acpi_ecreg.h


# 8077a62b 07-Jul-2001 Mike Smith <msmith@FreeBSD.org>

Oops, have to use AcpiSetCurrentResources, not invoke the _SRS method
directly.


# 4fa387b6 05-Jul-2001 Mike Smith <msmith@FreeBSD.org>

Implement PCI interrupt routing using the ACPI data attached to the
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.


# e71b6381 29-Jun-2001 Mike Smith <msmith@FreeBSD.org>

Update for new debug layer constant names in the ACPI CA 20010615
import.


# 2a4ac806 29-May-2001 Mike Smith <msmith@FreeBSD.org>

- Updates for new constant naming in the ACPI CA 20010518 update.
- 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).


# 91467fc6 31-Jan-2001 Mike Smith <msmith@FreeBSD.org>

ACPI_NUMBER becomes ACPI_INTEGER. acpi_EvaluateNumber becomes
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.


# 39a8493a 29-Dec-2000 Mike Smith <msmith@FreeBSD.org>

Hack in interrupt routing support (using the core $PIR support, not using
ACPICA properly). This makes it possible to use ACPICA in conjunction with
CardBus before I get around to implementing ACPI/PCI interrupt routing.


# 0ae55423 08-Dec-2000 Mike Smith <msmith@FreeBSD.org>

- Convert a lot of homebrew debugging output to use the ACPI CA debugging
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.


# 3cd59d7b 01-Dec-2000 Scott Long <scottl@FreeBSD.org>

Revert attach() back to the old behaviour of calling bus_generic_attach().
The new way doesn't seem to work reliably and was causing devices to not
be seen.

Approved by: msmith


# 042283a6 01-Dec-2000 Mike Smith <msmith@FreeBSD.org>

Update to work with the new ACPI CA snapshot.

- 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


# 15e32d5d 28-Oct-2000 Mike Smith <msmith@FreeBSD.org>

Initial FreeBSD OSPM (operating system power management) modules for
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.