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

Commit 4423d3e7 authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: arm-smmu: Add configuration option for page table levels



Some hardware may not be optimized for using four level page tables.
Add an option to use three level tables instead.

Change-Id: I54047803189f60636e4a94abeeba93435fb3089e
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent a25de292
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -86,6 +86,11 @@ conditions.
		  useful if the upstream hardware is capable of switching
		  between multiple domains within a single context bank.

- qcom,use-3-lvl-tables:
		  Some hardware configurations may not be optimized for using
		  a four level page table configuration. Set to use a three
		  level page table instead.

- clocks        : List of clocks to be used during SMMU register access. See
                  Documentation/devicetree/bindings/clock/clock-bindings.txt
                  for information about the format. For each clock specified
+4 −0
Original line number Diff line number Diff line
@@ -411,6 +411,7 @@ struct arm_smmu_device {
#define ARM_SMMU_OPT_FATAL_ASF		(1 << 1)
#define ARM_SMMU_OPT_SKIP_INIT		(1 << 2)
#define ARM_SMMU_OPT_DYNAMIC		(1 << 3)
#define ARM_SMMU_OPT_3LVL_TABLES	(1 << 4)
	u32				options;
	enum arm_smmu_arch_version	version;
	enum arm_smmu_implementation	model;
@@ -529,6 +530,7 @@ static struct arm_smmu_option_prop arm_smmu_options[] = {
	{ ARM_SMMU_OPT_FATAL_ASF, "qcom,fatal-asf" },
	{ ARM_SMMU_OPT_SKIP_INIT, "qcom,skip-init" },
	{ ARM_SMMU_OPT_DYNAMIC, "qcom,dynamic" },
	{ ARM_SMMU_OPT_3LVL_TABLES, "qcom,use-3-lvl-tables" },
	{ 0, NULL},
};

@@ -1567,6 +1569,8 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
		oas = smmu->ipa_size;
		if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH64) {
			fmt = ARM_64_LPAE_S1;
			if (smmu->options & ARM_SMMU_OPT_3LVL_TABLES)
				ias = min(ias, 39UL);
		} else if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH32_L) {
			fmt = ARM_32_LPAE_S1;
			ias = min(ias, 32UL);