Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 031d7460 authored by Dhaval Patel's avatar Dhaval Patel Committed by Patrick Daly
Browse files

iommu/arm-smmu: add option to skip SMR mask sanity check



Usually when an SMMU probes we do a sanity check on the SMR registers to
make sure they can fully support all of the mask bits.  This check can
cause problems for use cases where the SMMU is already in use when the
SMMU probes.  For example, for continuous splash screen support, the
stream matching table is programmed before control is even turned over
to Linux.

Add an option to skip this sanity check.

Change-Id: I51a9231fcd8b73034f1a1ca69e4fbb7e632635fa
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 9c2f648b
Loading
Loading
Loading
Loading
+20 −18
Original line number Diff line number Diff line
@@ -2063,6 +2063,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
			return -ENODEV;
		}

		if (!(smmu->options & ARM_SMMU_OPT_SKIP_INIT)) {
			smr = SMR_MASK_MASK << SMR_MASK_SHIFT;
			smr |= (SMR_ID_MASK << SMR_ID_SHIFT);
			writel_relaxed(smr, gr0_base + ARM_SMMU_GR0_SMR(0));
@@ -2080,6 +2081,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
			dev_notice(smmu->dev,
				   "\tstream matching with %u register groups, mask 0x%x",
				   smmu->num_mapping_groups, mask);
		}
	} else {
		smmu->num_mapping_groups = (id >> ID0_NUMSIDB_SHIFT) &
					   ID0_NUMSIDB_MASK;
@@ -2283,6 +2285,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
		smmu->irqs[i] = irq;
	}

	parse_driver_options(smmu);

	err = arm_smmu_device_cfg_probe(smmu);
	if (err)
		return err;
@@ -2322,8 +2326,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
	if (err)
		goto out_put_masters;

	parse_driver_options(smmu);

	if (smmu->version == ARM_SMMU_V2 &&
	    smmu->num_context_banks != smmu->num_context_irqs) {
		dev_err(dev,