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

Commit ec6f7826 authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

iommu/arm-smmu: pass CB index for smmu programming by TZ



As required, pass Context bank index as an argument to TZ
interface, used to initialize smmu.

Change-Id: I088fecd54b45866a67c4cb44dd76b16d81ab7664
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent a28a4791
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -629,7 +629,7 @@ static bool is_dynamic_domain(struct iommu_domain *domain)
	return !!(smmu_domain->attributes & (1 << DOMAIN_ATTR_DYNAMIC));
	return !!(smmu_domain->attributes & (1 << DOMAIN_ATTR_DYNAMIC));
}
}


static int arm_smmu_restore_sec_cfg(struct arm_smmu_device *smmu)
static int arm_smmu_restore_sec_cfg(struct arm_smmu_device *smmu, u32 cb)
{
{
	int ret;
	int ret;
	int scm_ret = 0;
	int scm_ret = 0;
@@ -637,7 +637,7 @@ static int arm_smmu_restore_sec_cfg(struct arm_smmu_device *smmu)
	if (!arm_smmu_is_static_cb(smmu))
	if (!arm_smmu_is_static_cb(smmu))
		return 0;
		return 0;


	ret = scm_restore_sec_cfg(smmu->sec_id, 0x0, &scm_ret);
	ret = scm_restore_sec_cfg(smmu->sec_id, cb, &scm_ret);
	if (ret || scm_ret) {
	if (ret || scm_ret) {
		pr_err("scm call IOMMU_SECURE_CFG failed\n");
		pr_err("scm call IOMMU_SECURE_CFG failed\n");
		return -EINVAL;
		return -EINVAL;
@@ -3897,7 +3897,7 @@ static int regulator_notifier(struct notifier_block *nb,
	if (event == REGULATOR_EVENT_PRE_DISABLE)
	if (event == REGULATOR_EVENT_PRE_DISABLE)
		qsmmuv2_halt(smmu);
		qsmmuv2_halt(smmu);
	else if (event == REGULATOR_EVENT_ENABLE) {
	else if (event == REGULATOR_EVENT_ENABLE) {
		if (arm_smmu_restore_sec_cfg(smmu))
		if (arm_smmu_restore_sec_cfg(smmu, 0))
			goto power_off;
			goto power_off;
		qsmmuv2_resume(smmu);
		qsmmuv2_resume(smmu);
	}
	}
@@ -4050,7 +4050,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
	bool cttw_dt, cttw_reg;
	bool cttw_dt, cttw_reg;
	int i;
	int i;


	if (arm_smmu_restore_sec_cfg(smmu))
	if (arm_smmu_restore_sec_cfg(smmu, 0))
		return -ENODEV;
		return -ENODEV;


	dev_dbg(smmu->dev, "probing hardware configuration...\n");
	dev_dbg(smmu->dev, "probing hardware configuration...\n");