Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
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@
|
|
ok jcs@
|
|
Fixes issues with dead touchpads after resume on some machines.
ok jcs@, deraadt@
|
|
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@
|
|
(researched by mlarkin). With this, and the latest BIOS which added S3,
the lenovo x1r9 and x1nano can resume.
ok kettenis mlarkin
|
|
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@
|
|
ok jcs@
|
|
ok kettenis@
|
|
with James Hastings
|
|
|
|
between ACPI and FDT. The ACPI tables have now been adjusted, so now we
need to accept the new scheme as well.
ok kettenis@
|
|
No code change.
|
|
wrong and the buffer size is implied by the field attribute instead of the
field length like for normal OpRegion fields. Fixes various laptops
where reading multiple bytes from AML over an i2c bus would overflow
the buffer. Still fixes the Dell Precision 3640.
ok tb@
|
|
|
|
ok kettenis@
|
|
S4 and S5 support, but fail to populate the SLEEP_CONTROL_REG and
SLEEP_STATUS_REG descriptions in the FADT. An example of such a machine
is the ASUS Zenbook 14 UM433DA. Any attempt to powerdown the machine
will result in a kernel crash. It turns out that using the legacy ACPI PM
registers works fine on this machien. So fall back on those registers
if SLEEP_CONTROL_REG and/or SLEEP_STATUS_REG aren't provided.
ok deraadt@, mpi@
|
|
GenericSerialBus operating regions witout checking whether they're really
available. This needs to work on RAMDISK kernels as well. Since we
don't want to pull in the i2c subsystem on those, provide a separate
and much simpler dummy implementation of the GenericSerialBus access code
when SMALL_KERNEL is defined.
ok tb@
|
|
or padded, and hence e. g. the access to the PCI vendor/device id would be
broken. The structs for the other tables all seem to be packed as well.
ok kettenis@
|
|
found and test by Rafael Avila de Espindola
ok kettenis
|
|
is blessed with IOMMU magic, if available. This is mainly for arm64,
since on amd64 and i386 the IOMMU only captures PCIe devices, as far
as I know, which uses the pci_probe_device_hook(). This though is for
non-PCI devices attached through ACPI.
ok kettenis@
|
|
used towards an smmu(4) for non-PCI devices. The references are provided
as ASCII printable paths.
ok kettenis@
|
|
caused by the reference handling change from December.
ok kettenis@ patrick@
|
|
These are not in a printable format, hence printing them as string is
wrong. Additionally, aml_searchrel()/aml_searchname() expect the name
to be passed in a printable format as well. Passing a nameref can lead
to an out-of-bounds read, and the comparison can fail. Hence make sure
that namerefs are passed to aml_getname() first, which returns printable
strings. Note that aml_getname() uses a static buffer, so there are a
few restrictions how the string can be used.
ok kettenis@
|
|
|
|
ok patrick@
|
|
LocalX. In that case, resolving the reference must be done before
resetting the LocalX variable. test daniel
ok kettenis
|
|
ok kettenis@
|
|
The timecounter struct is large and I think it may change in the
future. Changing it later will be easier if we use C99-style
initialization for all timecounter structs. It also makes reading the
code a bit easier.
For reasons I cannot explain, switching to C99-style initialization
sometimes changes the hash of the resulting object file, even though
the resulting struct should be the same. So there is a binary change
here, but only sometimes. No behavior should change in either case.
I can't compile-test this everywhere but I have been staring at the
diff for days now and I'm relatively confident this will not break
compilation. Fingers crossed.
ok gnezdo@
|
|
ok kettenis@ pirofti@
|
|
tpm(4) has timeout constants in milliseconds, e.g.
#define TPM_ACCESS_TMO 2000 /* 2sec */
This is fine.
The odd thing is that tpm(4) first converts these timeouts to counts
of ticks via tpm_tmotohz() before using DELAY() to busy-wait. DELAY()
takes a count of microseconds, which are not equivalent to ticks, so
the units are all screwed up.
Let's correct this:
- Remove tpm_tmotohz(). We're not working with ticks so we don't it.
- Multiply the timeouts to match the delay interval. tpm_request_locality()
and tpm_getburst() use intervals of 10 microseconds, so multiply the
millisecond timeouts by 100. In tpm_waitfor() the delay interval is 1
microsecond, so multiply the millisecond timeout by 1000.
- Update the parameter name in tpm_waitfor() to note that we expect a
count of milliseconds, not "tries".
Discussion: https://marc.info/?l=openbsd-tech&m=160995671326406&w=2
Prompted by kettenis@.
Suspend/resume tested by florian@ on an X1 Gen 2. For the record, it
looks like this:
tpm0 at acpi0 TPM_ addr 0xfed40000/0x5000, device 0x0000104a rev 0x4e
Earlier versions of this patch were reviewed by kn@, but the patch
became more ambitious when kettenis@ got involved so those reviews
are no longer applicable.
jcs@ notes (https://marc.info/?l=openbsd-tech&m=160834427630142&w=2)
in a related discussion that this driver "sucks" and should be
replaced with NetBSD's rewrite. This would get us a cleaner driver
with TPM 2.0 support. So there is future work to do here.
ok kettenis@
|
|
ok kettenis@
|
|
ok kettenis@
|
|
ok kettenis@
|
|
the generic IORT node information but also the Root Complex's attributes.
ok kettenis@
|
|
ok kettenis@
|
|
so that it can be used by more drivers.
ok kettenis@
|
|
region reporting table. Since the extent only covered memory starting
at 16M, these regions could not be reserved and would in turn cause a
panic. Make the extent start at 0 and immediately reserve the first
16M right away, so that we can change the reserved memory allocator to
EX_CONFLICTOK to make allocations succeed if they are already reserved.
ok kettenis@
|
|
it is used by acpihpet.c
|
|
Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remains intact because the kernel lock is still used
with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist
internally. This allows some code simplification.
OK mpi@
|
|
ok kettenis@
|
|
ok patrick@
|
|
These references need to be resolved at runtime rather than when
they're parsed such that they pick up the right values for those nodes
which can be changed when for example _INI methods run.
The current approach is to replace these reference with a string that
names the node in question. The problem with that is that packages
can also contain normal strings. Which means that we need special
code that depends on the context where the package is used.
This diff takes a different approach by retaining a reference when
parsing. Code that uses a package will need to resolve this reference
but there is no ambiguiety anymore.
ok patrick@
|
|
ok kettenis@
|
|
because the asmc read/write functions are timing out regularly on each
cycle. Since the sensor task is executed during kernel lock, this can
have a negative impact on time sensitive code, as seen with USB isoc
transfers.
Rewriting the asmc read/write functions to a similar execution pattern as
the Linux driver does, entirely removes the timeouts, and hence reduces
the asmc sensor update code to be executed within ~3ms.
ok mpi@
|
|
ok kettenis@
|
|
ok patrick@
|
|
ok gnedzo@
|
|
ok patrick@
|