OperationRegion Deep Dive
How ACPI OperationRegion connects AML methods to EC RAM, system memory, I/O ports, PCI config, GPIO, and other hardware-backed address spaces.
An AML method reads a field:
If (LEqual (LIDS, One)) {
Notify (LID0, 0x80)
}
Where did LIDS come from?
It may not be a normal variable. It may be a bit mapped to EC RAM, GPIO, system memory, PCI config space, or an I/O port.
That bridge is OperationRegion.
Method reads or writes a named field
Example: `_BST` reads battery state fields, or `_Qxx` reads EC query information.
Field maps names to bits/bytes
A named field such as `BSTA` may map to one byte inside an operation region.
OperationRegion defines address space
The region can be EmbeddedControl, SystemMemory, SystemIO, PCI_Config, GPIO, or another ACPI address space.
OS ACPI interpreter performs access
The interpreter invokes the appropriate region handler to read or write actual hardware-backed state.
Example: EC-backed region
OperationRegion (ERAM, EmbeddedControl, 0x00, 0xFF)
Field (ERAM, ByteAcc, NoLock, Preserve)
{
Offset (0x10),
BSTA, 8,
Offset (0x20),
LIDS, 1
}
BSTA and LIDS look like normal ACPI names, but reading them can trigger an EC transaction.
Why this matters
OperationRegion is where ACPI stops being only a description language and starts touching platform state.
| Item | Value | Note |
|---|---|---|
| EmbeddedControl | EC RAM / EC command interface | Common for battery, thermal, lid, hotkey, and platform events. |
| SystemMemory | Physical memory mapped region | Used for shared memory or firmware-reserved structures. |
| SystemIO | I/O port space | Used for legacy PM registers or chipset interfaces. |
| PCI_Config | PCI configuration space | Used to read or write PCI config registers through AML. |
| GeneralPurposeIo | GPIO region | Used for GPIO-backed ACPI fields on newer platforms. |
Debug Diary: EC timeout caused by innocent AML
Symptom:
ACPI Error: AE_TIME, Returned by Handler for [EmbeddedControl]
Battery status sometimes missing
Fan table looks correct
The ASL may look harmless:
Method (_BST, 0, Serialized)
{
Return (Package() { BSTA, BRTE, BCAP, BVOL })
}
But every field access can require EC communication. If the EC is busy, locked, or not responding after resume, the AML method fails.
OperationRegion debug checklist
Related notes
Found this useful?
Save it or share it with someone learning firmware, BIOS/UEFI, and embedded systems.
Nội dung liên quan
Một số bài viết, ghi chú hoặc project có liên quan đến nội dung bạn vừa đọc.
Embedded Controller OperationRegion
How AML talks to EC RAM through EmbeddedControl OperationRegion and how to debug EC timeout, SCI storm, battery, thermal, and hotkey issues.
Field in ACPI
How Field definitions map bits and bytes inside an OperationRegion to names used by AML methods.
GPIO OperationRegion
How ACPI models GPIO-backed platform state and why GPIO numbering, polarity, wake flags, and controller paths are common firmware bugs.
Biến note thành bài viết hoàn chỉnh
Notes là nơi ghi nhanh khái niệm.