2022-04-29 17:20:42

by Shubhrajyoti Datta

[permalink] [raw]
Subject: [PATCH v4] dt-bindings: mailbox: zynqmp_ipi: convert to yaml

Convert the ipi doc to yaml.

Signed-off-by: Shubhrajyoti Datta <[email protected]>
---
v2:
Fix the warnings reported by Rob
v3:
Run dtbs_check
v4:
fix the formatting
fix the ranges

.../mailbox/xlnx,zynqmp-ipi-mailbox.txt | 127 ----------------
.../mailbox/xlnx,zynqmp-ipi-mailbox.yaml | 142 ++++++++++++++++++
2 files changed, 142 insertions(+), 127 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
create mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml

diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
deleted file mode 100644
index ad76edccf881..000000000000
--- a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-Xilinx IPI Mailbox Controller
-========================================
-
-The Xilinx IPI(Inter Processor Interrupt) mailbox controller is to manage
-messaging between two Xilinx Zynq UltraScale+ MPSoC IPI agents. Each IPI
-agent owns registers used for notification and buffers for message.
-
- +-------------------------------------+
- | Xilinx ZynqMP IPI Controller |
- +-------------------------------------+
- +--------------------------------------------------+
-ATF | |
- | |
- | |
- +--------------------------+ |
- | |
- | |
- +--------------------------------------------------+
- +------------------------------------------+
- | +----------------+ +----------------+ |
-Hardware | | IPI Agent | | IPI Buffers | |
- | | Registers | | | |
- | | | | | |
- | +----------------+ +----------------+ |
- | |
- | Xilinx IPI Agent Block |
- +------------------------------------------+
-
-
-Controller Device Node:
-===========================
-Required properties:
---------------------
-IPI agent node:
-- compatible: Shall be: "xlnx,zynqmp-ipi-mailbox"
-- interrupt-parent: Phandle for the interrupt controller
-- interrupts: Interrupt information corresponding to the
- interrupt-names property.
-- xlnx,ipi-id: local Xilinx IPI agent ID
-- #address-cells: number of address cells of internal IPI mailbox nodes
-- #size-cells: number of size cells of internal IPI mailbox nodes
-
-Internal IPI mailbox node:
-- reg: IPI buffers address ranges
-- reg-names: Names of the reg resources. It should have:
- * local_request_region
- - IPI request msg buffer written by local and read
- by remote
- * local_response_region
- - IPI response msg buffer written by local and read
- by remote
- * remote_request_region
- - IPI request msg buffer written by remote and read
- by local
- * remote_response_region
- - IPI response msg buffer written by remote and read
- by local
-- #mbox-cells: Shall be 1. It contains:
- * tx(0) or rx(1) channel
-- xlnx,ipi-id: remote Xilinx IPI agent ID of which the mailbox is
- connected to.
-
-Optional properties:
---------------------
-- method: The method of accessing the IPI agent registers.
- Permitted values are: "smc" and "hvc". Default is
- "smc".
-
-Client Device Node:
-===========================
-Required properties:
---------------------
-- mboxes: Standard property to specify a mailbox
- (See ./mailbox.txt)
-- mbox-names: List of identifier strings for each mailbox
- channel.
-
-Example:
-===========================
- zynqmp_ipi {
- compatible = "xlnx,zynqmp-ipi-mailbox";
- interrupt-parent = <&gic>;
- interrupts = <0 29 4>;
- xlnx,ipi-id = <0>;
- #address-cells = <1>;
- #size-cells = <1>;
- ranges;
-
- /* APU<->RPU0 IPI mailbox controller */
- ipi_mailbox_rpu0: mailbox@ff990400 {
- reg = <0xff990400 0x20>,
- <0xff990420 0x20>,
- <0xff990080 0x20>,
- <0xff9900a0 0x20>;
- reg-names = "local_request_region",
- "local_response_region",
- "remote_request_region",
- "remote_response_region";
- #mbox-cells = <1>;
- xlnx,ipi-id = <1>;
- };
- /* APU<->RPU1 IPI mailbox controller */
- ipi_mailbox_rpu1: mailbox@ff990440 {
- reg = <0xff990440 0x20>,
- <0xff990460 0x20>,
- <0xff990280 0x20>,
- <0xff9902a0 0x20>;
- reg-names = "local_request_region",
- "local_response_region",
- "remote_request_region",
- "remote_response_region";
- #mbox-cells = <1>;
- xlnx,ipi-id = <2>;
- };
- };
- rpu0 {
- ...
- mboxes = <&ipi_mailbox_rpu0 0>,
- <&ipi_mailbox_rpu0 1>;
- mbox-names = "tx", "rx";
- };
- rpu1 {
- ...
- mboxes = <&ipi_mailbox_rpu1 0>,
- <&ipi_mailbox_rpu1 1>;
- mbox-names = "tx", "rx";
- };
diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml
new file mode 100644
index 000000000000..46e91828b6b1
--- /dev/null
+++ b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml
@@ -0,0 +1,142 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/mailbox/xlnx,zynqmp-ipi-mailbox.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Xilinx IPI(Inter Processor Interrupt) mailbox controller
+
+description: |
+ The Xilinx IPI(Inter Processor Interrupt) mailbox controller is to manage
+ messaging between two Xilinx Zynq UltraScale+ MPSoC IPI agents. Each IPI
+ agent owns registers used for notification and buffers for message.
+
+ +-------------------------------------+
+ | Xilinx ZynqMP IPI Controller |
+ +-------------------------------------+
+ +--------------------------------------------------+
+ TF-A | |
+ | |
+ | |
+ +--------------------------+ |
+ | |
+ | |
+ +--------------------------------------------------+
+ +------------------------------------------+
+ | +----------------+ +----------------+ |
+ Hardware | | IPI Agent | | IPI Buffers | |
+ | | Registers | | | |
+ | | | | | |
+ | +----------------+ +----------------+ |
+ | |
+ | Xilinx IPI Agent Block |
+ +------------------------------------------+
+
+maintainers:
+ - Shubhrajyoti Datta <[email protected]>
+
+properties:
+ compatible:
+ const: xlnx,zynqmp-ipi-mailbox
+
+ method:
+ description: |
+ The method of calling the PM-API firmware layer.
+ Permitted values are.
+ - "smc" : SMC #0, following the SMCCC
+ - "hvc" : HVC #0, following the SMCCC
+
+ $ref: /schemas/types.yaml#/definitions/string-array
+ enum:
+ - smc
+ - hvc
+ default: smc
+
+ '#address-cells':
+ const: 2
+
+ '#size-cells':
+ const: 2
+
+ xlnx,ipi-id:
+ description: |
+ Remote Xilinx IPI agent ID of which the mailbox is connected to.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ interrupts:
+ maxItems: 1
+
+ ranges: true
+
+additionalProperties: false
+
+required:
+ - compatible
+ - interrupts
+ - '#address-cells'
+ - '#size-cells'
+
+patternProperties:
+ '^mailbox@[0-9a-f]+$':
+ description: Internal ipi mailbox node
+ type: object # DT nodes are json objects
+ properties:
+ xlnx,ipi-id:
+ description:
+ Remote Xilinx IPI agent ID of which the mailbox is connected to.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ "#mbox-cells":
+ const: 1
+ description:
+ It contains tx(0) or rx(1) channel IPI id number.
+
+ reg:
+ maxItems: 4
+
+ reg-names:
+ items:
+ - const: local_request_region
+ - const: local_response_region
+ - const: remote_request_region
+ - const: remote_response_region
+
+
+ required:
+ - reg
+ - "#mbox-cells"
+
+examples:
+ - |
+ amba {
+ #address-cells = <0x2>;
+ #size-cells = <0x2>;
+ zynqmp_ipi {
+ compatible = "xlnx,zynqmp-ipi-mailbox";
+ interrupts = <0 29 4>;
+ xlnx,ipi-id = <0>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ ipi_mailbox_rpu0: mailbox@ff9905c0 {
+ reg = <0x0 0xff9905c0 0x0 0x20>,
+ <0x0 0xff9905e0 0x0 0x20>,
+ <0x0 0xff990e80 0x0 0x20>,
+ <0x0 0xff990ea0 0x0 0x20>;
+ reg-names = "local_request_region",
+ "local_response_region",
+ "remote_request_region",
+ "remote_response_region";
+ #mbox-cells = <1>;
+ xlnx,ipi-id = <4>;
+ };
+ };
+ };
+
+ rpu0 {
+ mboxes = <&ipi_mailbox_rpu0 0>,
+ <&ipi_mailbox_rpu0 1>;
+ mbox-names = "tx", "rx";
+ };
+...
--
2.25.1


