History log of /freebsd-10.2-release/sys/dev/acpica/acpi_resource.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 285830 23-Jul-2015 gjb

- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.2.
- Update default pkg(8) configuration to use the quarterly branch.[1]

Discussed with: re, portmgr [1]
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 281687 18-Apr-2015 jkim

MFC: r281396, r281475

Merge ACPICA 20150410.

Relnotes: yes


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 253392 16-Jul-2013 jhb

Workaround some broken BIOSes that specify edge-sensitive but active-low
settings for ACPI-enumerated serial ports by forcing any IRQs that use
an ISA IRQ value with these settings to active-high instead of active-low.

This is known to occur with the BIOS on an Intel D2500CCE motherboard.

Tested by: Robert Ames <robertames@hotmail.com>, lev
Submitted by: Juergen Weiss weiss at uni-mainz.de (original patch)


# 246128 30-Jan-2013 sbz

Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays

Reviewed by: cognet
Approved by: cognet


# 223383 21-Jun-2011 jhb

Fix build with ACPI_DEBUG defined.

Submitted by: jkim
Pointy hat to: jhb


# 223370 21-Jun-2011 jhb

Use AcpiWalkResources() to parse the resource list from _CRS rather than
using a home-rolled loop. While here, add support for 64-bit address
range resources.

Silence on: acpi@ (older version)


# 218687 14-Feb-2011 jkim

Rework r218685. Copy just enough data for the resource type.

Reviewed by: jhb, mdf


# 218685 14-Feb-2011 mdf

Prevent reading from the ACPI_RESOURCE past its actual end. For
paranoia limit to the size of the ACPI_RESOURCE as well.

Reviewd by: jhb (in spirit)
MFC after: 1 week


# 193530 05-Jun-2009 jkim

Import ACPICA 20090521.


# 167814 22-Mar-2007 jkim

Catch up with ACPI-CA 20070320 import.


# 158346 07-May-2006 njl

Don't attach special devices in the order they appear in the AML tree.
If the embedded controller exists before the sysresource devices, for
example, it will be attached first. Instead, let the normal device
order function work as we first desired. [1]

There still remained a problem where we couldn't allocate resources in
acpi0 that were passed up by the sysresource pseudo-devices. These
devices had to probe/attach first to give their resources to acpi, then
acpi would allocate them before probing/attaching other devices. To
work around this, we attach them from acpi_sysres_alloc(). A better
approach would be to implement multi-pass probe/attach in newbus but
that's a much bigger task.

Suggested by: jhb [1]
Hardware from: Centaur Technologies
MFC after: 1 week


# 152171 07-Nov-2005 jhb

*sigh* Revert stuff that wasn't supposed to be committed. The
acpi_resource change was a minor nit offered as an early candidate for
the recent ACPICA import problem and the acpi.c change is one I need to
test still that makes the ordered probing of system devices actually work
as advertised (probe devices in order based on the type of device rather
than in the order we encounter them in the device tree).


# 152170 07-Nov-2005 jhb

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


# 151948 01-Nov-2005 jkim

Catch up with ACPI-CA 20051021 import


# 150003 11-Sep-2005 obrien

Canonize the include of acpi.h.


# 143801 18-Mar-2005 phk

s/SLIST/STAILQ/
/imp/a\
pointy hat
.


# 140449 18-Jan-2005 jhb

Don't create new-bus resources for ACPI extended IRQ resources that are
producers rather than consumers as new-bus resources only handle consumed
resources. We already do this for the other ACPI resource types that
support the producer/consumer attribute.


# 139339 27-Dec-2004 njl

Remove trailing whitespace.


# 134217 23-Aug-2004 njl

Rework sysresource management. Instead of having each sysresource object
hold its own values, pass them up to the parent (acpi0) and merge/uniq them
on the way. After the namespace evaluation, acpi will reserve these
resources and manage them via rman before bus_generic_probe() and
bus_generic_attach(). This is necessary because some systems specify
conflicting resources in separate sysresource objects. It's also cleaner
in that the interface between sysresource and acpi is now merely the parent's
resource list. This code handles the following cases:

1. Unique resource: add it to the parent via bus_set_resource().
2. New wholly contained in old: discard new.
3. New tail overlaps old head: grow old head downward.
AND/OR
4. New head overlaps old tail: grow old tail upward.

Tested by: Pawel Worach <sajd_at_telia.com>
Tested by: Radek Kozlowski <radek_at_raadradd.com>
MFC after: 5 days


# 134088 20-Aug-2004 njl

Use the new start for the offset, not the old end.


# 134086 20-Aug-2004 njl

Correctly handle BIOS resources that are duplicated (!). There are many
systems that have overlapping regions specified in their sysresource
objects. This patch fixes ATA DMA and acpi_timer allocation for such
sysctems. It should eventually be moved to resource_list_add() if it is
a valid generalized approach. The minimal approach for 5.3 is:

