[PATCH] schemas: clock: Add critical-clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some platforms require clock to be always running, e.g. because those clock
supply devices which are not otherwise attached to the system. One example
is a system where the SoC serves as a crystal oscillator replacement for a
programmable logic device. The critical-clock property of a clock controller
allows listing clock which must never be turned off.

```
clock-controller@a000f000 {
     compatible = "vendor,clk95;
     reg = <0xa000f000 0x1000>
     #clocks-cells = <1>;
     ...
     critical-clocks = <UART3_CLK>, <SPI5_CLK>;
};
```

Signed-off-by: Marek Vasut <marex@xxxxxxx>
Cc: Rob Herring <robh+dt@xxxxxxxxxx>
Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
Cc: linux-clk@xxxxxxxxxxxxxxx
To: devicetree@xxxxxxxxxxxxxxx
---
 dtschema/lib.py                   | 2 ++
 dtschema/meta-schemas/clocks.yaml | 3 +++
 dtschema/schemas/clock/clock.yaml | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/dtschema/lib.py b/dtschema/lib.py
index eada062..e74b7b9 100644
--- a/dtschema/lib.py
+++ b/dtschema/lib.py
@@ -471,6 +471,8 @@ def fixup_node_props(schema):
         schema['properties']['assigned-clocks'] = True
         schema['properties']['assigned-clock-rates'] = True
         schema['properties']['assigned-clock-parents'] = True
+    if "clocks" in keys and "critical-clocks" not in keys:
+        schema['properties']['critical-clocks'] = True
     if "clocks" in keys and "protected-clocks" not in keys:
         schema['properties']['protected-clocks'] = True
 
diff --git a/dtschema/meta-schemas/clocks.yaml b/dtschema/meta-schemas/clocks.yaml
index 9057a4f..1074f36 100644
--- a/dtschema/meta-schemas/clocks.yaml
+++ b/dtschema/meta-schemas/clocks.yaml
@@ -21,6 +21,8 @@ properties:
     $ref: "cell.yaml#/array"
   assigned-clock-rates:
     $ref: "cell.yaml#/array"
+  critical-clocks:
+    $ref: "cell.yaml#/array"
   protected-clocks:
     $ref: "cell.yaml#/array"
 
@@ -37,4 +39,5 @@ dependentRequired:
   assigned-clocks: [clocks]
   assigned-clock-parents: [assigned-clocks]
   assigned-clock-rates: [assigned-clocks]
+  critical-clocks: [clocks]
   protected-clocks: [clocks]
diff --git a/dtschema/schemas/clock/clock.yaml b/dtschema/schemas/clock/clock.yaml
index 6e0f9d0..7dbace4 100644
--- a/dtschema/schemas/clock/clock.yaml
+++ b/dtschema/schemas/clock/clock.yaml
@@ -89,6 +89,8 @@ properties:
     $ref: "/schemas/types.yaml#/definitions/phandle-array"
   assigned-clock-rates:
     $ref: "/schemas/types.yaml#/definitions/uint32-array"
+  critical-clocks:
+    $ref: "/schemas/types.yaml#/definitions/phandle-array"
   protected-clocks:
     $ref: "/schemas/types.yaml#/definitions/phandle-array"
 
@@ -100,6 +102,7 @@ dependencies:
   assigned-clocks: [clocks]
   assigned-clock-parents: [assigned-clocks]
   assigned-clock-rates: [assigned-clocks]
+  critical-clocks: [clocks]
   protected-clocks: [clocks]
 
 additionalProperties: true
-- 
2.34.1




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux