Skip to content

Commit

Permalink
iommu/ipmmu-vmsa: Make IMBUSCTR setup optional
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Magnus Damm authored and Alex Williamson committed Nov 6, 2017
1 parent d574893 commit f5c8589
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/iommu/ipmmu-vmsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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[] = {
Expand Down

0 comments on commit f5c8589

Please sign in to comment.