diff mbox series

[net-next,v2,3/4] dt-bindings: net: Add schema for Qualcomm BAM-DMUX

Message ID 20211011141733.3999-4-stephan@gerhold.net (mailing list archive)
State Superseded
Headers show
Series net: wwan: Add Qualcomm BAM-DMUX WWAN network driver | expand

Commit Message

Stephan Gerhold Oct. 11, 2021, 2:17 p.m. UTC
The BAM Data Multiplexer provides access to the network data channels of
modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or
MSM8974. It is built using a simple protocol layer on top of a DMA engine
(Qualcomm BAM) and bidirectional interrupts to coordinate power control.

The device tree node combines the incoming interrupt with the outgoing
interrupts (smem-states) as well as the two DMA channels, which allows
the BAM-DMUX driver to request all necessary resources.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
Changes since RFC: None.
---
 .../bindings/net/qcom,bam-dmux.yaml           | 87 +++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml

Comments

Rob Herring (Arm) Oct. 18, 2021, 8:22 p.m. UTC | #1
On Mon, Oct 11, 2021 at 04:17:35PM +0200, Stephan Gerhold wrote:
> The BAM Data Multiplexer provides access to the network data channels of
> modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or
> MSM8974. It is built using a simple protocol layer on top of a DMA engine
> (Qualcomm BAM) and bidirectional interrupts to coordinate power control.
> 
> The device tree node combines the incoming interrupt with the outgoing
> interrupts (smem-states) as well as the two DMA channels, which allows
> the BAM-DMUX driver to request all necessary resources.
> 
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> Changes since RFC: None.
> ---
>  .../bindings/net/qcom,bam-dmux.yaml           | 87 +++++++++++++++++++
>  1 file changed, 87 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> new file mode 100644
> index 000000000000..33e125e70cb4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> @@ -0,0 +1,87 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/qcom,bam-dmux.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm BAM Data Multiplexer
> +
> +maintainers:
> +  - Stephan Gerhold <stephan@gerhold.net>
> +
> +description: |
> +  The BAM Data Multiplexer provides access to the network data channels
> +  of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916
> +  or MSM8974. It is built using a simple protocol layer on top of a DMA engine
> +  (Qualcomm BAM DMA) and bidirectional interrupts to coordinate power control.
> +
> +properties:
> +  compatible:
> +    const: qcom,bam-dmux

Is this block the same on every SoC? It needs to be SoC specific.

> +
> +  interrupts:
> +    description:
> +      Interrupts used by the modem to signal the AP.
> +      Both interrupts must be declared as IRQ_TYPE_EDGE_BOTH.
> +    items:
> +      - description: Power control
> +      - description: Power control acknowledgment
> +
> +  interrupt-names:
> +    items:
> +      - const: pc
> +      - const: pc-ack
> +
> +  qcom,smem-states:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description: State bits used by the AP to signal the modem.
> +    items:
> +      - description: Power control
> +      - description: Power control acknowledgment
> +
> +  qcom,smem-state-names:
> +    description: Names for the state bits used by the AP to signal the modem.
> +    items:
> +      - const: pc
> +      - const: pc-ack
> +
> +  dmas:
> +    items:
> +      - description: TX DMA channel phandle
> +      - description: RX DMA channel phandle
> +
> +  dma-names:
> +    items:
> +      - const: tx
> +      - const: rx
> +
> +required:
> +  - compatible
> +  - interrupts
> +  - interrupt-names
> +  - qcom,smem-states
> +  - qcom,smem-state-names
> +  - dmas
> +  - dma-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    mpss: remoteproc {
> +        bam-dmux {
> +            compatible = "qcom,bam-dmux";
> +
> +            interrupt-parent = <&modem_smsm>;
> +            interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>;
> +            interrupt-names = "pc", "pc-ack";
> +
> +            qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>;
> +            qcom,smem-state-names = "pc", "pc-ack";
> +
> +            dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>;
> +            dma-names = "tx", "rx";
> +        };
> +    };
> -- 
> 2.33.0
> 
>
Stephan Gerhold Oct. 19, 2021, 7:03 a.m. UTC | #2
On Mon, Oct 18, 2021 at 03:22:25PM -0500, Rob Herring wrote:
> On Mon, Oct 11, 2021 at 04:17:35PM +0200, Stephan Gerhold wrote:
> > The BAM Data Multiplexer provides access to the network data channels of
> > modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or
> > MSM8974. It is built using a simple protocol layer on top of a DMA engine
> > (Qualcomm BAM) and bidirectional interrupts to coordinate power control.
> > 
> > The device tree node combines the incoming interrupt with the outgoing
> > interrupts (smem-states) as well as the two DMA channels, which allows
> > the BAM-DMUX driver to request all necessary resources.
> > 
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> > Changes since RFC: None.
> > ---
> >  .../bindings/net/qcom,bam-dmux.yaml           | 87 +++++++++++++++++++
> >  1 file changed, 87 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > new file mode 100644
> > index 000000000000..33e125e70cb4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > @@ -0,0 +1,87 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/qcom,bam-dmux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Qualcomm BAM Data Multiplexer
> > +
> > +maintainers:
> > +  - Stephan Gerhold <stephan@gerhold.net>
> > +
> > +description: |
> > +  The BAM Data Multiplexer provides access to the network data channels
> > +  of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916
> > +  or MSM8974. It is built using a simple protocol layer on top of a DMA engine
> > +  (Qualcomm BAM DMA) and bidirectional interrupts to coordinate power control.
> > +
> > +properties:
> > +  compatible:
> > +    const: qcom,bam-dmux
> 
> Is this block the same on every SoC? It needs to be SoC specific.
> 

