devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] schemas: clock: Add protected-clock
@ 2022-02-15  8:39 Marek Vasut
  0 siblings, 0 replies; only message in thread
From: Marek Vasut @ 2022-02-15  8:39 UTC (permalink / raw)
  To: devicetree; +Cc: Marek Vasut, Rob Herring, Stephen Boyd, linux-clk

Some platforms or firmwares may not fully expose all the clocks to the OS, such
as in situations where those clks are used by drivers running in ARM secure
execution levels. Such a configuration can be specified in device tree with the
protected-clocks property in the form of a clock specifier list. This property should
only be specified in the node that is providing the clocks being protected:

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

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
To: devicetree@vger.kernel.org
---
 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 ae5a3bc..eada062 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 "protected-clocks" not in keys:
+        schema['properties']['protected-clocks'] = True
 
 
 def extract_node_compatibles(schema):
diff --git a/dtschema/meta-schemas/clocks.yaml b/dtschema/meta-schemas/clocks.yaml
index facad30..9057a4f 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"
+  protected-clocks:
+    $ref: "cell.yaml#/array"
 
   clock-frequency:
     $ref: "cell.yaml#/single"
@@ -35,3 +37,4 @@ dependentRequired:
   assigned-clocks: [clocks]
   assigned-clock-parents: [assigned-clocks]
   assigned-clock-rates: [assigned-clocks]
+  protected-clocks: [clocks]
diff --git a/dtschema/schemas/clock/clock.yaml b/dtschema/schemas/clock/clock.yaml
index a530f67..6e0f9d0 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"
+  protected-clocks:
+    $ref: "/schemas/types.yaml#/definitions/phandle-array"
 
 dependencies:
   clock-names: [clocks]
@@ -98,5 +100,6 @@ dependencies:
   assigned-clocks: [clocks]
   assigned-clock-parents: [assigned-clocks]
   assigned-clock-rates: [assigned-clocks]
+  protected-clocks: [clocks]
 
 additionalProperties: true
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-15  8:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-15  8:39 [PATCH] schemas: clock: Add protected-clock Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).