diff options
author | Magnus Damm <damm+renesas@opensource.se> | 2017-10-16 08:30:28 -0400 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2017-11-06 12:29:39 -0500 |
commit | f5c858912acd2b17059ebe6f34abac183bdfbf80 (patch) | |
tree | ff0eeec03ed9401e51898429969fe8812c7cb15a | |
parent | d574893aee991efa67fefa849347c49de5df8108 (diff) |
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>
-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 { | |||
44 | bool use_ns_alias_offset; | 44 | bool use_ns_alias_offset; |
45 | bool has_cache_leaf_nodes; | 45 | bool has_cache_leaf_nodes; |
46 | unsigned int number_of_contexts; | 46 | unsigned int number_of_contexts; |
47 | bool setup_imbuscr; | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | struct ipmmu_vmsa_device { | 50 | struct ipmmu_vmsa_device { |
@@ -457,9 +458,10 @@ static int ipmmu_domain_init_context(struct ipmmu_vmsa_domain *domain) | |||
457 | domain->cfg.arm_lpae_s1_cfg.mair[0]); | 458 | domain->cfg.arm_lpae_s1_cfg.mair[0]); |
458 | 459 | ||
459 | /* IMBUSCR */ | 460 | /* IMBUSCR */ |
460 | ipmmu_ctx_write_root(domain, IMBUSCR, | 461 | if (domain->mmu->features->setup_imbuscr) |
461 | ipmmu_ctx_read_root(domain, IMBUSCR) & | 462 | ipmmu_ctx_write_root(domain, IMBUSCR, |
462 | ~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); | 463 | ipmmu_ctx_read_root(domain, IMBUSCR) & |
464 | ~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); | ||
463 | 465 | ||
464 | /* | 466 | /* |
465 | * IMSTR | 467 | * IMSTR |
@@ -886,6 +888,7 @@ static const struct ipmmu_features ipmmu_features_default = { | |||
886 | .use_ns_alias_offset = true, | 888 | .use_ns_alias_offset = true, |
887 | .has_cache_leaf_nodes = false, | 889 | .has_cache_leaf_nodes = false, |
888 | .number_of_contexts = 1, /* software only tested with one context */ | 890 | .number_of_contexts = 1, /* software only tested with one context */ |
891 | .setup_imbuscr = true, | ||
889 | }; | 892 | }; |
890 | 893 | ||
891 | static const struct of_device_id ipmmu_of_ids[] = { | 894 | static const struct of_device_id ipmmu_of_ids[] = { |