diff mbox series

[v3,2/3] dt-bindings: iommu: add DART iommu bindings

Message ID 20210603085003.50465-3-sven@svenpeter.dev (mailing list archive)
State New, archived
Headers show
Series Apple M1 DART IOMMU driver | expand

Commit Message

Sven Peter June 3, 2021, 8:50 a.m. UTC
DART (Device Address Resolution Table) is the iommu found on Apple
ARM SoCs such as the M1.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
---
 .../devicetree/bindings/iommu/apple,dart.yaml | 81 +++++++++++++++++++
 MAINTAINERS                                   |  6 ++
 2 files changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/apple,dart.yaml

Comments

Rob Herring (Arm) June 10, 2021, 4:52 p.m. UTC | #1
On Thu, Jun 03, 2021 at 10:50:02AM +0200, Sven Peter wrote:
> DART (Device Address Resolution Table) is the iommu found on Apple
> ARM SoCs such as the M1.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> ---
>  .../devicetree/bindings/iommu/apple,dart.yaml | 81 +++++++++++++++++++
>  MAINTAINERS                                   |  6 ++
>  2 files changed, 87 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iommu/apple,dart.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iommu/apple,dart.yaml b/Documentation/devicetree/bindings/iommu/apple,dart.yaml
> new file mode 100644
> index 000000000000..db21ca07d121
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iommu/apple,dart.yaml
> @@ -0,0 +1,81 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iommu/apple,dart.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Apple DART IOMMU
> +
> +maintainers:
> +  - Sven Peter <sven@svenpeter.dev>
> +
> +description: |+
> +  Apple SoCs may contain an implementation of their Device Address
> +  Resolution Table which provides a mandatory layer of address
> +  translations for various masters.
> +
> +  Each DART instance is capable of handling up to 16 different streams
> +  with individual pagetables and page-level read/write protection flags.
> +
> +  This DART IOMMU also raises interrupts in response to various
> +  fault conditions.
> +
> +properties:
> +  compatible:
> +    const: apple,t8103-dart
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    description:
> +      Reference to the gate clock phandle if required for this IOMMU.
> +      Optional since not all IOMMUs are attached to a clock gate.
> +
> +  '#iommu-cells':
> +    const: 1
> +    description:
> +      Has to be one. The single cell describes the stream id emitted by
> +      a master to the IOMMU.
> +
> +required:
> +  - compatible
> +  - reg
> +  - '#iommu-cells'
> +  - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> +  - |+
> +    dart1: iommu@82f80000 {
> +      compatible = "apple,t8103-dart";
> +      reg = <0x82f80000 0x4000>;
> +      interrupts = <1 781 4>;
> +      #iommu-cells = <1>;
> +    };
> +
> +    master1 {
> +      iommus = <&{/dart1} 0>;

/dart1 is a path, but 'dart1' is a label. You need '&dart1' (or 
'&{/iommu@82f80000}' but that doesn't really work here because the 
examples get prefixed with /example-n/...)

With that fixed,

Reviewed-by: Rob Herring <robh@kernel.org>


> +    };
> +
> +  - |+
> +    dart2a: iommu@82f00000 {
> +      compatible = "apple,t8103-dart";
> +      reg = <0x82f00000 0x4000>;
> +      interrupts = <1 781 4>;
> +      #iommu-cells = <1>;
> +    };
> +    dart2b: iommu@82f80000 {
> +      compatible = "apple,t8103-dart";
> +      reg = <0x82f80000 0x4000>;
> +      interrupts = <1 781 4>;
> +      #iommu-cells = <1>;
> +    };
> +
> +    master2 {
> +      iommus = <&{/dart2a} 0>, <&{/dart2b} 1>;
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 673cadd5107a..4373d63f9ccf 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1240,6 +1240,12 @@ L:	linux-input@vger.kernel.org
>  S:	Odd fixes
>  F:	drivers/input/mouse/bcm5974.c
>  
> +APPLE DART IOMMU DRIVER
> +M:	Sven Peter <sven@svenpeter.dev>
> +L:	iommu@lists.linux-foundation.org
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/iommu/apple,dart.yaml
> +
>  APPLE SMC DRIVER
>  M:	Henrik Rydberg <rydberg@bitmath.org>
>  L:	linux-hwmon@vger.kernel.org
> -- 
> 2.25.1
Sven Peter June 12, 2021, 12:24 p.m. UTC | #2
Hi,

On Thu, Jun 10, 2021, at 18:52, Rob Herring wrote:
> On Thu, Jun 03, 2021 at 10:50:02AM +0200, Sven Peter wrote:
> > +
> > +examples:
> > +  - |+
> > +    dart1: iommu@82f80000 {
> > +      compatible = "apple,t8103-dart";
> > +      reg = <0x82f80000 0x4000>;
> > +      interrupts = <1 781 4>;
> > +      #iommu-cells = <1>;
> > +    };
> > +
> > +    master1 {
> > +      iommus = <&{/dart1} 0>;
> 
> /dart1 is a path, but 'dart1' is a label. You need '&dart1' (or 
> '&{/iommu@82f80000}' but that doesn't really work here because the 
> examples get prefixed with /example-n/...)
> 
> With that fixed,
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Makes sense, thanks for the review!
Fixed for the next version.


Sven
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iommu/apple,dart.yaml b/Documentation/devicetree/bindings/iommu/apple,dart.yaml
new file mode 100644
index 000000000000..db21ca07d121
--- /dev/null
+++ b/Documentation/devicetree/bindings/iommu/apple,dart.yaml
@@ -0,0 +1,81 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/apple,dart.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple DART IOMMU
+
+maintainers:
+  - Sven Peter <sven@svenpeter.dev>
+
+description: |+
+  Apple SoCs may contain an implementation of their Device Address
+  Resolution Table which provides a mandatory layer of address
+  translations for various masters.
+
+  Each DART instance is capable of handling up to 16 different streams
+  with individual pagetables and page-level read/write protection flags.
+
+  This DART IOMMU also raises interrupts in response to various
+  fault conditions.
+
+properties:
+  compatible:
+    const: apple,t8103-dart
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    description:
+      Reference to the gate clock phandle if required for this IOMMU.
+      Optional since not all IOMMUs are attached to a clock gate.
+
+  '#iommu-cells':
+    const: 1
+    description:
+      Has to be one. The single cell describes the stream id emitted by
+      a master to the IOMMU.
+
+required:
+  - compatible
+  - reg
+  - '#iommu-cells'
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |+
+    dart1: iommu@82f80000 {
+      compatible = "apple,t8103-dart";
+      reg = <0x82f80000 0x4000>;
+      interrupts = <1 781 4>;
+      #iommu-cells = <1>;
+    };
+
+    master1 {
+      iommus = <&{/dart1} 0>;
+    };
+
+  - |+
+    dart2a: iommu@82f00000 {
+      compatible = "apple,t8103-dart";
+      reg = <0x82f00000 0x4000>;
+      interrupts = <1 781 4>;
+      #iommu-cells = <1>;
+    };
+    dart2b: iommu@82f80000 {
+      compatible = "apple,t8103-dart";
+      reg = <0x82f80000 0x4000>;
+      interrupts = <1 781 4>;
+      #iommu-cells = <1>;
+    };
+
+    master2 {
+      iommus = <&{/dart2a} 0>, <&{/dart2b} 1>;
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 673cadd5107a..4373d63f9ccf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1240,6 +1240,12 @@  L:	linux-input@vger.kernel.org
 S:	Odd fixes
 F:	drivers/input/mouse/bcm5974.c
 
+APPLE DART IOMMU DRIVER
+M:	Sven Peter <sven@svenpeter.dev>
+L:	iommu@lists.linux-foundation.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/iommu/apple,dart.yaml
+
 APPLE SMC DRIVER
 M:	Henrik Rydberg <rydberg@bitmath.org>
 L:	linux-hwmon@vger.kernel.org