summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2022-02-17If S4 is not available, use S5 for the ACPI-transitions in hibernate support.Theo de Raadt
A bunch of servers work now. Really close to a 3-line diff... ok kettenis
2022-02-17remove unused definesJonathan Gray
2022-02-17reduce includesJonathan Gray
2022-02-17reduce includesJonathan Gray
ok deraadt@
2022-02-16rev 1.4 was wrong to put potential IO operations after _GTS.Theo de Raadt
re-creating the original (2 weeks ago) order of last-minute-disk-parking needs a different approach, hmm.
2022-02-16if the lids indicate we are not supposed to wakeup, return EAGAIN ratherTheo de Raadt
than scheduling an acpi thread
2022-02-16change MD gosleep() and sleep_finish() to return int, the MI code will beTheo de Raadt
able to react to this suitably.
2022-02-15Since acpitoshiba brightness button processing no longer plays gamesTheo de Raadt
with AML parsing outside the acpi thread, the locking-release dance around wsdisplay_{suspend,resume} can be removed ok kettenis
2022-02-15Defer the actual setting of the display brightness to the acpi thread.Mark Kettenis
ok deraadt@
2022-02-15when the MI suspend code encounters problems, we need a way toTheo de Raadt
reset the MD state before bailing out. New MD function sleep_abort() does that.
2022-02-15com at acpi like com at isa needs com_active() for suspend/resume support.Claudio Jeker
Fixes my com0 issues after zzz and ZZZ. OK kettenis@ miod@
2022-02-15MI disable_lid_wakeups() is not needed, x86 systems can do thisTheo de Raadt
in sleep_resume(), which seems sensible for other future systems also
2022-02-15The DVACT_POWERDOWN step was accidentally moved in relation to some MDTheo de Raadt
steps, so shuffle the MD steps to reinforce the order.
2022-02-14Make sure we call acpi_resume_cpu() with the right ACPI state. This wasMark Kettenis
accidentally broken with the reorganization of the suspend/resume code that was committed a few days ago. ok deraadt@
2022-02-14acpi_indicator() can take the softc*, instead of void*Theo de Raadt
2022-02-14test the correct pointer for acpi_intr_establish() resultJonathan Gray
ok deraadt@ gnezdo@
2022-02-10Embed klist head in acpi_softc to avoid explicit malloc.Visa Hankala
OK kettenis@
2022-02-09Move x86-only stubs used by kern/subr_suspend.c into dev/acpi/acpi_x86.cTheo de Raadt
for sharing between i386 and amd64. ok mlarkin kettenis
2022-02-09add Surface Go 3 hid to acpibat(4)Dave Voutila
Microsoft decided to break with basic ACPI standards with the Go 3. In this case, they don't expose the battery in a standard way, so acpibat(4) needs to look for the special Microsoft hid. From mlarkin@, ok kettenis@
2022-02-09add newline to acpitz(4) attach conditionDave Voutila
ok miod@
2022-02-08The suspend/resume code is a sticky mess of MI, MD, and ACPI sequencing.Theo de Raadt
This splits out the MI sequencing, backing it with per-architecture helper functions. Further steps will be neccesary because ACPI and MD are too tightly coupled, but soon we'll be able to use this code for more architectures (which depends on figuring out the lowest-level cpu sleeping method) ok kettenis
2022-02-04set the APM_BATT_CHARGING state if the battery is being charged and tryRobert Nagy
to calculate the remaining time to be fully charged ok jca@
2022-02-02acpi_addtask() calls malloc() w/ M_NOWAIT (because some calls come fromTheo de Raadt
interrupt context), this however means occasional resource shortage will result in callbacks registration failing, and unknown consequences for the task-submitting caller. Changing this to use pools with a low water mark, decreases the odds of that problem occuring. ok kettenis
2022-02-01GPE_DIRECT is calling the AML parser from interrupt context, which isTheo de Raadt
not permitted. Luckily nothing is using GPE_DIRECT anymore, so this code can be deleted. ok kettenis
2022-01-26An ACPI device needs to be both present and enabled for it to function.Mark Kettenis
So only attempt to attach hardware that has both bits enabled. This fixes an issue where com(4) would attach for a disabled serial port leading to misdetection of the hardware variant and a subsequent hang when /etc/rc runs ttyflags -a. ok anton@, deraadt@
2022-01-18Improve how quirks are handled on sdhc(4)-compatible drivers. So farPatrick Wildt
we have passed a modified version of the contents in the capabilities register if we wanted to override what sdhc(4) would otherwise read. Unfortunately there's a second capabilities register that we did not yet take into consideration, which is why to disable DDR50 support we created a quirk flag in the softc. The sdhc(4) ACPI nodes have a way to mask and set bits in both of the capabilities register, which is a flexible approach to solving that issue and using that for our sdhc(4) drivers even improves readability. ok kettenis@
2022-01-12Make acpi_getpropint() return uint64_t, as ACPI integers are in fact thatPatrick Wildt
wide and some _DSD properties depend on it. ok kettenis@
2022-01-09spellingJonathan Gray
feedback and ok tb@ jmc@ ok ratchov@
2022-01-04acpi_getprop() needs to actually make sure that we're looking at thePatrick Wildt
correct property. While there adjust acpi_getpropint() as well to increase similarity with acpi_getprop(). ok kettenis@
2022-01-02preferense -> preferenceJonathan Gray
2021-12-29Allow ohci(4) and ehci(4) to attach to acpi(4).Patrick Wildt
ok kettenis@
2021-12-29acpi_intr_disestablish() is available on all our ACPI platforms whichPatrick Wildt
support interrupts via ACPI, so there's need for an ifdef around it. ok kettenis@
2021-12-26Add address locators for the ACPI "bus" and use these to fix the order ofMark Kettenis
the com(4) devices to match the traditional order one the ISA bus. ok patrick@, anton@
2021-12-21Move checks on attach arguments from attach into match.Mark Kettenis
ok anton@, deraadt@
2021-12-21Rename local variable intrfn to intr, matches what dev/fdt/com_fdt.cAnton Lindqvist
already does.
2021-12-21Do not attach com at acpi when there's no address or irq present. FixesAnton Lindqvist
a regression caused by the recent change to start attaching com at acpi as it turns out that Libreboot exposes console devices lacking crucial data in their acpi tables. The same console attaches fine over isa, therefore restore this behavior. Problem reported by <cipher-hearts at riseup dot net> on bugs@ ok deraadt@ kettenis@
2021-12-16Attach com over acpi on amd64. Some hardware uses a different interruptAnton Lindqvist
assignment compared to the the legacy one supported by com over isa. This causes the console to halt once userland takes over as no interrupts are received. The actual address and irq can be read from ACPI, kettenis@ already added support for arm64 which paved the way for amd64. Some consoles that previously attached over isa are now expected to attach over acpi. Thanks to patrick@ for testing on arm64. ok kettenis@
2021-12-09Broken ACPI tables containing scopes that are larger than their outer shellPatrick Wildt
are caught by our ACPI parser. Unfortunately in such cases our reaction was to start parsing AML somewhere outside our current scope. The intention was to clamp down the inner scope to the maximum of the outer one. So, rectify it. This issue has shown up in EDK2's QEMU SBSA target, where the SSDT table was generated incorrectly. Surprisingly neither Linux nor ACPICA's iASL noticed that the table was broken. ok kettenis@ millert@
2021-12-07Fix typo in Tiger Lake H configuration.Mark Kettenis
From James Hastings
2021-12-07print the failed method numberTheo de Raadt
2021-12-07Fix parsing of SR_IRQ resource descriptors here as well.Mark Kettenis
ok patrick@, anton@
2021-12-07Fix parsing of SR_IRQ resource descriptors.Mark Kettenis
ok patrick@, anton@
2021-11-02knfTheo de Raadt
2021-10-30Change hw.perfpolicy=auto by default, at startup. If the system has ACTheo de Raadt
power connected (default is yes when no driver differentiates) then default to 100% performance. On battery, use the existing auto algorithm (which is admittedly somewhat unrefined). This change overrides the system/BIOS speed and puts OpenBSD in control. As this happens very early during boot, besides speedups in all usage usage patterns, some surprises: unhibernate and sysupgrade times are cut in half. note: on a few architectures, the setperf fn pointer is changed late, and thus the auto algorithm stops timeing out. kettenis and i will look for a solution. in snaps for more than a week. ok kettenis
2021-10-23tpm(4): add support for tpm2 CRB interfaceDave Voutila
Some modern tpm2 devices require or prefer drivers communicate via the CRB interface and not the TIS/fifo interface. This change adds basic support for detecting CRB start mode and using CRB to issue commands required for proper S4 hibernation. As a result, this also defines a new struct definition for the TPM2 acpi table required for start mode detection. This fixes recent S4 regressions on the Surface Go 2 caused by a change in firmware from Microsoft. Other CRB start methods may need implementing in the future to support additional hardware. tested by deraadt@ and many others, ok kettenis@
2021-09-29Add support for Cannon Lake H and Tiger Lake H platforms.Mark Kettenis
ok jcs@
2021-09-21During resume, also restore pins that we configured as GPIO interrupt pins.Mark Kettenis
Fixes issues with dead touchpads after resume on some machines. ok jcs@, deraadt@
2021-09-18Work around a BIOS bug on Lenovo Thinkpads based on Intel's Tiger LakeMark Kettenis
platforms where the GPIO pin that is used for the touchpad interrupt gets reset when entering S3 and isn't properly restored upon resume. ok deraadt@, jcs@
2021-09-11Identify TPM2.0 devices and perform the 2.0-specific "suspend" commandTheo de Raadt
(researched by mlarkin). With this, and the latest BIOS which added S3, the lenovo x1r9 and x1nano can resume. ok kettenis mlarkin
2021-08-30Remove magic offset from data structures. This makes it much easier toMark Kettenis
compare the data structures with the Linux code which unfortunately is the only documentation we have for the pin numbers used by ACPI. While there make the data structures const. ok jcs@