summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
AgeCommit message (Collapse)Author
2023-02-10Adjust knote(9) APIVisa Hankala
Make knote(9) lock the knote list internally, and add knote_locked(9) for the typical situation where the list is already locked. Remove the KNOTE(9) macro to simplify the API. Manual page OK jmc@ OK mpi@ mvs@
2023-02-04Initial driver for Universal Flash Storage (UFS) Host Controllers.Marcus Glocker
ok kettenis@
2023-02-04timecounting: remove incomplete PPS supportScott Soule Cheloha
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is going to finish adding PPS support, so let's remove the stubs: - Delete the dead tc_poll_pps() call from tc_windup(). - Remove all tc_poll_pps symbols from the kernel. Link: https://marc.info/?l=openbsd-tech&m=167519035723210&w=2 ok miod@
2022-12-18Disable the keyboard on the Samsung Galaxy Book Go until we can fix theMarcus Glocker
resulting interrupt storm. It's causing bad system performance, and breaks the installer.
2022-11-24Don't report unknown apic structure types if they're in the OEM reservedJonathan Matthew
range (0x80 to 0xff). We're not going to understand OEM specific structures, and some machines such as the Dell R6515 have significant numbers of them. ok kettenis@
2022-11-08acpihpet(4): disable/reenable acpihpet_delay() during suspend/resumeScott Soule Cheloha
We can't use the HPET to delay(9) after we halt it during suspend. Disable acpihpet_delay() before we halt the HPET and reenable it after we restart the HPET during resume. ok mlarkin@
2022-11-06Add FDT-based attachment for qciic(4).Patrick Wildt
ok kettenis@
2022-11-06Add FDT-based attachment for qcgpio(4).Patrick Wildt
ok kettenis@
2022-10-30On the Lenovo X13s attaching to the multiport USB controller leads to hardPatrick Wildt
resets. Previously this was only seen with smmu(4) enabled, probably as there is no IORT reference to that controller and hence no IOMMU mapping established. Since recent BIOS updates, this now also happens without smmu(4) enabled. Let's skip this node for now to keep machines running. Prompted by deraadt@ ok phessler@
2022-10-26Constify battery check tableKlemens Nanni
OK jcs
2022-10-20Add the hooks to disable and enable GPIO interrupts. Should fix potentialMark Kettenis
interrupt storms related to level-triggered interrupts. ok mglocker@
2022-10-20Constify global product tableKlemens Nanni
Looking for .rodata candidates in /bsd .data symbols, this one popped up: ffffffff82281b70 l O .data 0000000000001688 asmc_prods OK jung
2022-10-08Add PNP ID to make this attach on Qualcomm SoCs.Mark Kettenis
ok mglocker@, patrick@
2022-10-03Reorganize the EFI code a bit. Move the efi.h header from dev/acpi toMark Kettenis
dev/efi and rename the arm64 efi.c to efi_machdep.c, preparing the way for MI EFI code and an amd64 implementation of EFI runtime support. ok deraadt@, mlarkin@
2022-09-15Enable the keyboard on the Samsung Galaxy Book Go.Marcus Glocker
Help from kettenis@, "Nice!" deraadt@
2022-09-13Split out the code that collects data from acpiac(4), acpibat(4) andMark Kettenis
acpisbs(4) for apm(4) and hook it up to the arm64 version of apm(4) on systems with ACPI. ok kn@
2022-09-12Add support for level-triggered GPIO events.Mark Kettenis
ok mlarkin@
2022-09-12acpihpet(4): acpihpet_delay: only use lower 32 bits of counterScott Soule Cheloha
We can't use acpihpet_r() to implement acpihpet_delay(). Even if we made acpihpet_r() atomic on amd64, i386 would still be incapable of doing atomic 8-byte reads. As-is, the code does a split read on all platforms, which may or may not already be causing problems with TSC calibration: https://marc.info/?l=openbsd-tech&m=166220561709496&w=2 Switch from acpihpet_r() to bus_space_read_4() and only use the lower 32 bits of the counter. This makes acpihpet_delay() slightly larger, but unless we want two acpihpet_delay() implementations we have no choice. Link: https://marc.info/?l=openbsd-tech&m=166165347220077&w=2 ok jsg@
2022-09-11Register the I2C controller with ACPI. Skip this on the SC8280XP SoC forMark Kettenis
now as the AML on the Lenovo X13S tries to do I2C transactions to a device that doesn't respond leading to the ACPI thread spinning until the transaction times out. ok mlarkin@, deraadt@
2022-09-10Add another pin to the SC7180 map function.Mark Kettenis
2022-09-10Don't restrict GPIO events to pin numbers below 256. With the _EVT()Mark Kettenis
method events corresponding to larger numbers are possible. Fixes lid state detection on the x13s. ok patrick@
2022-09-10Generalize the code such that it works on SC7180 SoCs as well.Mark Kettenis
ok mglocker@, patrick@
2022-09-10Add _HID for SC7180 SoCs.Mark Kettenis
ok mglocker@
2022-09-09The DSDT on the snapdragon 7c based Acer Aspire 1 (A114-61) uses a bogusMark Kettenis
compatible ID. Add its hardware ID to the list to work around this. ok patrick@, mlarkin@, mglocker@
2022-09-08Use generic PNP ID to match HID-over-I2C devices.Mark Kettenis
ok patrick@, drahn@
2022-09-08Add a few more pin mappings based on what is in some Linux device treeMark Kettenis
updates that are floating around. Remove some #ifdef'ed out debug code that was left behind. ok patrick@, drahn@
2022-09-07Add a few more PNP IDs to handle variants of the Qualcomm dual roleMark Kettenis
controller based on AML dumps found online and some further detective work looking at Windows drivers by jsg@. ok jsg@, millert@
2022-09-03Make sure we don't suspend if we have no way to wake up the machine.Mark Kettenis
The idea is that device drivers that can wake up the machine register themselves by calling device_register_wakeup(). To prevent regressions on amd64, we let acpi(4) register itself as a wakeup device if the AML for the machine defines wakeup devices. This may be refined in the future. This diff will prevent people from suspending their arm64 SBCs without having a way to wake them up. For now the only driver that registers itself is axppmic(4), which means that at this moment only SBCs with an allwinner A64 or H5 SoC will actually support suspend/resume. ok mlarkin@, deraadt@
2022-08-31Add qcgpio(4) and qciic(4), drivers for the Qualcomm GPIO and I2C controllersMark Kettenis
found on the SC8280XP SoC. Together these drivers make the keyboard, trackpoint and touchpad work on the x13s. ok deraadt@
2022-08-31Introduce iic_intr_disestablish() and use it in ihidev(4).Mark Kettenis
ok jcs@
2022-08-25acpihpet(4): don't truncate HPET frequency to 32-bit valueScott Soule Cheloha
timecounter.tc_frequency is a 64-bit value: this cast is unnecessary. Split off from the acpihpet_delay() commit at jsg@'s suggestion. Link1: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2 Link2: https://marc.info/?l=openbsd-tech&m=166132727120528&w=2 probably ok jsg@
2022-08-25acpihpet(4): add acpihpet_delay(), another delay(9) implementationScott Soule Cheloha
When lapic_delay() is removed from the tree in the near future, older machines without a constant/invariant TSC will need a delay(9) implementation better than i8254_delay(). This patch adds acpihpet_delay(), a delay(9) implementation based on the ACPI HPET timer. It is preferable to i8254_delay() (0) and acpitimer_delay() (1000), so set its quality to 2000. On newer machines, the HPET is slower to read than the PMT on newer machines for reasons unknown, so _technically_ this quality hierarchy is not always accurate. However, we expect these newer machines to have a constant/invariant TSC available, so the inaccuracy is harmless because tsc_delay() will be available, which is better than both the PMT and the HPET. In general, on real hardware that predates wide availability of the constant/invariant TSC, the HPET is preferable to the PMT. With input from jsg@. Link: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2 ok mlarkin@ jsg@
2022-08-25acpitimer(4): add acpitimer_delay(), another delay(9) implementationScott Soule Cheloha
When lapic_delay() is removed from the tree in the near future, older machines without a constant/invariant TSC will need a delay(9) implementation better than i8254_delay(). This patch adds acpitimer_delay(), a delay(9) implementation based on the ACPI PM timer. It is only preferable to i8254_delay(), so set its quality to 1000. With input from jsg@. Link: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2 ok mlarkin@ jsg@
2022-08-10Provide the AML root in ACPI's softc so that drivers that need accessPatrick Wildt
don't have to declare it using extern. Suggested by and with feedback from kettenis@ Tested by deraadt@ on arm64, amd64 and i386 Tested by bluhm@ on amd64 and i386
2022-07-05Missing header change that should have gone with xhci_acpi.c r1.8Theo Buehler
from kettenis via patrick
2022-07-04Add support for the dual role controllers integrated on the QualcommMark Kettenis
Snapdragon 8cx gen 3 SoC. ok patrick@
2022-06-29match on Alder Lake-PJonathan Gray
ok deraadt@ kettenis@
2022-06-28Add support for the Synopsys DesignWare UART found on the Ryzen EmbeddedMark Kettenis
V1000 SoCs. ok anton@
2022-06-28A com_acpi_softc pointer is used as the interrupt callback cookie whichAnton Lindqvist
is later on interpreted as a com_softc pointer. This is not a problem in practice as a com_softc structure is the first member of the com_acpi_softc structure. Using the actual types consistently yields a better symmetry in my opinion between registering the interrupt and the corresponding interrupt handler. ok deraadt@ kettenis@
2022-06-28Add hardware ID for EHCI-compliant USB controller with standard debug.Mark Kettenis
ok jsg@
2022-06-28Add hardware ID for XHCI-compliant USB controller without standard debug.Mark Kettenis
ok jsg@
2022-06-27Whitespace/KNFMike Larkin
2022-06-27amdgpio(4): restore pin configuration on resumeMike Larkin
Save/restore the pin configuration on suspend/resume for amdgpio(4). This fixes missing interrupts after resume for trackpads on some machines, including the ROG Zephyrus 14 and the HP DevOne (and probably others). Code based on pchgpio(4). ok deraadt, kettenis
2022-06-11Bring back PL011 UART FIFO support to pluart(4). This time with workingAnton Lindqvist
tx interrupts. Special treatment of Server Base System Architecture (SBSA) generic UART devices is required as presence of the interrupt trigger level register is not guaranteed. Therefore treat such devices of having a 1-byte FIFO. ok visa@
2022-05-29pwr_action isn't used in this file, zap pointless decl.Jeremie Courreges-Anglas
2022-04-06constify struct cfattachChristian Weisgerber
2022-04-04As a hack, use CD_SKIPHIBERNATE. For 2.0, our TPM lifecycle managementTheo de Raadt
is improper, and some chips are more sensitive to this than others. In an unhibernate situation, /bsd.booted will 'suspend' the TPM, then jump directly into unhib /bsd, which 'resumes' it. This is wrong because the lifecycle is supposed to be more like suspend->BIOS->resume. This is a hack until we figure out how to fix the lifecycle. from claudio, ok dv
2022-03-21Update hw.power whenever we refresh the AC state. This makes sure the stateMark Kettenis
doesn't get out of sync with what apm(8) reports if power is plugged or unplugged when a machine is suspended. Which in turn makes sure the machine properly goes into a low CPU P-state when requested. ok deraadt@, florian@
2022-03-13Revert previous commit. It breaks the serial console on my rpi4.Mark Kettenis
2022-03-11Enable PL011 UART FIF0 support in pluart(4). The FIFO depth depends onAnton Lindqvist
the revision and ranges from 16 to 32 bytes. Special treatment of Server Base System Architecture (SBSA) generic UART devices is required as presence of the interrupt trigger level register is not guaranteed. Therefore treat such devices of having a 1-byte FIFO. With help from kettenis@ and ok visa@