diff options
author | Magnus Damm <damm+renesas@opensource.se> | 2017-10-16 21:30:28 +0900 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2017-11-06 10:29:39 -0700 |
commit | f5c858912acd2b17059ebe6f34abac183bdfbf80 (patch) | |
tree | ff0eeec03ed9401e51898429969fe8812c7cb15a /drivers/iommu | |
parent | d574893aee991efa67fefa849347c49de5df8108 (diff) | |
download | linux-stable-f5c858912acd2b17059ebe6f34abac183bdfbf80.tar.gz linux-stable-f5c858912acd2b17059ebe6f34abac183bdfbf80.tar.bz2 linux-stable-f5c858912acd2b17059ebe6f34abac183bdfbf80.zip |
iommu/ipmmu-vmsa: Make IMBUSCTR setup optional
Introduce a feature to allow opt-out of setting up
IMBUSCR. The default case is unchanged.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/ipmmu-vmsa.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 7587017972b0..49f2c697b108 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -44,6 +44,7 @@ struct ipmmu_features { bool use_ns_alias_offset; bool has_cache_leaf_nodes; unsigned int number_of_contexts; + bool setup_imbuscr; }; struct ipmmu_vmsa_device { @@ -457,9 +458,10 @@ static int ipmmu_domain_init_context(struct ipmmu_vmsa_domain *domain) domain->cfg.arm_lpae_s1_cfg.mair[0]); /* IMBUSCR */ - ipmmu_ctx_write_root(domain, IMBUSCR, - ipmmu_ctx_read_root(domain, IMBUSCR) & - ~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); + if (domain->mmu->features->setup_imbuscr) + ipmmu_ctx_write_root(domain, IMBUSCR, + ipmmu_ctx_read_root(domain, IMBUSCR) & + ~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); /* * IMSTR @@ -886,6 +888,7 @@ static const struct ipmmu_features ipmmu_features_default = { .use_ns_alias_offset = true, .has_cache_leaf_nodes = false, .number_of_contexts = 1, /* software only tested with one context */ + .setup_imbuscr = true, }; static const struct of_device_id ipmmu_of_ids[] = { |