[PATCH] iommu: rockchip: Fix physical address decoding

2021-06-18 Thread Benjamin Gaignard
Restore bits 39 to 32 at correct position. It reverses the operation done in rk_dma_addr_dte_v2(). Fixes: c55356c534aa ("iommu: rockchip: Add support for iommu v2") Reported-by: Dan Carpenter Signed-off-by: Benjamin Gaignard --- drivers/iommu/rockchip-iommu.c | 3 ++- 1 file

[PATCH v2] iommu: rockchip: Fix physical address decoding

2021-06-18 Thread Benjamin Gaignard
Restore bits 39 to 32 at correct position. It reverses the operation done in rk_dma_addr_dte_v2(). Fixes: c55356c534aa ("iommu: rockchip: Add support for iommu v2") Reported-by: Dan Carpenter Signed-off-by: Benjamin Gaignard --- drivers/iommu/rockchip-iommu.c | 6 -- 1 file

[PATCH v4 4/6] ARM: dts: rockchip: rk3036: Remove useless interrupt-names on IOMMU node

2021-05-07 Thread Benjamin Gaignard
Remove useless interrupt-names property for IOMMU node Signed-off-by: Benjamin Gaignard --- arch/arm/boot/dts/rk3036.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi index 47a787a12e55..16753dc50bf3 100644 --- a/arch/arm/boot

[PATCH v4 5/6] ARM64: dts: rockchip: rk3036: Remove useless interrupt-names properties

2021-05-07 Thread Benjamin Gaignard
Remove useless interrupt-names properties for IOMMU nodes Signed-off-by: Benjamin Gaignard --- arch/arm64/boot/dts/rockchip/px30.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi index c45b0cfcae09

[PATCH v4 3/6] ARM: dts: rockchip: rk322x: Fix IOMMU nodes properties

2021-05-07 Thread Benjamin Gaignard
Add '#" to iommu-cells properties. Remove useless interrupt-names properties Signed-off-by: Benjamin Gaignard --- version 4: - Remove interrupt-names properties from IOMMU nodes arch/arm/boot/dts/rk322x.dtsi | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a

[PATCH v4 6/6] iommu: rockchip: Add support iommu v2

2021-05-07 Thread Benjamin Gaignard
From: Simon Xue RK356x SoC got new IOMMU hardware block (version 2). Add a compatible to distinguish it from the first version. Signed-off-by: Simon Xue [Benjamin] - port driver from kernel 4.19 to 5.12 - change functions prototype. - squash all fixes in this commit. Signed-off-by: Benjamin

[PATCH v4 0/6] Add IOMMU driver for rk356x

2021-05-07 Thread Benjamin Gaignard
property Benjamin Gaignard (5): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu: rockchip: Add compatible for v2 ARM: dts: rockchip: rk322x: Fix IOMMU nodes properties ARM: dts: rockchip: rk3036: Remove useless interrupt-names on IOMMU node ARM64: dts: rockchip

[PATCH v4 1/6] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-07 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard --- version 4: - Add descriptions for reg items - Add description for interrupts items - Remove useless interrupt-names proporties version 2: - Change maintainer - Change reg maxItems - Change interrupt maxItems

[PATCH v4 2/6] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-07 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring --- version 3: - Rename compatible with SoC name version 2: - Add power-domains property .../devicetree/bindings/iommu

