Skip to contentSkip to conversation

Add Unisoc iommu basic driver

PATCH Superseded Chunyan Zhang 5 participants 13 messages Feb 3, 2021 – Mar 4, 2021

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Chunyan Zhang

author reviewer
#0 lore raw

v3 cover Add Unisoc iommu basic driver

From: Chunyan Zhang <[email protected]>

Changes since v2:
* Added a WARN and return 0 if an invalid iova was passed to sprd_iommu_iova_to_phys();
* Changed the name of sprd_iommu_write();
* Revised CONFIG_SPRD_IOMMU help graph in Kconfig.
* Revised comments for the struct sprd_iommu_device;
* Converted to use "GPL" instread of "GPL v2", they are same as license-rules.rst shows.

Changes since v1:
* Fixed compile errors reported by kernel test robot <[email protected]>.
* Changed to use syscon to get mapped registers for iommu and media devices to avoid double map issue.
* Addressed Robin's comments:
- Added including offset in the returned physical address if the input virtual address isn't page-aligned;
- Added platform_device_put() after calling of_find_device_by_node();
- Removed iommu register offset from driver, it will be defined as the cell of DT reference to syscon phandle;
- Removed multi compatible strings which are not needed;
- Added comments for the function sprd_iommu_clk_enable();
- Added clocks property in bindings;
- Set device_driver.suppress_bind_attrs to disable unbind the devices via sysfs;
- A few trivial fixes.

Changes since RFC v2:
* Addressed Robin's comments:
- Add COMPILE_TEST support;
- Use DMA allocator for PTE;
- Revised to avoid resource leak issue;
- Added ->iotlb_sync implemented;
- Moved iommu group allocation to probe;
- Changed some function names to make them sprd specific;
* Added support for more iommu instance;

Changes since RFC v1:
* Rebased on v5.11-rc1;
* Changed sprd-iommu to tristate;
* Removed check for args_count of iommu OF node, since there's no args for sprd-iommu device node;
* Added another IP version (i.e. vau);
* Removed unnecessary configs selection from CONFIG_SPRD_IOMMU;
* Changed to get zeroed pages.

Chunyan Zhang (2):
dt-bindings: iommu: add bindings for sprd iommu
iommu: add Unisoc iommu basic driver

 .../devicetree/bindings/iommu/sprd,iommu.yaml |  72 +++
 drivers/iommu/Kconfig                         |  12 +
 drivers/iommu/Makefile                        |   1 +
 drivers/iommu/sprd-iommu.c                    | 600 ++++++++++++++++++
 4 files changed, 685 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml
 create mode 100644 drivers/iommu/sprd-iommu.c
Signature · 6 lines
2.25.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
author reviewer
#1 lore raw

PATCH v3 1/2 dt-bindings: iommu: add bindings for sprd iommu

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
 .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +72 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"
+
+oneOf:
+  - required:
+      - reg
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;
+      #iommu-cells = <0>;
+    };
+
+  - |
+    iommu_jpg: iommu-jpg {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&jpg_regs 0x300>;
+      #iommu-cells = <0>;
+      clocks = <&mm_gate 1>;
+    };
+
+...
Signature · 6 lines
2.25.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
maintainer
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

Quoted 68 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
 .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +50 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"
+
+oneOf:
+  - required:
+      - reg

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 10 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +10 -0
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;

If the IOMMU is contained within another device, then it should just be a child node of that device. Or just make 'dpu_regs' an IOMMU provider (i.e. just add #iommu-cells to it).

Quoted 15 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +12 -0
+      #iommu-cells = <0>;
+    };
+
+  - |
+    iommu_jpg: iommu-jpg {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&jpg_regs 0x300>;
+      #iommu-cells = <0>;
+      clocks = <&mm_gate 1>;
+    };
+
+...
Signature · 1 line
2.25.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

author reviewer
#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

Hi Rob,

Quoted 75 lines · Rob Herring
Quoted 73 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
 .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +55 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"
+
+oneOf:
+  - required:
+      - reg
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 5 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +5 -0
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;

If the IOMMU is contained within another device, then it should just be a child node of that device.

Yes, actually IOMMU can be seen as a child of multimedia devices, I considered moving IOMMU under into multimedia device node, but multimedia devices need IOMMU when probe[1], so I dropped that idea.

And they share the same register base, e.g.

+ mm {

+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;

+
+ dpu_regs: syscon@63000000 {
+ compatible = "sprd,sc9863a-dpuregs", "syscon";
+ reg = <0 0x63000000 0 0x1000>;
+ };
+
+ dpu: dpu@63000000 {

+                               compatible = "sprd,sharkl3-dpu";
+                               sprd,disp-regs = <&dpu_regs>;
+                               iommus = <&iommu_dispc>;
+                       };
+
+                       iommu_dispc: iommu@63000000 {
+                               compatible = "sprd,iommu-v1";
+                               sprd,iommu-regs = <&dpu_regs 0x800>;
+                               #iommu-cells = <0>;

+ };

DPU use the registers from 0, IOMMU from 0x800, the purpose of using syscon node was to avoid remapping register physical address.

Quoted 2 lines

Or just make 'dpu_regs' an IOMMU provider
(i.e. just add #iommu-cells to it).

xxx_regs(syscon node) defines the register range for IOMMU and a multimedia device (such as dpu, image codec, etc.)

Hope I've explained the relationship of xxx_regs, multimedia device, and iommu clearly :)

Any suggestion for this kind of cases?

Thanks,
Chunyan

[1] https://elixir.bootlin.com/linux/v5.11-rc6/source/drivers/iommu/of_iommu.c#L145

Quoted 16 lines
Quoted 14 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +12 -1
+      #iommu-cells = <0>;
+    };
+
+  - |
+    iommu_jpg: iommu-jpg {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&jpg_regs 0x300>;
+      #iommu-cells = <0>;
+      clocks = <&mm_gate 1>;
+    };
+
+...
--
Quoted 2 lines

2.25.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

maintainer
#4 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

Quoted 88 lines · Chunyan Zhang

Hi Rob,

Quoted 75 lines · Rob Herring
Quoted 73 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
 .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +55 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"
+
+oneOf:
+  - required:
+      - reg
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 5 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +5 -0
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;

If the IOMMU is contained within another device, then it should just be a child node of that device.

Quoted 3 lines

Yes, actually IOMMU can be seen as a child of multimedia devices, I considered moving IOMMU under into multimedia device node, but multimedia devices need IOMMU when probe[1], so I dropped that idea.

Don't design your binding around working-around linux issues.

Review

Quoted 9 lines

And they share the same register base, e.g.

(quoted diff) +7 -0
+               mm {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       dpu_regs: syscon@63000000 {

Drop this node.

Review

Quoted 7 lines
(quoted diff) +7 -0
+                               compatible = "sprd,sc9863a-dpuregs", "syscon";
+                               reg = <0 0x63000000 0 0x1000>;
+                       };
+
+                       dpu: dpu@63000000 {
+                               compatible = "sprd,sharkl3-dpu";
+                               sprd,disp-regs = <&dpu_regs>;

reg = <0 0x63000000 0 0x800>;

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 6 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +6 -0
+                               iommus = <&iommu_dispc>;
+                       };
+
+                       iommu_dispc: iommu@63000000 {
+                               compatible = "sprd,iommu-v1";
+                               sprd,iommu-regs = <&dpu_regs 0x800>;

reg = <0 0x63000800 0 0x800>;

Quoted 1 line

+ #iommu-cells = <0>;

Though given it seems there is only 1 client and this might really be just 1 h/w block, you don't really need to use the iommu binding at all. The DPU should be able to instantiate it's own IOMMU device. There's other examples of this such as mali GPU though that is all one driver, but that's a Linux implementation detail.

Rob
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

reviewer
#5 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

Quoted 63 lines · Rob Herring
Quoted 62 lines · Chunyan Zhang

Hi Rob,

Quoted 58 lines · Rob Herring
Quoted 56 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
  .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
  1 file changed, 72 insertions(+)

create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +38 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 46

Quoted 8 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +8 -0
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"

OK, so apparently the hardware is not quite as trivial as my initial impression, and you should have interrupts as well.

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 4 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +4 -0
+
+oneOf:
+  - required:
+      - reg

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 10 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +10 -0
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;

If the IOMMU is contained within another device, then it should just be a child node of that device.

Quoted 5 lines
Quoted 3 lines

Yes, actually IOMMU can be seen as a child of multimedia devices, I considered moving IOMMU under into multimedia device node, but multimedia devices need IOMMU when probe[1], so I dropped that idea.

Don't design your binding around working-around linux issues.

Having stumbled across the DRM driver patches the other day, I now see where this is coming from, and it's even worse than that - this whole binding seems to be largely working around bad driver design.

Quoted 20 lines

Review

Quoted 9 lines

And they share the same register base, e.g.

(quoted diff) +7 -0
+               mm {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       dpu_regs: syscon@63000000 {

Drop this node.

Review

Quoted 7 lines
(quoted diff) +7 -0
+                               compatible = "sprd,sc9863a-dpuregs", "syscon";
+                               reg = <0 0x63000000 0 0x1000>;
+                       };
+
+                       dpu: dpu@63000000 {
+                               compatible = "sprd,sharkl3-dpu";
+                               sprd,disp-regs = <&dpu_regs>;
Quoted 1 line

reg = <0 0x63000000 0 0x800>;

In fact judging by the other driver it looks like the length only needs to be 0x200 here (but maybe there's more to come in future).

Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 6 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +6 -0
+                               iommus = <&iommu_dispc>;
+                       };
+
+                       iommu_dispc: iommu@63000000 {
+                               compatible = "sprd,iommu-v1";
+                               sprd,iommu-regs = <&dpu_regs 0x800>;

reg = <0 0x63000800 0 0x800>;

...and this one looks to need less than 0x80, even :)

Quoted 8 lines
Quoted 2 lines

+ #iommu-cells = <0>;

Though given it seems there is only 1 client and this might really be just 1 h/w block, you don't really need to use the iommu binding at all. The DPU should be able to instantiate it's own IOMMU device. There's other examples of this such as mali GPU though that is all one driver, but that's a Linux implementation detail.

FWIW that's really a very different situation - the MMUs in a Mali GPU are fundamental parts of its internal pipelines and would never make sense to handle as separate devices (if it were even feasible to try). An IOMMU like this one is typically a logically-distinct block stuck to the external bus interface of any old device, rewriting transactions that said device has already issued - it's telling that it needs to allocate the prot_page scratchpad for "faulting" transactions to still flow somewhere, implying that it's not even involved enough to be able to terminate them.

As such I think it *does* make complete sense to describe even "dedicated" IOMMUs like this one, Rockchip, Exynos, etc. in DT. Otherwise you'd be effectively forcing OSes to turn half their display/media drivers into mini board files with secret knowledge of which blocks are integrated with IOMMUs on which SoCs.

Robin.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

author reviewer
#6 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

Quoted 68 lines · Robin Murphy
Quoted 66 lines · Rob Herring
Quoted 65 lines · Chunyan Zhang

Hi Rob,

Quoted 61 lines · Rob Herring
Quoted 59 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
  .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
  1 file changed, 72 insertions(+)

create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +41 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 46

Quoted 5 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +5 -0
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"

OK, so apparently the hardware is not quite as trivial as my initial impression, and you should have interrupts as well.

Ok, I will have a look.

Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +9 -0
+
+oneOf:
+  - required:
+      - reg
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 5 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +5 -0
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;

If the IOMMU is contained within another device, then it should just be a child node of that device.

Yes, actually IOMMU can be seen as a child of multimedia devices, I considered moving IOMMU under into multimedia device node, but multimedia devices need IOMMU when probe[1], so I dropped that idea.

Quoted 6 lines
Quoted 1 line

Don't design your binding around working-around linux issues.

Having stumbled across the DRM driver patches the other day, I now see where this is coming from, and it's even worse than that - this whole binding seems to be largely working around bad driver design.

I guess you mean bad h/w design (not bad driver design)? Having this syscon node just because I don't want a same register range to be mapped to multiple virtual address ranges, and that's the case for many media devices and their IOMMUs. If this issue exsists for one device only, I can even endure, but that's not unfortunately. But anyway, as you all think this is not a good way, I will change to use reg property.

Quoted 32 lines
Quoted 20 lines

Review

Quoted 9 lines

And they share the same register base, e.g.

(quoted diff) +7 -0
+               mm {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       dpu_regs: syscon@63000000 {

Drop this node.

Review

Quoted 7 lines
(quoted diff) +7 -0
+                               compatible = "sprd,sc9863a-dpuregs", "syscon";
+                               reg = <0 0x63000000 0 0x1000>;
+                       };
+
+                       dpu: dpu@63000000 {
+                               compatible = "sprd,sharkl3-dpu";
+                               sprd,disp-regs = <&dpu_regs>;
Quoted 1 line

reg = <0 0x63000000 0 0x800>;

In fact judging by the other driver it looks like the length only needs to be 0x200 here (but maybe there's more to come in future).

Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +6 -0
+                               iommus = <&iommu_dispc>;
+                       };
+
+                       iommu_dispc: iommu@63000000 {
+                               compatible = "sprd,iommu-v1";
+                               sprd,iommu-regs = <&dpu_regs 0x800>;
Quoted 3 lines
Quoted 1 line

reg = <0 0x63000800 0 0x800>;

...and this one looks to need less than 0x80, even :)

There're some registers not be added in the current driver indeed. The specification defines registers up to 0x7c.

Quoted 20 lines
Quoted 9 lines
Quoted 3 lines

+ #iommu-cells = <0>;

Though given it seems there is only 1 client and this might really be just 1 h/w block, you don't really need to use the iommu binding at all. The DPU should be able to instantiate it's own IOMMU device. There's other examples of this such as mali GPU though that is all one driver, but that's a Linux implementation detail.

FWIW that's really a very different situation - the MMUs in a Mali GPU are fundamental parts of its internal pipelines and would never make sense to handle as separate devices (if it were even feasible to try). An IOMMU like this one is typically a logically-distinct block stuck to the external bus interface of any old device, rewriting transactions that said device has already issued - it's telling that it needs to allocate the prot_page scratchpad for "faulting" transactions to still flow somewhere, implying that it's not even involved enough to be able to terminate them.

Quoted 6 lines

As such I think it *does* make complete sense to describe even "dedicated" IOMMUs like this one, Rockchip, Exynos, etc. in DT. Otherwise you'd be effectively forcing OSes to turn half their display/media drivers into mini board files with secret knowledge of which blocks are integrated with IOMMUs on which SoCs.

Thanks for helping me explain the situation.

Regards,
Chunyan

Quoted 1 line

Robin.

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

author reviewer
#7 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

In reply to Robin Murphy

Hi Robin,

Quoted 62 lines · Robin Murphy
Quoted 62 lines
Quoted 62 lines
Quoted 62 lines · Chunyan Zhang
Quoted 59 lines

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
  .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
  1 file changed, 72 insertions(+)

create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +41 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 46

Quoted 5 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +5 -0
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"

OK, so apparently the hardware is not quite as trivial as my initial impression, and you should have interrupts as well.

I've checked with my colleagues for this issue. And like I explained before, one sprd IOMMU serves one master device only, so interrupts are handled by master devices rather than IOMMUs.

Chunyan

author reviewer
#8 lore raw

Re: [PATCH v3 1/2] dt-bindings: iommu: add bindings for sprd iommu

In reply to Rob Herring
Quoted 118 lines · Rob Herring
Quoted 88 lines · Chunyan Zhang

Hi Rob,

Quoted 75 lines · Rob Herring
Quoted 73 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
 .../devicetree/bindings/iommu/sprd,iommu.yaml | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iommu/sprd,iommu.yaml
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +55 -0
new file mode 100644
index 000000000000..4fc99e81fa66
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/sprd,iommu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc IOMMU and Multi-media MMU
+
+maintainers:
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - sprd,iommu-v1
+
+  "#iommu-cells":
+    const: 0
+    description:
+      Unisoc IOMMUs are all single-master IOMMU devices, therefore no
+      additional information needs to associate with its master device.
+      Please refer to the generic bindings document for more details,
+      Documentation/devicetree/bindings/iommu/iommu.txt
+
+  reg:
+    maxItems: 1
+    description:
+      Not required if 'sprd,iommu-regs' is defined.
+
+  clocks:
+    description:
+      Reference to a gate clock phandle, since access to some of IOMMUs are
+      controlled by gate clock, but this is not required.
+
+  sprd,iommu-regs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Reference to a syscon phandle plus 1 cell, the syscon defines the
+      register range used by the iommu and the media device, the cell
+      defines the offset for iommu registers. Since iommu module shares
+      the same register range with the media device which uses it.
+
+required:
+  - compatible
+  - "#iommu-cells"
+
+oneOf:
+  - required:
+      - reg
+  - required:
+      - sprd,iommu-regs
+
+additionalProperties: false
+
Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 5 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +5 -0
+examples:
+  - |
+    iommu_disp: iommu-disp {
+      compatible = "sprd,iommu-v1";
+      sprd,iommu-regs = <&dpu_regs 0x800>;

If the IOMMU is contained within another device, then it should just be a child node of that device.

Quoted 3 lines

Yes, actually IOMMU can be seen as a child of multimedia devices, I considered moving IOMMU under into multimedia device node, but multimedia devices need IOMMU when probe[1], so I dropped that idea.

Don't design your binding around working-around linux issues.

Review

Quoted 9 lines

And they share the same register base, e.g.

(quoted diff) +7 -0
+               mm {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       dpu_regs: syscon@63000000 {

Drop this node.

Review

Quoted 7 lines
(quoted diff) +7 -0
+                               compatible = "sprd,sc9863a-dpuregs", "syscon";
+                               reg = <0 0x63000000 0 0x1000>;
+                       };
+
+                       dpu: dpu@63000000 {
+                               compatible = "sprd,sharkl3-dpu";
+                               sprd,disp-regs = <&dpu_regs>;

reg = <0 0x63000000 0 0x800>;

Quoted 8 lines

Documentation/devicetree/bindings/iommu/sprd,iommu.yaml line 60

Quoted 6 lines
Documentation/devicetree/bindings/iommu/sprd,iommu.yaml new file +6 -0
+                               iommus = <&iommu_dispc>;
+                       };
+
+                       iommu_dispc: iommu@63000000 {
+                               compatible = "sprd,iommu-v1";
+                               sprd,iommu-regs = <&dpu_regs 0x800>;

reg = <0 0x63000800 0 0x800>;

Alright, considering you deprecate using syscon to map registers here, I will drop that.
But that would cause the same physical address to be mapped two times at least. And this is not a single case, since there are a few media devices and their IOMMUs which all have this issue.

Thanks,
Chunyan

Quoted 10 lines
Quoted 2 lines

+ #iommu-cells = <0>;

Though given it seems there is only 1 client and this might really be just 1 h/w block, you don't really need to use the iommu binding at all. The DPU should be able to instantiate it's own IOMMU device. There's other examples of this such as mali GPU though that is all one driver, but that's a Linux implementation detail.

Rob

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

author reviewer
#9 lore raw

PATCH v3 2/2 iommu: add Unisoc iommu basic driver

In reply to Chunyan Zhang

From: Chunyan Zhang <[email protected]>

This iommu module can be used by Unisoc's multimedia devices, such as display, Image codec(jpeg) and a few signal processors, including VSP(video), GSP(graphic), ISP(image), and CPP(camera pixel processor), etc.

---
 drivers/iommu/Kconfig      |  12 +
 drivers/iommu/Makefile     |   1 +
 drivers/iommu/sprd-iommu.c | 600 +++++++++++++++++++++++++++++++++++++
 3 files changed, 613 insertions(+)
 create mode 100644 drivers/iommu/sprd-iommu.c
drivers/iommu/Kconfig +12 -0
index 192ef8f61310..99e7712f3903 100644
@@ -408,4 +408,16 @@ config VIRTIO_IOMMU
 
 	  Say Y here if you intend to run this kernel as a guest.
 
+config SPRD_IOMMU
+	tristate "Unisoc IOMMU Support"
+	depends on ARCH_SPRD || COMPILE_TEST
+	select IOMMU_API
+	help
+	  Support for IOMMU on Unisoc's SoCs, this iommu can be used by
+	  Unisoc's multimedia devices, such as display, Image codec(jpeg)
+	  and a few signal processors, including VSP(video), GSP(graphic),
+	  ISP(image), and CPP(camera pixel processor), etc.
+
+	  Say Y here if you want to use the multimedia devices listed above.
+
 endif # IOMMU_SUPPORT
drivers/iommu/Makefile +1 -0
index 61bd30cd8369..5925b6af2123 100644
@@ -28,3 +28,4 @@ obj-$(CONFIG_S390_IOMMU) += s390-iommu.o
 obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
 obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o
 obj-$(CONFIG_IOMMU_SVA_LIB) += iommu-sva-lib.o
+obj-$(CONFIG_SPRD_IOMMU) += sprd-iommu.o
drivers/iommu/sprd-iommu.c new file +600 -0

600 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
#10 lore raw

Re: [PATCH v3 2/2] iommu: add Unisoc iommu basic driver

I love your patch! Perhaps something to improve:

Hi Chunyan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on iommu/next]
[also build test WARNING on robh/for-next v5.11-rc6 next-20210125] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Chunyan-Zhang/Add-Unisoc-iommu-basic-driver/20210203-171459
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/02726f17be90f0d6226117f44cef3497250e378f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chunyan-Zhang/Add-Unisoc-iommu-basic-driver/20210203-171459 git checkout 02726f17be90f0d6226117f44cef3497250e378f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

In file included from ./arch/nios2/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12, from include/asm-generic/current.h:5, from ./arch/nios2/include/generated/asm/current.h:1, from include/linux/mutex.h:14,
from include/linux/notifier.h:14,
from include/linux/clk.h:14,
from drivers/iommu/sprd-iommu.c:9:
drivers/iommu/sprd-iommu.c: In function 'sprd_iommu_iova_to_phys':

>> drivers/iommu/sprd-iommu.c:375:4: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
     375 |    "iova (0x%llx) exceeds the vpn range[0x%lx-0x%lx]\n",
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     376 |    iova, start, end))
         |    ~~~~
         |    |
         |    dma_addr_t {aka unsigned int}
   include/asm-generic/bug.h:89:48: note: in definition of macro '__WARN_printf'
      89 |   warn_slowpath_fmt(__FILE__, __LINE__, taint, arg); \
         |                                                ^~~
   drivers/iommu/sprd-iommu.c:374:6: note: in expansion of macro 'WARN'
     374 |  if (WARN(iova < start || iova > end,
         |      ^~~~
   drivers/iommu/sprd-iommu.c:375:16: note: format string is defined here
     375 |    "iova (0x%llx) exceeds the vpn range[0x%lx-0x%lx]\n",
         |             ~~~^
         |                |
         |                long long unsigned int
         |             %x
   drivers/iommu/sprd-iommu.c: At top level:
   drivers/iommu/sprd-iommu.c:438:20: error: initialization of 'void (*)(struct iommu_domain *, long unsigned int,  size_t)' {aka 'void (*)(struct iommu_domain *, long unsigned int,  unsigned int)'} from incompatible pointer type 'void (*)(struct iommu_domain *)' [-Werror=incompatible-pointer-types]
     438 |  .iotlb_sync_map = sprd_iommu_sync_map,
         |                    ^~~~~~~~~~~~~~~~~~~

drivers/iommu/sprd-iommu.c:438:20: note: (near initialization for 'sprd_iommu_ops.iotlb_sync_map')
cc1: some warnings being treated as errors

vim +375 drivers/iommu/sprd-iommu.c

364
365 static phys_addr_t sprd_iommu_iova_to_phys(struct iommu_domain *domain,
366 dma_addr_t iova)
367 {
368 struct sprd_iommu_domain *dom = to_sprd_domain(domain);
369 unsigned long flags;
370 phys_addr_t pa;
371 unsigned long start = domain->geometry.aperture_start;
372 unsigned long end = domain->geometry.aperture_end;
373
374 if (WARN(iova < start || iova > end,

 > 375			 "iova (0x%llx) exceeds the vpn range[0x%lx-0x%lx]\n",

376 iova, start, end))
377 return 0;
378
379 spin_lock_irqsave(&dom->pgtlock, flags);
380 pa = *(dom->pgt_va + ((iova - start) >> SPRD_IOMMU_PAGE_SHIFT));
381 pa = (pa << SPRD_IOMMU_PAGE_SHIFT) + ((iova - start) & (SPRD_IOMMU_PAGE_SIZE - 1));
382 spin_unlock_irqrestore(&dom->pgtlock, flags);
383
384 return pa;
385 }
386

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#11 lore raw

Re: [PATCH v3 2/2] iommu: add Unisoc iommu basic driver

In reply to Chunyan Zhang
Quoted 5 lines · Chunyan Zhang
drivers/iommu/Kconfig +0 -0
index 192ef8f61310..99e7712f3903 100644

drivers/iommu/Kconfig config VIRTIO_IOMMU · line 416

Quoted 9 lines
drivers/iommu/Kconfig +6 -0
@@ -408,4 +408,16 @@ config VIRTIO_IOMMU
 
 	  Say Y here if you intend to run this kernel as a guest.
 
+config SPRD_IOMMU
+	tristate "Unisoc IOMMU Support"
+	depends on ARCH_SPRD || COMPILE_TEST
+	select IOMMU_API
+	help
+	  Support for IOMMU on Unisoc's SoCs, this iommu can be used by

s/iommu/IOMMU/ please

Quoted 5 lines
drivers/iommu/Kconfig +5 -0
+	  Unisoc's multimedia devices, such as display, Image codec(jpeg)
+	  and a few signal processors, including VSP(video), GSP(graphic),
+	  ISP(image), and CPP(camera pixel processor), etc.
+
+	  Say Y here if you want to use the multimedia devices listed above.
Signature · 5 lines
~Randy
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
author reviewer
#12 lore raw

Re: [PATCH v3 2/2] iommu: add Unisoc iommu basic driver

Quoted 10 lines · Randy Dunlap
Quoted 8 lines · Chunyan Zhang
drivers/iommu/Kconfig +0 -0
index 192ef8f61310..99e7712f3903 100644
@@ -408,4 +408,16 @@ config VIRTIO_IOMMU
 
        Say Y here if you intend to run this kernel as a guest.
 
Quoted 8 lines

drivers/iommu/Kconfig config VIRTIO_IOMMU · line 416

Quoted 6 lines
drivers/iommu/Kconfig +6 -0
+config SPRD_IOMMU
+     tristate "Unisoc IOMMU Support"
+     depends on ARCH_SPRD || COMPILE_TEST
+     select IOMMU_API
+     help
+       Support for IOMMU on Unisoc's SoCs, this iommu can be used by

s/iommu/IOMMU/ please

Sure, thanks.

Chunyan

Quoted 10 lines

drivers/iommu/Kconfig config VIRTIO_IOMMU · line 421

Quoted 6 lines
drivers/iommu/Kconfig +5 -0
+       Unisoc's multimedia devices, such as display, Image codec(jpeg)
+       and a few signal processors, including VSP(video), GSP(graphic),
+       ISP(image), and CPP(camera pixel processor), etc.
+
+       Say Y here if you want to use the multimedia devices listed above.

--
~Randy

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu