Add bindings for a fixed-rate clock that retrieves its rate from an NVMEM provider. This allows to store clock settings in EEPROM or EFUSE or similar device. Component shortages lead to boards being shipped with different clock crystals, based on what was available at the time. The clock frequency was written to EEPROM at production time. Systems can adapt to a wide range of input frequencies using the clock framework, but this required us to patch the devicetree at runtime or use some custom driver. This provides a more generic solution. Signed-off-by: Mike Looijmans <mike.looijmans@xxxxxxxx> --- Changes in v3: Modify fixed-clock instead of introducing nvmem-clock Changes in v2: Changed "fixed-clock" into "nvmem-clock" in dts example Add minItems:1 to nvmem-cell-names .../bindings/clock/fixed-clock.yaml | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/clock/fixed-clock.yaml b/Documentation/devicetree/bindings/clock/fixed-clock.yaml index b0a4fb8256e2..23e4df96d3b0 100644 --- a/Documentation/devicetree/bindings/clock/fixed-clock.yaml +++ b/Documentation/devicetree/bindings/clock/fixed-clock.yaml @@ -12,7 +12,9 @@ maintainers: properties: compatible: - const: fixed-clock + enum: + - fixed-clock + - fixed-clock-nvmem "#clock-cells": const: 0 @@ -33,6 +35,27 @@ required: additionalProperties: false +if: + properties: + compatible: + contains: + const: fixed-clock-nvmem + +then: + properties: + nvmem-cells: + maxItems: 2 + description: + Reads clock-frequency and/or clock-accuracy from an NVMEM provider in + binary native integer format. The size of the NVMEM cell can be 1, 2, 4 + or 8 bytes. If the contents of the nvmem are all zeroes or all 0xff, the + value reverts to the one given in the property. + + nvmem-cell-names: + items: + - const: clock-frequency + - const: clock-accuracy + examples: - | clock { -- 2.17.1 Met vriendelijke groet / kind regards, Mike Looijmans System Expert TOPIC Embedded Products B.V. Materiaalweg 4, 5681 RJ Best The Netherlands T: +31 (0) 499 33 69 69 E: mike.looijmans@xxxxxxxxxxxxxxxxx W: www.topic.nl Please consider the environment before printing this e-mail