[PATCH v5 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-21 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

[PATCH v5 0/4] Add IOMMU driver for rk356x

2021-05-21 Thread Benjamin Gaignard
version 3: - Rename compatible with soc prefix - Rebase on v5.12 tag version 2: - Fix iommu-cells typo in rk322x.dtsi - Change maintainer - Change reg maxItems - Add power-domains property Benjamin Gaignard (4): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu

[PATCH v5 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-21 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring --- .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 80 +++ 2 files changed, 80 insertions(+), 38 deletions(-) delete

[PATCH v5 4/4] iommu: rockchip: Add support for iommu v2

2021-05-21 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard --- version 5: - Use internal ops to support v2 hardware

[PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Benjamin Gaignard
device like drm. Use a global variable shouldn't be since SoC usually doesn't embedded different versions of the iommu hardware block. If that happen one day a WARN_ON will be displayed at probe time. Signed-off-by: Benjamin Gaignard --- version 5: - Use of_device_get_match_data() - Add internal ops

Re: [PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Benjamin Gaignard
Le 21/05/2021 à 14:58, Robin Murphy a écrit : On 2021-05-21 09:36, Benjamin Gaignard wrote: Add internal ops to be able to handle incoming variant v2. The goal is to keep the overall structure of the framework but to allow to add the evolution of this hardware block. The ops are global

[PATCH v6 0/4] Add IOMMU driver for rk356x

2021-05-21 Thread Benjamin Gaignard
maxItems - Add power-domains property Benjamin Gaignard (4): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu: rockchip: Add compatible for v2 iommu: rockchip: Add internal ops to handle variants iommu: rockchip: Add support for iommu v2 .../bindings/iommu/rockchip

[PATCH v6 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Benjamin Gaignard
device like drm. Use a global variable shouldn't be since SoC usually doesn't embedded different versions of the iommu hardware block. If that happen one day a WARN_ON will be displayed at probe time. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 6: - Remove #include

[PATCH v6 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-21 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 80 +++ 2 files changed, 80 insertions

[PATCH v6 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-21 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6

[PATCH v6 4/4] iommu: rockchip: Add support for iommu v2

2021-05-21 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 5: - Use internal

[PATCH v7 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-25 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 80 +++ 2 files changed, 80 insertions

[PATCH v7 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-25 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6

[PATCH v7 4/4] iommu: rockchip: Add support for iommu v2

2021-05-25 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 7: - Set

[PATCH v7 0/4] Add IOMMU driver for rk356x

2021-05-25 Thread Benjamin Gaignard
in rk322x.dtsi - Change maintainer - Change reg maxItems - Add power-domains property Benjamin Gaignard (4): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu: rockchip: Add compatible for v2 iommu: rockchip: Add internal ops to handle variants iommu: rockchip

[PATCH v7 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-25 Thread Benjamin Gaignard
device like drm. Use a global variable shouldn't be since SoC usually doesn't embedded different versions of the iommu hardware block. If that happen one day a WARN_ON will be displayed at probe time. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 7: - Set DMA mask - Add

[PATCH v7 4/4] iommu: rockchip: Add support for iommu v2

2021-05-25 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 7: - Set

[PATCH v8 4/4] iommu: rockchip: Add support for iommu v2

2021-06-04 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 8: - Fix

[PATCH v8 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-06-04 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 80 +++ 2 files changed, 80 insertions

[PATCH v8 3/4] iommu: rockchip: Add internal ops to handle variants

2021-06-04 Thread Benjamin Gaignard
device like drm. Use a global variable shouldn't be since SoC usually doesn't embedded different versions of the iommu hardware block. If that happen one day a WARN_ON will be displayed at probe time. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 7: - Set DMA mask - Add

[PATCH v8 0/4] Add IOMMU driver for rk356x

2021-06-04 Thread Benjamin Gaignard
version 2: - Fix iommu-cells typo in rk322x.dtsi - Change maintainer - Change reg maxItems - Add power-domains property Benjamin Gaignard (4): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu: rockchip: Add compatible for v2 iommu: rockchip: Add internal ops

[PATCH v8 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-06-04 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6

[PATCH v3] iommu/rockchip: Fix physical address decoding

2021-07-12 Thread Benjamin Gaignard
Restore bits 39 to 32 at correct position. It reverses the operation done in rk_dma_addr_dte_v2(). Fixes: c55356c534aa ("iommu: rockchip: Add support for iommu v2") Reported-by: Dan Carpenter Signed-off-by: Benjamin Gaignard --- version 3: - change commit header to match with

Re: [PATCH v2] iommu: rockchip: Fix physical address decoding

2021-07-05 Thread Benjamin Gaignard
Le 18/06/2021 à 15:00, Benjamin Gaignard a écrit : Restore bits 39 to 32 at correct position. It reverses the operation done in rk_dma_addr_dte_v2(). Fixes: c55356c534aa ("iommu: rockchip: Add support for iommu v2") Reported-by: Dan Carpenter Signed-off-by: Benjamin Gaignard G

[PATCH 2/3] dt-bindings: iommu: rockchip: Add compatible for v2

2021-04-22 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. Signed-off-by: Benjamin Gaignard --- Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml b

[PATCH 1/3] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-04-22 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard --- .../bindings/iommu/rockchip,iommu.txt | 38 -- .../bindings/iommu/rockchip,iommu.yaml| 76 +++ 2 files changed, 76 insertions(+), 38 deletions(-) delete mode 100644 Documentation

[PATCH 0/3] IOMMU: Add driver for rk356x

2021-04-22 Thread Benjamin Gaignard
This series adds the IOMMU driver for rk356x SoC. Since a new compatible is needed to distinguish this second version of IOMMU hardware block from the first one, it is an opportunity to convert the binding to DT schema. Benjamin Benjamin Gaignard (2): dt-bindings: iommu: rockchip: Convert

[PATCH 3/3] iommu: rockchip: Add support iommu v2

2021-04-22 Thread Benjamin Gaignard
From: Simon Xue RK356x SoC got new IOMMU hardware block (version 2). Add a compatible to distinguish it from the first version. Signed-off-by: Simon Xue [Benjamin] - port driver from kernel 4.19 to 5.12 - change functions prototype. - squash all fixes in this commit. Signed-off-by: Benjamin

[PATCH v2 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-04-22 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard --- version 2: - Change maintainer - Change reg maxItems - Change interrupt maxItems .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 79 +++ 2

[PATCH v2 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-04-22 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard --- version 2: - Add power-domains property .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6 insertions

[PATCH v2 0/4] Add driver for rk356x

2021-04-22 Thread Benjamin Gaignard
- Change reg maxItems - Add power-domains property Benjamin Gaignard (3): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu: rockchip: Add compatible for v2 ARM: dts: rockchip: rk322x: Fix iommu-cells properties name Simon Xue (1): iommu: rockchip: Add support iommu

[PATCH v2 4/4] iommu: rockchip: Add support iommu v2

2021-04-22 Thread Benjamin Gaignard
From: Simon Xue RK356x SoC got new IOMMU hardware block (version 2). Add a compatible to distinguish it from the first version. Signed-off-by: Simon Xue [Benjamin] - port driver from kernel 4.19 to 5.12 - change functions prototype. - squash all fixes in this commit. Signed-off-by: Benjamin

[PATCH v2 3/4] ARM: dts: rockchip: rk322x: Fix iommu-cells properties name

2021-04-22 Thread Benjamin Gaignard
Add '#" to iommu-cells properties Signed-off-by: Benjamin Gaignard --- arch/arm/boot/dts/rk322x.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index a4dd50aaf3fc..8af2e9288029 100644 --- a/arc

[PATCH v3 4/4] iommu: rockchip: Add support iommu v2

2021-05-04 Thread Benjamin Gaignard
From: Simon Xue RK356x SoC got new IOMMU hardware block (version 2). Add a compatible to distinguish it from the first version. Signed-off-by: Simon Xue [Benjamin] - port driver from kernel 4.19 to 5.12 - change functions prototype. - squash all fixes in this commit. Signed-off-by: Benjamin

[PATCH v3 0/4] Add driver for rk356x

2021-05-04 Thread Benjamin Gaignard
version 2: - Fix iommu-cells typo in rk322x.dtsi - Change maintainer - Change reg maxItems - Add power-domains property Benjamin Gaignard (3): dt-bindings: iommu: rockchip: Convert IOMMU to DT schema dt-bindings: iommu: rockchip: Add compatible for v2 ARM: dts: rockchip: rk322x: Fix iommu

[PATCH v3 3/4] ARM: dts: rockchip: rk322x: Fix iommu-cells properties name

2021-05-04 Thread Benjamin Gaignard
Add '#" to iommu-cells properties Signed-off-by: Benjamin Gaignard --- arch/arm/boot/dts/rk322x.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index a4dd50aaf3fc..8af2e9288029 100644 --- a/arc

[PATCH v3 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-04 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard --- version 2: - Change maintainer - Change reg maxItems - Change interrupt maxItems .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 79 +++ 2

[PATCH v3 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-04 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard --- version 3: - Rename compatible with SoC name version 2: - Add power-domains property .../devicetree/bindings/iommu/rockchip,iommu.yaml

Re: [PATCH v2 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-04 Thread Benjamin Gaignard
very soon. One comment here: On Thu, 2021-04-22 at 16:15 +0200, Benjamin Gaignard wrote: Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard --- version 2:  - Change maintainer  - Change reg maxItems  - Change interrupt maxItems  .../bindings/iommu/rockchip,iommu.txt

Re: [PATCH] iommu/rockchip: Fix PAGE_DESC_HI_MASKs for RK3568

2021-11-24 Thread Benjamin Gaignard
: c55356c534aa ("iommu: rockchip: Add support for iommu v2") Signed-off-by: Alex Bee Thanks for the fix. Reviewed-by: Benjamin Gaignard --- I've found this bug, when testing the recent VOP2 submission, which is the first perpherial which uses iommu for RK356x. I could use it on my qu