Commit Graph

1161 Commits

Author SHA1 Message Date
jruoho
cc54315739 Add a missing case value in a switch statement. 2011-04-25 05:30:21 +00:00
jruoho
f7681ae9ed Simplify a little. No functional change. 2011-04-14 07:06:52 +00:00
jruoho
1e511da05c Use the common power resource code. Also add a comment explaining
what can happen if we do not power on the resource upon resume from S3.
2011-04-14 06:37:13 +00:00
jruoho
43337e89a7 Simplify by using a static array for the reference counting. 2011-04-14 06:25:25 +00:00
jruoho
78ce31faf6 Maintain the state properly during firmware-based DVFS. 2011-04-01 11:46:57 +00:00
mlelstv
6c3c510455 Use wireless function key to toggle not only bluetooth but also
telephony (GPRS/UMTS/..) like other operating systems.
2011-03-27 08:52:25 +00:00
jruoho
b66af12b69 Remove the "simple CPU lock" that was unnecessary.
Thanks to rmind@ for clarifications.
2011-03-24 05:10:05 +00:00
jruoho
8e61d41493 Like in rest of the acpi(4) stack, queue all resume hooks. 2011-03-19 12:57:30 +00:00
jruoho
9567c7d56b Properly set the frequency during suspend and resume. Should fix problems
introduced in the revision 1.42. Pointed out by Taylor C. Campbell.
2011-03-17 15:59:36 +00:00
jruoho
c79df2b59e Add a comment. 2011-03-17 15:32:18 +00:00
jruoho
6315c7d63e Add __cpu_simple_lock_t. Use it, x86_read_psl(), and x86_disable_intr() to
disable interrupts locally and protect the access to APERF and MPERF. Also
rationalize the MD initialization sequence.
2011-03-05 09:47:19 +00:00
jruoho
4e1517c4e6 Rename a badly named constant. Make it correspond with <x86/specialreg.h>. 2011-03-04 12:10:49 +00:00
jruoho
d87d6f14e7 Remove redundant/wrong increment of a variable. 2011-03-04 09:28:34 +00:00
jruoho
80dcd7f76f Add DMI quirk support via pmf_get_platform(9). If any of the listed models
are matched, the whole driver will be prevented from attaching. The first
entry is Supermicro PDSMi-LN4+ (a BIOS bug with bogus P-state entries).
2011-03-03 19:24:43 +00:00
jruoho
5bfb3ade6b Append Intel's Turbo Boost to the debug printfs if we detect it. 2011-03-02 06:17:08 +00:00
jruoho
5b407ea29a Detach evcnt(9) before the states. 2011-03-01 13:38:45 +00:00
jruoho
e98440f29b Move also the evcnt(9) event counters to one place. No functional change. 2011-03-01 05:57:04 +00:00
jruoho
2562de9c62 Use __arraycount(3). 2011-03-01 05:37:02 +00:00
jruoho
b9f7a5accd Simplify by moving the debug printfs to one place. No functional change. 2011-03-01 05:32:03 +00:00
jruoho
c9111546fe Move the xcall(9) that does the P- and T-state transformations from the MD
layer to the main code. Makes the caches coherent and provides consistent
vmstat(1) output. This is still not quite right, given that most of the
cross-calls are typically unnecessary with the dependency coordination.
2011-03-01 04:35:48 +00:00
jruoho
cd966b244a Provide MD wrappers for match and attach. 2011-02-27 18:32:53 +00:00
jruoho
494badeb16 Move acpicpu(4) from "acpinodebus" to "cpufeaturebus". 2011-02-27 17:10:33 +00:00
jruoho
0db13a33ab Comment the coordination types. 2011-02-25 20:59:37 +00:00
jruoho
a080ec141b Start to derive the percpu(9) (or per-domain) state coordination
mechanisms by parsing the _CSD, _PSD, and _TSD objects by default.
2011-02-25 19:55:06 +00:00
jruoho
eb43e911ff Rename couple of badly named functions for consistency. No functional change. 2011-02-25 12:08:35 +00:00
jruoho
97b3ad9cac Add preliminary support for the IA32_APERF and IA32_MPERF frequency counters.
These are not yet used for anything and only Intel is supported at the moment.
2011-02-25 09:16:00 +00:00
jruoho
86bc152d93 Store a pointer to cpu_info rather than cpu_info::ci_acpiid alone. 2011-02-25 06:18:02 +00:00
jruoho
c601745de5 Clarify a comment. 2011-02-25 05:07:43 +00:00
jruoho
bf04997f97 Lower the worst-case latency in P- and T-state transitions to 1 usec.
The previous 10 usec was based on the Intel's Core family. It may have been
improved since that. Also provide an arbitrary upper bound for BIOS bugs.
2011-02-23 06:17:55 +00:00
jruoho
05fb6a1824 Adjust the previous and add a comment for it. 2011-02-23 06:02:00 +00:00
jruoho
53139a574d Fix previous. Not my day. 2011-02-22 17:19:58 +00:00
jruoho
f7e44b18e5 Yet another small fix to the C-state parsing. As can be seen from the _CST
object noted in the revision 1.40, there is only one C-state on the machine,
yet the BIOS define its type as C2. Thus, instead of relying on the BIOS
data, sequentially count the parsed C-states.
2011-02-22 17:16:04 +00:00
jmcneill
b5c82123a3 make this build again 2011-02-22 16:39:05 +00:00
jruoho
5dc29dcc76 After a closer examination, remove entirely the check that was considered in
the revision 1.38. As noted in the specification (ACPI 4.0, p. 314):

  The platform must expose a _CST object for either all or none of its
  processors. If the _CST object exists, OSPM uses the C state information
  specified in the _CST object in lieu of P_LVL2 and P_LVL3 registers
  defined in P_BLK and the P_LVLx_LAT values defined in the FADT.