2022-05-03 00:36:27

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v4] dt-bindings: mailbox: zynqmp_ipi: convert to yaml

On 28/04/2022 18:50, Shubhrajyoti Datta wrote:
> Convert the ipi doc to yaml.
>
> Signed-off-by: Shubhrajyoti Datta <[email protected]>
> ---
> v2:

(...)

> +maintainers:
> + - Shubhrajyoti Datta <[email protected]>
> +
> +properties:
> + compatible:
> + const: xlnx,zynqmp-ipi-mailbox
> +
> + method:
> + description: |
> + The method of calling the PM-API firmware layer.
> + Permitted values are.
> + - "smc" : SMC #0, following the SMCCC
> + - "hvc" : HVC #0, following the SMCCC

Wrong alignment of entire description.

> +
> + $ref: /schemas/types.yaml#/definitions/string-array

This does not look like string array, but regular string.

> + enum:
> + - smc
> + - hvc
> + default: smc
> +
> + '#address-cells':
> + const: 2
> +
> + '#size-cells':
> + const: 2
> +
> + xlnx,ipi-id:
> + description: |
> + Remote Xilinx IPI agent ID of which the mailbox is connected to.
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + interrupts:
> + maxItems: 1
> +
> + ranges: true
> +
> +additionalProperties: false
> +
> +required:
> + - compatible
> + - interrupts
> + - '#address-cells'
> + - '#size-cells'

