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

Commit bb9dbadf authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu/arm-smmu: Request TZ to change page table format to V8L"

parents d2fc5045 6847566c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1411,6 +1411,8 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
		/* CBA2R */
#ifdef CONFIG_64BIT
		reg = CBA2R_RW64_64BIT;
		if (!arm_smmu_has_secure_vmid(smmu_domain))
			msm_tz_set_cb_format(smmu->sec_id, cfg->cbndx);
#else
		reg = CBA2R_RW64_32BIT;
#endif
+27 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -53,6 +53,8 @@ static const char * const device_id_mappings[] = {
#define TZ_SMMU_ATOS_START 1
#define TZ_SMMU_ATOS_END 0

#define SMMU_CHANGE_PAGETABLE_FORMAT    0X01

enum tz_smmu_device_id msm_dev_to_device_id(struct device *dev)
{
	const char *device_id;
@@ -104,3 +106,27 @@ int msm_tz_smmu_atos_end(struct device *dev, int cb_num)
{
	return __msm_tz_smmu_atos(dev, cb_num, TZ_SMMU_ATOS_END);
}

void msm_tz_set_cb_format(enum tz_smmu_device_id sec_id, int cbndx)
{
	struct scm_desc desc = {0};
	unsigned int ret = 0;

	desc.args[0] = sec_id;
	desc.args[1] = cbndx;
	desc.args[2] = 1;	/* Enable */
	desc.arginfo = SCM_ARGS(3, SCM_VAL, SCM_VAL, SCM_VAL);

	ret = scm_call2(SCM_SIP_FNID(SCM_SVC_SMMU_PROGRAM,
			SMMU_CHANGE_PAGETABLE_FORMAT), &desc);

	/* At this stage, we cannot afford to fail because we have
	 * committed to support V8L format to client and we can't
	 * fallback.
	 */
	if (ret) {
		pr_err("Format change failed for CB %d with ret %d\n",
			cbndx, ret);
		BUG();
	}
}
+7 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -53,6 +53,7 @@ enum tz_smmu_device_id {
int msm_tz_smmu_atos_start(struct device *dev, int cb_num);
int msm_tz_smmu_atos_end(struct device *dev, int cb_num);
enum tz_smmu_device_id msm_dev_to_device_id(struct device *dev);
void msm_tz_set_cb_format(enum tz_smmu_device_id sec_id, int cbndx);

#else

@@ -71,6 +72,11 @@ static inline enum tz_smmu_device_id msm_dev_to_device_id(struct device *dev)
	return -EINVAL;
}

static inline void msm_tz_set_cb_format(enum tz_smmu_device_id sec_id,
					int cbndx)
{
}

#endif /* CONFIG_MSM_TZ_SMMU */

#endif /* __MSM_TZ_SMMU_H__ */