linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: David Heidelberg <david@ixit.cz>
Cc: Andy Gross <agross@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	~okias/devicetree@lists.sr.ht, Alex Elder <elder@linaro.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-binding: soc: qcom: convert QCOM SMP2P binding to yaml
Date: Mon, 31 Jan 2022 15:30:14 -0600	[thread overview]
Message-ID: <YfhU5s8H/3PjEAAc@builder.lan> (raw)
In-Reply-To: <20211218205039.35994-1-david@ixit.cz>

On Sat 18 Dec 14:50 CST 2021, David Heidelberg wrote:

> Convert Qualcomm SoC SMP2P binding to the yaml format.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
>  .../bindings/soc/qcom/qcom,smp2p.txt          | 110 --------------
>  .../bindings/soc/qcom/qcom,smp2p.yaml         | 139 ++++++++++++++++++
>  2 files changed, 139 insertions(+), 110 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt
>  create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt
> deleted file mode 100644
> index 49e1d72d3648..000000000000
> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt
> +++ /dev/null
> @@ -1,110 +0,0 @@
> -Qualcomm Shared Memory Point 2 Point binding
> -
> -The Shared Memory Point to Point (SMP2P) protocol facilitates communication of
> -a single 32-bit value between two processors.  Each value has a single writer
> -(the local side) and a single reader (the remote side).  Values are uniquely
> -identified in the system by the directed edge (local processor ID to remote
> -processor ID) and a string identifier.
> -
> -- compatible:
> -	Usage: required
> -	Value type: <string>
> -	Definition: must be one of:
> -		    "qcom,smp2p"
> -
> -- interrupts:
> -	Usage: required
> -	Value type: <prop-encoded-array>
> -	Definition: one entry specifying the smp2p notification interrupt
> -
> -- mboxes:
> -	Usage: required
> -	Value type: <prop-encoded-array>
> -	Definition: reference to the associated doorbell in APCS, as described
> -		    in mailbox/mailbox.txt
> -
> -- qcom,ipc:
> -	Usage: required, unless mboxes is specified
> -	Value type: <prop-encoded-array>
> -	Definition: three entries specifying the outgoing ipc bit used for
> -		    signaling the remote end of the smp2p edge:
> -		    - phandle to a syscon node representing the apcs registers
> -		    - u32 representing offset to the register within the syscon
> -		    - u32 representing the ipc bit within the register
> -
> -- qcom,smem:
> -	Usage: required
> -	Value type: <u32 array>
> -	Definition: two identifiers of the inbound and outbound smem items used
> -		    for this edge
> -
> -- qcom,local-pid:
> -	Usage: required
> -	Value type: <u32>
> -	Definition: specifies the identifier of the local endpoint of this edge
> -
> -- qcom,remote-pid:
> -	Usage: required
> -	Value type: <u32>
> -	Definition: specifies the identifier of the remote endpoint of this edge
> -
> -= SUBNODES
> -Each SMP2P pair contain a set of inbound and outbound entries, these are
> -described in subnodes of the smp2p device node. The node names are not
> -important.
> -
> -- qcom,entry-name:
> -	Usage: required
> -	Value type: <string>
> -	Definition: specifies the name of this entry, for inbound entries this
> -		    will be used to match against the remotely allocated entry
> -		    and for outbound entries this name is used for allocating
> -		    entries
> -
> -- interrupt-controller:
> -	Usage: required for incoming entries
> -	Value type: <empty>
> -	Definition: marks the entry as inbound; the node should be specified
> -		    as a two cell interrupt-controller as defined in
> -		    "../interrupt-controller/interrupts.txt"
> -		    If not specified this node will denote the outgoing entry
> -
> -- #interrupt-cells:
> -	Usage: required for incoming entries
> -	Value type: <u32>
> -	Definition: must be 2 - denoting the bit in the entry and IRQ flags
> -
> -- #qcom,smem-state-cells:
> -	Usage: required for outgoing entries
> -	Value type: <u32>
> -	Definition: must be 1 - denoting the bit in the entry
> -
> -= EXAMPLE
> -The following example shows the SMP2P setup with the wireless processor,
> -defined from the 8974 apps processor's point-of-view. It encompasses one
> -inbound and one outbound entry:
> -
> -wcnss-smp2p {
> -	compatible = "qcom,smp2p";
> -	qcom,smem = <431>, <451>;
> -
> -	interrupts = <0 143 1>;
> -
> -	qcom,ipc = <&apcs 8 18>;
> -
> -	qcom,local-pid = <0>;
> -	qcom,remote-pid = <4>;
> -
> -	wcnss_smp2p_out: master-kernel {
> -		qcom,entry-name = "master-kernel";
> -
> -		#qcom,smem-state-cells = <1>;
> -	};
> -
> -	wcnss_smp2p_in: slave-kernel {
> -		qcom,entry-name = "slave-kernel";
> -
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml
> new file mode 100644
> index 000000000000..40d1c42e917b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml
> @@ -0,0 +1,139 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/soc/qcom/qcom,smp2p.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Qualcomm Shared Memory Point 2 Point
> +
> +description: |

You may omit the pipe.

> +  The Shared Memory Point to Point (SMP2P) protocol facilitates communication of
> +  a single 32-bit value between two processors.  Each value has a single writer
> +  (the local side) and a single reader (the remote side).  Values are uniquely
> +  identified in the system by the directed edge (local processor ID to remote
> +  processor ID) and a string identifier.
> +
> +maintainers:
> +  - Bjorn Andersson <bjorn.andersson@linaro.org>
> +
> +properties:
> +  compatible:
> +    const: qcom,smp2p
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  mboxes:
> +    description: >
> +      reference to the associated doorbell in APCS, as described
> +      in mailbox/mailbox.txt
> +
> +  qcom,ipc:
> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +    description: >
> +      three entries specifying the outgoing ipc bit used for
> +      signaling the remote end of the smp2p edge
> +    minItems: 1
> +    maxItems: 32 # no hard limit
> +    items:
> +      items:
> +        - description: phandle to a syscon node representing the apcs registers
> +        - description: offset to the register within the syscon
> +        - description: the IPC bit within the register
> +
> +  qcom,smem:
> +    $ref: /schemas/types.yaml#/definitions/uint32-matrix
> +    description: indentifiers of the smem items used for this edge
> +    items:
> +      - items:
> +          - description: identifier of inbound smem items
> +      - items:
> +          - description: identifier of outbound smem items
> +
> +  qcom,local-pid:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: specifies the identifier of the local endpoint of this edge
> +
> +  qcom,remote-pid:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: specifies the identifier of the remote endpoint of this edge
> +
> +patternProperties:
> +  "^((master|slave)-kernel|ipa-ap-to-modem|ipa-modem-to-ap|)$":

These are simply the identifiers in "qcom,entry-name" and putting them
in the binding would mean that whenever we have additions (there are
some for e.g. WiFi on newer platforms) we have to update the binding.

So I would prefer if we just skip the constraints on the names of the
child nodes.

Regards,
Bjorn

> +    type: object
> +    properties:
> +      interrupt-controller:
> +        description: >
> +          marks the entry as inbound, if not specified
> +          this node will denote the outgoing entry
> +
> +      '#interrupt-cells':
> +        const: 2
> +
> +      qcom,entry-name:
> +        $ref: /schemas/types.yaml#/definitions/string
> +        description: >
> +          specifies the name of this entry, for inbound entries this will be
> +          used to match against the remotely allocated entry and for outbound
> +          entries this name is used for allocating entries
> +
> +      '#qcom,smem-state-cells':
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: required for outgoing entries
> +        const: 1
> +
> +    required:
> +      - qcom,entry-name
> +
> +    oneOf:
> +      - required:
> +          - interrupt-controller
> +          - '#interrupt-cells'
> +      - required:
> +          - '#qcom,smem-state-cells'
> +
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +  - qcom,smem
> +  - qcom,local-pid
> +  - qcom,remote-pid
> +
> +anyOf:
> +  - required:
> +      - mboxes
> +  - required:
> +      - qcom,ipc
> +
> +additionalProperties: false
> +
> +examples:
> +  # The following example shows the SMP2P setup with the wireless processor,
> +  # defined from the 8974 apps processor's point-of-view. It encompasses one
> +  # inbound and one outbound entry:
> +  - |
> +    wcnss-smp2p {
> +        compatible = "qcom,smp2p";
> +        qcom,smem = <431>, <451>;
> +
> +        interrupts = <0 143 1>;
> +
> +        qcom,ipc = <&apcs 8 18>;
> +
> +        qcom,local-pid = <0>;
> +        qcom,remote-pid = <4>;
> +
> +        wcnss_smp2p_out: master-kernel {
> +            qcom,entry-name = "master-kernel";
> +
> +            #qcom,smem-state-cells = <1>;
> +        };
> +
> +        wcnss_smp2p_in: slave-kernel {
> +            qcom,entry-name = "slave-kernel";
> +
> +            interrupt-controller;
> +            #interrupt-cells = <2>;
> +        };
> +    };
> -- 
> 2.34.1
> 

      parent reply	other threads:[~2022-01-31 21:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18 20:50 [PATCH] dt-binding: soc: qcom: convert QCOM SMP2P binding to yaml David Heidelberg
2021-12-19 21:57 ` Rob Herring
2022-01-31 21:30 ` Bjorn Andersson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YfhU5s8H/3PjEAAc@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=agross@kernel.org \
    --cc=david@ixit.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=~okias/devicetree@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).