Missing required xlnx,ipi-id. Such change was not explained in commit msg.

> +
> +patternProperties:

Put patternProperties just after "properties".

> + '^mailbox@[0-9a-f]+$':
> + description: Internal ipi mailbox node
> + type: object # DT nodes are json objects
> + properties:
> + xlnx,ipi-id:
> + description:
> + Remote Xilinx IPI agent ID of which the mailbox is connected to.
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> + "#mbox-cells":

Wrong quotes. Keep it consistent.

> + const: 1
> + description:
> + It contains tx(0) or rx(1) channel IPI id number.

No need for double space ^^.

> +
> + reg:
> + maxItems: 4
> +
> + reg-names:
> + items:
> + - const: local_request_region
> + - const: local_response_region
> + - const: remote_request_region
> + - const: remote_response_region
> +
> +
> + required:
> + - reg
> + - "#mbox-cells"

Missing required properties.

> +
> +examples:
> + - |
> + amba {
> + #address-cells = <0x2>;
> + #size-cells = <0x2>;
> + zynqmp_ipi {

Generic node names (mailbox?), no underscores in node names.

> + compatible = "xlnx,zynqmp-ipi-mailbox";
> + interrupts = <0 29 4>;

interrupts look like common flags, so use defines.

> + xlnx,ipi-id = <0>;
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + ipi_mailbox_rpu0: mailbox@ff9905c0 {
> + reg = <0x0 0xff9905c0 0x0 0x20>,
> + <0x0 0xff9905e0 0x0 0x20>,
> + <0x0 0xff990e80 0x0 0x20>,
> + <0x0 0xff990ea0 0x0 0x20>;
> + reg-names = "local_request_region",
> + "local_response_region",

These needs alignment with first string.

> + "remote_request_region",
> + "remote_response_region";
> + #mbox-cells = <1>;
> + xlnx,ipi-id = <4>;
> + };
> + };
> + };
> +
> + rpu0 {
> + mboxes = <&ipi_mailbox_rpu0 0>,
> + <&ipi_mailbox_rpu0 1>;
> + mbox-names = "tx", "rx";
> + };

Skip consumer example, it's obvious.

> +...


Best regards,
Krzysztof