aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHai Nguyen Pham <hai.pham.ud@renesas.com>2019-05-03 10:49:28 +0700
committerRyo Kataoka <ryo.kataoka.wt@renesas.com>2019-07-11 21:17:11 +0900
commite206eb5b81a60e64c35fbc3a999b1a0db2b98044 (patch)
tree98157546907372a1840f3b02ec4f6ca9e6b9819b
parent4498fec78778c999f9f0fb51085353541c1c0804 (diff)
downloadrenesas-bsp-e206eb5b81a60e64c35fbc3a999b1a0db2b98044.tar.gz
iommu/ipmmu-vmsa: Remove cache snoop transaction for page table walk request
According to Hardware Manual Errata on Apr. 10, 2019, cache snoop transaction for page table walk request is not supported on R-Car Gen3. Hence, this patch removes these fields since setting them up in IMTTBCR register will have no effect. Signed-off-by: Hai Nguyen Pham <hai.pham.ud@renesas.com>
-rw-r--r--drivers/iommu/ipmmu-vmsa.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index e1aabb7295a400..aac05ab895b622 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -53,6 +53,7 @@ struct ipmmu_features {
bool setup_imbuscr;
bool twobit_imttbcr_sl0;
bool reserved_context;
+ bool cache_snoop;
#ifdef CONFIG_IPMMU_VMSA_WHITELIST
bool whitelist;
#endif
@@ -763,18 +764,21 @@ static int ipmmu_domain_init_context(struct ipmmu_vmsa_domain *domain)
/*
* TTBCR
- * We use long descriptors with inner-shareable WBWA tables and allocate
- * the whole 32-bit VA space to TTBR0.
+ * We use long descriptors and allocate the whole 32-bit VA space to
+ * TTBR0.
*/
if (domain->mmu->features->twobit_imttbcr_sl0)
tmp = IMTTBCR_SL0_TWOBIT_LVL_1;
else
tmp = IMTTBCR_SL0_LVL_1;
+ if (domain->mmu->features->cache_snoop)
+ tmp |= IMTTBCR_SH0_INNER_SHAREABLE | IMTTBCR_ORGN0_WB_WA |
+ IMTTBCR_IRGN0_WB_WA;
+
ipmmu_ctx_write_root(domain, IMTTBCR,
ipmmu_ctx_read_root(domain, IMTTBCR) |
- IMTTBCR_EAE | IMTTBCR_SH0_INNER_SHAREABLE |
- IMTTBCR_ORGN0_WB_WA | IMTTBCR_IRGN0_WB_WA | tmp);
+ IMTTBCR_EAE | tmp);
/* MAIR0 */
ipmmu_ctx_write_root(domain, IMMAIR0,
@@ -1390,6 +1394,7 @@ static const struct ipmmu_features ipmmu_features_default = {
.setup_imbuscr = true,
.twobit_imttbcr_sl0 = false,
.reserved_context = false,
+ .cache_snoop = true,
#ifdef CONFIG_IPMMU_VMSA_WHITELIST
.whitelist = false,
#endif
@@ -1402,6 +1407,7 @@ static const struct ipmmu_features ipmmu_features_rcar_gen3 = {
.setup_imbuscr = false,
.twobit_imttbcr_sl0 = true,
.reserved_context = true,
+ .cache_snoop = false,
#ifdef CONFIG_IPMMU_VMSA_WHITELIST
.whitelist = true,
#endif