Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1598552
| From | Magnus Damm <magnus.damm@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 |
| Date | 2017-03-12 06:50 +0100 |
| Message-ID | <tk4ye-5pJ-5@gated-at.bofh.it> (permalink) |
| References | <tk4yd-5pJ-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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-TLBs 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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> --- Changes since V2: - Added outer set of () to IMUASID() and IMUCTR() - thanks Ramesh! - Added Reviewed-by from Geert - thanks! Changes since V1: - Added support for the second I/O range at 0x600. drivers/iommu/ipmmu-vmsa.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- 0020/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2017-03-12 14:11:23.020607110 +0900 @@ -213,7 +213,9 @@ static void set_archdata(struct device * #define IMPMBA(n) (0x0280 + ((n) * 4)) #define IMPMBD(n) (0x02c0 + ((n) * 4)) -#define IMUCTR(n) (0x0300 + ((n) * 16)) +#define IMUCTR(n) ((n) < 32 ? IMUCTR0(n) : IMUCTR32(n)) +#define IMUCTR0(n) (0x0300 + ((n) * 16)) +#define IMUCTR32(n) (0x0600 + (((n) - 32) * 16)) #define IMUCTR_FIXADDEN (1 << 31) #define IMUCTR_FIXADD_MASK (0xff << 16) #define IMUCTR_FIXADD_SHIFT 16 @@ -223,7 +225,9 @@ static void set_archdata(struct device * #define IMUCTR_FLUSH (1 << 1) #define IMUCTR_MMUEN (1 << 0) -#define IMUASID(n) (0x0308 + ((n) * 16)) +#define IMUASID(n) ((n) < 32 ? IMUASID0(n) : IMUASID32(n)) +#define IMUASID0(n) (0x0308 + ((n) * 16)) +#define IMUASID32(n) (0x0608 + (((n) - 32) * 16)) #define IMUASID_ASID8_MASK (0xff << 8) #define IMUASID_ASID8_SHIFT 8 #define IMUASID_ASID0_MASK (0xff << 0) @@ -1164,7 +1168,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;
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v3 0/3] iommu/ipmmu-vmsa: r8a7796 support V3 Magnus Damm <magnus.damm@gmail.com> - 2017-03-12 06:50 +0100
[PATCH v3 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2017-03-12 06:50 +0100
Re: [PATCH v3 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code Geert Uytterhoeven <geert@linux-m68k.org> - 2017-03-12 10:40 +0100
[PATCH v3 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding Magnus Damm <magnus.damm@gmail.com> - 2017-03-12 06:50 +0100
[PATCH v3 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48 Magnus Damm <magnus.damm@gmail.com> - 2017-03-12 06:50 +0100
csiph-web