Skip to contentSkip to conversation

dt-bindings: misc: fastrpc convert bindings to yaml

PATCH Superseded Abel Vesa 2 participants 3 messages Sep 6, 2022

Subsystems (4)

v11 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

PATCH v11 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.

Use compute-cb@ subnodes instead of just cb@. Add qcom,glink-channels and qcom,smd-channels missing properties to make sure dtbs_check doesn't fail right off the bat. Correct the name of the parent node in the example from smd-edge to glink-edge.

Since now the qcom,fastrpc bindings document is yaml, update the reference to it in qcom,glink-edge and also use $ref.

Also update the MAINTAINERS file to point to the yaml version.

---

Changes since v10:
* addressed all comments from Krzysztof
- removed items where unnecessary
- added maxItems where necessary
- used double quotes for consitency everywhere

 .../devicetree/bindings/misc/qcom,fastrpc.txt |  88 -------------
 .../bindings/misc/qcom,fastrpc.yaml           | 122 ++++++++++++++++++
 .../bindings/remoteproc/qcom,glink-edge.yaml  |   4 +-
 MAINTAINERS                                   |   2 +-
 4 files changed, 125 insertions(+), 91 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 -88
deleted file mode 100644
index 5ec124b138a6..000000000000
@@ -1,88 +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"
-
-- qcom,non-secure-domain:
-	Usage: required
-	Value type: <boolean>
-	Definition: Property to specify that dsp domain is non-secure.
-
-- qcom,vmids:
-	Usage: optional
-	Value type: <u32 array>
-	Definition: Virtual machine IDs for remote processor.
-
-- #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 +122 -0

122 lines not on this page · raw message

Documentation/devicetree/bindings/remoteproc/qcom,glink-edge.yaml +2 -2
index fa69f7b21eed..8953678da83e 100644
@@ -23,9 +23,9 @@ properties:
       Qualcomm APR/GPR (Asynchronous/Generic Packet Router)
 
   fastrpc:
-    type: object
+    $ref: /schemas/misc/qcom,fastrpc.yaml#
     description:
-      See Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
+      Qualcomm FastRPC
 
   interrupts:
     maxItems: 1
MAINTAINERS +1 -1
index 96f47a7865d6..ad697195fc59 100644
@@ -16863,7 +16863,7 @@ M:	Srinivas Kandagatla <[email protected]>
 M:	Amol Maheshwari <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
+F:	Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml
 F:	drivers/misc/fastrpc.c
 F:	include/uapi/misc/fastrpc.h
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 3 lines · Abel Vesa

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

Thank you for your patch. There is something to discuss/improve.

Quoted 14 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +14 -0
+
+patternProperties:
+  "(compute-)?cb@[0-9]*$":
+    type: object
+
+    description: >
+      Each subnode of the Fastrpc represents compute context banks available on the dsp.
+
+    properties:
+      compatible:
+        const: qcom,fastrpc-compute-cb
+
+      reg:
+        maxItems: 1

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

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

I think this was pointed previously by Rob in v4 - you need here
additionalProperties: false (on that level of indentation).

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

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

Best regards,
Krzysztof

author
#2 lore raw
Quoted 26 lines · Krzysztof Kozlowski
Quoted 3 lines · Abel Vesa

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

Thank you for your patch. There is something to discuss/improve.

Quoted 19 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +19 -0
+
+patternProperties:
+  "(compute-)?cb@[0-9]*$":
+    type: object
+
+    description: >
+      Each subnode of the Fastrpc represents compute context banks available on the dsp.
+
+    properties:
+      compatible:
+        const: qcom,fastrpc-compute-cb
+
+      reg:
+        maxItems: 1
+
+      qcom,nsession:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        default: 1
+        description: >
Quoted 8 lines

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

Quoted 5 lines
Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml new file +5 -0
+          A value indicating how many sessions can share this context bank.
+
+    required:
+      - compatible
+      - reg

I think this was pointed previously by Rob in v4 - you need here
additionalProperties: false (on that level of indentation).

Ugh, I thought if the check doesn't complain, it is not necessary to add it as false.

Will resend.

Quoted 12 lines

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

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

Best regards,
Krzysztof