The _CST is seemingly valid on the system under consideration:

        Name (_CST, Package (0x02)
        {
            0x01,
            Package (0x04)
            {
                ResourceTemplate ()
                {
                    Register (SystemIO,
                        0x08,               // Bit Width
                        0x00,               // Bit Offset
                        0x000000000000F800, // Address
                        0x01,               // Access Size
                        )
                },

                0x02,
                0x0064,
                0x00000000
            }
        })

The check was also unnecessary in the sense that ACPI doesn't use bus_space(9).
2011-02-22 16:05:30 +00:00
jruoho
9e252589bd Always declare HALT as available. If ACPI_FADT_C1_SUPPORTED is not
set in the FADT, print a warning, as it is obviously a BIOS bug.
2011-02-22 09:39:48 +00:00
jruoho
9a2a620992 Only check if the register address in _CST is valid if the ACPI processor
object address is valid. Some systems define the Processor() as:

    Scope (_PR)
    {
        Processor (C000, 0x00, 0x00000410, 0x06) {}
        Processor (C001, 0x01, 0x00000000, 0x00) {}
        Processor (C002, 0x02, 0x00000000, 0x00) {}
        Processor (C003, 0x03, 0x00000000, 0x00) {}
    }

This may be typical to AMD systems that do not seem to use _CST, but instead
operate with HLT (and C1E for the C3-state). The same check is already done
in acpicpu_cstate_fadt(). Note that it is unclear whether this violates the
specification, given:

   "PBlockAddress provides the system I/O address for the processors
    register block. Each processor can supply a different such address.
    PBlockLength is the length of the processor register block, in bytes and
    is either 0 (for no P_BLK) or 6.  With one exception, all processors are
    required to have the same PBlockLength.  The exception is that the boot
    processor can have a non-zero PBlockLength when all other processors
    have a zero PBlockLength.  It is valid for every processor to have a
    PBlockLength of 0. (ACPI 4.0, p. 626)"
