iommu/ipmmu-vmsa: Initial r8a7796 support
Subsystems (2)
cover iommu/ipmmu-vmsa: Initial r8a7796 support
iommu/ipmmu-vmsa: Initial r8a7796 support
[PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
This series adds r8a7796 support to the IPMMU driver. The DT binding gets updated, maximum number of micro-TLBs are increased and the driver is adjusted to match on the new DT binding.
The main differences between r8a7795 and r8a7796 IPMMUs are:
1) Number of on-chip IPMMU device instances
2) Interrupt register bit assignment for IPMMU-MM
3) Maximum number of micro-TLBs
4) Micro-TLB assignment
DT binding extension and change number 3 above are part of this patch series. Other changes will be part of DT integration code that will be submitted separately.
---
Developed on top of next-20160602 and:
[PATCH v3 00/06] iommu/ipmmu-vmsa: IPMMU multi-arch update V3 [PATCH v2 00/11] iommu/ipmmu-vmsa: r8a7795 support V2
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 drivers/iommu/ipmmu-vmsa.c | 11 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-)
PATCH 1/3 iommu/ipmmu-vmsa: Add r8a7796 DT binding
From: Magnus Damm <[email protected]>
Update the IPMMU DT binding documentation to include the r8a7796 compat string for R-Car M3-W.
---
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt +1 -0
@@ -16,6 +16,7 @@ Required Properties: - "renesas,ipmmu-r8a7793" for the R8A7793 (R-Car M2-N) IPMMU. - "renesas,ipmmu-r8a7794" for the R8A7794 (R-Car E2) IPMMU. - "renesas,ipmmu-r8a7795" for the R8A7795 (R-Car H3) IPMMU. + - "renesas,ipmmu-r8a7796" for the R8A7796 (R-Car M3-W) IPMMU. - "renesas,ipmmu-vmsa" for generic R-Car Gen2 VMSA-compatible IPMMU. - reg: Base address and size of the IPMMU registers.
Re: [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding
Hi Magnus,
Thank you for the patch.
Quoted 6 lines · On Tuesday 07 Jun 2016 12:39:27 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Update the IPMMU DT binding documentation to include the r8a7796 compat string for R-Car M3-W.
Signed-off-by Magnus Damm <[email protected]>
Quoted 8 lines
---
Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 + 1 file changed, 1 insertion(+)---
0001/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt
+++work/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt
2016-06
Quoted 8 lines
-06 11:27:37.560607110 +0900 @@ -16,6 +16,7 @@ Required Properties:
- "renesas,ipmmu-r8a7793" for the R8A7793 (R-Car M2-N) IPMMU.
- "renesas,ipmmu-r8a7794" for the R8A7794 (R-Car E2) IPMMU.
- "renesas,ipmmu-r8a7795" for the R8A7795 (R-Car H3) IPMMU.
+ - "renesas,ipmmu-r8a7796" for the R8A7796 (R-Car M3-W) IPMMU.
- "renesas,ipmmu-vmsa" for generic R-Car Gen2 VMSA-compatible IPMMU.- reg: Base address and size of the IPMMU registers.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 2/3 iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Bump up the maximum numbers of micro-TLBS to 48.
Each IPMMU device instance get micro-TLB assignment via the "iommus" property in DT. Older SoCs tend to use a maximum number of 32 micro-TLBd per IPMMU instance however newer SoCs such as r8a7796 make use of up to 48 micro-TLBs.
At this point no SoC specific handling is done to validate the maximum number of micro-TLBs, and because of that the DT information is assumed to be within correct range for each particular SoC.
If needed in the future SoC specific feature flags can be added to handle the maximum number of micro-TLBs without requiring DT changes, however at this point this does not seem necessary.
---
drivers/iommu/ipmmu-vmsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/ipmmu-vmsa.c +1 -1
@@ -1115,7 +1115,7 @@ static int ipmmu_probe(struct platform_d } mmu->dev = &pdev->dev; - mmu->num_utlbs =32 ; + mmu->num_utlbs =48 ;spin_lock_init (&mmu->lock);bitmap_zero (mmu->ctx,IPMMU_CTX_MAX ); mmu->features = match->data;
Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
Hello.
Quoted 7 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Bump up the maximum numbers of micro-TLBS to 48.
Each IPMMU device instance get micro-TLB assignment via the "iommus" property in DT. Older SoCs tend to use a maximum number of 32 micro-TLBd per IPMMU instance however
Micro-TLBs?
Quoted 7 lines
newer SoCs such as r8a7796 make use of up to 48 micro-TLBs.
At this point no SoC specific handling is done to validate the maximum number of micro-TLBs, and because of that the DT information is assumed to be within correct range for each particular SoC.
Quoted 6 lines
If needed in the future SoC specific feature flags can be added to handle the maximum number of micro-TLBs without requiring DT changes, however at this point this does not seem necessary.
Signed-off-by Magnus Damm <[email protected]>
[...]
MBR, Sergei
Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
In reply to Magnus DammHi Magnus,
Thank you for the patch.
Quoted 28 lines · On Tuesday 07 Jun 2016 12:39:36 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Bump up the maximum numbers of micro-TLBS to 48.
Each IPMMU device instance get micro-TLB assignment via the "iommus" property in DT. Older SoCs tend to use a maximum number of 32 micro-TLBd per IPMMU instance however newer SoCs such as r8a7796 make use of up to 48 micro-TLBs.
At this point no SoC specific handling is done to validate the maximum number of micro-TLBs, and because of that the DT information is assumed to be within correct range for each particular SoC.
If needed in the future SoC specific feature flags can be added to handle the maximum number of micro-TLBs without requiring DT changes, however at this point this does not seem necessary.
Signed-off-by Magnus Damm <[email protected]>---
drivers/iommu/ipmmu-vmsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/ipmmu-vmsa.c static int ipmmu_probe(struct platform_d · line 1118
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c +1
-1@@ -1115,7 +1115,7 @@ static int ipmmu_probe(struct platform_d } mmu->dev = &pdev->dev; - mmu->num_utlbs =32 ; + mmu->num_utlbs =48 ;
This value is only used to validate that all utlb numbers in the bus master DT nodes are within the range acceptable by the device. If we bump it up unconditionally we could as well remove it completely. A possibly better alternative would be to specify the number of utlbs, or even the mask of implemented utlbs, in the DT node of the IPMMU.
Why 48 by the way ? The IPMMU instance with the largest utlb number in the R- Car Gen3 datasheet uses a 0-38 utlb range.
Quoted 3 lines
drivers/iommu/ipmmu-vmsa.c +0
-0spin_lock_init (&mmu->lock);bitmap_zero (mmu->ctx,IPMMU_CTX_MAX ); mmu->features = match->data;
Signature · 3 lines
Regards, Laurent Pinchart
PATCH 3/3 iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
In reply to Magnus DammFrom: Magnus Damm <[email protected]>
Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook up the updated compat string.
---
drivers/iommu/ipmmu-vmsa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/iommu/ipmmu-vmsa.c +7 -2
@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false, }; -static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,
@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },
@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r ipmmu_vmsa_iommu_of_setup);IOMMU_OF_DECLARE (ipmmu_r8a7795_iommu_of,"renesas,ipmmu-r8a7795" , ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE (ipmmu_r8a7796_iommu_of,"renesas,ipmmu-r8a7796" , + ipmmu_vmsa_iommu_of_setup);#endif MODULE_DESCRIPTION ("IOMMU API for Renesas VMSA-compatible IPMMU" );
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Hi Magnus,
Thank you for the patch.
Quoted 36 lines · On Tuesday 07 Jun 2016 12:39:45 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update
IOMMU_OF_DECLAREto hook up the updated compat string.Signed-off-by Magnus Damm <[email protected]>---
drivers/iommu/ipmmu-vmsa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)drivers/iommu/ipmmu-vmsa.c +5
-2@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false, }; -static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },
drivers/iommu/ipmmu-vmsa.c IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c +2
-0@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r ipmmu_vmsa_iommu_of_setup);IOMMU_OF_DECLARE (ipmmu_r8a7795_iommu_of,"renesas,ipmmu-r8a7795" , ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE (ipmmu_r8a7796_iommu_of,"renesas,ipmmu-r8a7796" , + ipmmu_vmsa_iommu_of_setup);
How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Quoted 3 lines
drivers/iommu/ipmmu-vmsa.c +0
-0#endif MODULE_DESCRIPTION ("IOMMU API for Renesas VMSA-compatible IPMMU" );
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Hi Laurent,
Quoted 24 lines · Laurent Pinchart
Quoted 24 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +5
-2@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false, }; -static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r
Quoted 8 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Do we want to specify the number of utlbs here? Does it differ between r8a7795, r8a7796, and future members?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Hi Geert,
Quoted 37 lines · Geert Uytterhoeven
Hi Laurent,
Quoted 24 lines · Laurent Pinchart
Quoted 24 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +5
-2@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false, }; -static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "rQuoted 8 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Quoted 2 lines
Do we want to specify the number of utlbs here? Does it differ between r8a7795, r8a7796, and future members?
The utlb number is already a property of the SoC part number. So I don't see why we want to encode this as a separate DT property instead of going with an in-driver feature flag.
Thanks,
/ magnus
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
In reply to Geert UytterhoevenHi Geert,
Quoted 34 lines · On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote:
Quoted 24 lines · Laurent Pinchart
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 static const struct ipmmu_features ipmmu · line 1074
Quoted 4 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +0
-0@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false,};
Quoted 19 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +5
-2-static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "rQuoted 8 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Quoted 2 lines
Do we want to specify the number of utlbs here? Does it differ between r8a7795, r8a7796, and future members?
It differs between IPMMU instances on a given SoC, so if we want to specify it it should be a DT property.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Hi Laurent,
Quoted 37 lines · Laurent Pinchart
Hi Geert,
Quoted 34 lines · On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote:
Quoted 32 lines · Laurent Pinchart
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 static const struct ipmmu_features ipmmu · line 1074
Quoted 4 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +0
-0@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false,};
Quoted 19 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +5
-2-static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Quoted 5 lines
Quoted 2 lines
Do we want to specify the number of utlbs here? Does it differ between r8a7795, r8a7796, and future members?
It differs between IPMMU instances on a given SoC, so if we want to specify it it should be a DT property.
Can you please point out which documentation that says it varies with IPMMU instance?
Based on IMUCTRn register description "H3-ES1" has 0-31 range while "Others" have 0-47.
Thanks,
/ magnus
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Hi Magnus,
Quoted 5 lines · On Wednesday 08 Jun 2016 18:12:31 Magnus Damm wrote:
Quoted 4 lines · Laurent Pinchart
Quoted 3 lines · On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote:
Quoted 2 lines · Laurent Pinchart
Quoted 2 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 renamed from drivers/iommu/ipmmu-vmsa.c +0
-0
[snip]
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 9 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 6 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Do we want to specify the number of utlbs here? Does it differ between r8a7795, r8a7796, and future members?
Quoted 8 lines
Quoted 2 lines
It differs between IPMMU instances on a given SoC, so if we want to specify it it should be a DT property.
Can you please point out which documentation that says it varies with IPMMU instance?
Based on IMUCTRn register description "H3-ES1" has 0-31 range while "Others" have 0-47.
The maximum number of uTLBs is indeed the same according to that part of the documentation, but not all uTLBs are available in all IPMMU instances. We even have holes in the uTLB ranges, maybe a mask would be more appropriate.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Quoted 28 lines · On Tuesday 09 Aug 2016 16:17:57 Laurent Pinchart wrote:
Quoted 5 lines · On Wednesday 08 Jun 2016 18:12:31 Magnus Damm wrote:
Quoted 4 lines · Laurent Pinchart
Quoted 3 lines · On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote:
Quoted 2 lines · Laurent Pinchart
Quoted 2 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 renamed from drivers/iommu/ipmmu-vmsa.c +0
-0[snip]
Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 6 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
Quoted 5 lines
Quoted 2 lines
Do we want to specify the number of utlbs here? Does it differ between r8a7795, r8a7796, and future members?
It differs between IPMMU instances on a given SoC, so if we want to specify it it should be a DT property.
Can you please point out which documentation that says it varies with IPMMU instance?
Quoted 6 lines
Quoted 2 lines
Based on IMUCTRn register description "H3-ES1" has 0-31 range while "Others" have 0-47.
The maximum number of uTLBs is indeed the same according to that part of the documentation, but not all uTLBs are available in all IPMMU instances. We even have holes in the uTLB ranges, maybe a mask would be more appropriate.
And the other option is of course to ignore that and accept any uTLB number, in which case we will rely on the IOMMU bus master node providing correct information.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
In reply to Laurent PinchartHi Laurent,
Quoted 41 lines · Laurent Pinchart
Hi Magnus,
Thank you for the patch.
Quoted 36 lines · On Tuesday 07 Jun 2016 12:39:45 Magnus Damm wrote:
From: Magnus Damm <[email protected]>
Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update
IOMMU_OF_DECLAREto hook up the updated compat string.Signed-off-by Magnus Damm <[email protected]>---
drivers/iommu/ipmmu-vmsa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +5
-2@@ -1074,7 +1074,7 @@ static const struct ipmmu_features ipmmu .twobit_imttbcr_sl0 = false, }; -static const struct ipmmu_features ipmmu_features_r8a7795 = { +static const struct ipmmu_features ipmmu_features_rcar_gen3 = { .use_ns_alias_offset = false, .has_cache_leaf_nodes = true, .has_eight_ctx = true,@@ -1088,7 +1088,10 @@ static const struct of_device_id ipmmu_o .data = &ipmmu_features_default, }, { .compatible = "renesas,ipmmu-r8a7795", - .data = &ipmmu_features_r8a7795, + .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a7796", + .data = &ipmmu_features_rcar_gen3, }, { /* Terminator */ },@@ -1268,6 +1271,8 @@ IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r
Quoted 8 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "r · line 1275
Quoted 5 lines
drivers/iommu/ipmmu-vmsa.c 2016-06-06 11:19:40.210607110 +0900 renamed from drivers/iommu/ipmmu-vmsa.c +2
-0ipmmu_vmsa_iommu_of_setup); IOMMU_OF_DECLARE(ipmmu_r8a7795_iommu_of, "renesas,ipmmu-r8a7795", ipmmu_vmsa_iommu_of_setup); +IOMMU_OF_DECLARE(ipmmu_r8a7796_iommu_of, "renesas,ipmmu-r8a7796", + ipmmu_vmsa_iommu_of_setup);How about a Gen3 generic compatible string in addition to the SoC-specific ones ?
As you probably know, neither R-Car Gen2 nor R-Car Gen3 families are finished evolving. Because of that I find speculating with DT compat strings just potentially confusing with no apparent upside. Just going with what we know (ie the part number) is more than good enough IMO.
Thanks,
/ magnus
Hi Magnus,
Quoted 9 lines · Magnus Damm
iommu/ipmmu-vmsa: Initial r8a7796 support
[PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
This series adds r8a7796 support to the IPMMU driver. The DT binding gets updated, maximum number of micro-TLBs are increased and the driver is adjusted to match on the new DT binding.
Thanks for your series!
For your convenience, I've queued it up in topic/r8a7796-ipmmu-v1 at
https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git, and will include it in next renesas-drivers release.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds