summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
* rman_reserve_resource doesn't set the bushandle, so we have to do it here.imp2004-06-281-1/+1
| | | | | Badness noted by: njl Perforce reply not read by: imp
* MFp4: Set the bus handle to the bus handle of the resource, not theimp2004-06-271-3/+2
| | | | | | | | | starting value. This is more pedantically correct (since the handle isn't always identical to the start of the resource) and also doesn't access the innards of struct resource direct (which I forbid in my tree). We need to do this for all resource types, not just ioport. Reviewed by: njl
* Update some comments and remove non-standard notation.njl2004-06-241-4/+7
|
* Add a quirks array based on matching ACPI tables. The entries in this filenjl2004-06-241-0/+482
| | | | | | are currently all bad BIOS revisions that will never be able to support ACPI. They were derived by examining which BIOS's are blacklisted by other operating systems. Other types of quirks will be possible here as well.
* Attach the correct handle, not the one that was just deleted. Also,njl2004-06-241-3/+2
| | | | remove some duplicated code.
* Run the power off code directly instead of using indirection throughnjl2004-06-241-28/+11
| | | | | | | smp_rendezvous() to ensure we run on the BSP. This reverts rev 1.128. Add a comment indicating that MI code should be the one that runs all shutdown functions on the BSP with the APs halted. This should work around problems in power off while waiting for the MI code to be improved.
* Use uintmax_t for CPU statistics and add a cast to prevent truncation ofnjl2004-06-241-2/+2
| | | | | | the statistics in a multiply. Pointed out by: YONETANI Tomokazu
* - Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources arejhb2004-06-234-34/+143
| | | | | | | | | | | | | | | | | 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)
* Now that we associate a device_t with ACPI device handles, lookup thejhb2004-06-231-7/+41
| | | | | | | device associated with any PCI devices that are enumerated in the ACPI tree when adding children to an ACPI PCI bus and remove the duplicate ACPI-only device_t and replace the device_t associated with the handle with the ACPI and PCI aware device_t.
* Fix typos and add spaces before `(' in some commentsbrueffer2004-06-221-3/+3
| | | | | | Submitted by: markus Approved by: njl MFC after: 3 days
* Add more precision to the cx_usage sysctl output and special-case 0%.njl2004-06-191-5/+11
| | | | Submitted by: YONETANI Tomokazu <qhwt+freebsd-acpi AT les.ath.cx>
* Remove compat code and unused lock declarations.njl2004-06-181-22/+2
|
* Remove compat defines.njl2004-06-181-4/+0
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-162-4/+4
| | | | Bump __FreeBSD_version accordingly.
* Revert the removal of the initial_irq hack for now as this code is morejhb2004-06-141-9/+7
| | | | | broken than I thought and doesn't do a good job of routing virgin interrupts at all.
* Remove disable_on_poweroff and our pre-sync shutdown handler. Disablingnjl2004-06-141-30/+1
| | | | | of GPEs is now done in acpi_shutdown() and so we no longer need the option of disabling ACPI in the poweroff case.
* Clean up acpi_probe_order() a bit and clarify some comments.njl2004-06-141-9/+19
|
* Don't probe/attach in the ACPI_DEBUG case.njl2004-06-141-2/+1
|
* Add support to ACPI to manage its own resources. Previously, resourcenjl2004-06-1310-101/+246
| | | | | | | | | | | | | | | | | 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.
* Associate a device_t with an ACPI_HANDLE. This make AcpiWalkNamespace morenjl2004-06-132-0/+21
| | | | | useful. If ACPI-CA allowed null object handlers, we wouldn't need the placeholder function.
* Remove accidental change.njl2004-06-071-1/+1
|
* Avoid printing extraneous warning messages when trying to switch a devicenjl2004-06-072-17/+17
| | | | | | | | which doesn't support ACPI power states. Return AE_NOT_FOUND for these cases and don't print the warning message. Also, print the name of the handle instead of device when unable to switch states. The device is often not attached at this point and so its name is NULL, which doesn't help debugging.
* - Use PCI_INVALID_IRQ macro rather than a magic number.jhb2004-06-071-2/+1
| | | | - Remove obsolete comment about APIC_IO routing.
* Don't forget to pass shutdown events down to children first now that wenjl2004-06-051-0/+3
| | | | handle them at the bus level too.
* Disable wake GPEs in the reboot path as well as poweroff path. This fixesnjl2004-06-051-4/+11
| | | | | | "stray irq 9" messages on my Thinkpad. It may also help with general reboot consistency although the recent hang on reboot was solved by acpi_cpu.c rev 1.39.
* Rework acpi_cpu_idle() to select the next idle state before sleeping, notnjl2004-06-051-109/+78
| | | | | | | | | | | | | | after. Unify the paths for all Cx states. Remove cpu_idle_busy and instead do the little profiling we need before re-enabling interrupts. Use 1 quantum as estimate for C1 sleep duration since the timer interrupt is the main reason we wake. While here, change the cx_history sysctl to cx_usage and report statistics for which idle states were used in terms of percent. This seems more intuitive than counters. Remove the cx_stats structure since it's no longer used. Update the man page. Change various types which do not need explicit size.
* Work around the preemption problem in acpi_cpu.c for shutting down.peter2004-06-041-0/+2
| | | | Submitted by: nate / jhb
* Add missing <sys/module.h> includesphk2004-05-3014-0/+14
|
* Decrease sleep_delay default to 1 second now that the machines thatnjl2004-05-291-2/+2
| | | | required the 5 second delay have been fixed.
* Style cleanups, don't set the device description before the probe routinenjl2004-05-293-49/+37
| | | | has completed successfully.
* Don't assume that the current setting (_CRS) of a PCI link device isjhb2004-05-281-7/+9
| | | | | | | | correct. Instead, check it against the possible settings (_PRS) when the link is probed. This is important when using APIC mode but link devices still have PIC mode settings. This is also what Linux does. Additional prodding by: Len Brown len dot brown at intel dot com
* Style fixes.njl2004-05-281-56/+54
|
* Now that we properly disable GPEs before entering a sleep state, includingnjl2004-05-281-1/+1
| | | | | S5 (soft off), we don't need to disable ACPI when powering off. This may fix some systems that don't power off correctly.
* Style cleanups. "extern" is unneeded for function prototypes.njl2004-05-281-74/+68
|
* Update the new suspend/resume GPE methods to properly limit the GPEnjl2004-05-284-16/+65
| | | | | | | based on the destination sleep state. Add a method to restore the old state on resume. This is needed for the case of suspending to a very low state disabling a GPE (i.e. S4), resuming, and then suspending to a higher state (i.e. S3). This case should now keep the proper GPEs enabled.
* Pass a pointer to the sleep state instead of casting gymnastics to passnjl2004-05-281-4/+4
| | | | the value itself in the pointer.
* Fix paste-o.njl2004-05-281-1/+1
|
* Attach per-device sysctls to allow users to set whether or not a givennjl2004-05-281-0/+52
| | | | | | | | | device can wake the system. For example: dev.root0.nexus0.acpi0.acpi_lid0.wake: 1 dev.root0.nexus0.acpi0.acpi_button0.wake: 1 dev.root0.nexus0.acpi0.pcib0.wake: 0 dev.root0.nexus0.acpi0.sio0.wake: 0
* Fix LP64 environments: cast a pointer type to intptr_t before castingmarcel2004-05-281-2/+2
| | | | to int and vice versa.
* Restructure the wake GPE API. Now there are three functions:njl2004-05-274-186/+285
| | | | | | | | | | | | | | | | | | acpi_wake_init: Evaluate _PRW and set the GPE type acpi_wake_set_enable: Enable or disable a device's GPE. acpi_wake_sleep_prep: Perform any last-minute changes to the device to prepare it for entering the given sleep state. Also, walk the entire namespace when transitioning to a sleep state, disabling any GPEs which aren't appropriate for the given state. Transition acpi_lid and acpi_button to the new API. This clears the way for non-ACPI-aware devices to wake the system (i.e. modems) and fixes a problem where systems power up after shutdown when a GPE is triggered.
* Enable GPE at runtime rather than suspend time. This is to match thenjl2004-05-252-2/+6
| | | | | new behavior in ACPI-CA that defers GPE configuration. This is a temporary measure while reworking the GPE interface.
* Remove call to _INI for thermal devices. ACPI-CA now calls _INI fornjl2004-05-251-6/+0
| | | | Devices, ThermalZones, and Processors.
* Changes to implement 20040514:njl2004-05-255-45/+67
| | | | | | | | | | | | | | | * Add calls to AcpiSetGpeType. We use wake/run as the type for lid and button switches since wake-only causes Thinkpads to immediately wake on the second suspend. Note that with wake/run, some systems return both wake and device-specific notifies so we don't register for system notifies for lid and button switches. * Remove the hw.acpi.osi_method tunable since it is not needed. * Always print unknown notifies for all types. * Add more cleanup for the EC if it fails to attach. * Use the GPE handle now that we parse it. This allows GPEs to be defined in AML GPE blocks. * Always use ACPI_NOT_ISR since it's ok to acquire a mutex in our thread which processes queued requests.
* Revert the previous commit. The bus accessor macros do not check thenjl2004-05-221-3/+56
| | | | | | | return value for BUS_READ_IVAR and thus don't generate the proper NULL in cases where a device (i.e. on PCI) does not have a handle. Found by: peadar, tjr
* Use the simpler __BUS_ACCESSOR macros for ivars instead of defining themnjl2004-05-181-56/+3
| | | | ourselves.
* Add support for GPE being a package of { reference, gpe bit }.njl2004-05-141-40/+86
| | | | | Rework the ECDT probe to pass all the parameters in a temporary struct. Note why we are mostly ok evaluating _GLK so early.
* Add support for retrieving _GLK in the ECDT probe. Now we no longer alwaysnjl2004-05-131-35/+20
| | | | | use the global lock at the beginning of the ECDT probe. Instead, we use the handle from the ECDT to call _GLK. Also, unify the device description.
* If an ACPI PCI-PCI bridge doesn't have a _PRT object, fall back to usingjhb2004-05-101-1/+9
| | | | | | | | | the swizzle method for routing PCI interrupts across the bridge. This fixes problems with motherboards (typically laptops) whose BIOS doesn't provide a PRT for the AGP bridge even though there is a device entry for the bridge in the ACPI namespace. Tested by: Kenneth Culver culverk at sweetdreamsracing dot biz
* Change hw.acpi.cpu.cx_lowest to accept values in the form of C1,njl2004-05-071-9/+12
| | | | | C2, ... Update power_profile to use the new format. Update the man page to reflect this and give more info on Cx states.
* Rename acpi_cpu to cpu. Change the probe routine to early on rejectnjl2004-05-061-42/+90
| | | | | | devices it cannot attach to. This gets rid of extraneous but harmless device_probe_and_attach() errors. While I'm here, make the device description more useful. The !acpi case for cpu is handled by legacy0.
OpenPOWER on IntegriCloud