Hm, I think describing it as *SoC*-specific wouldn't be accurate:
This node does not describe any hardware block, it's more a "firmware
convention". The only hardware involved is the BAM DMA engine, which
already has SoC/IP-specific compatibles in its own device tree node.

This means that if anything there should be "firmware version"-specific
compatibles, because one SoC might have different (typically signed)
firmware versions that provide slightly different functionality.
However, I have to admit that I'm not familiar enough with the different
firmware versions to come up with a reasonable naming schema for the
compatible. :/

In general, I cannot think of any difference between different versions
that would matter to a driver. The protocol is quite simple, and minor
firmware differences can be better handled through the control channel
that sets up the connection for the modem.

Does that make sense?

Thanks!
Stephan
Rob Herring (Arm) Oct. 19, 2021, 1:19 p.m. UTC | #3
On Tue, Oct 19, 2021 at 2:03 AM Stephan Gerhold <stephan@gerhold.net> wrote:
>
> On Mon, Oct 18, 2021 at 03:22:25PM -0500, Rob Herring wrote:
> > On Mon, Oct 11, 2021 at 04:17:35PM +0200, Stephan Gerhold wrote:
> > > The BAM Data Multiplexer provides access to the network data channels of
> > > modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or
> > > MSM8974. It is built using a simple protocol layer on top of a DMA engine
> > > (Qualcomm BAM) and bidirectional interrupts to coordinate power control.
> > >
> > > The device tree node combines the incoming interrupt with the outgoing
> > > interrupts (smem-states) as well as the two DMA channels, which allows
> > > the BAM-DMUX driver to request all necessary resources.
> > >
> > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > > ---
> > > Changes since RFC: None.
> > > ---
> > >  .../bindings/net/qcom,bam-dmux.yaml           | 87 +++++++++++++++++++
> > >  1 file changed, 87 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > > new file mode 100644
> > > index 000000000000..33e125e70cb4
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > > @@ -0,0 +1,87 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/net/qcom,bam-dmux.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Qualcomm BAM Data Multiplexer
> > > +
> > > +maintainers:
> > > +  - Stephan Gerhold <stephan@gerhold.net>
> > > +
> > > +description: |
> > > +  The BAM Data Multiplexer provides access to the network data channels
> > > +  of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916
> > > +  or MSM8974. It is built using a simple protocol layer on top of a DMA engine
> > > +  (Qualcomm BAM DMA) and bidirectional interrupts to coordinate power control.
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: qcom,bam-dmux
> >
> > Is this block the same on every SoC? It needs to be SoC specific.
> >
>
> Hm, I think describing it as *SoC*-specific wouldn't be accurate:
> This node does not describe any hardware block, it's more a "firmware
> convention". The only hardware involved is the BAM DMA engine, which
> already has SoC/IP-specific compatibles in its own device tree node.
>
> This means that if anything there should be "firmware version"-specific
> compatibles, because one SoC might have different (typically signed)
> firmware versions that provide slightly different functionality.
> However, I have to admit that I'm not familiar enough with the different
> firmware versions to come up with a reasonable naming schema for the
> compatible. :/
>
> In general, I cannot think of any difference between different versions
> that would matter to a driver. The protocol is quite simple, and minor
> firmware differences can be better handled through the control channel
> that sets up the connection for the modem.
>
> Does that make sense?

Okay. Please add some of the above details to the binding.

