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>
This commit is contained in:
Magnus Damm 2017-10-16 21:30:28 +09:00 committed by Alex Williamson
parent d574893aee
commit f5c858912a
1 changed files with 6 additions and 3 deletions

View File

@ -44,6 +44,7 @@ struct ipmmu_features {
bool use_ns_alias_offset; bool use_ns_alias_offset;
bool has_cache_leaf_nodes; bool has_cache_leaf_nodes;
unsigned int number_of_contexts; unsigned int number_of_contexts;
bool setup_imbuscr;
}; };
struct ipmmu_vmsa_device { 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]); domain->cfg.arm_lpae_s1_cfg.mair[0]);
/* IMBUSCR */ /* IMBUSCR */
ipmmu_ctx_write_root(domain, IMBUSCR, if (domain->mmu->features->setup_imbuscr)
ipmmu_ctx_read_root(domain, IMBUSCR) & ipmmu_ctx_write_root(domain, IMBUSCR,
~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK)); ipmmu_ctx_read_root(domain, IMBUSCR) &
~(IMBUSCR_DVM | IMBUSCR_BUSSEL_MASK));
/* /*
* IMSTR * IMSTR
@ -886,6 +888,7 @@ static const struct ipmmu_features ipmmu_features_default = {
.use_ns_alias_offset = true, .use_ns_alias_offset = true,
.has_cache_leaf_nodes = false, .has_cache_leaf_nodes = false,
.number_of_contexts = 1, /* software only tested with one context */ .number_of_contexts = 1, /* software only tested with one context */
.setup_imbuscr = true,
}; };
static const struct of_device_id ipmmu_of_ids[] = { static const struct of_device_id ipmmu_of_ids[] = {