This page is a work in progress!
ACPI v6.5 spec. introduced ClockInput resource descriptor to describe clocks required for devices.
ClockInput (FrequencyNumerator, FrequencyDivisor, Scale, FixedMode, ResourceSource, ˓ResourceSourceIndex)
Examples from ACPI spec.
Case 1: Simple clock input descriptor, with a fixed frequency of 33 1/3 MHz and no Device shown as a clock source.
ClockInput (100, 3, MHz, Fixed,,)
Case 2: Clock input descriptor referencing a variable clock input of 19.2 kHz, with a source device and index.
ClockInput (19200, 1, Hz, Variable, “\\_SB.PCI0.CLK4”, 3)
SCMI Clock Driver with ClockInput resources
Device (SCMI) { Name (_HID, "PNP####") ... } Device(I2C) { ... Name(_CLK, 13) // SCMI clock ID for I2C root clock Method (_CRS, 0, NotSerialized) { Name (RBUF, ResourceTemplate () { MEMORY32FIXED(ReadWrite, 0x30A40000, 0x14, ) Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 69 } ClockInput (24, 1, MHz, Variable, “\\_SB.SCMI”, _CLK) }) Return(RBUF) } ... }
ACPI ClockInput resources with variable clock rate would require support from the operating system. Clock drivers and clock framework support will be required from OS.
ClockInput resources with _PRS, SRS, and _CRS
Another approach is to support ClockInput resources from AML without requiring operating system infrastructures.
CLK: Method(GCLK, ...) // Get Clock Rate Method(SCLK, ...) // Set Clock Rate DEV: _PRS: ClockInput(FREQ_1, 1, MHz, Variable, CLK,) ClockInput(FREQ_2, 1, MHz, Variable, CLK, ) ClockInput(FREQ_3, 1, MHz, Variable, CLK, ) _CRS: freq_num, freq_div = CLK.GCLK(...) ClockInput(freq_num, freq_div, ... , Variable, "//SB.CLK", ) _SRS: ... local0 = decode(Arg0) CLK.SCLK(local0)
Challenges
ClockInput resource doesn't have resource names so we cannot index them for modification.
Linux kernel bindings for drivers to select and set _PRS and _SRS seem to be missing.