Rob
Stephan Gerhold Oct. 19, 2021, 1:31 p.m. UTC | #4
On Tue, Oct 19, 2021 at 08:19:42AM -0500, Rob Herring wrote:
> On Tue, Oct 19, 2021 at 2:03 AM Stephan Gerhold <stephan@gerhold.net> wrote:
> >
> > On Mon, Oct 18, 2021 at 03:22:25PM -0500, Rob Herring wrote:
> > > On Mon, Oct 11, 2021 at 04:17:35PM +0200, Stephan Gerhold wrote:
> > > > The BAM Data Multiplexer provides access to the network data channels of
> > > > modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or
> > > > MSM8974. It is built using a simple protocol layer on top of a DMA engine
> > > > (Qualcomm BAM) and bidirectional interrupts to coordinate power control.
> > > >
> > > > The device tree node combines the incoming interrupt with the outgoing
> > > > interrupts (smem-states) as well as the two DMA channels, which allows
> > > > the BAM-DMUX driver to request all necessary resources.
> > > >
> > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > > > ---
> > > > Changes since RFC: None.
> > > > ---
> > > >  .../bindings/net/qcom,bam-dmux.yaml           | 87 +++++++++++++++++++
> > > >  1 file changed, 87 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > > > new file mode 100644
> > > > index 000000000000..33e125e70cb4
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> > > > @@ -0,0 +1,87 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/net/qcom,bam-dmux.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Qualcomm BAM Data Multiplexer
> > > > +
> > > > +maintainers:
> > > > +  - Stephan Gerhold <stephan@gerhold.net>
> > > > +
> > > > +description: |
> > > > +  The BAM Data Multiplexer provides access to the network data channels
> > > > +  of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916
> > > > +  or MSM8974. It is built using a simple protocol layer on top of a DMA engine
> > > > +  (Qualcomm BAM DMA) and bidirectional interrupts to coordinate power control.
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: qcom,bam-dmux
> > >
> > > Is this block the same on every SoC? It needs to be SoC specific.
> > >
> >
> > Hm, I think describing it as *SoC*-specific wouldn't be accurate:
> > This node does not describe any hardware block, it's more a "firmware
> > convention". The only hardware involved is the BAM DMA engine, which
> > already has SoC/IP-specific compatibles in its own device tree node.
> >
> > This means that if anything there should be "firmware version"-specific
> > compatibles, because one SoC might have different (typically signed)
> > firmware versions that provide slightly different functionality.
> > However, I have to admit that I'm not familiar enough with the different
> > firmware versions to come up with a reasonable naming schema for the
> > compatible. :/
> >
> > In general, I cannot think of any difference between different versions
> > that would matter to a driver. The protocol is quite simple, and minor
> > firmware differences can be better handled through the control channel
> > that sets up the connection for the modem.
> >
> > Does that make sense?
> 
> Okay. Please add some of the above details to the binding.
> 

OK, I will try to clarify this a bit in v3.

Thanks!
Stephan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
new file mode 100644
index 000000000000..33e125e70cb4
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
@@ -0,0 +1,87 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/qcom,bam-dmux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm BAM Data Multiplexer
+
+maintainers:
+  - Stephan Gerhold <stephan@gerhold.net>
+
+description: |
+  The BAM Data Multiplexer provides access to the network data channels
+  of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916
+  or MSM8974. It is built using a simple protocol layer on top of a DMA engine
+  (Qualcomm BAM DMA) and bidirectional interrupts to coordinate power control.
+
+properties:
+  compatible:
+    const: qcom,bam-dmux
+
+  interrupts:
+    description:
+      Interrupts used by the modem to signal the AP.
+      Both interrupts must be declared as IRQ_TYPE_EDGE_BOTH.
+    items:
+      - description: Power control
+      - description: Power control acknowledgment
+
+  interrupt-names:
+    items:
+      - const: pc
+      - const: pc-ack
+
+  qcom,smem-states:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: State bits used by the AP to signal the modem.
+    items:
+      - description: Power control
+      - description: Power control acknowledgment
+
+  qcom,smem-state-names:
+    description: Names for the state bits used by the AP to signal the modem.
+    items:
+      - const: pc
+      - const: pc-ack
+
+  dmas:
+    items:
+      - description: TX DMA channel phandle
+      - description: RX DMA channel phandle
+
+  dma-names:
+    items:
+      - const: tx
+      - const: rx
+
+required:
+  - compatible
+  - interrupts
+  - interrupt-names
+  - qcom,smem-states
+  - qcom,smem-state-names
+  - dmas
+  - dma-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    mpss: remoteproc {
+        bam-dmux {
+            compatible = "qcom,bam-dmux";
+
+            interrupt-parent = <&modem_smsm>;
+            interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>;
+            interrupt-names = "pc", "pc-ack";
+
+            qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>;
+            qcom,smem-state-names = "pc", "pc-ack";
+
+            dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>;
+            dma-names = "tx", "rx";
+        };
+    };