"Loop through all current resources to see if the new one overlaps
any existing ones. If so, the old one always takes precedence and
the new one is adjusted (or rejected). We check for three cases:

1. Tail of new resource overlaps head of old resource: truncate the
new resource so it is contiguous with the start of the old.
2. New resource wholly contained within the old resource: error.
3. Head of new resource overlaps tail of old resource: truncate the
new resource so it is contiguous, following the old."

Tested by: Radek Kozlowski <radek_at_raadradd.com>
Discussed with: imp
MFC after: 4 days


# 133623 13-Aug-2004 njl

MPSAFE locking: Add a comment that we need resource list and device_t
refcounting/locking.


# 131282 29-Jun-2004 njl

Use the acpi_id_probe() method instead of acpi_MatchHid(), which is now
static.


# 130981 23-Jun-2004 jhb

- 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)


# 130439 13-Jun-2004 njl

Add support to ACPI to manage its own resources. Previously, resource
allocation was passed up to nexus. Now, we probe sysresource objects and
manage the resources they describe in a local rman pool. This helps
devices which attach/detach varying resources (like the _CST object) and
module loads/unloads. The allocation/release routines now check to see if
the resource is described in a child sysresource object and if so,
allocate from the local rman. Sysresource objects add their resources to
the pool and reserve them upon boot. This means sysresources need to be
probed before other ACPI devices.

Changes include:
* Add ordering to the child device probe. The current order is: system
resource objects, embedded controllers, then everything else.
* Make acpi_MatchHid take a handle instead of a device_t arg.
* Replace acpi_{get,set}_resource with the generic equivalents.


# 129879 30-May-2004 phk

Add missing <sys/module.h> includes


# 128071 09-Apr-2004 njl

Add MODULE_DEPEND entries so some of these drivers can eventually be
loaded separately from ACPI (i.e., embedded use).


# 127679 31-Mar-2004 njl

Add an interface to pass an argument to the resource parsing functions.
This is just groundwork for changing sysresource behavior.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:


# 127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


# 120453 26-Sep-2003 njl

Consistently print attach messages.


# 119969 10-Sep-2003 marcel

Extend the ACPI resource handling to make use of the BUS_CONFIG_INTR()
method. This is necessary on ia64 where it's known that serial interfaces
described in the ACPI namespace may not have the well-known IRQs assigned
to them. This confuses us in thinking they are PCI based interrupts and
wrongly program the APIC.


# 119529 28-Aug-2003 njl

Style and whitespace changes. Also, make the ivar functions non-inline
since inlining failed due to the size of BUS_*


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 108196 23-Dec-2002 marcel

Fix a De Morgan bug: If we only expect a memory range OR an
I/O port range, then we should ignore a resource if it's NOT
a memory range AND NOT an I/O port range.
The OR in the condition caused us to ignore perfectly valid
memory addresses.

While here, remove redundant parenthesis and reindent the
debug print to avoid long lines.


# 104432 04-Oct-2002 peter

Oops, missed this one. Fix a printf format error on 64 bit systems
where sizes are long instead of int.


# 96926 19-May-2002 peter

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


# 91125 23-Feb-2002 msmith

Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.


# 90014 31-Jan-2002 takawata

Fix irq/drq handling. IRQ and DRQ resource information can be get
in one object for one resource. Array of values in a object means
possible values for the object.


# 89054 08-Jan-2002 msmith

Staticise devclasses and some unnecessarily global variables.


# 83164 06-Sep-2001 msmith

Allocate system resource IRQs as shareable; this is the typical case.


# 82704 31-Aug-2001 msmith

Don't claim memory resources owned by a PNP0C01 device ("system memory")
as some systems claim the entire physical address space is owned by it.


# 82667 31-Aug-2001 msmith

Don't activate placeholder resources; it can be very expensive in the
SYS_RES_MEMORY case, and it shouldn't be necessary.


# 82536 30-Aug-2001 msmith

Retarget the resource parser slightly. We only fetch current resources
for the device now (we should really just be parsing a passed-in resource
buffer).

Wrap long lines so this is (more) readable.

Support Address16 and Address32 resources, in the CONSUMER case.

Support DRQs so that we can handle ISA devices.

Support ExtendedIrqs (we ignore most of their attributes)

Add a placeholder device for system memory and system resources. This
takes the place of the nexus placeholder, which only attaches to ISA.


# 82372 26-Aug-2001 msmith

Updates to match the ACPI CA 20010816 import:

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


# 80078 21-Jul-2001 msmith

Convert from acpi_strerror() to AcpiFormatException()

Fix dangling include of the dear departed acpi_ecreg.h


# 78993 29-Jun-2001 msmith

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


# 77432 29-May-2001 msmith

- 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).


# 69744 08-Dec-2000 msmith

- 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.


# 67761 28-Oct-2000 msmith

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.