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

Commit cf93cac5 authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: arm-smmu: Remove hibernation dt-property



Hibernation support is a software choice rather than a hardware property.
Fix an issue where multiple targets share the same devicetree, but only
some want hibernation enabled.

Change-Id: Id5665556583f326108630802a71c4f00eef7a668
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent a118d1d3
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -87,11 +87,6 @@ conditions.
		When qcom,enable-static-cb is selected, indicates which
		iommu context banks may be used by HLOS.

- qcom,hibernation-support:
		A boolean, indicates that hibernation should be supported and
		all secure usecases should be disabled, since they cannot be
		restored properly.

- qcom,skip-init : Disable resetting configuration for all context banks
                  during device reset.  This is useful for targets where
                  some context banks are dedicated to other execution
+9 −2
Original line number Diff line number Diff line
@@ -579,7 +579,6 @@ static struct arm_smmu_option_prop arm_smmu_options[] = {
	{ ARM_SMMU_OPT_MMU500_ERRATA1, "qcom,mmu500-errata-1" },
	{ ARM_SMMU_OPT_STATIC_CB, "qcom,enable-static-cb"},
	{ ARM_SMMU_OPT_HALT, "qcom,enable-smmu-halt"},
	{ ARM_SMMU_OPT_HIBERNATION, "qcom,hibernation-support"},
	{ 0, NULL},
};

@@ -607,6 +606,7 @@ static struct iommu_gather_ops qsmmuv500_errata1_smmu_gather_ops;
static bool arm_smmu_is_static_cb(struct arm_smmu_device *smmu);
static bool arm_smmu_is_master_side_secure(struct arm_smmu_domain *smmu_domain);
static bool arm_smmu_is_slave_side_secure(struct arm_smmu_domain *smmu_domain);
static bool arm_smmu_opt_hibernation(struct arm_smmu_device *smmu);

static int msm_secure_smmu_map(struct iommu_domain *domain, unsigned long iova,
			       phys_addr_t paddr, size_t size, int prot);
@@ -635,6 +635,13 @@ static void parse_driver_options(struct arm_smmu_device *smmu)
				arm_smmu_options[i].prop);
		}
	} while (arm_smmu_options[++i].opt);

	if (arm_smmu_opt_hibernation(smmu) &&
	    smmu->options && ARM_SMMU_OPT_SKIP_INIT) {
		dev_info(smmu->dev,
			 "Disabling incompatible option: skip-init\n");
		smmu->options &= ~ARM_SMMU_OPT_SKIP_INIT;
	}
}

static bool is_dynamic_domain(struct iommu_domain *domain)
@@ -707,7 +714,7 @@ static void arm_smmu_secure_domain_unlock(struct arm_smmu_domain *smmu_domain)

static bool arm_smmu_opt_hibernation(struct arm_smmu_device *smmu)
{
	return smmu->options & ARM_SMMU_OPT_HIBERNATION;
	return IS_ENABLED(CONFIG_HIBERNATION);
}

/*
+0 −1
Original line number Diff line number Diff line
@@ -23,6 +23,5 @@
#define ARM_SMMU_OPT_MMU500_ERRATA1	(1 << 7)
#define ARM_SMMU_OPT_STATIC_CB          (1 << 8)
#define ARM_SMMU_OPT_HALT               (1 << 9)
#define ARM_SMMU_OPT_HIBERNATION	(1 << 10)

#endif