2011-02-22 09:34:13 +00:00
jruoho
6f104f5638 Use kmem(9). Also retire ACPI_PCI_FIXUP and PCI_INTR_FIXUP_DISABLED #ifdefs. 2011-02-20 16:24:54 +00:00
jruoho
0aef142598 Split fujbp(4) and fujhk(4) to separate instances from fujitsu(4). Allows
modularization and takes care of tsutsui@'s justified concern over the too
generic name "fujitsu". Ok gsutre@.
2011-02-20 08:31:46 +00:00
jruoho
8bd40def25 Always explicitly enable the wake GPE for acpibut(4). This follows FreeBSD
and Linux, although it is somewhat unclear why this is necessary. But better
safe than sorry.
2011-02-20 06:59:53 +00:00
jruoho
762d68ff2c Add quirk support for _OSI strings introduced in ACPICA 20110211. While
here, clean up acpi_probe() and the quirk code. Remove #ifdef ACPI_DEBUGGER.
2011-02-20 06:45:32 +00:00
jruoho
c9d84242af After the GPE handler has finished, inform ACPICA that the interrupt has
been handled and it is safe to re-enable the GPE. Should fix all problems
introduced during the merge of ACPICA 20110211.
2011-02-19 19:39:28 +00:00
jruoho
3af8b2cb19 Revisit the wake-device code once more.
1. Remove the AcpiEnableGpe() call. This was wrong.

  2. Only call _PSW or _DSW for devices that are scheduled for wake.
     This was an old bug.

  3. Only enable wake GPEs during suspend. Disabling these for
     devices not setup for wake was causing problems.

  4. No wake GPEs should be enabled at runtime.
     Unconditionally disable these during resume.

This should make the wake-device code work again. Note that waking via
pckbd(4) has always been unreliable; the _PRW object is not typically located
under the PC keyboard object, but in the parent of it (e.g. the LPC bridge).
2011-02-19 09:52:32 +00:00
jruoho
53d29cc6c2 A small cleanup for the previous; use kmem(9), add assertions, etc. 2011-02-18 13:56:03 +00:00
jruoho
1ce01ed2f8 Remove the (debug) check that evaluated whether the first T-state (i.e. the
100 % duty cycle) had control value of zero, as in the IA32 clock modulation
MSR. As the access may be based on I/O, it is unclear if a strict validation
like this was correct. Should fix the problem reported by Hisashi T Fujinaka
on current users.
2011-02-18 07:00:05 +00:00
jruoho
80a2b0455e As explained in the new ACPICA documentation, as of ACPICA 20101207, the
_PRW methods are no longer automatically executed as part of the ACPICA
initialization. Refactor and rewrite the wake-device code to account this.
2011-02-17 19:36:49 +00:00
jruoho
41e8c1fe85 Include acdebug.h for the ACPICA debugger. 2011-02-17 12:08:46 +00:00
jruoho
9a25770d19 ACPICA 20101209:
Completed the major overhaul of the GPE support code that was begun in July
2010. Major features include: removal of _PRW execution in ACPICA (host
executes _PRWs anyway), cleanup of "wake" GPE interfaces and processing,
changes to existing interfaces, simplification of GPE handler operation, and
a handful of new interfaces:

    AcpiUpdateAllGpes
    AcpiFinishGpe
    AcpiSetupGpeForWake
    AcpiSetGpeWakeMask

ACPICA 20100702:

Implemented several updates to the recently added GPE reference count
support. The model for "wake" GPEs is changing to give the host OS complete
control of these GPEs. Eventually, the ACPICA core will not execute any _PRW
methods, since the host already must execute them. Also, additional changes
were made to help ensure that the reference counts are kept in proper
synchronization with reality. Rafael J. Wysocki.

1) Ensure that GPEs are not enabled twice during initialization.
2) Ensure that GPE enable masks stay in sync with the reference count.
3) Do not inadvertently enable GPEs when writing GPE registers.
4) Remove the internal wake reference counter and add new AcpiGpeWakeup
interface. This interface will set or clear individual GPEs for wakeup.
5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces
are now used for "runtime" GPEs only.
2011-02-17 10:49:29 +00:00
jmcneill
2bf4673f17 cast curlwp to uintptr_t before casting to ACPI_THREAD_ID, fixes i386 build 2011-02-17 10:35:50 +00:00
jruoho
99109677b7 ACPICA 20100806:
Fixed a problem with the prototype for AcpiOsReadPciConfiguration.
The prototype in acpiosxf.h had the output value pointer as a (void *).
It should be a (UINT64 *). This may affect some host OSL code.
2011-02-17 10:23:43 +00:00
jruoho
01d77446c4 ACPICA 20100806:
Obsolete Functions: AcpiOsValidateInterface - no longer used.
2011-02-17 10:21:43 +00:00