Skip to contentSkip to conversation

dt-bindings: misc: fastrpc convert bindings to yaml

PATCH In review David Heidelberg 2 participants 4 messages Dec 8, 2021 – Jan 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 dt-bindings: misc: fastrpc convert bindings to yaml

Convert Qualcomm FastRPC bindings to yaml format, so that we could validate dt-entries correctly and any future additions can go into yaml format.

Also:
- simplify example
- embrace compute-cb@ subnodes instead of just cb@

---
v4:
- combined mine and Srinivas versions of the patch
- previously found issues should be fixed

 .../devicetree/bindings/misc/qcom,fastrpc.txt | 78 ---------------
 .../bindings/misc/qcom,fastrpc.yaml           | 94 +++++++++++++++++++
 2 files changed, 94 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
 create mode 100644 Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml
Documentation/devicetree/bindings/misc/qcom,fastrpc.txt deleted +0 -78
deleted file mode 100644
index 2a1827ab50d2..000000000000
@@ -1,78 +0,0 @@
-Qualcomm Technologies, Inc. FastRPC Driver
-
-The FastRPC implements an IPC (Inter-Processor Communication)
-mechanism that allows for clients to transparently make remote method
-invocations across DSP and APPS boundaries. This enables developers
-to offload tasks to the DSP and free up the application processor for
-other tasks.
-
-- compatible:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "qcom,fastrpc"
-
-- label
-	Usage: required
-	Value type: <string>
-	Definition: should specify the dsp domain name this fastrpc
-	corresponds to. must be one of this: "adsp", "mdsp", "sdsp", "cdsp"
-
-- #address-cells
-	Usage: required
-	Value type: <u32>
-	Definition: Must be 1
-
-- #size-cells
-	Usage: required
-	Value type: <u32>
-	Definition: Must be 0
-
-= COMPUTE BANKS
-Each subnode of the Fastrpc represents compute context banks available
-on the dsp.
-- All Compute context banks MUST contain the following properties:
-
-- compatible:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "qcom,fastrpc-compute-cb"
-
-- reg
-	Usage: required
-	Value type: <u32>
-	Definition: Context Bank ID.
-
-- qcom,nsessions:
-	Usage: Optional
-	Value type: <u32>
-	Defination: A value indicating how many sessions can share this
-		    context bank. Defaults to 1 when this property
-		    is not specified.
-
-Example:
-
-adsp-pil {
-	compatible = "qcom,msm8996-adsp-pil";
-	...
-	smd-edge {
-		label = "lpass";
-		fastrpc {
-			compatible = "qcom,fastrpc";
-			qcom,smd-channels = "fastrpcsmd-apps-dsp";
-			label = "adsp";
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			cb@1 {
-				compatible = "qcom,fastrpc-compute-cb";
-				reg = <1>;
-			};
-
-			cb@2 {
-				compatible = "qcom,fastrpc-compute-cb";
-				reg = <2>;
-			};
-			...
-		};
-	};
-};
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +94 -0

94 lines not on this page · raw message

Signature · 1 line
2.33.0
maintainer
#1 lore raw
Quoted 163 lines · David Heidelberg

Convert Qualcomm FastRPC bindings to yaml format, so that we could validate dt-entries correctly and any future additions can go into yaml format.

Also:
- simplify example
- embrace compute-cb@ subnodes instead of just cb@

---
v4:
- combined mine and Srinivas versions of the patch
- previously found issues should be fixed

 .../devicetree/bindings/misc/qcom,fastrpc.txt | 78 ---------------
 .../bindings/misc/qcom,fastrpc.yaml           | 94 +++++++++++++++++++
 2 files changed, 94 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
 create mode 100644 Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml
Documentation/devicetree/bindings/misc/qcom,fastrpc.txt deleted +0 -78
deleted file mode 100644
index 2a1827ab50d2..000000000000
@@ -1,78 +0,0 @@
-Qualcomm Technologies, Inc. FastRPC Driver
-
-The FastRPC implements an IPC (Inter-Processor Communication)
-mechanism that allows for clients to transparently make remote method
-invocations across DSP and APPS boundaries. This enables developers
-to offload tasks to the DSP and free up the application processor for
-other tasks.
-
-- compatible:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "qcom,fastrpc"
-
-- label
-	Usage: required
-	Value type: <string>
-	Definition: should specify the dsp domain name this fastrpc
-	corresponds to. must be one of this: "adsp", "mdsp", "sdsp", "cdsp"
-
-- #address-cells
-	Usage: required
-	Value type: <u32>
-	Definition: Must be 1
-
-- #size-cells
-	Usage: required
-	Value type: <u32>
-	Definition: Must be 0
-
-= COMPUTE BANKS
-Each subnode of the Fastrpc represents compute context banks available
-on the dsp.
-- All Compute context banks MUST contain the following properties:
-
-- compatible:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "qcom,fastrpc-compute-cb"
-
-- reg
-	Usage: required
-	Value type: <u32>
-	Definition: Context Bank ID.
-
-- qcom,nsessions:
-	Usage: Optional
-	Value type: <u32>
-	Defination: A value indicating how many sessions can share this
-		    context bank. Defaults to 1 when this property
-		    is not specified.
-
-Example:
-
-adsp-pil {
-	compatible = "qcom,msm8996-adsp-pil";
-	...
-	smd-edge {
-		label = "lpass";
-		fastrpc {
-			compatible = "qcom,fastrpc";
-			qcom,smd-channels = "fastrpcsmd-apps-dsp";
-			label = "adsp";
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			cb@1 {
-				compatible = "qcom,fastrpc-compute-cb";
-				reg = <1>;
-			};
-
-			cb@2 {
-				compatible = "qcom,fastrpc-compute-cb";
-				reg = <2>;
-			};
-			...
-		};
-	};
-};
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +53 -0
new file mode 100644
index 000000000000..f42ab208a7fc
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/misc/qcom,fastrpc.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Qualcomm FastRPC Driver
+
+maintainers:
+  - Srinivas Kandagatla <[email protected]>
+
+description: |
+  The FastRPC implements an IPC (Inter-Processor Communication)
+  mechanism that allows for clients to transparently make remote method
+  invocations across DSP and APPS boundaries. This enables developers
+  to offload tasks to the DSP and free up the application processor for
+  other tasks.
+
+properties:
+  compatible:
+    items:
+      - const: qcom,fastrpc
+
+  label:
+    items:
+      enum:
+        - adsp
+        - mdsp
+        - sdsp
+        - cdsp
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  "(compute-)?cb@[0-9]$":
+    type: object
+
+    description: >
+      Each subnode of the Fastrpc represents compute context banks available on the dsp.
+
+    properties:
+      compatible:
+        items:
+          - const: qcom,fastrpc-compute-cb
+
+      reg:
+        maxItems: 1
+
+      qcom,nsession:

Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml line 63

Quoted 10 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +10 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        default: 1
+        description: >
+          A value indicating how many sessions can share this context bank.
+
+    required:
+      - compatible
+      - reg
+
+    additionalProperties: true

Why? What other properties are present.

Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml line 71

Quoted 8 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +8 -0
+
+required:
+  - compatible
+  - label
+  - '#address-cells'
+  - '#size-cells'
+
+additionalProperties: true

Why? What other properties are present. This is generally never correct.

Rob

#2 lore raw

Well, since this is a subnode, some nodes are not converted yet and at least know it'll bash about iommus, qcom,glink-channels and qcom,smd-channels. I can change it to false, bit it'll print these additional warnings, until other binding don't get converted.

David

Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml line 63

Quoted 5 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +5 -0
+    required:
+      - compatible
+      - reg
+
+    additionalProperties: true

Why? What other properties are present.

Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml line 71

Quoted 8 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +8 -0
+
+required:
+  - compatible
+  - label
+  - '#address-cells'
+  - '#size-cells'
+
+additionalProperties: true

Why? What other properties are present. This is generally never correct.

Rob

#3 lore raw

Should I pick different approach or keeping additionalProperties: true is suitable solution in this situation?

Thanks
David Heidelberg

Quoted 26 lines · David Heidelberg

Well, since this is a subnode, some nodes are not converted yet and at least know it'll bash about iommus, qcom,glink-channels and qcom,smd-channels. I can change it to false, bit it'll print these additional warnings, until other binding don't get converted.

David

Quoted 5 lines

+ required:
+ - compatible
+ - reg
+
+ additionalProperties: true

Why? What other properties are present.

Quoted 8 lines

+
+required:

 +  - compatible
 +  - label
 +  - '#address-cells'
 +  - '#size-cells'

+
+additionalProperties: true

Why? What other properties are present. This is generally never correct.

Rob