summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/dsdt.c
AgeCommit message (Collapse)Author
2019-01-10Properly implement (as far as we can) Event()/Signal()/Wait() AML operations.Mark Kettenis
ok mpi@, tedu@, deraadt@
2018-08-19Add support for multiple PCI segments. Only really implemented for arm64Mark Kettenis
for now as amd64/i386 firmware still caters for legacy OSes that only support a single PCI segment. ok patrick@
2018-06-29Use <stdint.h> types.Mark Kettenis
ok mpi@, jung@, krw@, deraadt@
2018-06-12Don't panic on I/O to unregistered regionspaces. Needed to unbreak the GPDMike Larkin
pocket which has a questionable BIOS. The code will now simply printf and return to the caller without doing any I/O in this case. The spec defines this to be undefined behaviour anyway. ok kettenis, deraadt, pirofti
2018-05-19Fix GenericSerialBus support by parsing ExtendedAccessField correctly.Mark Kettenis
ok mlarkin@
2018-05-17Sprinkle some #ifndef SMALL_KERNEL such that RAMDISK kernels cuild again.Mark Kettenis
pointed out by stsp@
2018-05-17Implement GenericSerialBus OpRegion support.Mark Kettenis
ok mlarkin@
2018-05-17Implement LoadTable().Mark Kettenis
ok mlarkin@
2017-11-29Revise OperatingRegion code to make it extensible and have chvgpio(4)Mark Kettenis
provide the OEM defined regions that are used by the AML on some Cherryview-based machines. ok mlarkin@
2017-10-12Add missing size to free(); ok deraadt@ mpi@anton
2017-05-28Remove a redundant assignment introduced in revision 1.219 but favor theanton
assignment outside of the conditional. ok stsp@
2017-04-15Fix format string in ACPI_MEMDEBUG blockPhilip Guenther
From Anton Lindqvist (anton.lindqvist(at)gmail.com)
2017-04-08Two prototypes for acpi_maptable; merge to one placeTheo de Raadt
2017-02-16On Apple hardware, claim an OSI of Darwin and no other OSesJoshua Stein
The DSDT on at MacBooks takes many different and beneficial code paths when the OS reports to be Darwin, but due to the way it checks OSI, we can't just add Darwin to the aml_valid_osi array since later checks for Windows variants will supersede the Darwin check. Fixes suspend and keeps Thunderbolt ports powered up after resume. One regression is that the acpibat driver no longer attaches and will require an ACPI Smart Battery driver, which is in the works. Adapted from a similar change in the Linux kernel from 2014. ok deraadt
2017-01-14Revert aml_rdpciaddr changes; breaks several machines that were workingMark Kettenis
before.
2017-01-08Make aml_rdpciaddr() work for for devices behind bridges. The code nowMark Kettenis
uses the mapping between AML nodes and PCI devices that we establish. Because _INIT methods may end up calling aml_rdpciaddr(), make sure we create that mapping early. Also handle devices that aren't actually present. These devices are now included in the mapping and reads will return an all-ones patterm whereas writes are a no-op.. ok mlarkin@
2016-12-18Remove comparison of array which is always non-NULL. Fixes clang warning.Mark Kettenis
ok jca@ (a while back)
2016-10-25Add the resource index to aml_parse_resource() callback function.Paul Irofti
This is needed by an upcoming acpiec commit that handles machines breaking the current ACPI specifications. Change suggested by and ok kettenis@, guenther@
2016-10-21Add support for the ACPI timer opcode.Joris Vink
ok kettenis@
2016-09-27Print the type of operation space that failed as there seem to be more ofMike Larkin
these occurring recently.
2016-09-02Remove unused argument in aml_showvalue().Paul Irofti
The second argument of aml_showvalue() was probably supposed to set the verbosity level through dnprintf() but in fact it does nothing. OK deraadt@
2016-05-08Add support for writing gpio pins.Mark Kettenis
2016-05-07Implement ACPI 5.0 GeneralPurposeIo OpRegion support. This basically allowsMark Kettenis
AML to peek and poke at GPIO pins as if it were reading and writing registers. For now this only implements peeking at pins. It will print a message if AML attempt to poke at a pin. And it will panic if the assumptions made in the code are violated. ok mlarkin@
2016-03-14Correct the value of SRT_ENDTAG: it was documented incorrectly in earlyPhilip Guenther
ACPI specs. With the correct value, it can now be used in a few places instead of hardcoding 0x79. ok kettenis@
2016-03-02Claim to be more versions of windows for _OSI checks.Jonathan Gray
2001.1 SP1 Windows Server 2003 SP1 2006.1 Windows Server 2008 2006 SP1 Windows Vista SP1 2006 SP2 Windows Vista SP2 2015 Windows 10 ok kettenis@
2016-01-13Change aml_find_node() such that it only walks down the tree and doesn'tMark Kettenis
traverse sideways. This seems to be what all callersexpect it to do, and fixes a bug in dwiic(4) where it would try to access i2c devices on busses they're not attached to. If there is any fallout from this change, the right thing to do is probably to make sure callers pass the right node. While there, change the return type to void, as the return value was useless and none of the callers looked at it. ok mlarkin@
2015-08-20Respect the access size when reading or writing to pci config space.Mark Kettenis
This version also makes sure writes are properly aligned, preventing the panics seen with the previous incarnation of this change. Fixes battery status passthrough in vmware, brightness keys on my x220 and who knows what else. ok mlarkin@, deraadt@
2015-05-04When writing a value to a field, don't read past the end of the source valueJonathan Matthew
if the field is bigger. Fixes crashes seen on HP bc2500 blades with MP kernels. ok kettenis@
2015-03-16Reduce use of SMALL_KERNEL in acpi, bringing acpiec driver and more gpeTheo de Raadt
handling into RAMDISK. This is now possible because the install media has ample room. The goal is to reduce special cases where we may be skipping (unknown) important operations... ok mlarkin kettenis
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-07-20Skip reading bits from a region marked as "Preserve" if all bits will beMark Kettenis
modified. Some Sony and Asus laptops don't like this; the read seems to trigger an unwanted SMI that makes the machine hang. Diagnosed by mpi@ ok mpi@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-06-25So it turns out that there is AML out there that asks for an accessMark Kettenis
width that isn't compatible with the alignment of the region: OperationRegion (SATC, SystemMemory, 0xE008800A, 0x04) Field (SATC, DWordAcc, NoLock, Preserve) { STCL, 16 } DWordAcc means 4-byte access, but 0xE008800A is only 2-byte aligned. Moreover, the region itself is 4 bytes long. From this I conclude that 4-byte wide access to a 2-byte aligned address is really wanted in cases like this. ok deraadt@
2014-06-23SystemMemory is used to access memory mapped registers on some machines, so weMark Kettenis
must use the bus_space(9) API to access it instead of memcpy(9). Also make sure we properly align access to fields that need more than byte alignment. ok guenther@
2014-05-21Fix invalid / missing format specifiers in several dnprintf statementsMike Larkin
(used only when ACPI_DEBUG is enabled) From a diff on tech@ by Fabian Raetz, with a minor change by me, tested on i386 and amd64 with ACPI_DEBUG enabled and disabled.
2014-05-02Make acpi_mutex_acquire/release actually grab the global lock if it should.Mark Kettenis
Get rid of the fake global lock code that these functions were using before. ok pirofti@, mlarkin@
2014-04-26Get rid of duplication of the global lock code. Allow recursion in allMark Kettenis
code paths. ok pirofti@
2014-03-13Update the _OSI list to include newer Redmond products which may be requestedBryan Steele
by newer firmware. May cause problems with brightness control on some systems. "lets see what happens" kettenis@, and.. deraadt@ agrees (..hopefully).
2013-12-12printf(variable) --> printf("%s", variable)Philip Guenther
ok deraadt@
2013-11-04Enable locking of fields using the acpi global lock if required. Seems to fixMark Kettenis
a couple of machines and so far caused no regressions. Pt this in the tree now to get wider testing. ok deraadt@
2013-06-02support aml_store to a method object to override itjoshua stein
resolves a problem parsing the AML on an ASUS UX21A originally from armani@ ok kettenis@
2013-06-02The AML on the Lanner FW-8758 does a Store() to a named object that's neverMark Kettenis
actually defined. The ACPI standard isn't clear wether this is allowed, but it makes some sense to just initialize the object with the source of the Store(). Fixes the resulting panic on that particular machine. ok mlarkin@
2013-05-23Properly implement access to IndexField() field units. The origional codeMark Kettenis
only worked for field units that were 8 bits or less in size on fields using byte access. Fixes issues origionally reported by jcs@ and armani@. ok mlarkin@
2013-04-10Fix various glitches in queue macro usage.Philip Guenther
ok millert@
2013-02-09Add explicit __attribute__ ((__format__(__kprintf__)))) to the functions andMiod Vallat
function pointer arguments which are {used as,} wrappers around the kernel printf function. No functional change.
2013-01-18acpi: Add global lock enter and leave routines.Paul Irofti
I think this diff is the way to go if we want to have proper locking in our acpi drivers. This doesn't hook onto anything from the kernel and is just building framework towards locking. Okay mlarkin@, kettenis@.
2012-07-16Add shorter form function aml_node_setval() for setting an intTheo de Raadt
on an AML node. Shortens the tricky code in a lot of callers. Earlier version seen by pirofti and kettenis.
2012-07-10Ooops. A debug printf sneaked in. Sorry about that.Paul Irofti
2012-07-10More wraping and style.Paul Irofti