diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index e16ff1c..a369ec9 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -5,18 +5,22 @@ - [Development](development.md) - [Supply-chain auditing](supply-chain.md) - [Specifications](specs/specifications.md) - - [Embedded Controller Interface](specs/ec_interface/ec_interface.md) + - [Embedded Controller Interface](specs/ec_interface/README.md) - [EC SoC Interface](specs/ec_interface/ec-soc-interface.md) - - [Legacy EC Interface](specs/ec_interface/legacy-ec-interface.md) - - [Secure EC Services Overview](specs/ec_interface/secure-ec-services-overview.md) - - [EC Firmware Management](specs/ec_interface/ec-firmware-management.md) - - [EC Power Service](specs/ec_interface/ec-power-service.md) - - [Battery Service](specs/ec_interface/battery-service.md) - - [Thermal Service](specs/ec_interface/thermal-service.md) - - [UCSI Interface](specs/ec_interface/ucsi-interface.md) - - [EC Input Management](specs/ec_interface/ec-input-management.md) - - [EC Time Alarm Service](specs/ec_interface/ec-time-alarm-service.md) - - [EC Debug Service](specs/ec_interface/ec-debug-service.md) - - [EC Manufacturing Service](specs/ec_interface/ec-manufacturing-service.md) - - [EC OEM Service](specs/ec_interface/ec-oem-service.md) - - [Sample System Implementation](specs/ec_interface/sample-system-implementation.md) + - [Legacy EC Interface](specs/ec_interface/legacy/README.md) + - [FF-A EC Interface](specs/ec_interface/ffa/README.md) + - [EC Firmware Management](specs/ec_interface/ffa/management.md) + - [EC Power Service](specs/ec_interface/ffa/power.md) + - [Battery Service](specs/ec_interface/ffa/battery.md) + - [Thermal Service](specs/ec_interface/ffa/thermal.md) + - [UCSI Interface](specs/ec_interface/ffa/ucsi.md) + - [EC Input Management](specs/ec_interface/ffa/input.md) + - [EC Time Alarm Service](specs/ec_interface/ffa/time-alarm.md) + - [EC Debug Service](specs/ec_interface/ffa/debug.md) + - [EC Manufacturing Service](specs/ec_interface/ffa/manufacturing.md) + - [EC OEM Service](specs/ec_interface/ffa/oem.md) + - [Sample System Implementation](specs/ec_interface/ffa/acpi-sample.md) + - [HID EC Interface](specs/ec_interface/hid/README.md) + - [HID Time and Alarm](specs/ec_interface/hid/HUTRR120-SystemWakeTimerAndRTC.md) + - [HID Battery](specs/ec_interface/hid/HUTRR-DRAFT-Battery.md) + - [eSPI PCC Specification](specs/ec_interface/espi/espi_pcc_draft.md) diff --git a/docs/src/specs/ec_interface/README.md b/docs/src/specs/ec_interface/README.md new file mode 100644 index 0000000..bafc339 --- /dev/null +++ b/docs/src/specs/ec_interface/README.md @@ -0,0 +1,147 @@ +# Embedded Controller Interface Specification + +The Embedded Controller (EC) Interface Specification describes a base set of requirements for interfacing with core +Windows features. + +It covers the following areas: +- Firmware Management +- Battery +- Time and Alarm +- UCSI +- Thermal +- Power +- Input Devices +- Customization + +## Protocols and Stacks + +There are 3 ways to communicate with the EC: + +- ACPI specification for Legacy EC controller (eSPI) based interface on x86 devices, directly accessed through OperationRegion in ACPI +- ACPI through FFA driver and in secure world an SV or OEM customer driver to communicate with the EC on ARM devices +- Directly through HID class driver for bus based devices, I2C, I3C and eSPI + +This specification is organized accordingly and you can find the details for each protocol in the sub folder. + +[Legacy EC Interface](legacy/README.md) + +[FFA EC Interface](ffa/README.md) + +[HID EC Interface](hid/README.md) + + +## Transports + +While other transports can be wired up to work with OEM or SV drivers we are focused on supporting I2C, I3C and eSPI natively both through direct ACPI access and the HID stacks. + +Today there is partial support for I2C and eSPI in ACPI and support for I2C and I3C on HID. To support eSPI natively work is being done to better standardize eSPI based on PCC specification. + +The following is a visual of the driver stacks planned to interface with the EC from the OS. + +## CPU-to-Embedded-Controller Architecture + +```mermaid +flowchart TB + subgraph CPU["CPU / PC"] + direction LR + + subgraph NSW["Non-Secure World"] + direction TB + + subgraph STACK["Top-Level Stack"] + direction LR + INPUT["Input"] + BATTERY["Battery"] + TAD["TAD"] + MPTF["MPTF"] + OEM["OEM"] + end + + subgraph HID_DRIVERS["HID Class Drivers"] + direction LR + INPUT_HID["Input HID Driver"] + BATTERY_HID["Battery HID Driver"] + TAD_HID["TAD HID Driver"] + MPTF_HID["MPTF HID Driver"] + OEM_HID["OEM HID Driver"] + end + + INPUT --> INPUT_HID + BATTERY --> BATTERY_HID + TAD --> TAD_HID + MPTF --> MPTF_HID + OEM --> OEM_HID + + subgraph OS_DRIVERS["OS Driver Layer"] + direction LR + HIDCLASS["HIDClass Driver"] + ACPI["ACPI Driver"] + end + + INPUT_HID --> HIDCLASS + BATTERY_HID --> HIDCLASS + TAD_HID --> HIDCLASS + MPTF_HID --> HIDCLASS + OEM_HID --> HIDCLASS + + subgraph HID_SUPPORT["HID Transport Support"] + direction LR + HIDSPBCX["HIDSpbCx"] + HIDI3C["HIDI3C"] + HIDESPI["HIDeSPI"] + end + + HIDCLASS --> HIDSPBCX + HIDCLASS --> HIDI3C + HIDCLASS --> HIDESPI + + I2C["I2C Transport"] + I3C["I3C Transport"] + ESPI["eSPI Transport"] + + HIDSPBCX --> I2C + HIDI3C --> I3C + HIDESPI --> ESPI + + FFA["FF-A"] + I2CI3C["I2C/I3C"] + ESPIA["ESPI"] + ACPI --> FFA + ACPI --> I2CI3C + ACPI --> ESPIA + end + + subgraph SW["Secure World"] + direction TB + HAFNIUM["Hafnium"] + ECSP["EC SP"] + CUSTOM["Custom Transport Driver"] + + HAFNIUM --> ECSP + ECSP --> CUSTOM + end + + FFA --> HAFNIUM + end + + subgraph EC["Embedded Controller"] + direction TB + EC_IF["EC Transport Interfaces"] + EC_FW["EC Firmware / Services"] + EC_IF --> EC_FW + end + + I2C -->|I2C| EC_IF + I3C -->|I3C| EC_IF + ESPI -->|eSPI| EC_IF + ESPIA -->|eSPI| EC_IF + I2CI3C --> |ACPI| EC_IF + CUSTOM -->|Custom secure transport| EC_IF + + classDef nonsecure fill:#dbeafe,stroke:#2563eb,color:#111827; + classDef secure fill:#fef3c7,stroke:#d97706,color:#111827; + classDef controller fill:#dcfce7,stroke:#16a34a,color:#111827; + class INPUT,BATTERY,TAD,MPTF,OEM,INPUT_HID,BATTERY_HID,TAD_HID,MPTF_HID,OEM_HID,HIDCLASS,ACPI,HIDSPBCX,HIDI3C,HIDESPI,I2C,I3C,ESPI,FFA nonsecure; + class HAFNIUM,ECSP,CUSTOM secure; + class EC_IF,EC_FW controller; +``` diff --git a/docs/src/specs/ec_interface/ec-soc-interface.md b/docs/src/specs/ec_interface/ec-soc-interface.md index 6da5f56..4ae1093 100644 --- a/docs/src/specs/ec_interface/ec-soc-interface.md +++ b/docs/src/specs/ec_interface/ec-soc-interface.md @@ -19,4 +19,5 @@ work towards a more robust solution that will handle routing, larger packets and security in a common way across OS’s and across SV architectures. -![EC connections to apps](media/odp_arch.png) \ No newline at end of file +See the [CPU-to-Embedded-Controller Architecture](README.md#cpu-to-embedded-controller-architecture) for the supported +software stacks and transport paths. \ No newline at end of file diff --git a/docs/src/specs/ec_interface/ec_interface.md b/docs/src/specs/ec_interface/ec_interface.md deleted file mode 100644 index a1e96d3..0000000 --- a/docs/src/specs/ec_interface/ec_interface.md +++ /dev/null @@ -1,11 +0,0 @@ -# Embedded Controller Interface Specification - -Embedded Controller(EC) Interface Specification describes base set of requirements to interface to core Windows features. -It covers the following areas: -- Firmware Management -- Battery -- Time and Alarm -- UCSI -- Thermal and Power -- Input Devices -- Customization diff --git a/docs/src/specs/ec_interface/espi/espi_pcc_draft.md b/docs/src/specs/ec_interface/espi/espi_pcc_draft.md new file mode 100644 index 0000000..31f79a7 --- /dev/null +++ b/docs/src/specs/ec_interface/espi/espi_pcc_draft.md @@ -0,0 +1,330 @@ +# eSPI ACPI Interface Update + +## Purpose + +The purpose of this document is to propose an update for the eSPI hardware interface that allows a more efficient and common interface to various eSPI hardware on x86 and ARM designs. + +## Current ACPI EC eSPI Interface + +The current ACPI design is implemented with 3 I/O ports and two interrupt signals as defined below. + +[12. ACPI Embedded Controller Interface Specification — ACPI Specification 6.5 documentation](https://uefi.org/specs/ACPI/6.5/12_Embedded_Controller_Interface_Specification.html) + +**I/O Ports** + +| **Register** | **Access** | **Purpose** | +|--------------|------------|------------------| +| EC_SC | Read | Status Register | +| EC_SC | Write | Command Register | +| EC_DATA | Read/Write | Data Register | + +**Status Register** + +| **Bit** | **Name** | **Meaning** | +|---------|----------|--------------------------------| +| 0 | OBF | Output Buffer Full | +| 1 | IBF | Input Buffer Full | +| 2 | Reserved | | +| 3 | CMD | Data register contains command | +| 4 | BURST | EC in burst mode | +| 5 | SCI_EVT | SCI query pending | +| 6 | SMI_EVT | SMI query pending | +| 7 | Reserved | | + +**Command Register** + +| **Command** | **Value** | +|-------------|-----------| +| RD_EC | 0x80 | +| WR_EC | 0x81 | +| BE_EC | 0x82 | +| BD_EC | 0x83 | +| QR_EC | 0x84 | + +## EC Operations + +### EC Write Flow + +1. **Wait until ready:** Confirm **EC_SC\[IBF\] = 0**. +2. **Issue write command:** Write **0x81 (WR_EC)** to **EC_SC**. +3. **Wait for command acceptance:** Confirm **EC_SC\[IBF\] = 0**. +4. **Provide address:** Write the EC address to **EC_DATA**. +5. **Wait for address acceptance:** Confirm **EC_SC\[IBF\] = 0**. +6. **Provide data:** Write the data byte to **EC_DATA**. +7. **Complete transaction:** Wait until **EC_SC\[IBF\] = 0**. + +### EC Read Flow + +1. **Wait until ready:** Confirm **EC_SC\[IBF\] = 0**. +2. **Issue read command:** Write **0x80 (RD_EC)** to **EC_SC**. +3. **Wait for command acceptance:** Confirm **EC_SC\[IBF\] = 0**. +4. **Provide address:** Write the EC address to **EC_DATA**. +5. **Wait for response:** Wait until **EC_SC\[OBF\] = 1**. +6. **Read data:** Read the data byte from **EC_DATA**. + +### EC Event Flow + +1. **Receive notification:** OSPM invokes the EC GPE handler. +2. **Confirm pending SCI:** Verify **EC_SC\[SCI_EVT\] = 1**. +3. **Wait until ready:** Confirm **EC_SC\[IBF\] = 0**. +4. **Issue query command:** Write **0x84 (QR_EC)** to **EC_SC**. +5. **Wait for command acceptance:** Confirm **EC_SC\[IBF\] = 0**. +6. **Read event code:** Read **EVT = XX** from **EC_DATA**. +7. **Dispatch handler:** Invoke the corresponding **\_QXX** control method. + +> **Note:** The OEM defines the meaning of each event code and its corresponding **\_QXX** method. + +## eSPI Features to Address + +The following is a list of issues with the current ACPI eSPI EC definition that we are seeking to address: + +1. Based on I/O port definition only works on x86 need ARM support as well +2. Only works for flat memory mapped layout, does not work well with packet-based transactions +3. Very inefficient throughput for larger transfers of data that doesn’t take advantage of the actual eSPI protocol +4. Does not expose VWire and GPIO extension ability to OS +5. Single set of ports cannot define multiple channels +6. Need secure and non-secure channels ideally without having two physical connections. + +## eSPI Proposal over PCC + +Existing ACPI specification is available for defining channel based communication through PCC. + +[14. Platform Communications Channel (PCC) — ACPI Specification 6.5 documentation](https://uefi.org/specs/ACPI/6.5/14_Platform_Communications_Channel.html) + +Recommendation is to define a hardware interface that is compatible with PCC Type 3 and 4 that allows us to create inbox ACPI based or driver based handling of communication with the channel. + +## Hardware Resources + +For a given eSPI controller each controller has some global register and configuration data and then can have 1 or more PCC channels. + +### Channel Independent Config + +Optionally specify MMIO region where the CONFIG registers as defined in the eSPI specification are mapped. These are read-only and allow the OS to read the ID of eSPI controller and Channel configuration to provide any workarounds for specific controllers. Each register is 32-bits and is direct accessed by MMIO operation. + +| Start (Hex) | End (Hex) | Register Name | +|-------------|-----------|---------------------------------------------| +| 000 | 003 | Reserved | +| 004 | 007 | Device Identification | +| 008 | 00B | General Capabilities and Configurations | +| 00C | 00F | Reserved | +| 010 | 013 | Channel 0 Capabilities and Configurations | +| 014 | 01F | Reserved | +| 020 | 023 | Channel 1 Capabilities and Configurations | +| 024 | 02F | Reserved | +| 030 | 033 | Channel 2 Capabilities and Configurations | +| 034 | 03F | Reserved | +| 040 | 043 | Channel 3 Capabilities and Configurations | +| 044 | 047 | Channel 3 Capabilities and Configurations 2 | +| 048 | 04B | Channel 3 Capabilities and Configurations 3 | +| 04C | 04F | Channel 3 Capabilities and Configurations 4 | +| 050 | 7FF | Reserved | +| 800 | FFF | Platform Specific registers | + +### Global Status Register + +An MMIO or I/O port that can be read which returns the global status of the eSPI based on the definition of the eSPI controller. + + + +### Global Reset Register + +An MMIO or I/O port register and mask that can be written to that traps into FW to initiate an in-band reset and reconfigures the eSPI config space back to defaults. Any pending transactions are lost and controller is in fresh state. + +### + +### VWire Channel + +All interrupts come through a single GPE. The status register is read until no new VWIRE_AVAIL is set. The actual VWire event is described by an MMIO resource that is 16-bits long. The upper 8-bits is the Index and lower 8-bits is the data as described in the eSPI protocol specification. + +When a VWire event is read it will be removed from the FIFO. If events are not read until VWIRE_AVAIL is no longer set in the status, the interrupt and GPE should be triggered again. + +### + +### Peripheral Channel + +There can be multiple sub-channels exposed via a single peripheral channel. Each sub-channel must have a corresponding PCC table defining the channel details and the address of the MMIO region. Type 3 and Type 4 tables should be used for bi-directional packet based communication. + +The doorbell register when written will trigger a peripheral channel transfer of the data length specified by the Length field in the PCC Shared Memory Region. + +On systems where MMIO accesses automatically generate peripheral transactions the doorbell can be set to 0 and the Command register should point to the shared buffer command field indicating the bits to indicate command completion. + +## + +## Sample ACPI Definition for the eSPI PCC Device + +The sample separates the namespace device definition from the PCCT subspace records. PCC is exposed as independent subspaces, and the subspace ID is the index of each structure in the PCCT array. The addresses below are illustrative and must be replaced by the platform memory map. + +### Illustrative Address Map + +| Resource | Base Address | Length | Purpose | +|----|----|----|----| +| Channel-independent configuration | 0xFEDC0000 | 0x1000 | Read-only eSPI identification and channel capability/configuration registers. | +| Global status register | 0xFEDC1000 | 0x4 | 32-bit controller status, including implementation-defined pending/available indications. | +| Global reset register | 0xFEDC1004 | 0x4 | 32-bit reset control; this example uses bit 0 as the in-band eSPI reset request. | +| Doorbell register | 0xFEDC1008 | 0x4 | Bit 0 rings the selected eSPI peripheral channel. | +| Type 4 acknowledge register | 0xFEDC100C | 0x4 | Bit 0 acknowledges a platform notification on the Type 4 subspace. | +| VWire FIFO register | 0xFEDC1010 | 0x4 | 32-bit read FIFO. Reading returns the next queued VWire event and removes it from the FIFO. | +| PCC Type 3 shared memory | 0xFEDC2000 | 0x400 | 1024-byte extended master subspace for OS-initiated bidirectional peripheral traffic. | +| PCC Type 4 shared memory | 0xFEDC2400 | 0x400 | 1024-byte extended slave subspace for platform-initiated bidirectional peripheral traffic. | + +### Sample SSDT Namespace Definition + +DefinitionBlock ("", "SSDT", 2, "OEMID", "ESPIPCC", 0x00000001) +{ +  Scope (\\SB) +  { +    Device (ESPI) +    { +      Name (\_HID, "OEM0001") +      Name (\_UID, Zero) +      Name (\_DDN, "eSPI PCC Controller") +      Name (\_STA, 0x0F) + +      Name (\_CRS, ResourceTemplate () +      { +        Memory32Fixed (ReadOnly, 0xFEDC0000, 0x00001000, CFG0) +        Memory32Fixed (ReadWrite, 0xFEDC1000, 0x00000004, STS0) +        Memory32Fixed (ReadWrite, 0xFEDC1004, 0x00000004, RST0) +        Memory32Fixed (ReadWrite, 0xFEDC1008, 0x00000008, DBR0) +        Memory32Fixed (ReadWrite, 0xFEDC1010, 0x00000004, VWF0) +      }) + +      OperationRegion (ECFG, SystemMemory, 0xFEDC0000, 0x1000) +      OperationRegion (GCSR, SystemMemory, 0xFEDC1000, 0x0014) +      Field (GCSR, DWordAcc, NoLock, Preserve) +      { +        GSTA, 32, +        GRST, 1, Reserved, 31, +        DB00, 1, Reserved, 31, +        AK00, 1, Reserved, 31, +        VWFR, 32  // VWire FIFO, offset 0x10 +      } + +      // Extended PCC shared-memory header: 16 bytes, followed by 1008-byte payload. +      OperationRegion (PCC3, PCC, 0, 0x400)  // Host -\> EC, Type 3 +      Field (PCC3, DWordAcc, NoLock, Preserve) +      { +        C3SG, 32,  // Signature, offset 0x00 +        C3FL, 32,  // Flags, offset 0x04 +        C3LN, 32,  // Length, offset 0x08 +        C3CM, 32,  // Command, offset 0x0C +        C3DT, 8064  // Payload, offset 0x10, 1008 bytes +      } + +      OperationRegion (PCC4, PCC, 1, 0x400)  // EC -\> Host, Type 4 +      Field (PCC4, DWordAcc, NoLock, Preserve) +      { +        C4SG, 32,  // Signature, offset 0x00 +        C4FL, 32,  // Flags, offset 0x04 +        C4LN, 32,  // Length, offset 0x08 +        C4CM, 32,  // Command, offset 0x0C +        C4DT, 8064  // Payload, offset 0x10, 1008 bytes +      } + +      Method (ERST, 0, Serialized) +      { +        Store (One, GRST) +      } +    } +  } +} + +**Namespace notes:** **PCC3** references PCCT subspace ID 0 and **PCC4** references subspace ID 1. Each OperationRegion remains exactly **0x400 bytes**. The first **16 bytes** follow the Extended PCC shared-memory header layout: a 32-bit **Signature** at offset 0x00, 32-bit **Flags** at offset 0x04, 32-bit **Length** at offset 0x08, and 32-bit **Command** at offset 0x0C. The remaining **1008 bytes**, starting at offset 0x10, are available for the eSPI packet payload. + +### Sample PCCT Subspace Definitions + +The PCCT contains an ordered array of PCC subspace structures, with the array index becoming the PCC subspace ID. The following pseudo-definition shows the fields that platform firmware would emit for the two channels; exact C structure names depend on the firmware ACPI table library. + +PCCT.Header.Signature = 'PCCT' +PCCT.Header.Revision = 2 +PCCT.Flags = 1  // Platform interrupt supported + +// Subspace ID 0: Extended PCC Master (Type 3) +Type = 3 +Length = sizeof (TYPE3_SUBSPACE) +PlatformInterrupt = \ +InterruptFlags = \ +BaseAddress = 0x00000000FEDC2000 +AddressLength = 0x0000000000000400  // 1024 bytes +DoorbellRegister = GAS(SystemMemory, 32, 0, DWord, 0xFEDC1008) +DoorbellPreserve = 0xFFFFFFFE +DoorbellWrite = 0x00000001 +CommandCompleteCheck = GAS(SystemMemory, 32, 0, DWord, 0xFEDC1000) +CommandCompleteMask = 0x00000001 +CommandCompleteValue = 0x00000001 +ErrorStatusRegister = GAS(SystemMemory, 32, 0, DWord, 0xFEDC1000) +ErrorStatusMask = 0x00000002 + +// Subspace ID 1: Extended PCC Slave (Type 4) +Type = 4 +Length = sizeof (TYPE4_SUBSPACE) +PlatformInterrupt = \ +InterruptFlags = \ +BaseAddress = 0x00000000FEDC2400 +AddressLength = 0x0000000000000400  // 1024 bytes +DoorbellRegister = GAS(SystemMemory, 32, 0, DWord, 0xFEDC1008) +DoorbellPreserve = 0xFFFFFFFE +DoorbellWrite = 0x00000001 +CommandCompleteCheck = GAS(SystemMemory, 32, 0, DWord, 0xFEDC1000) +CommandCompleteMask = 0x00000004 +CommandCompleteValue = 0x00000004 +PlatformAckRegister = GAS(SystemMemory, 32, 0, DWord, 0xFEDC100C) +PlatformAckPreserve = 0xFFFFFFFE +PlatformAckWrite = 0x00000001 + +## Sample PCC Type 3 and Type 4 Call Flows + +PCC communication uses independent subspaces, shared memory, a doorbell protocol, platform notification, and completion/status registers. The following sample maps those mechanisms to the document’s Type 3 **PCC3** initiator channel and Type 4 **PCC4** platform-notification channel. + +CCC = Command Complete Check register + +### Type 3 Initiator Call Flow: Host 🡪 eSPI Device + +| Step | Host / Initiator | eSPI Device / EC | +|----|----|----| +| 1 | While(CCC_REG & CCC_MASK) == 0 | Set CCC_REG command complete bit to advertise to OS Channel is free | +| 2 | Initialize **PCC3**: write **C3SG**, clear stale completion/error state, set **C3FL**, set **C3LN** to the total valid message length, and write the eSPI operation to **C3CM**. | No action; the controller must not consume the request before the doorbell. | +| 3 | Copy the request packet into **C3DT**. Complete all shared-memory writes and issue the required memory barrier before notifying hardware. | No action. | +| 4 | Ring the Type 3 doorbell by writing **DB00 = 1** at **0xFEDC1008**. | Detect new valid command claim PCC3, validate Signature/Flags/Length/Command, and reject malformed or oversized messages. | +| 5 | Wait for completion using the platform interrupt when available; otherwise poll the Type 3 completion bit in **GSTA** using the PCCT nominal latency and maximum access rate. | Read data to local buffer to process and mark as completed. | + +#### Type 3 Sequence Summary + +OSPM           eSPI Controller / EC + \|-- Lock PCC3 ------------------\>\| + \|-- Write header + request -----\>\| + \|-- Memory barrier -------------\>\| + \|-- DB00 = 1 -------------------\>\| + \|                  Validate and execute eSPI request + \|\<-- Response in PCC4 -----------\| + \|\<-- Completion interrupt/status-\| + \|-- Populate + Read barrier ------\>\| + \|-- Clear completion; Trigger NP_AVAIL ----\>\| + +\|-- Trigger VWire for Host Notify 🡪 \| + +### + +### Type 4 Response Call Flow: EC Initiates a Platform Notification + +| Step | eSPI Controller / EC Initiator | OSPM / Responder | +|----|----|----| +| 1 | Wait until the Type 4 platform-acknowledge state indicates that **PCC4** is free and no earlier notification remains unacknowledged. | Keep the Type 4 interrupt handler registered for PCC subspace ID 1. | +| 2 | Initialize **PCC4**: write **C4SG**, set notification flags in **C4FL**, set **C4LN**, write the notification command to **C4CM**, and copy the event or response packet into **C4DT**. | No action while the platform owns the shared region. | +| 3 | Complete all writes, then set the Type 4 notification/completion state in **GSTA** and assert the platform interrupt described by the Type 4 PCCT entry. | Receive the interrupt and identify PCC4 as the notifying subspace from its Type 4 completion/notification status. | +| 4 | Do not modify PCC4 again until OSPM acknowledges the notification. | First clear any stale platform-acknowledge interrupt state, then issue a read barrier and validate Signature, Flags, Length, and Command. | +| 5 | Wait for the acknowledgement register write. | Copy and dispatch the payload from **C4DT** to the appropriate eSPI consumer. If the payload is a response to an earlier logical operation, correlate it using the command-defined transaction identifier. | +| 6 | Observe the acknowledgement, deassert the Type 4 interrupt/notification state, and release PCC4 for reuse. | Acknowledge the platform notification by writing **AK00 = 1** at **0xFEDC100C**. | +| 7 | Optionally record protocol or payload errors in the platform-defined status bits before returning the channel to idle. | Complete deferred processing outside the interrupt context and report any validation or protocol error to the client. | + +#### + +#### Type 4 Sequence Summary + +eSPI Controller / EC       OSPM + \|-- Wait for PCC4 free ----------\>\| + \|-- Write header + notification -\>\| + \|-- Publish status + interrupt ---\>\| + \|                            Validate and consume PCC4 + \|\<-- AK00 = 1 --------------------\| + \|-- Clear notification; free ----\>\| diff --git a/docs/src/specs/ec_interface/secure-ec-services-overview.md b/docs/src/specs/ec_interface/ffa/README.md similarity index 96% rename from docs/src/specs/ec_interface/secure-ec-services-overview.md rename to docs/src/specs/ec_interface/ffa/README.md index 87ecc14..a0a7f13 100644 --- a/docs/src/specs/ec_interface/secure-ec-services-overview.md +++ b/docs/src/specs/ec_interface/ffa/README.md @@ -1,18 +1,9 @@ -# Secure EC Services Overview +# ACPI to FFA Services Overview -In this section we review a system design where the EC communication is -in the secure world running in a dedicated SP. In a system without -secure world or where communication to EC is not desired to be secure -all the ACPI functions can be mapped directly to data from the EC -operation region. +In this section we review a system design where the EC communication +is in the secure world running in a dedicated SP. -The following github projects provide sample implementations of this interface: - -[ACPI EC samples, Kernel mode test driver, User mode test driver](https://github.com/opendevicepartnership/ec-test-app)
-[Sample Secure Partition Service for EC services in RUST](https://github.com/opendevicepartnership/haf-ec-service)
-[RUST crate for FFA implementation in secure partition](https://github.com/opendevicepartnership/ffa)
- -The following GUID’s have been designed to represent each service +The following GUID’s have been designed to represent each service operating in the secure partition for EC. | EC Service Name | Service GUID | Description @@ -38,11 +29,11 @@ operating in the secure partition for EC. This section covers the components involved in sending a command to EC through the FFA flow in windows. This path is specific to ARM devices -and a common solution with x64 is still being worked out. Those will -continue through the non-secure OperationRegion in the near term. +for x86 devices should use HID or direct access. Those will +continue through the non-secure OperationRegion. ![A diagram of a computer security system Description automatically -generated](media/image1.png) +generated](../media/image1.png) ARM has a standard for calling into the secure world through SMC’s and targeting a particular service running in secure world via a UUID. The @@ -232,7 +223,7 @@ corresponding service must use to trigger given notification going forward. ``` ![A diagram of a application Description automatically -generated](media/image2.png) +generated](../media/image2.png) In the above example we indicate that the OS will handle 2 different notification events for UUID 330c1273-fde5-4757-9819-5b6539037502 which @@ -248,7 +239,7 @@ SP. Please refer to ARM documentation for full details on Inter-partition protocol DEN0077A_Firmware_Framework_Arm_A-profile_1.3 -

Input

+### Input | Parameter  | Register  | Value  | | ---------- | --------- | -------------------------------- | @@ -267,7 +258,7 @@ protocol DEN0077A_Firmware_Framework_Arm_A-profile_1.3 -

Output

+### Output | Parameter  | Register  | Value  | | ---------- | --------- | -------------------------------- | @@ -364,7 +355,7 @@ so both ACPI and the EC service must be designed either with shared memory buffer or a further notify data packet. ![A diagram of a service Description automatically -generated](media/image3.png) +generated](../media/image3.png) ## Runtime Requests @@ -379,7 +370,7 @@ interface where the OS will resume the SP thread after the timeout specified. The following is sample call sequence. ![A diagram of a company's process Description automatically -generated](media/image4.png) +generated](../media/image4.png) ### FFA Example Data Flow @@ -387,7 +378,7 @@ For an example let’s take the battery status request _BST and follow data through. ![A screenshot of a computer Description automatically -generated](media/image5.png) +generated](../media/image5.png) ``` FFA_REQ_PACKET req = { @@ -430,8 +421,7 @@ typedef struct _FFA_INTERFACE { FFA is in charge of sending the SMC over to the secure world and routing to the correct service based on UUID. -![A diagram of a computer Description automatically -generated](media/image6.png) +![A diagram of a computer Description automatically generated](../media/image6.png) ``` X0 = SEND_DIRECT_REQ2 SMC command ID @@ -624,7 +614,7 @@ buffers defined in previous section and existing ACPI and FFA functionality. ![A diagram of a service Description automatically -generated](media/image7.png) +generated](../media/image7.png) Inside of our FFA functions rather than copying our data payload into the direct registers we define a queue in shared memory and populate the @@ -634,7 +624,7 @@ is then used by the service to locate the request in the TX queue. We define a separate queue for RX and TX so we don’t need to synchronize between OS and secure partition. -![](media/image8.png) +![](../media/image8.png) ### ACPI Structures and Methods for Asynchronous diff --git a/docs/src/specs/ec_interface/sample-system-implementation.md b/docs/src/specs/ec_interface/ffa/acpi-sample.md similarity index 98% rename from docs/src/specs/ec_interface/sample-system-implementation.md rename to docs/src/specs/ec_interface/ffa/acpi-sample.md index a0ce14c..2741811 100644 --- a/docs/src/specs/ec_interface/sample-system-implementation.md +++ b/docs/src/specs/ec_interface/ffa/acpi-sample.md @@ -385,7 +385,7 @@ Device(EC0) { ``` ![A diagram of a communication system AI-generated content may be -incorrect.](media/image12.png) +incorrect.](../media/image12.png) #### Non-Secure eSPI Notifications @@ -404,7 +404,7 @@ Method (_Q07) { ``` ![A diagram of a non-secure notification AI-generated content may be -incorrect.](media/image13.png) +incorrect.](../media/image13.png) ### Secure eSPI Access @@ -441,7 +441,7 @@ non-secure definition. ``` ![A diagram of a communication system AI-generated content may be -incorrect.](media/image14.png) +incorrect.](../media/image14.png) #### Secure eSPI Notification @@ -496,5 +496,4 @@ ID. } ``` -![A diagram of a event AI-generated content may be -incorrect.](media/image15.png) +![Notification Flow](../media/image15.png) diff --git a/docs/src/specs/ec_interface/battery-service.md b/docs/src/specs/ec_interface/ffa/battery.md similarity index 98% rename from docs/src/specs/ec_interface/battery-service.md rename to docs/src/specs/ec_interface/ffa/battery.md index ac48e12..519f676 100644 --- a/docs/src/specs/ec_interface/battery-service.md +++ b/docs/src/specs/ec_interface/ffa/battery.md @@ -5,7 +5,7 @@ Battery control is monitored through the Modern Power Thermal Framework firmware for these features. This section outlines the interface required in ACPI for this framework to function. -Note: There is an issue with ACPI and embedded packages `return Package() {BST0,BST1,BST2,BST3}` returns "BST0","BST1","BST2","BST3" rather than the values pointed to by these variables. As such we need to create a global Name for BSTD and initialize default values and update these fields like the following. +**Note:** There is an issue with ACPI and embedded packages `return Package() {BST0,BST1,BST2,BST3}` returns "BST0","BST1","BST2","BST3" rather than the values pointed to by these variables. As such we need to create a global Name for BSTD and initialize default values and update these fields like the following. ``` Name (BSTD, Package (4) { diff --git a/docs/src/specs/ec_interface/ec-debug-service.md b/docs/src/specs/ec_interface/ffa/debug.md similarity index 100% rename from docs/src/specs/ec_interface/ec-debug-service.md rename to docs/src/specs/ec_interface/ffa/debug.md diff --git a/docs/src/specs/ec_interface/ec-input-management.md b/docs/src/specs/ec_interface/ffa/input.md similarity index 100% rename from docs/src/specs/ec_interface/ec-input-management.md rename to docs/src/specs/ec_interface/ffa/input.md diff --git a/docs/src/specs/ec_interface/ec-firmware-management.md b/docs/src/specs/ec_interface/ffa/management.md similarity index 100% rename from docs/src/specs/ec_interface/ec-firmware-management.md rename to docs/src/specs/ec_interface/ffa/management.md diff --git a/docs/src/specs/ec_interface/ec-manufacturing-service.md b/docs/src/specs/ec_interface/ffa/manufacturing.md similarity index 100% rename from docs/src/specs/ec_interface/ec-manufacturing-service.md rename to docs/src/specs/ec_interface/ffa/manufacturing.md diff --git a/docs/src/specs/ec_interface/ec-oem-service.md b/docs/src/specs/ec_interface/ffa/oem.md similarity index 100% rename from docs/src/specs/ec_interface/ec-oem-service.md rename to docs/src/specs/ec_interface/ffa/oem.md diff --git a/docs/src/specs/ec_interface/ec-power-service.md b/docs/src/specs/ec_interface/ffa/power.md similarity index 100% rename from docs/src/specs/ec_interface/ec-power-service.md rename to docs/src/specs/ec_interface/ffa/power.md diff --git a/docs/src/specs/ec_interface/thermal-service.md b/docs/src/specs/ec_interface/ffa/thermal.md similarity index 100% rename from docs/src/specs/ec_interface/thermal-service.md rename to docs/src/specs/ec_interface/ffa/thermal.md diff --git a/docs/src/specs/ec_interface/ec-time-alarm-service.md b/docs/src/specs/ec_interface/ffa/time-alarm.md similarity index 100% rename from docs/src/specs/ec_interface/ec-time-alarm-service.md rename to docs/src/specs/ec_interface/ffa/time-alarm.md diff --git a/docs/src/specs/ec_interface/ucsi-interface.md b/docs/src/specs/ec_interface/ffa/ucsi.md similarity index 98% rename from docs/src/specs/ec_interface/ucsi-interface.md rename to docs/src/specs/ec_interface/ffa/ucsi.md index 00680cb..670171a 100644 --- a/docs/src/specs/ec_interface/ucsi-interface.md +++ b/docs/src/specs/ec_interface/ffa/ucsi.md @@ -33,12 +33,12 @@ these commands: - Negotiated Power Level Change -![Diagram of USB Type-C software components.](media/image10.png) +![Diagram of USB Type-C software components.](../media/image10.png) ## UCSI ACPI Interface ![A diagram of a memory Description automatically -generated](media/image11.png) +generated](../media/image11.png) ### Shared Mailbox Interface diff --git a/docs/src/specs/ec_interface/hid/HUTRR-DRAFT-Battery.md b/docs/src/specs/ec_interface/hid/HUTRR-DRAFT-Battery.md new file mode 100644 index 0000000..34af339 --- /dev/null +++ b/docs/src/specs/ec_interface/hid/HUTRR-DRAFT-Battery.md @@ -0,0 +1,679 @@ +Request #: HUTRR TBD +Title: Control Method Battery +Spec Release: HID Usage Tables 1.7 +Received: +Requester: Phil Weber +Company: Microsoft +------------------ +Pages Affected: Battery System Page (0x85) +Values Checked: 0x0100-0x0186 +------------------ +Current Status: Draft +Priority: Normal +Submitted: +------------------ +Required Voter: +Required Voter: +Required Voter: +------------------ +Voting Begins: +Voting Ends: +Voting Result: + + +Summary +======= + +Add a Control Method Battery application usage to the Battery System Usage Page +(0x85). The new top-level collection (TLC) exposes one independently managed +battery using a transport-neutral HID protocol modeled on the ACPI 6.5 Control +Method Battery interface. + +The TLC reuses existing Power Page (0x84) and Battery System Page (0x85) usages +where their semantics match. New usages are introduced for ACPI fields and +operations that have no equivalent HID usage, including extended static +information, portable UTF-8 identity strings, measurement configuration, +maintenance controls, charge/runtime estimates, peak-power capabilities, +thresholds, thermal throttling, capability negotiation, notifications, and a +stable battery tag. + +This draft intentionally defines the complete ACPI 6.5 battery surface as part +of the HIDBattery contract rather than defining only the subset currently +consumed by one operating system. + + +Background +========== + +ACPI Control Method Batteries provide operating systems with a common model for +static battery information, dynamic status, capacity-change notification, and +optional battery management functions. That model is independent of the +physical fuel-gauge or charger implementation, but ACPI normally exposes it +through AML control methods. + +HID already defines Power (0x84) and Battery System (0x85) pages. Those pages +contain useful electrical and Smart Battery usages, but they do not define an +application collection whose report contract is equivalent to an ACPI Control +Method Battery. Implementations consequently need vendor-defined collections +and host-specific knowledge even when the underlying information is standard. + +Windows battery miniclass drivers are expected to provide battery identity, +static information, current status, status-change notifications, and selected +controls to the battery class driver. A HID miniclass can implement those +callbacks directly from this TLC without requiring vendor-specific report +formats. + + +Goals +===== + +1. Define one standard battery TLC that is independent of USB, HID-over-I2C, + HID-over-SPI, and other HID transports. +2. Preserve the meaning, units, special values, and event behavior of the ACPI + 6.5 Control Method Battery interface. +3. Reuse existing HID usages when their meaning is equivalent. +4. Support a persistent controller with a removable or replaceable battery + pack. +5. Support multiple batteries by exposing one TLC for each independently + managed battery. +6. Carry battery identity strings in reports rather than relying on + transport-specific string descriptor indexes. +7. Provide the information and controls needed by the Windows battery + miniclass interface without making Windows structures the wire format. + + +Non-goals +========= + +1. This proposal does not define charger, AC adapter, UPS, or system aggregate + battery TLCs. +2. This proposal does not require report IDs to have fixed numeric values. + Hosts discover reports and fields by usages. +3. This proposal does not expose AML, ACPI namespace paths, General Purpose + Events, or System Control Interrupts on the wire. +4. This proposal does not replace the existing Smart Battery collections. + + +Proposal +======== + +Add the Control Method Battery application usage and supporting usages to the +Battery System Page (0x85). Change the final reserved range from 0xF4-0xFFFF to: + + 0x00F4-0x00FF Reserved + 0x0100-0x0186 Defined by this proposal + 0x0187-0xFFFF Reserved + +For this TLC only, add Dynamic Flag (DF) as an allowed alternate usage type for +the existing Charging (0x44) and Discharging (0x45) usages. Their existing +Selector (Sel) type and existing behavior are unchanged. + + +Control Method Battery application usage +---------------------------------------- + +Usage ID Usage Name Type +-------- ----------------------- ---- +0x0100 Control Method Battery CA + +Control Method Battery (0x0100) + +Defines an Application Collection for one independently managed battery. A +device containing multiple independently managed batteries shall expose one +Control Method Battery TLC per battery. A persistent controller may keep the +TLC enumerated while Battery Present is zero. Battery Tag shall change when the +pack represented by the TLC is removed, replaced, or materially changes +identity. + +All reports defined by this proposal are required. A field may contain an +unknown value only when this proposal or the referenced ACPI definition +explicitly defines an unknown value. + + +Collection usages +----------------- + +Usage ID Usage Name Type +-------- -------------------------------------- ---- +0x0101 Control Method Battery Information CL +0x0102 Control Method Battery Identity CL +0x0103 Control Method Battery Status CL +0x0104 Control Method Battery Notification CL +0x0105 Battery Measurement Configuration CL +0x0106 Battery Maintenance CL +0x0107 Battery Charge Time CL +0x0108 Battery Runtime CL +0x0109 Battery Power Characteristics CL +0x010A Battery Power State CL +0x010B Battery Power Threshold CL +0x010C Battery Capacity Trip Point CL +0x010D Battery Thermal Control CL +0x010E Battery Capability Negotiation CL +0x010F Power Consumer List CL + +Each collection usage groups the fields for the correspondingly named report. +The grouping does not change the independent meaning of any data usage. + + +Protocol and static-information usages +-------------------------------------- + +Usage ID Usage Name Type Description +-------- --------------------------------- ----- ----------- +0x0120 Protocol Revision SV Revision of this HIDBattery report contract. This draft defines revision 1. +0x0121 Battery Tag DV Nonzero identity value for the currently installed pack. It changes after removal, replacement, or identity change. Zero means that no battery is present. +0x0122 Battery Information Revision SV Revision of the static information layout. ACPI _BIX revision 1 is encoded as 1. +0x0123 Battery Power Unit CL Selects the unit for all capacity, rate, and peak-power fields in this TLC. +0x0124 Capacity in Milliwatt Hours Sel Capacity is in mWh and rate/power is in mW. +0x0125 Capacity in Milliampere Hours Sel Capacity is in mAh and rate/current is in mA. +0x0126 Battery Technology CL Selects primary or secondary battery technology. +0x0127 Primary Battery Technology Sel Non-rechargeable battery. +0x0128 Secondary Battery Technology Sel Rechargeable battery. +0x0129 Design Capacity Low SV OEM low-capacity threshold in the selected capacity unit. +0x012A Measurement Accuracy SV Measurement accuracy in thousandths of one percent; 80000 represents 80 percent. +0x012B Maximum Sampling Time SV Maximum supported sampling interval in milliseconds. All ones means unavailable. +0x012C Minimum Sampling Time SV Minimum supported sampling interval in milliseconds. All ones means unavailable. +0x012D Maximum Averaging Interval SV Maximum supported averaging interval in milliseconds. +0x012E Minimum Averaging Interval SV Minimum supported averaging interval in milliseconds. +0x012F Battery Swapping Capability CL Selects the replacement behavior of the battery. +0x0130 Battery Not Swappable Sel Battery is not user replaceable. +0x0131 Battery Cold Swappable Sel System must be shut down before replacement while on battery power. +0x0132 Battery Hot Swappable Sel Battery may be replaced without shutting down the system. + +The following existing usages are reused in Control Method Battery Information: + +Page ID Usage Name Meaning in this TLC +----- ----- -------------------------- -------------------------------------- +0x85 0x83 Design Capacity ACPI _BIX Design Capacity. +0x85 0x67 Full Charge Capacity ACPI _BIX Last Full Charge Capacity. +0x84 0x40 Config Voltage ACPI _BIX Design Voltage, in mV. +0x85 0x8C Warning Capacity Limit ACPI _BIX Design Capacity of Warning. +0x85 0x6B Cycle Count ACPI _BIX Cycle Count. +0x85 0x8D Capacity Granularity 1 ACPI _BIX Battery Capacity Granularity 1. +0x85 0x8E Capacity Granularity 2 ACPI _BIX Battery Capacity Granularity 2. +0x85 0x85 Manufacture Date Packed Smart Battery manufacture date. + +Design Capacity, Full Charge Capacity, and Config Voltage use all ones to mean +unknown. Cycle Count uses all ones to mean unknown. Capacity values use the +selected Battery Power Unit. Voltage is in millivolts. + + +Identity usages and string encoding +----------------------------------- + +Usage ID Usage Name Type +-------- ------------------------------ ------------- +0x0133 Battery Model Number BufferedBytes +0x0134 Battery Serial Number String BufferedBytes +0x0135 Battery Type String BufferedBytes +0x0136 Battery OEM Information BufferedBytes +0x0137 Battery Manufacturer Name BufferedBytes +0x0138 Battery Unique Identifier BufferedBytes +0x0139 Power Consumer Identifiers BufferedBytes + +Each identity field is a fixed-size byte buffer declared by the report +descriptor. It contains a UTF-8 string terminated by 0x00. The first 0x00 and +all remaining bytes shall be zero. A value that does not fit shall be truncated +at a UTF-8 code-point boundary and terminated. An unsupported or empty value is +encoded as an all-zero buffer. + +Battery Model Number, Battery Serial Number String, Battery Type String, and +Battery OEM Information correspond to the ACPI _BIX strings. Battery +Manufacturer Name and Battery Unique Identifier provide the additional identity +needed by battery class APIs. Battery Unique Identifier shall be stable for the +life of a physical pack and unique among packs that can be attached to the +system. + +Power Consumer Identifiers is a sequence of NUL-terminated UTF-8 stable device +identifiers followed by an additional NUL. It represents the relationships +reported by ACPI _PCL. An empty list contains two zero bytes. Each identifier +shall be either an ACPI namespace path beginning with "acpi:" or an RFC 8141 +UUID URN beginning with "urn:uuid:". A platform that uses UUID URNs shall expose +the same UUID as a device-enumeration property on the referenced consumer so +the host can resolve the relationship. + +The complete encoded list, including the final extra NUL, shall fit in the +declared report field. It shall not be silently truncated. A conforming device +therefore selects a field size large enough for its complete consumer list. + + +Dynamic-status and event usages +------------------------------- + +Usage ID Usage Name Type Description +-------- --------------------------------- ----- ----------- +0x0140 Battery Critical DF Battery is in the critical energy state. +0x0141 Battery Charge Limiting Active DF Battery charge limiting is active. +0x0142 Battery Present Rate DV Power accepted or supplied at the battery terminals, in mW or mA according to Battery Power Unit. Direction is given by Charging and Discharging. All ones means unknown. +0x0143 Battery Status Sequence DV Monotonically increasing status generation. Wrap from 0xFFFFFFFF to zero is permitted. +0x0144 Battery Information Changed DF Static information or identity changed and shall be reread. +0x0145 Battery Maintenance Changed DF Maintenance status changed and shall be reread. +0x0146 Battery Power State Changed DF Peak-power capability changed and shall be reread. +0x0147 Battery Power Threshold Crossed DF A configured peak-power threshold was crossed. +0x0186 System On Line DF The system is drawing operating power from an external source. + +The following existing usages are reused in Control Method Battery Status: + +Page ID Usage Name Meaning in this TLC +----- ----- ------------------ -------------------------------------------- +0x85 0x44 Charging ACPI _BST charging state; used as a DF. +0x85 0x45 Discharging ACPI _BST discharging state; used as a DF. +0x85 0xD0 AC Present External power is physically connected. +0x85 0xD1 Battery Present A battery pack is installed in this TLC. +0x85 0x66 Remaining Capacity ACPI _BST Battery Remaining Capacity. +0x84 0x30 Voltage ACPI _BST Battery Present Voltage, in mV. +0x84 0x36 Temperature Battery temperature, in 0.1 kelvin. + +Charging and Discharging are mutually exclusive. A rechargeable battery shall +report a valid Present Rate, Remaining Capacity, and Voltage. A primary battery +may report all ones where ACPI permits an unknown value. + +AC Present reports physical source presence. System On Line reports the +effective source supplying the system. System On Line shall be zero while the +battery is intentionally discharging with AC present, including Discharge on AC +Enabled operation. Hosts shall use System On Line, not AC Present, for +operating-system "on line power" state. + +The device shall send the status Input report when any status value changes, +when Battery Tag changes, or when one of the event flags is asserted. Event +flags describe the reason for the current report and are cleared after the +report is successfully delivered. Battery Status Sequence increments before +each changed report is made available. The host shall tolerate lost or +coalesced Input reports and may read all Feature reports at any time. + +Battery Information Changed corresponds to ACPI Notify 0x81. Battery +Maintenance Changed corresponds to Notify 0x82. Battery Power State Changed and +Battery Power Threshold Crossed correspond to Notify 0x83. A remaining-capacity +trip-point crossing causes a status report and corresponds to Notify 0x80. + + +Windows notification support usages +----------------------------------- + +Usage ID Usage Name Type Description +-------- ------------------------------- ----- ----------- +0x0182 Notification Power State Mask DV Power-state changes that trigger a status Input report. +0x0183 Notification Low Capacity DV Inclusive lower capacity bound in the selected capacity unit. +0x0184 Notification High Capacity DV Inclusive upper capacity bound in the selected capacity unit. +0x0185 Critical Bias DV Capacity reserved for the critical transition, in the selected capacity unit. + +The host writes the Control Method Battery Notification Feature report to arm +notifications. The device shall generate a status Input report when the power +state differs from the requested mask or Remaining Capacity leaves the +inclusive low/high band. Writing a power-state mask of zero and both capacity +bounds as zero disables this notification condition. ACPI Battery Capacity Trip +Point remains independently active. + + +Measurement configuration usages +-------------------------------- + +Usage ID Usage Name Type Description +-------- ------------------ ----- ----------- +0x0148 Sampling Time DV Time in milliseconds between measurements used for status values. +0x0149 Averaging Interval DV Time in milliseconds over which status measurements are averaged. +0x014A Operation Status DV Result of the most recent operation in the containing report. + +Sampling Time maps to ACPI _BMS and shall be within Minimum Sampling Time and +Maximum Sampling Time. Averaging Interval maps to ACPI _BMA and shall be within +Minimum Averaging Interval and Maximum Averaging Interval. Values are 1 through +0xFFFFFFFF milliseconds. + +The host sets both values in one Set Feature operation. The device applies the +values atomically. Operation Status is read-only: + + 0 Success + 1 One or both values are outside the supported range + 2-0xFFFFFFFF Reserved + +The host may Get Feature after Set Feature to verify the applied values and +Operation Status. + + +Maintenance usages +------------------ + +Usage ID Usage Name Type +-------- ----------------------------------------------------- ---- +0x0150 Calibration Active DF +0x0151 Charging Disabled DF +0x0152 Discharge on AC Enabled DF +0x0153 Recalibration Requested DF +0x0154 Standby Recommended for Calibration DF +0x0155 Charge Limit Suspension Blocked by Thermal Condition DF +0x0156 Charge Limit Suspension Blocked by Battery Protection DF +0x0157 Calibration Supported SF +0x0158 Charging Control Supported SF +0x0159 Discharge on AC Supported SF +0x015A Individual Battery Control Supported SF +0x015B Charge Before Calibration Required SF +0x015C Charge Limit Suspension Supported SF +0x015D Recalibrate Count SV +0x015E Quick Recalibrate Time DV +0x015F Slow Recalibrate Time DV +0x0160 Start Calibration OOC +0x0161 Disable Charging OOC +0x0162 Enable Discharge on AC OOC +0x0163 Suspend Charge Limiting OOC + +The state, capability, count, and time usages map in order to ACPI _BMD. +Start Calibration, Disable Charging, Enable Discharge on AC, and Suspend Charge +Limiting map to ACPI _BMC argument bits 0 through 3. + +Start Calibration is mutually exclusive with the other three controls and takes +precedence if set. Suspend Charge Limiting shall be set only when Charge Limit +Suspension Supported is one. A device that cannot apply a control shall leave +the corresponding state unchanged and assert Battery Maintenance Changed. + +If Individual Battery Control Supported is zero, writing any maintenance +control in one TLC applies to every affected battery in the system. The device +shall update the maintenance state and send Battery Maintenance Changed status +reports for every affected TLC. Hosts shall not assume that an operation is +local to the TLC that received the write. + +Recalibrate Count is zero when recalibration is requested only by +Recalibration Requested. Quick and Slow Recalibrate Time are in seconds: + + 0 Meaning defined by the corresponding ACPI _BMD field + 1-0xFFFFFFFE Estimated or remaining time + 0xFFFFFFFF Unknown + + +Charge-time and runtime usages +------------------------------ + +Usage ID Usage Name Type Description +-------- ----------------------- ----- ----------- +0x0168 Target Charge Level DV Requested percentage of Full Charge Capacity, from 1 through 100. +0x0169 Estimated Charge Time DV ACPI _BCT result in seconds. +0x016A Requested Discharge Rate DV Expected discharge rate in mW or mA; zero selects the current average rate. +0x016B Estimated Runtime DV ACPI _BTM result in seconds. + +For Battery Charge Time, the host writes Target Charge Level and then reads the +same Feature report. Estimated Charge Time is read-only: + + 0 Target is below current capacity or above 100 percent + 1-0xFFFFFFFE Estimated charging time in seconds + 0xFFFFFFFF Unknown + +For Battery Runtime, the host writes Requested Discharge Rate and then reads the +same Feature report. Estimated Runtime is read-only: + + 0 Requested rate is unsustainable, or battery is critical when + Requested Discharge Rate is zero + 1-0xFFFFFFFE Estimated runtime in seconds + 0xFFFFFFFF Unknown + +Set Feature completion means that the result is available to Get Feature. A +device shall not expose partially updated request/result pairs. + + +Peak-power usages +----------------- + +Usage ID Usage Name Type +-------- ---------------------------------------------- ---- +0x0170 Power Characteristics Revision SV +0x0171 Instantaneous Peak Power Threshold Supported SF +0x0172 Sustainable Peak Power Threshold Supported SF +0x0173 Maximum Instantaneous Peak Power Threshold SV +0x0174 Maximum Sustainable Peak Power Threshold SV +0x0175 Power State Revision DV +0x0176 Instantaneous Peak Power Level DV +0x0177 Instantaneous Peak Power Period DV +0x0178 Sustainable Peak Power Level DV +0x0179 Sustainable Peak Power Period DV +0x017A Power Threshold Revision DV +0x017B Power Threshold Identifier DV +0x017C Power Threshold Value DV + +Power Characteristics usages map to ACPI _BPC revision 1. Maximum threshold +values use mW or mA according to Battery Power Unit. + +Power State usages map to ACPI _BPS revision 1. Peak Power Levels use mW or mA. +Peak Power Periods use milliseconds. A level and period of zero means that the +corresponding capability is unsupported. The device sends the Battery Power +State Input report when either capability changes by the configured relative +threshold. + +Power Threshold maps to ACPI _BPT revision 1: + + Power Threshold Identifier 0 Clear all thresholds + Power Threshold Identifier 1 Instantaneous peak power + Power Threshold Identifier 2 Sustainable peak power + +Power Threshold Value is the relative change threshold in mW or mA. Zero +disables the selected threshold. Operation Status in this report is: + + 0 Success + 1 Invalid threshold value + 2 Hardware timeout + 3 Unknown hardware error + 4 Unsupported threshold type + 5 Unsupported revision + 6-0xFFFFFFFF Reserved + + +Capacity-trip, thermal, and capability usages +--------------------------------------------- + +Usage ID Usage Name Type Description +-------- -------------------------- ----- ----------- +0x017D Capacity Trip Point DV Remaining-capacity crossing point in the selected capacity unit. Zero clears it. +0x017E Thermal Throttle Limit DV Maximum permitted charging level in percent, from 0 through 100. +0x0180 Host Capability Flags DV Host capabilities corresponding to ACPI battery _OSC revision 1 DWORD 2. +0x0181 Device Capability Flags DV Device acknowledgement and supported capability bits. + +Capacity Trip Point maps to ACPI _BTP. The device sends a status Input report +when Remaining Capacity crosses the programmed value in either direction. + +Thermal Throttle Limit maps to ACPI _BTH. At 100 percent the battery may charge +at maximum current. The device is responsible for applying the limit. + +Capability negotiation uses the ACPI Control Method Battery UUID +F18FC78B-0F15-4978-B793-53F833A1D35B and revision 1 semantics. Defined flags are: + + Bit 0 Revised battery granularity definition + Bit 1 Wake on low-battery user preference + Bit 2 Battery power-delivery threshold notifications + Bits 3-31 Reserved + +The host writes Host Capability Flags. The device returns supported and +accepted bits in Device Capability Flags. Reserved bits shall be zero. + + +Report contract +=============== + +The Control Method Battery TLC contains the following reports. Report IDs are +assigned by the descriptor and are not standardized. + +Report Kind Access +-------------------------------------- -------- ------------------------------ +Control Method Battery Information Feature Device to host +Control Method Battery Identity Feature Device to host +Control Method Battery Status Input Device to host, on change +Control Method Battery Notification Feature Host configuration/readback +Battery Measurement Configuration Feature Host configuration/readback +Battery Maintenance Feature Bidirectional control/status +Battery Charge Time Feature Host request/device result +Battery Runtime Feature Host request/device result +Battery Power Characteristics Feature Device to host +Battery Power State Input Device to host, on change +Battery Power Threshold Feature Host configuration/readback +Battery Capacity Trip Point Feature Host configuration/readback +Battery Thermal Control Feature Host configuration/readback +Battery Capability Negotiation Feature Host configuration/readback +Power Consumer List Feature Device to host + +Feature reports that contain read-only fields shall ignore host-written values +for those fields. Host-writable fields are applied atomically at successful Set +Feature completion. Get Feature returns the last accepted configuration and the +result derived from that configuration. + + +Common representation rules +--------------------------- + +1. Fields are packed as declared by the HID report descriptor. Multi-byte + fields use HID little-endian bit ordering. +2. ACPI Integer (DWORD) fields use 32 report bits unless a smaller range is + explicitly defined by this proposal. +3. ACPI DWORD values are interpreted as unsigned. The all-ones bit pattern is + 0xFFFFFFFF even if a descriptor tool displays it as signed -1. +4. Reserved bits are zero when sent and ignored when received. +5. Capacity, rate, and peak-power values use Battery Power Unit. Voltage uses + millivolts. Time fields state milliseconds or seconds in their definitions. +6. Charging and Discharging shall not both be one. +7. Static information shall describe the battery identified by Battery Tag. + The host shall discard cached information when Battery Tag changes. +8. If Battery Present is zero, Battery Tag is zero and all other dynamic fields + are ignored. +9. While Battery Tag is zero, every identity buffer is all zero. Static fields + are zero or use their defined unknown sentinel. A host shall not cache + identity or static information read while Battery Tag is zero. + + +Host operation sequences +------------------------ + +Enumeration + +1. Parse each Control Method Battery TLC. +2. Read Control Method Battery Information and Identity. +3. Read configuration/status Feature reports. +4. Arm Control Method Battery Notification. +5. Consume status and power-state Input reports. + +Battery replacement + +1. Device sends a status Input report with Battery Present zero and Battery Tag + zero. +2. When a pack is inserted, the device assigns a new nonzero Battery Tag. +3. Device sends a status Input report with Battery Present one, the new tag, and + Battery Information Changed one. +4. Host invalidates all cached data and rereads static, identity, maintenance, + and power-characteristic reports. + +Measurement configuration + +1. Host reads the supported ranges from Control Method Battery Information. +2. Host sets Sampling Time and Averaging Interval. +3. Host gets Battery Measurement Configuration and verifies Operation Status. + +Charge-time or runtime query + +1. Host sets the request field in the corresponding Feature report. +2. Device computes and stores the result before completing Set Feature. +3. Host gets the same Feature report and reads the result. + + +ACPI 6.5 mapping +================ + +ACPI object HIDBattery representation +----------- --------------------------------------------------------------- +_STA Battery Present; HID transport presence remains independent. +_BIX Control Method Battery Information and Identity. +_BIF Represented by the _BIX superset; no separate legacy report. +_BST Control Method Battery Status Input report. +_BTP Capacity Trip Point and status Input report on crossing. +_BMS Sampling Time and Operation Status. +_BMA Averaging Interval and Operation Status. +_BMD Battery Maintenance status/capability/count/time fields. +_BMC Battery Maintenance control fields. +_BCT Battery Charge Time request/result Feature report. +_BTM Battery Runtime request/result Feature report. +_BPC Battery Power Characteristics Feature report. +_BPS Battery Power State Input report. +_BPT Battery Power Threshold Feature report and threshold event. +_BTH Thermal Throttle Limit Feature report. +_OSC Battery Capability Negotiation Feature report. +_PCL Power Consumer List Feature report. + + +Windows battery miniclass mapping +================================= + +Battery miniclass operation HIDBattery source +---------------------------------- ------------------------------------------ +BatteryMiniQueryTag Battery Present and Battery Tag. +BatteryMiniQueryStatus Status flags, Remaining Capacity, Voltage, and Present Rate. +BatteryMiniQueryInformation Static information, Identity, Temperature, Manufacture Date, Cycle Count, and Estimated Runtime. +BatteryMiniSetInformation Critical Bias and applicable Battery Maintenance controls. +BatteryMiniSetStatusNotify Notification Power State Mask and low/high capacity bounds. +BatteryMiniDisableStatusNotify Clear the Control Method Battery Notification report. + +BATTERY_INFORMATION mapping: + +Windows field HIDBattery source +--------------------- ------------------------------------------------------- +Capabilities Battery Present, Secondary Battery Technology, and driver policy. +Technology Primary or Secondary Battery Technology. +Chemistry First four ASCII bytes of Battery Type String, padded with spaces. +DesignedCapacity Design Capacity. +FullChargedCapacity Full Charge Capacity. +DefaultAlert1 Design Capacity Low. +DefaultAlert2 Warning Capacity Limit. +CriticalBias Critical Bias. +CycleCount Cycle Count. + +BATTERY_STATUS mapping: + +Windows field HIDBattery source +-------------- ------------------------------------------------------------- +PowerState System On Line, Charging, Discharging, and Battery Critical. +Capacity Remaining Capacity. +Voltage Voltage. +Rate Present Rate, positive while charging and negative while discharging. + +When Battery Power Unit selects milliampere-hours/milliamperes, a Windows +miniclass converts every Windows-facing capacity or rate quantity using Voltage +when the Windows API requires power units. This includes DesignedCapacity, +FullChargedCapacity, DefaultAlert1, DefaultAlert2, CriticalBias, status Capacity +and Rate, and notification low/high bounds. If a reliable conversion is not +possible, the driver uses the Windows relative-capacity capability consistently +for capacities, alert thresholds, critical bias, and notification bounds while +preserving their ordering and threshold semantics. + + +Sample descriptor +================= + +The accompanying HIDBattery.wara file is a non-normative Waratah 1.9 source +descriptor for this proposal. It: + +* extends the built-in Battery System page with the proposed usages; +* creates one Control Method Battery TLC; +* reuses the existing Power and Battery System usages listed above; +* contains the complete report surface described by this proposal; and +* compiles with WaratahCmd 1.9 against HID Usage Tables 1.7. + +Waratah 1.9 cannot declare the complete unsigned 32-bit logical range required +by ACPI while also generating the all-ones sentinel. The sample therefore uses +a signed logical range for raw ACPI DWORD fields, and some non-sentinel fields +are optimized to fewer than 32 bits. The sample validates report organization +and usage compatibility, but it is not a normative firmware descriptor for +values from 0x80000000 through 0xFFFFFFFE. A production descriptor shall follow +the Common representation rules above and encode the complete 32-bit field. + + +References +========== + +1. USB-IF, HID Usage Tables 1.7, Power Page (0x84) and Battery System Page + (0x85): https://usb.org/sites/default/files/hut1_7.pdf +2. UEFI Forum, ACPI Specification 6.5, section 10.2.2, Battery Control Methods: + https://uefi.org/specs/ACPI/6.5/10_Power_Source_and_Power_Meter_Devices.html#battery-control-methods +3. Microsoft, Writing Battery Miniclass Drivers: + https://learn.microsoft.com/windows-hardware/drivers/battery/writing-battery-miniclass-drivers +4. Microsoft, hidtools / Waratah: + https://github.com/microsoft/hidtools +5. USB-IF, HUTRR submission template and process: + https://www.usb.org/sites/default/files/hutrr_form.txt + + +Response +======== + + diff --git a/docs/src/specs/ec_interface/hid/HUTRR120-SystemWakeTimerAndRTC.md b/docs/src/specs/ec_interface/hid/HUTRR120-SystemWakeTimerAndRTC.md new file mode 100644 index 0000000..ef455db --- /dev/null +++ b/docs/src/specs/ec_interface/hid/HUTRR120-SystemWakeTimerAndRTC.md @@ -0,0 +1,472 @@ +Request \#:        HUTRR120 +Title:            RTC & System Wake Timer +Spec Release:    1.7 +Requester:        Phil Weber +Company:          Microsoft +------------------ +Pages Affected:  Time and Date (0x13) (*New Page*) +Generic Desktop (0x01) +Generic Device Controls (0x06) +------------------ +Current Status:   In Review +Priority:         Normal +------------------ +Required Voter:   QC +Required Voter:   Intel +Required Voter:   Dell +------------------ + +Voting Begins:    \ +Voting Ends:      \ +Voting Result:    \ + +**Summary:** + +Add new Usages to support configuring a system's onboard RTC (Real-Time-Clock) and System Wake Timer. + +**Scenario:** + +CPU timers tend to drift and lack time-keeping capability during sleep/shutdown. An **RTC** (Real-Time-Clock, distinct from the CPU-Clock) is a dedicated, battery-powered device (typically integrated into motherboards/chipsets) to maintain a ‘wall-clock’ time+date with high precision. Commonly used to provide current time+date to the user, data timestamping, task-scheduling and a basis for authentication. + +The pairing with a battery/super-capacitor, ensures accurate time+date is kept while the CPU is not running. While this device is very-accurate and typically factory-initialized, it still requires regular updates from the system to account for drift (e.g. using NTP), timezone changes and addition of leap-seconds. The system typically retrieves the current time from the device on returning to its working-state. + +The **system wake-timer** device provides a CPU-external mechanism to signal a ‘wake’. It is commonly implemented as an ‘always on’ low-power hardware block in the chipset/SoC or directly into the platform’s power-management/wake controller. + +When configured, the device will wake the system at the specified future time after the timer expires. This enables the system to save power by sleeping during idle periods and then resume to perform scheduled tasks. + +**Proposal:** + +Add to Table 9.1 – Generic Device Controls Page + +| **Usage Id** | **Usage Name** | **Usage Types** | +|--------------|----------------------|-----------------| +| 0x46-4F | *Reserved* | | +| 0x50 | Vendor Current State | DV | +| 0x51 | Current State | NAry | +| 0x52 | Cleared | Sel | +| 0x53 | Failed | Sel | +| 0x54 | Running | Sel | +| 0x55 | Expired | Sel | +| 0x56 | Signaled | Sel | + +Add a new section to Generic Device Controls with the following details. + +*Reviewer Note: These Usages are reminiscent of ‘23.3 Sensor State Event Usages’. New Usages have been declared since Sensor Events are expected to be used with Modifiers. Modifiers are not applicable to non-sensor scenarios, so new, dedicated Usages shall be created.* + +9.5 Device State + +Some devices can fail requested operations (though the Report is successfully sent/received) because of underlying hardware faults, loss of backing resources, invalid configuration, or other device-specific conditions that are not visible through transport-level success alone. These usages allow the system to determine whether a requested operation succeeded, failed, or requires recovery. + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Usage NameUsage TypesUsage Description
Current StateNAryThe most-recent state
ClearedSelState is uninitialized or recently reset/cleared.
FailedSel

Failed to perform the most recent operation. (Note: HID-transport functionality is still clearly working)

+

Common for when the device is actually backed by another device that can experience failures

ExpiredSelExpired (e.g. timer has completed)
SignaledSelSignaled (e.g. external interrupt raised)
RunningSelRunning (e.g. everything behaving normally)
+ + +++++ + + + + + + + + + + + + + + +
Usage NameUsage TypesUsage Description
Vendor Current StateDV

Opaque state-value meaningful only to the device vendor.

+

Typically used in conjunction with ‘Current State’

+ +Create new page ‘Time and Date’ (0x13). + +*Reviewer Note: These Usages are reminiscent of ‘23.15 Time Sensor Field Usages’. New Usages have been declared since Sensor Data Fields are expected to be used with Modifiers. Modifiers are not applicable to non-sensor scenarios, so new, dedicated Usages shall be created.* + +22 - Time and Date (0x13) + +Common Usages to describe times and dates. + +| **Usage Id** | **Usage Name** | **Usage Types** | +|--------------|--------------------------------|-----------------| +| 0x00 | *Undefined* | | +| 0x01 | Year | DV | +| 0x02 | Month | DV | +| 0x03 | Day | DV | +| 0x04 | Hour | DV | +| 0x05 | Minute | DV | +| 0x06 | Second | DV | +| 0x07 | Millisecond | DV | +| 0x08-F | *Reserved* | | +| 0x10 | Time Zone Offset From UTC | DV | +| 0x11 | Daylight Savings Time Observed | DF | +| 0x12 | Daylight Savings Time Active | DF | + +22.1 Date + +Conventional UTC (proleptic Gregorian) calendar divisions. + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Usage NameUsage TypesUsage Description
YearDV

Standard UTC Gregorian calendar year.

+

Positive integers for AD and negative for BC.

+

0 is undefined in the Gregorian calendar.

MonthDVStandard UTC Gregorian calendar month
DayDVStandard UTC Gregorian calendar day of the month
+ +22.2 Time + +22.2.1 Conventional UTC time (Coordinated Universal Time) divisions. + +| **Usage Name** | **Usage Types** | **Usage Description** | +|----------------|-----------------|--------------------------| +| Hour | DV | Standard UTC hour | +| Minute | DV | Standard UTC minute | +| Second | DV | Standard UTC second | +| Millisecond | DV | Standard UTC millisecond | + +22.2.2 Time zone and Daylight Savings Time (DST). + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Usage NameUsage TypesUsage Description
Time Zone Offset From UTCDV

Minutes local time is behind (-) or ahead (+) of UTC+00:00

+

Offset = (localTime – UTC)
+e.g. AEST timezone of UTC+10:00 is ahead +600 minutes.

+

e.g. EST timezone of UTC-05:00 is behind -300 minutes.

Daylight Savings Time ObservedDFIndicates if DST is observed in current time zone
Daylight Savings Time ActiveDF

Indicates if time has been adjusted by system to apply DST.

+

Useful when the device is shared to coordinate applying/removing DST.

+ +Add to Table 4.1 – Generic Desktop Page + +| **Usage Id** | **Usage Name** | **Usage Types** | +|--------------|----------------------------------------|-----------------| +| | | | +| 0x14 | **System Wake Timer** | CA | +| 0x15 | **System Real Time Clock** | CA | +| | | | +| 0xF0 | Timer Expiration: External Power | DV | +| 0xF1 | Timer Expiration: Internal Power | DV | +| 0xF2 | Power Source Change Minimum Expiration | DV | +| 0xF3 | Lowest System Wakeable Power State | NAry | +| 0xF4 | S1 | Sel | +| 0xF5 | S2 | Sel | +| 0xF6 | S3 | Sel | +| 0xF7 | S4 | Sel | +| 0xF8 | S5 | Sel | +| 0xF9-FFFF | *Reserved* | | + +Add 4.17 System Wake Timer + +The **system wake-timer** device provides a CPU-external mechanism to signal a ‘wake’. It is commonly implemented as an ‘always on’ low-power hardware block in the chipset/SoC or directly into the platform’s power-management/wake controller. + +When configured, the device will wake the system (via the above out-of-band means) at the specified future time after the timer expires. This enables the system to save power by sleeping during idle periods and then resume to perform scheduled tasks. + +Separate wake configurations may be made for whether the system is running on External (i.e. AC/wall) power or Internal (i.e. DC/battery) power. It is up to the device to determine the power source and choose the right configuration, switching as necessary. + +There is typically a single system wake timer available to the system. + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Usage NameUsage TypesUsage Description
System Wake TimerCAA configurable timer, capable of waking the system when in a low-power state.
Timer Expiration: External PowerDVTimer expiration when device is connected to external (i.e. AC/wall) power.
Timer Expiration: Internal PowerDVTimer expiration when device is connected to internal (i.e. DC/battery) power.
Power Source Change Minimum ExpirationDV

Additional time the wake-timer must wait for, when the power-source changes (e.g. from external to internal) while the system is in Sx and the timer has already expired.

+

(e.g. System enters Sx while on external-power with internal-power timer expired. While in Sx, power-source changes to internal, must wait for additional period before signaling wake.)

+ +4.17.1 Lowest System Wakeable Power State + +By ACPI convention, S0 is the working-state, and S1-5 (i.e. Sx) is a low-power state, (where the larger the digit, the lower the power). + + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Usage NameUsage TypesUsage Description
Lowest System Wakeable Power StateNAryIndicates the lowest power state the system can enter and still be signaled awake.
S1SelStandard ACPI S1 sleep state
S2SelStandard ACPI S2 sleep state
S3SelStandard ACPI S3 sleep state
S4Sel

Standard ACPI S4 (Hibernate) sleep state.

+

System context saved, hardware mostly off

S5Sel

Standard ACPI S5 (soft off) sleep state.

+

System context lost, requires full reboot.

+ +4.17.2 Timer Expiration Rules + +1. Upon configuration, the wake timer immediately begins counting-down (i.e. while in S0). + +2. A wake shall be signalled, ONLY when the system is in Sx (i.e. a non-working state). The lowest such state is defined by ‘Lowest System Wakeable Power State’ + +3. If the system is in Sx, and the wake timer expires, the system is signalled to wake. + +4. If the system is in S0, and the wake timer expires, no wake is signalled. + +5. If the system enters Sx with an expired wake timer, the system is immediately signalled to wake. + +6. Once expired, the wake timer remains expired until it is cleared or re-configured. (i.e. entering S0 or signalling wake does NOT clear the timer) + +7. If the system changes power-source while in Sx, and the associated timer has already expired, ‘Power Source Change Minimum Expiration’ must additionally be waited before signalling to wake. + +Add 4.18 System Real Time Clock (RTC) + +CPU timers tend to drift and lack time-keeping capability during sleep/shutdown. An **RTC** (Real-Time-Clock, distinct from the CPU-Clock) is a dedicated, battery-powered device (typically integrated into motherboards/chipsets) to maintain a ‘wall-clock’ time+date with high precision. Commonly used to provide current time+date to the user, data timestamping, task-scheduling and a basis for authentication. + +The pairing with a battery/super-capacitor, ensures accurate time+date is kept while the CPU is not running. While this device is typically factory-initialized, it requires regular system updates to account for drift (e.g. using NTP), timezone changes and addition of leap-seconds. The system typically retrieves the current time from the device on returning to its working-state. + +There is typically a single RTC available to the system. + +| **Usage Name** | **Usage Types** | **Usage Description** | +|----------------------------|-----------------|----------------------------| +| **System Real Time Clock** | CA | The system accessible RTC. | + +**Sample Descriptor .wara:** + +The below sample describes a System Wake Timer and a System Real Time Clock. + +System Wake Timer Reports:- + + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Report TypeReport IdDescription
Feature1Describes the lowest system power state this wake timer can wake the system.
Output1

Wait timer configuration.

+

Setting a null-value clears the configuration, stopping any active countdown.

+

Must request corresponding Input report to validate configuration was applied successfully, as underlying hardware may fail

Input1

Current wake-timer configuration.

+

Must be requested explicitly by system. Will NOT be sent as Interrupt.

+

Examine ‘Current State’ to determine if configuration was successfully applied.

+
    +
  • Cleared (wake-timer is NOT running)

  • +
  • Failed (could NOT apply requested configuration, timer is NOT running)

  • +
  • Running (successfully applied configuration, timer is counting-down)

  • +
  • Expired (wake-timer has expired but NOT signaled a wake)

  • +
  • Signaled (expired wake has been signaled)

  • +
+ +System Real Time Clock Reports:- + + +++++ + + + + + + + + + + + + + + +
Output3

Sets the RTC.

+

This device supports a resolution of 1 millisecond.

+

Must request corresponding Input report to validate configuration was applied successfully, as underlying hardware may fail.

Input3

Retrieves the current RTC time.

+

Examine ‘Current State’ to determine if previously set time was successfully applied.

+
    +
  • Failed (could NOT apply requested time, current time is invalid)

  • +
  • Running (successfully applied time)

  • +
\ No newline at end of file diff --git a/docs/src/specs/ec_interface/hid/README.md b/docs/src/specs/ec_interface/hid/README.md new file mode 100644 index 0000000..f26478e --- /dev/null +++ b/docs/src/specs/ec_interface/hid/README.md @@ -0,0 +1,23 @@ +# HID EC Interface + +This section is a collection of the HID definitions for each HID class driver in the OS that is loaded on a Top Level Collection. + +Today HIDClass, HIDI2C and HIDI3C are all inboxed drivers in the OS and support input devices. Here we outline the specs for the remaining missing pieces for all the HID class drivers and HIDeSPI. + +## HID Transport Drivers + +HID supports I3C inbox in the OS without requiring any vendor or OEM drivers to be installed if the HID device is HCI compliant. For I2C and SPI drivers the stack is also present, but requires a Silicon Vendor driver for the underlying I2C interface as I2C controllers are not fully standardized. + +For eSPI we first need to standardize and have a more efficient eSPI interface. As part of that we are working on updating the EC specification based on PCC interface defined in ACPI. You can find the current draft spec here: + +[ESPI PCC Specification](../espi/espi_pcc_draft.md) + +## HID Class Drivers + +For each top level collection there is a corresponding HID Class driver that gets loaded for that TLC. The HID Class driver implements the miniport driver interface from the OS based on the HID specification for that class. + +Below are links to HUTRR documents for HID Class drivers as they are created as draft specifications to cover all the EC +services: + +- [HID Time and Alarm](HUTRR120-SystemWakeTimerAndRTC.md) +- [HID Battery](HUTRR-DRAFT-Battery.md) diff --git a/docs/src/specs/ec_interface/hid/hid-battery.wara b/docs/src/specs/ec_interface/hid/hid-battery.wara new file mode 100644 index 0000000..aad3803 --- /dev/null +++ b/docs/src/specs/ec_interface/hid/hid-battery.wara @@ -0,0 +1,991 @@ +# Draft descriptor for the proposed Control Method Battery top-level collection. +# Proposed usages are added to the existing Battery System Usage Page (0x85). +# Multi-byte integers are little-endian. Fields declared with a signed 32-bit +# logical range are interpreted as raw ACPI DWORD values by the protocol. + +[[usagePage]] +id = 0x85 +name = "Battery System" + + [[usagePage.usage]] + id = 0x100 + name = "Control Method Battery" + types = ['CA'] + + [[usagePage.usage]] + id = 0x101 + name = "Control Method Battery Information" + types = ['CL'] + + [[usagePage.usage]] + id = 0x102 + name = "Control Method Battery Identity" + types = ['CL'] + + [[usagePage.usage]] + id = 0x103 + name = "Control Method Battery Status" + types = ['CL'] + + [[usagePage.usage]] + id = 0x104 + name = "Control Method Battery Notification" + types = ['CL'] + + [[usagePage.usage]] + id = 0x105 + name = "Battery Measurement Configuration" + types = ['CL'] + + [[usagePage.usage]] + id = 0x106 + name = "Battery Maintenance" + types = ['CL'] + + [[usagePage.usage]] + id = 0x107 + name = "Battery Charge Time" + types = ['CL'] + + [[usagePage.usage]] + id = 0x108 + name = "Battery Runtime" + types = ['CL'] + + [[usagePage.usage]] + id = 0x109 + name = "Battery Power Characteristics" + types = ['CL'] + + [[usagePage.usage]] + id = 0x10A + name = "Battery Power State" + types = ['CL'] + + [[usagePage.usage]] + id = 0x10B + name = "Battery Power Threshold" + types = ['CL'] + + [[usagePage.usage]] + id = 0x10C + name = "Battery Capacity Trip Point" + types = ['CL'] + + [[usagePage.usage]] + id = 0x10D + name = "Battery Thermal Control" + types = ['CL'] + + [[usagePage.usage]] + id = 0x10E + name = "Battery Capability Negotiation" + types = ['CL'] + + [[usagePage.usage]] + id = 0x10F + name = "Power Consumer List" + types = ['CL'] + + [[usagePage.usage]] + id = 0x120 + name = "Protocol Revision" + types = ['SV'] + + [[usagePage.usage]] + id = 0x121 + name = "Battery Tag" + types = ['DV'] + + [[usagePage.usage]] + id = 0x122 + name = "Battery Information Revision" + types = ['SV'] + + [[usagePage.usage]] + id = 0x123 + name = "Battery Power Unit" + types = ['CL'] + + [[usagePage.usage]] + id = 0x124 + name = "Capacity in Milliwatt Hours" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x125 + name = "Capacity in Milliampere Hours" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x126 + name = "Battery Technology" + types = ['CL'] + + [[usagePage.usage]] + id = 0x127 + name = "Primary Battery Technology" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x128 + name = "Secondary Battery Technology" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x129 + name = "Design Capacity Low" + types = ['SV'] + + [[usagePage.usage]] + id = 0x12A + name = "Measurement Accuracy" + types = ['SV'] + + [[usagePage.usage]] + id = 0x12B + name = "Maximum Sampling Time" + types = ['SV'] + + [[usagePage.usage]] + id = 0x12C + name = "Minimum Sampling Time" + types = ['SV'] + + [[usagePage.usage]] + id = 0x12D + name = "Maximum Averaging Interval" + types = ['SV'] + + [[usagePage.usage]] + id = 0x12E + name = "Minimum Averaging Interval" + types = ['SV'] + + [[usagePage.usage]] + id = 0x12F + name = "Battery Swapping Capability" + types = ['CL'] + + [[usagePage.usage]] + id = 0x130 + name = "Battery Not Swappable" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x131 + name = "Battery Cold Swappable" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x132 + name = "Battery Hot Swappable" + types = ['Sel'] + + [[usagePage.usage]] + id = 0x133 + name = "Battery Model Number" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x134 + name = "Battery Serial Number String" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x135 + name = "Battery Type String" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x136 + name = "Battery OEM Information" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x137 + name = "Battery Manufacturer Name" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x138 + name = "Battery Unique Identifier" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x139 + name = "Power Consumer Identifiers" + types = ['BufferedBytes'] + + [[usagePage.usage]] + id = 0x140 + name = "Battery Critical" + types = ['DF'] + + [[usagePage.usage]] + id = 0x141 + name = "Battery Charge Limiting Active" + types = ['DF'] + + [[usagePage.usage]] + id = 0x142 + name = "Battery Present Rate" + types = ['DV'] + + [[usagePage.usage]] + id = 0x143 + name = "Battery Status Sequence" + types = ['DV'] + + [[usagePage.usage]] + id = 0x144 + name = "Battery Information Changed" + types = ['DF'] + + [[usagePage.usage]] + id = 0x145 + name = "Battery Maintenance Changed" + types = ['DF'] + + [[usagePage.usage]] + id = 0x146 + name = "Battery Power State Changed" + types = ['DF'] + + [[usagePage.usage]] + id = 0x147 + name = "Battery Power Threshold Crossed" + types = ['DF'] + + [[usagePage.usage]] + id = 0x148 + name = "Sampling Time" + types = ['DV'] + + [[usagePage.usage]] + id = 0x149 + name = "Averaging Interval" + types = ['DV'] + + [[usagePage.usage]] + id = 0x14A + name = "Operation Status" + types = ['DV'] + + [[usagePage.usage]] + id = 0x150 + name = "Calibration Active" + types = ['DF'] + + [[usagePage.usage]] + id = 0x151 + name = "Charging Disabled" + types = ['DF'] + + [[usagePage.usage]] + id = 0x152 + name = "Discharge on AC Enabled" + types = ['DF'] + + [[usagePage.usage]] + id = 0x153 + name = "Recalibration Requested" + types = ['DF'] + + [[usagePage.usage]] + id = 0x154 + name = "Standby Recommended for Calibration" + types = ['DF'] + + [[usagePage.usage]] + id = 0x155 + name = "Charge Limit Suspension Blocked by Thermal Condition" + types = ['DF'] + + [[usagePage.usage]] + id = 0x156 + name = "Charge Limit Suspension Blocked by Battery Protection" + types = ['DF'] + + [[usagePage.usage]] + id = 0x157 + name = "Calibration Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x158 + name = "Charging Control Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x159 + name = "Discharge on AC Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x15A + name = "Individual Battery Control Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x15B + name = "Charge Before Calibration Required" + types = ['SF'] + + [[usagePage.usage]] + id = 0x15C + name = "Charge Limit Suspension Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x15D + name = "Recalibrate Count" + types = ['SV'] + + [[usagePage.usage]] + id = 0x15E + name = "Quick Recalibrate Time" + types = ['DV'] + + [[usagePage.usage]] + id = 0x15F + name = "Slow Recalibrate Time" + types = ['DV'] + + [[usagePage.usage]] + id = 0x160 + name = "Start Calibration" + types = ['OOC'] + + [[usagePage.usage]] + id = 0x161 + name = "Disable Charging" + types = ['OOC'] + + [[usagePage.usage]] + id = 0x162 + name = "Enable Discharge on AC" + types = ['OOC'] + + [[usagePage.usage]] + id = 0x163 + name = "Suspend Charge Limiting" + types = ['OOC'] + + [[usagePage.usage]] + id = 0x168 + name = "Target Charge Level" + types = ['DV'] + + [[usagePage.usage]] + id = 0x169 + name = "Estimated Charge Time" + types = ['DV'] + + [[usagePage.usage]] + id = 0x16A + name = "Requested Discharge Rate" + types = ['DV'] + + [[usagePage.usage]] + id = 0x16B + name = "Estimated Runtime" + types = ['DV'] + + [[usagePage.usage]] + id = 0x170 + name = "Power Characteristics Revision" + types = ['SV'] + + [[usagePage.usage]] + id = 0x171 + name = "Instantaneous Peak Power Threshold Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x172 + name = "Sustainable Peak Power Threshold Supported" + types = ['SF'] + + [[usagePage.usage]] + id = 0x173 + name = "Maximum Instantaneous Peak Power Threshold" + types = ['SV'] + + [[usagePage.usage]] + id = 0x174 + name = "Maximum Sustainable Peak Power Threshold" + types = ['SV'] + + [[usagePage.usage]] + id = 0x175 + name = "Power State Revision" + types = ['DV'] + + [[usagePage.usage]] + id = 0x176 + name = "Instantaneous Peak Power Level" + types = ['DV'] + + [[usagePage.usage]] + id = 0x177 + name = "Instantaneous Peak Power Period" + types = ['DV'] + + [[usagePage.usage]] + id = 0x178 + name = "Sustainable Peak Power Level" + types = ['DV'] + + [[usagePage.usage]] + id = 0x179 + name = "Sustainable Peak Power Period" + types = ['DV'] + + [[usagePage.usage]] + id = 0x17A + name = "Power Threshold Revision" + types = ['DV'] + + [[usagePage.usage]] + id = 0x17B + name = "Power Threshold Identifier" + types = ['DV'] + + [[usagePage.usage]] + id = 0x17C + name = "Power Threshold Value" + types = ['DV'] + + [[usagePage.usage]] + id = 0x17D + name = "Capacity Trip Point" + types = ['DV'] + + [[usagePage.usage]] + id = 0x17E + name = "Thermal Throttle Limit" + types = ['DV'] + + [[usagePage.usage]] + id = 0x180 + name = "Host Capability Flags" + types = ['DV'] + + [[usagePage.usage]] + id = 0x181 + name = "Device Capability Flags" + types = ['DV'] + + [[usagePage.usage]] + id = 0x182 + name = "Notification Power State Mask" + types = ['DV'] + + [[usagePage.usage]] + id = 0x183 + name = "Notification Low Capacity" + types = ['DV'] + + [[usagePage.usage]] + id = 0x184 + name = "Notification High Capacity" + types = ['DV'] + + [[usagePage.usage]] + id = 0x185 + name = "Critical Bias" + types = ['DV'] + + [[usagePage.usage]] + id = 0x186 + name = "System On Line" + types = ['DF'] + +# One Control Method Battery TLC represents one independently managed battery. +[[applicationCollection]] +usage = ['Battery System', 'Control Method Battery'] + + # Protocol identity and ACPI _BIX-compatible static information. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Control Method Battery Information'] + + # Maybe this can be in Page Units; determine whether it can change dynamically. + [[applicationCollection.featureReport.logicalCollection.logicalCollection]] + usage = ['Battery System', 'Battery Power Unit'] + + # Static + [[applicationCollection.featureReport.logicalCollection.logicalCollection.arrayItem]] + usageRange = ['Battery System', 'Capacity in Milliwatt Hours', 'Capacity in Milliampere Hours'] + + # Static + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x83] # Design Capacity + logicalValueRange = [-1, 0x7FFFFFFF] + + # Static + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x67] # Full Charge Capacity + logicalValueRange = [-1, 0x7FFFFFFF] + + # Static + [[applicationCollection.featureReport.logicalCollection.logicalCollection]] + usage = ['Battery System', 'Battery Technology'] + + # Static + [[applicationCollection.featureReport.logicalCollection.logicalCollection.arrayItem]] + usageRange = ['Battery System', 'Primary Battery Technology', 'Secondary Battery Technology'] + + # Static + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x84, 0x40] # Config Voltage / ACPI Design Voltage + logicalValueRange = [-1, 0x7FFFFFFF] + + # Static + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x8C] # Warning Capacity Limit + logicalValueRange = [0, 0x7FFFFFFF] + + # Static + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Design Capacity Low'] + logicalValueRange = [0, 0x7FFFFFFF] + + # Dynamic; consider moving to Status. + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x6B] # Cycle Count + logicalValueRange = [-1, 0x7FFFFFFF] + + # Static + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Measurement Accuracy'] + logicalValueRange = [0, 100000] + + # Static; should go into the report descriptor for range. + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Maximum Sampling Time'] + logicalValueRange = [-1, 0x7FFFFFFF] + + # Static; should go into the report descriptor for range. + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Minimum Sampling Time'] + logicalValueRange = [-1, 0x7FFFFFFF] + + # Static; should go into the report descriptor for range. + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Maximum Averaging Interval'] + logicalValueRange = [0, 0x7FFFFFFF] + + # Static; should go into the report descriptor for range. + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Minimum Averaging Interval'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x8D] # Capacity Granularity 1 ** Static Low to Warning + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x8E] # Capacity Granularity 2 ** Static Warning to Full + logicalValueRange = [0, 0x7FFFFFFF] + + # Static + [[applicationCollection.featureReport.logicalCollection.logicalCollection]] + usage = ['Battery System', 'Battery Swapping Capability'] + + [[applicationCollection.featureReport.logicalCollection.logicalCollection.arrayItem]] + usageRange = ['Battery System', 'Battery Not Swappable', 'Battery Hot Swappable'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = [0x85, 0x85] # Manufacture Date + logicalValueRange = [0, 0xFFFF] + + # UTF-8, NUL-terminated strings. Unused bytes are zero. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Control Method Battery Identity'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Model Number'] + count = 64 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Serial Number String'] + count = 64 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Type String'] + count = 32 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery OEM Information'] + count = 64 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Manufacturer Name'] + count = 64 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Unique Identifier'] + count = 64 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] + + # ACPI _BST-compatible dynamic state. Sent on any state change. + [[applicationCollection.inputReport]] + + [[applicationCollection.inputReport.logicalCollection]] + usage = ['Battery System', 'Control Method Battery Status'] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Tag'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x85, 0x45] # Discharging + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x85, 0x44] # Charging + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Critical'] + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Charge Limiting Active'] + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x85, 0xD0] # AC Present + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'System On Line'] + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x85, 0xD1] # Battery Present + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Present Rate'] + logicalValueRange = [-1, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x85, 0x66] # Remaining Capacity + logicalValueRange = [-1, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x84, 0x30] # Voltage + logicalValueRange = [-1, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = [0x84, 0x36] # Temperature + logicalValueRange = [-1, 0x7FFFFFFF] + usageUnitMultiplier = 0.1 + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Status Sequence'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Information Changed'] + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Maintenance Changed'] + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Power State Changed'] + logicalValueRange = [0, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Battery Power Threshold Crossed'] + logicalValueRange = [0, 1] + + # Windows battery-class notification band and critical-bias configuration. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Control Method Battery Notification'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Notification Power State Mask'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Notification Low Capacity'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Notification High Capacity'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Critical Bias'] + logicalValueRange = [0, 0x7FFFFFFF] + + # ACPI _BMS and _BMA. Set then Get the report to obtain Operation Status. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Measurement Configuration'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Sampling Time'] + logicalValueRange = [1, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Averaging Interval'] + logicalValueRange = [1, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Operation Status'] + logicalValueRange = [0, 0x7FFFFFFF] + + # ACPI _BMD state/capabilities and _BMC controls. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Maintenance'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Calibration Active'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Charging Disabled'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Discharge on AC Enabled'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Recalibration Requested'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Standby Recommended for Calibration'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Charge Limit Suspension Blocked by Thermal Condition'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Charge Limit Suspension Blocked by Battery Protection'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Calibration Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Charging Control Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Discharge on AC Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Individual Battery Control Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Charge Before Calibration Required'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Charge Limit Suspension Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Recalibrate Count'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Quick Recalibrate Time'] + logicalValueRange = [-1, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Slow Recalibrate Time'] + logicalValueRange = [-1, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Start Calibration'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Disable Charging'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Enable Discharge on AC'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Suspend Charge Limiting'] + logicalValueRange = [0, 1] + + # ACPI _BCT. Target Charge Level is written; Estimated Charge Time is read. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Charge Time'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Target Charge Level'] + logicalValueRange = [1, 100] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Estimated Charge Time'] + logicalValueRange = [-1, 0x7FFFFFFF] + + # ACPI _BTM. Requested rate is written; Estimated Runtime is read. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Runtime'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Requested Discharge Rate'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Estimated Runtime'] + logicalValueRange = [-1, 0x7FFFFFFF] + + # ACPI _BPC. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Power Characteristics'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Power Characteristics Revision'] + logicalValueRange = [1, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Instantaneous Peak Power Threshold Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Sustainable Peak Power Threshold Supported'] + logicalValueRange = [0, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Maximum Instantaneous Peak Power Threshold'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Maximum Sustainable Peak Power Threshold'] + logicalValueRange = [0, 0x7FFFFFFF] + + # ACPI _BPS. Sent when peak power capability changes. + [[applicationCollection.inputReport]] + + [[applicationCollection.inputReport.logicalCollection]] + usage = ['Battery System', 'Battery Power State'] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Power State Revision'] + logicalValueRange = [1, 1] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Instantaneous Peak Power Level'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Instantaneous Peak Power Period'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Sustainable Peak Power Level'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.inputReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Sustainable Peak Power Period'] + logicalValueRange = [0, 0x7FFFFFFF] + + # ACPI _BPT. Set then Get the report to obtain Operation Status. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Power Threshold'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Power Threshold Revision'] + logicalValueRange = [1, 1] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Power Threshold Identifier'] + logicalValueRange = [0, 2] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Power Threshold Value'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Operation Status'] + logicalValueRange = [0, 5] + + # ACPI _BTP and _BTH. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Capacity Trip Point'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Capacity Trip Point'] + logicalValueRange = [0, 0x7FFFFFFF] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Thermal Control'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Thermal Throttle Limit'] + logicalValueRange = [0, 100] + + # ACPI Control Method Battery _OSC capability exchange. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Battery Capability Negotiation'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Host Capability Flags'] + logicalValueRange = [0, 7] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Device Capability Flags'] + logicalValueRange = [0, 7] + + # ACPI _PCL represented as a NUL-separated UTF-8 list of stable identifiers. + [[applicationCollection.featureReport]] + + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Battery System', 'Power Consumer List'] + + [[applicationCollection.featureReport.logicalCollection.variableItem]] + usage = ['Battery System', 'Power Consumer Identifiers'] + count = 256 + logicalValueRange = [0, 255] + reportFlags = ['bufferedBytes'] diff --git a/docs/src/specs/ec_interface/hid/hid-tad.wara b/docs/src/specs/ec_interface/hid/hid-tad.wara new file mode 100644 index 0000000..e75f7b9 --- /dev/null +++ b/docs/src/specs/ec_interface/hid/hid-tad.wara @@ -0,0 +1,511 @@ +# Authored with Waratah: https://github.com/microsoft/hidtools +# ---------------------------------------------------------------------------- +[[usagePage]] +id = 0x01 +name = "Generic Desktop" + +[[usagePage.usage]] +id = 0x14 +name = "System Wake Timer" +types = ['CA'] + +[[usagePage.usage]] +id = 0x15 +name = "System Real Time Clock" +types = ['CA'] + +[[usagePage.usage]] +id = 0xF0 +name = "Timer Expiration: External Power" +types = ['DV'] + +[[usagePage.usage]] +id = 0xF1 +name = "Timer Expiration: Internal Power" +types = ['DV'] + +[[usagePage.usage]] +id = 0xF2 +name = "Power Source Change Minimum Expiration" +types = ['DV'] + +[[usagePage.usage]] +id = 0xF3 +name = "Lowest System Wakeable Power State" +types = ['NAry'] + +[[usagePage.usage]] +id = 0xF4 +name = "S1" +types = ['Sel'] + +[[usagePage.usage]] +id = 0xF5 +name = "S2" +types = ['Sel'] + +[[usagePage.usage]] +id = 0xF6 +name = "S3" +types = ['Sel'] + +[[usagePage.usage]] +id = 0xF7 +name = "S4" +types = ['Sel'] + +[[usagePage.usage]] +id = 0xF8 +name = "S5" +types = ['Sel'] + +[[usagePage]] +id = 0x06 +name = "Generic Device Controls" + +[[usagePage.usage]] +id = 0x50 +name = "Vendor Current State" +types = ['DV'] + +[[usagePage.usage]] +id = 0x51 +name = "Current State" +types = ['NAry'] + +[[usagePage.usage]] +id = 0x52 +name = "Cleared" +types = ['Sel'] + +[[usagePage.usage]] +id = 0x53 +name = "Failed" +types = ['Sel'] + +[[usagePage.usage]] +id = 0x54 +name = "Running" +types = ['Sel'] + +[[usagePage.usage]] +id = 0x55 +name = "Expired" +types = ['Sel'] + +[[usagePage.usage]] +id = 0x56 +name = "Signaled" +types = ['Sel'] + +[[usagePage]] +id = 0x13 +name = "Time and Date" + +[[usagePage.usage]] +id = 0x1 +name = "Year" +types = ['DV'] + +[[usagePage.usage]] +id = 0x2 +name = "Month" +types = ['DV'] + +[[usagePage.usage]] +id = 0x3 +name = "Day" +types = ['DV'] + +[[usagePage.usage]] +id = 0x4 +name = "Hour" +types = ['DV'] + +[[usagePage.usage]] +id = 0x5 +name = "Minute" +types = ['DV'] + +[[usagePage.usage]] +id = 0x6 +name = "Second" +types = ['DV'] + +[[usagePage.usage]] +id = 0x7 +name = "Millisecond" +types = ['DV'] + +[[usagePage.usage]] +id = 0x10 +name = "Time Zone Offset From UTC" +types = ['DV'] + +[[usagePage.usage]] +id = 0x11 +name = "Daylight Savings Time Observed" +types = ['DF'] + +[[usagePage.usage]] +id = 0x12 +name = "Daylight Savings Time Active" +types = ['DF'] + +[[applicationCollection]] +usage = ['Generic Desktop', 'System Wake Timer'] + [[applicationCollection.featureReport]] + id = 1 + + # Indicate the lowest power-state of the system that this timer may trigger a wake. + # If system goes to a lower power-state, regardless of timer settings, will NOT trigger a wake. + [[applicationCollection.featureReport.logicalCollection]] + usage = ['Generic Desktop', 'Lowest System Wakeable Power State'] + + [[applicationCollection.featureReport.logicalCollection.arrayItem]] + usageRange = ['Generic Desktop', 'S3', 'S5'] + reportFlags = ['constant'] + + [[applicationCollection.outputReport]] + id = 1 + # Configures the Wake-Timer. + # Null values (e.g. 0) clears the timer configuration. + [[applicationCollection.outputReport.variableItem]] + usage = ['Generic Desktop', 'Timer Expiration: External Power'] + logicalValueRange = [1, 2147483647] + unit = 'second' + reportFlags = ['nullstate'] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Generic Desktop', 'Timer Expiration: Internal Power'] + logicalValueRange = [1, 2147483647] + unit = 'second' + reportFlags = ['nullstate'] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Generic Desktop', 'Power Source Change Minimum Expiration'] + logicalValueRange = [5, 10] + unit = 'second' + reportFlags = ['nullstate'] + + [[applicationCollection.inputReport]] + id = 1 + + # Null values (e.g. 0) indicates the configuration has not been set. + [[applicationCollection.inputReport.variableItem]] + usage = ['Generic Desktop', 'Timer Expiration: External Power'] + logicalValueRange = [1, 2147483647] + unit = 'second' + reportFlags = ['nullstate'] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Generic Desktop', 'Timer Expiration: Internal Power'] + logicalValueRange = [1, 2147483647] + unit = 'second' + reportFlags = ['nullstate'] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Generic Desktop', 'Power Source Change Minimum Expiration'] + logicalValueRange = [5, 10] + unit = 'second' + reportFlags = ['nullstate'] + + [[applicationCollection.inputReport.logicalCollection]] + usage = ['Generic Device Controls', 'Current State'] + + [[applicationCollection.inputReport.logicalCollection.arrayItem]] + usages = [ ['Generic Device Controls', 'Cleared'], + ['Generic Device Controls', 'Failed'], + ['Generic Device Controls', 'Expired'], + ['Generic Device Controls', 'Signaled'], + ['Generic Device Controls', 'Running']] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Generic Device Controls', 'Vendor Current State'] + sizeInBits = 4 + logicalValueRange = 'maxUnsignedSizeRange' + +[[applicationCollection]] +usage = ['Generic Desktop', 'System Real Time Clock'] + + [[applicationCollection.outputReport]] + id = 3 + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Year'] + logicalValueRange = [1900,9999] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Month'] + logicalValueRange = [1,12] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Day'] + logicalValueRange = [1,31] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Hour'] + logicalValueRange = [0,23] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Minute'] + logicalValueRange = [0,59] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Second'] + logicalValueRange = [0,59] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Millisecond'] + logicalValueRange = [0,999] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Time Zone Offset From UTC'] + logicalValueRange = [-720, 840] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Daylight Savings Time Observed'] + logicalValueRange = [0,1] + + [[applicationCollection.outputReport.variableItem]] + usage = ['Time and Date', 'Daylight Savings Time Active'] + logicalValueRange = [0,1] + + [[applicationCollection.inputReport]] + id = 3 + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Year'] + logicalValueRange = [1900,9999] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Month'] + logicalValueRange = [1,12] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Day'] + logicalValueRange = [1,31] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Hour'] + logicalValueRange = [0,23] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Minute'] + logicalValueRange = [0,59] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Second'] + logicalValueRange = [0,59] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Millisecond'] + logicalValueRange = [0,999] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Time Zone Offset From UTC'] + logicalValueRange = [-720, 840] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Daylight Savings Time Observed'] + logicalValueRange = [0,1] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Time and Date', 'Daylight Savings Time Active'] + logicalValueRange = [0,1] + + [[applicationCollection.inputReport.logicalCollection]] + usage = ['Generic Device Controls', 'Current State'] + + [[applicationCollection.inputReport.logicalCollection.arrayItem]] + usages = [ ['Generic Device Controls', 'Failed'], + ['Generic Device Controls', 'Running']] + + [[applicationCollection.inputReport.variableItem]] + usage = ['Generic Device Controls', 'Vendor Current State'] + sizeInBits = 4 + logicalValueRange = 'maxUnsignedSizeRange' + +# **Sample descriptor:** +# 0x05, 0x01, // UsagePage(Generic Desktop[0x0001]) +# 0x09, 0x14, // UsageId(System Wake Timer[0x0014]) +# 0xA1, 0x01, // Collection(Application) +# 0x85, 0x01, // ReportId(1) +# 0x09, 0xF3, // UsageId(Lowest System Wakeable Power State[0x00F3]) +# 0xA1, 0x02, // Collection(Logical) +# 0x19, 0xF6, // UsageIdMin(S3[0x00F6]) +# 0x29, 0xF8, // UsageIdMax(S5[0x00F8]) +# 0x15, 0x01, // LogicalMinimum(1) +# 0x25, 0x03, // LogicalMaximum(3) +# 0x95, 0x01, // ReportCount(1) +# 0x75, 0x02, // ReportSize(2) +# 0xB1, 0x01, // Feature(Constant, Array, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0xC0, // EndCollection() +# 0x75, 0x06, // ReportSize(6) +# 0xB1, 0x03, // Feature(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0xF0, // UsageId(Timer Expiration: External Power[0x00F0]) +# 0x66, 0x01, 0x10, // Unit('second', SiLinear, Seconds:1) +# 0x27, 0xFF, 0xFF, 0xFF, 0x7F, // LogicalMaximum(2,147,483,647) +# 0x75, 0x1F, // ReportSize(31) +# 0x91, 0x42, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NullState, NonVolatile, BitField) +# 0x75, 0x01, // ReportSize(1) +# 0x91, 0x03, // Output(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0xF1, // UsageId(Timer Expiration: Internal Power[0x00F1]) +# 0x75, 0x1F, // ReportSize(31) +# 0x91, 0x42, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NullState, NonVolatile, BitField) +# 0x09, 0xF2, // UsageId(Power Source Change Minimum Expiration\[0x00F2\]) +# 0x15, 0x05, // LogicalMinimum(5) +# 0x25, 0x0A, // LogicalMaximum(10) +# 0x75, 0x04, // ReportSize(4) +# 0x91, 0x42, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NullState, NonVolatile, BitField) +# 0x75, 0x05, // ReportSize(5) +# 0x91, 0x03, // Output(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0xF0, // UsageId(Timer Expiration: External Power\[0x00F0\]) +# 0x15, 0x01, // LogicalMinimum(1) +# 0x27, 0xFF, 0xFF, 0xFF, 0x7F, // LogicalMaximum(2,147,483,647) +# 0x75, 0x1F, // ReportSize(31) +# 0x81, 0x42, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NullState, BitField) +# 0x75, 0x01, // ReportSize(1) +# 0x81, 0x03, // Input(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0xF1, // UsageId(Timer Expiration: Internal Power\[0x00F1\]) +# 0x75, 0x1F, // ReportSize(31) +# 0x81, 0x42, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NullState, BitField) +# 0x75, 0x01, // ReportSize(1) +# 0x81, 0x03, // Input(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x85, 0x02, // ReportId(2) +# 0x09, 0xF2, // UsageId(Power Source Change Minimum Expiration\[0x00F2\]) +# 0x15, 0x05, // LogicalMinimum(5) +# 0x25, 0x0A, // LogicalMaximum(10) +# 0x75, 0x04, // ReportSize(4) +# 0x91, 0x42, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NullState, NonVolatile, BitField) +# 0x91, 0x03, // Output(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x05, 0x06, // UsagePage(Generic Device Controls\[0x0006\]) +# 0x09, 0x51, // UsageId(Current State\[0x0051\]) +# 0xA1, 0x02, // Collection(Logical) +# 0x09, 0x52, // UsageId(Cleared\[0x0052\]) +# 0x09, 0x53, // UsageId(Failed\[0x0053\]) +# 0x09, 0x55, // UsageId(Expired\[0x0055\]) +# 0x09, 0x56, // UsageId(Signaled\[0x0056\]) +# 0x09, 0x54, // UsageId(Running\[0x0054\]) +# 0x15, 0x01, // LogicalMinimum(1) +# 0x25, 0x05, // LogicalMaximum(5) +# 0x75, 0x03, // ReportSize(3) +# 0x81, 0x00, // Input(Data, Array, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0xC0, // EndCollection() +# 0x09, 0x50, // UsageId(Vendor Current State\[0x0050\]) +# 0x65, 0x00, // Unit(None) +# 0x15, 0x00, // LogicalMinimum(0) +# 0x25, 0x0F, // LogicalMaximum(15) +# 0x75, 0x04, // ReportSize(4) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x75, 0x01, // ReportSize(1) +# 0x81, 0x03, // Input(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0xC0, // EndCollection() +# 0x05, 0x01, // UsagePage(Generic Desktop\[0x0001\]) +# 0x09, 0x15, // UsageId(System Real Time Clock\[0x0015\]) +# 0xA1, 0x01, // Collection(Application) +# 0x85, 0x03, // ReportId(3) +# 0x05, 0x13, // UsagePage(Time and Date\[0x0013\]) +# 0x09, 0x01, // UsageId(Year\[0x0001\]) +# 0x16, 0x6C, 0x07, // LogicalMinimum(1,900) +# 0x26, 0x0F, 0x27, // LogicalMaximum(9,999) +# 0x75, 0x0E, // ReportSize(14) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x02, // UsageId(Month\[0x0002\]) +# 0x15, 0x01, // LogicalMinimum(1) +# 0x25, 0x0C, // LogicalMaximum(12) +# 0x75, 0x04, // ReportSize(4) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x03, // UsageId(Day\[0x0003\]) +# 0x25, 0x1F, // LogicalMaximum(31) +# 0x75, 0x05, // ReportSize(5) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x04, // UsageId(Hour\[0x0004\]) +# 0x15, 0x00, // LogicalMinimum(0) +# 0x25, 0x17, // LogicalMaximum(23) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x05, // UsageId(Minute\[0x0005\]) +# 0x09, 0x06, // UsageId(Second\[0x0006\]) +# 0x25, 0x3B, // LogicalMaximum(59) +# 0x95, 0x02, // ReportCount(2) +# 0x75, 0x06, // ReportSize(6) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x07, // UsageId(Millisecond\[0x0007\]) +# 0x26, 0xE7, 0x03, // LogicalMaximum(999) +# 0x95, 0x01, // ReportCount(1) +# 0x75, 0x0A, // ReportSize(10) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x10, // UsageId(Time Zone Offset From UTC\[0x0010\]) +# 0x16, 0x30, 0xFD, // LogicalMinimum(-720) +# 0x26, 0x48, 0x03, // LogicalMaximum(840) +# 0x75, 0x0B, // ReportSize(11) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x11, // UsageId(Daylight Savings Time Observed\[0x0011\]) +# 0x09, 0x12, // UsageId(Daylight Savings Time Active\[0x0012\]) +# 0x15, 0x00, // LogicalMinimum(0) +# 0x25, 0x01, // LogicalMaximum(1) +# 0x95, 0x02, // ReportCount(2) +# 0x75, 0x01, // ReportSize(1) +# 0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x95, 0x01, // ReportCount(1) +# 0x91, 0x03, // Output(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField) +# 0x09, 0x01, // UsageId(Year\[0x0001\]) +# 0x16, 0x6C, 0x07, // LogicalMinimum(1,900) +# 0x26, 0x0F, 0x27, // LogicalMaximum(9,999) +# 0x75, 0x0E, // ReportSize(14) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x02, // UsageId(Month\[0x0002\]) +# 0x15, 0x01, // LogicalMinimum(1) +# 0x25, 0x0C, // LogicalMaximum(12) +# 0x75, 0x04, // ReportSize(4) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x03, // UsageId(Day\[0x0003\]) +# 0x25, 0x1F, // LogicalMaximum(31) +# 0x75, 0x05, // ReportSize(5) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x04, // UsageId(Hour\[0x0004\]) +# 0x15, 0x00, // LogicalMinimum(0) +# 0x25, 0x17, // LogicalMaximum(23) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x05, // UsageId(Minute\[0x0005\]) +# 0x09, 0x06, // UsageId(Second\[0x0006\]) +# 0x25, 0x3B, // LogicalMaximum(59) +# 0x95, 0x02, // ReportCount(2) +# 0x75, 0x06, // ReportSize(6) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x07, // UsageId(Millisecond\[0x0007\]) +# 0x26, 0xE7, 0x03, // LogicalMaximum(999) +# 0x95, 0x01, // ReportCount(1) +# 0x75, 0x0A, // ReportSize(10) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x10, // UsageId(Time Zone Offset From UTC\[0x0010\]) +# 0x16, 0x30, 0xFD, // LogicalMinimum(-720) +# 0x26, 0x48, 0x03, // LogicalMaximum(840) +# 0x75, 0x0B, // ReportSize(11) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x09, 0x11, // UsageId(Daylight Savings Time Observed\[0x0011\]) +# 0x09, 0x12, // UsageId(Daylight Savings Time Active\[0x0012\]) +# 0x15, 0x00, // LogicalMinimum(0) +# 0x25, 0x01, // LogicalMaximum(1) +# 0x95, 0x02, // ReportCount(2) +# 0x75, 0x01, // ReportSize(1) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x05, 0x06, // UsagePage(Generic Device Controls\[0x0006\]) +# 0x09, 0x51, // UsageId(Current State\[0x0051\]) +# 0xA1, 0x02, // Collection(Logical) +# 0x09, 0x53, // UsageId(Failed\[0x0053\]) +# 0x09, 0x54, // UsageId(Running\[0x0054\]) +# 0x15, 0x01, // LogicalMinimum(1) +# 0x25, 0x02, // LogicalMaximum(2) +# 0x95, 0x01, // ReportCount(1) +# 0x75, 0x02, // ReportSize(2) +# 0x81, 0x00, // Input(Data, Array, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0xC0, // EndCollection() +# 0x09, 0x50, // UsageId(Vendor Current State\[0x0050\]) +# 0x15, 0x00, // LogicalMinimum(0) +# 0x25, 0x0F, // LogicalMaximum(15) +# 0x75, 0x04, // ReportSize(4) +# 0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0x75, 0x03, // ReportSize(3) +# 0x81, 0x03, // Input(Constant, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField) +# 0xC0, // EndCollection() diff --git a/docs/src/specs/ec_interface/legacy-ec-interface.md b/docs/src/specs/ec_interface/legacy/README.md similarity index 100% rename from docs/src/specs/ec_interface/legacy-ec-interface.md rename to docs/src/specs/ec_interface/legacy/README.md diff --git a/docs/src/specs/ec_interface/media/odp_arch.png b/docs/src/specs/ec_interface/media/odp_arch.png deleted file mode 100644 index 9e65c04..0000000 Binary files a/docs/src/specs/ec_interface/media/odp_arch.png and /dev/null differ