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

Commit 1148824f authored by Sunil Khatri's avatar Sunil Khatri Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Program SMMU aperture only if tz support



SMMU aperture programming is done by clients as per
the newer tz model. In legacy tz model aperture
programming is handled by tz itself and clients
dont have to do it explicitly.

Before making a scm call make sure to check if tz
support aperture programming by clients.

Change-Id: I72558d4c13b4c8d72d9c7e8721711ffb383e8983
Signed-off-by: default avatarSunil Khatri <sunilkh@codeaurora.org>
Signed-off-by: default avatarUrvashi Agrawal <urvaagra@codeaurora.org>
parent f33e6d6a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include "kgsl_pwrctrl.h"

#define CP_APERTURE_REG	0
#define CP_SMMU_APERTURE_ID 0x1B

#define _IOMMU_PRIV(_mmu) (&((_mmu)->priv.iommu))

@@ -1172,7 +1173,7 @@ static int program_smmu_aperture(unsigned int cb, unsigned int aperture_reg)
	desc.args[3] = 0xFFFFFFFF;
	desc.arginfo = SCM_ARGS(4);

	return scm_call2(SCM_SIP_FNID(SCM_SVC_MP, 0x1B), &desc);
	return scm_call2(SCM_SIP_FNID(SCM_SVC_MP, CP_SMMU_APERTURE_ID), &desc);
}

static int _init_global_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt)
@@ -1215,7 +1216,8 @@ static int _init_global_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt)
		goto done;
	}

	if (!MMU_FEATURE(mmu, KGSL_MMU_GLOBAL_PAGETABLE)) {
	if (!MMU_FEATURE(mmu, KGSL_MMU_GLOBAL_PAGETABLE) &&
		scm_is_call_available(SCM_SVC_MP, CP_SMMU_APERTURE_ID)) {
		ret = program_smmu_aperture(cb_num, CP_APERTURE_REG);
		if (ret) {
			pr_err("SMMU aperture programming call failed with error %d\n",