Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1415663 > unrolled thread

[PATCH 0/3] iommu/ipmmu-vmsa: Initial r8a7796 support

Started byMagnus Damm <magnus.damm@gmail.com>
First post2016-06-07 05:50 +0200
Last post2016-06-07 09:40 +0200
Articles 14 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] iommu/ipmmu-vmsa: Initial r8a7796 support Magnus Damm <magnus.damm@gmail.com> - 2016-06-07 05:50 +0200
    [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding Magnus Damm <magnus.damm@gmail.com> - 2016-06-07 05:50 +0200
      Re: [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-06-08 02:20 +0200
    [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2016-06-07 06:00 +0200
      Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-06-08 02:20 +0200
        Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-08 09:10 +0200
          Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2016-06-08 10:10 +0200
          Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-06-08 10:50 +0200
            Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2016-06-08 11:20 +0200
        Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2016-06-08 10:10 +0200
    [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 Magnus Damm <magnus.damm@gmail.com> - 2016-06-07 06:00 +0200
      Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-07 13:10 +0200
      Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-06-08 02:20 +0200
    Re: [PATCH 0/3] iommu/ipmmu-vmsa: Initial r8a7796 support Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-07 09:40 +0200

#1415663 — [PATCH 0/3] iommu/ipmmu-vmsa: Initial r8a7796 support

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-07 05:50 +0200
Subject[PATCH 0/3] iommu/ipmmu-vmsa: Initial r8a7796 support
Message-ID<rHgbD-5Lh-3@gated-at.bofh.it>
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.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 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(-)

[toc] | [next] | [standalone]


#1415669 — [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-07 05:50 +0200
Subject[PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding
Message-ID<rHgbE-5Lh-11@gated-at.bofh.it>
In reply to#1415663
From: Magnus Damm <damm+renesas@opensource.se>

Update the IPMMU DT binding documentation to include the r8a7796 compat
string for R-Car M3-W.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 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-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.

[toc] | [prev] | [next] | [standalone]


#1416774 — Re: [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding

FromLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Date2016-06-08 02:20 +0200
SubjectRe: [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding
Message-ID<rHznX-1aY-15@gated-at.bofh.it>
In reply to#1415669
Hi Magnus,

Thank you for the patch.

On Tuesday 07 Jun 2016 12:39:27 Magnus Damm wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
> 
> Update the IPMMU DT binding documentation to include the r8a7796 compat
> string for R-Car M3-W.
> 
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> 
>  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
> -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.

-- 
Regards,

Laurent Pinchart

[toc] | [prev] | [next] | [standalone]


#1415676 — [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-07 06:00 +0200
Subject[PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHglj-5QV-9@gated-at.bofh.it>
In reply to#1415663
From: Magnus Damm <damm+renesas@opensource.se>

Support the r8a7796 IPMMU by sharing feature flags between
r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook
up the updated compat string.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 drivers/iommu/ipmmu-vmsa.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- 0031/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2016-06-06 11:19:40.210607110 +0900
@@ -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");

[toc] | [prev] | [next] | [standalone]


#1416775 — Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Date2016-06-08 02:20 +0200
SubjectRe: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHznX-1aY-13@gated-at.bofh.it>
In reply to#1415676
Hi Magnus,

Thank you for the patch.

On Tuesday 07 Jun 2016 12:39:45 Magnus Damm wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
> 
> Support the r8a7796 IPMMU by sharing feature flags between
> r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook
> up the updated compat string.
> 
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> ---
> 
>  drivers/iommu/ipmmu-vmsa.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> --- 0031/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c	2016-06-06 11:19:40.210607110 +0900
> @@ -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);

How about a Gen3 generic compatible string in addition to the SoC-specific 
ones ?

>  #endif
> 
>  MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");

-- 
Regards,

Laurent Pinchart

[toc] | [prev] | [next] | [standalone]


#1416945 — Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-06-08 09:10 +0200
SubjectRe: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHFMK-5qw-17@gated-at.bofh.it>
In reply to#1416775
Hi Laurent,

On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>> --- 0031/drivers/iommu/ipmmu-vmsa.c
>> +++ work/drivers/iommu/ipmmu-vmsa.c   2016-06-06 11:19:40.210607110 +0900
>> @@ -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);
>
> 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 -- geert@linux-m68k.org

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

[toc] | [prev] | [next] | [standalone]


#1417023 — Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-08 10:10 +0200
SubjectRe: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHGIO-64G-35@gated-at.bofh.it>
In reply to#1416945
Hi Geert,

On Wed, Jun 8, 2016 at 4:04 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Laurent,
>
> On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
>>> --- 0031/drivers/iommu/ipmmu-vmsa.c
>>> +++ work/drivers/iommu/ipmmu-vmsa.c   2016-06-06 11:19:40.210607110 +0900
>>> @@ -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);
>>
>> 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?

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

[toc] | [prev] | [next] | [standalone]


#1417088 — Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Date2016-06-08 10:50 +0200
SubjectRe: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHHlw-6ig-47@gated-at.bofh.it>
In reply to#1416945
Hi Geert,

On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote:
> On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart wrote:
> >> --- 0031/drivers/iommu/ipmmu-vmsa.c
> >> +++ work/drivers/iommu/ipmmu-vmsa.c   2016-06-06 11:19:40.210607110 +0900
> >> @@ -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);
> > 
> > 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?

It differs between IPMMU instances on a given SoC, so if we want to specify it 
it should be a DT property.

-- 
Regards,

Laurent Pinchart

[toc] | [prev] | [next] | [standalone]


#1417126 — Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-08 11:20 +0200
SubjectRe: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHHOx-6Iz-5@gated-at.bofh.it>
In reply to#1417088
Hi Laurent,

On Wed, Jun 8, 2016 at 5:48 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Geert,
>
> On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote:
>> On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart wrote:
>> >> --- 0031/drivers/iommu/ipmmu-vmsa.c
>> >> +++ work/drivers/iommu/ipmmu-vmsa.c   2016-06-06 11:19:40.210607110 +0900
>> >> @@ -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);
>> >
>> > 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?
>
> 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

[toc] | [prev] | [next] | [standalone]


#1417012 — Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-08 10:10 +0200
SubjectRe: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
Message-ID<rHGIN-64G-7@gated-at.bofh.it>
In reply to#1416775
Hi Laurent,

On Wed, Jun 8, 2016 at 9:18 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Magnus,
>
> Thank you for the patch.
>
> On Tuesday 07 Jun 2016 12:39:45 Magnus Damm wrote:
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> Support the r8a7796 IPMMU by sharing feature flags between
>> r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook
>> up the updated compat string.
>>
>> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>> ---
>>
>>  drivers/iommu/ipmmu-vmsa.c |    9 +++++++--
>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> --- 0031/drivers/iommu/ipmmu-vmsa.c
>> +++ work/drivers/iommu/ipmmu-vmsa.c   2016-06-06 11:19:40.210607110 +0900
>> @@ -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);
>
> 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

[toc] | [prev] | [next] | [standalone]


#1415678 — [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

FromMagnus Damm <magnus.damm@gmail.com>
Date2016-06-07 06:00 +0200
Subject[PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
Message-ID<rHglj-5QV-7@gated-at.bofh.it>
In reply to#1415663
From: Magnus Damm <damm+renesas@opensource.se>

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 <damm+renesas@opensource.se>
---

 drivers/iommu/ipmmu-vmsa.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0029/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2016-06-06 11:17:33.230607110 +0900
@@ -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;

[toc] | [prev] | [next] | [standalone]


#1416006 — Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2016-06-07 13:10 +0200
SubjectRe: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
Message-ID<rHn3t-1Vt-57@gated-at.bofh.it>
In reply to#1415678
Hello.

On 6/7/2016 6:39 AM, Magnus Damm wrote:

> From: Magnus Damm <damm+renesas@opensource.se>
>
> 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?

> 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 <damm+renesas@opensource.se>
[...]

MBR, Sergei

[toc] | [prev] | [next] | [standalone]


#1416771 — Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

FromLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Date2016-06-08 02:20 +0200
SubjectRe: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
Message-ID<rHznX-1aY-7@gated-at.bofh.it>
In reply to#1415678
Hi Magnus,

Thank you for the patch.

On Tuesday 07 Jun 2016 12:39:36 Magnus Damm wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
> 
> 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 <damm+renesas@opensource.se>
> ---
> 
>  drivers/iommu/ipmmu-vmsa.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- 0029/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c	2016-06-06 11:17:33.230607110 +0900
> @@ -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.

>  	spin_lock_init(&mmu->lock);
>  	bitmap_zero(mmu->ctx, IPMMU_CTX_MAX);
>  	mmu->features = match->data;

-- 
Regards,

Laurent Pinchart

[toc] | [prev] | [next] | [standalone]


#1415793

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-06-07 09:40 +0200
Message-ID<rHjMe-897-15@gated-at.bofh.it>
In reply to#1415663
Hi Magnus,

On Tue, Jun 7, 2016 at 5:39 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> 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 -- geert@linux-m68k.org

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web