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

Commit fdcde415 authored by Vishwanath Raju K's avatar Vishwanath Raju K Committed by Archana Sriram
Browse files

iommu/arm-smmu: Do not write to slave side protected context banks



For msm targets that have slave side access control, iommu
driver is not allowed to write to secure context bank register
space. Extend arm_smmu_skip_write logic to consider such
protected context bank ttbr address space as well for skipping.

Change-Id: Ibb6ee5a0425c1aa86ab82b78eca386de09baaace
Signed-off-by: default avatarVishwanath Raju K <vishk@codeaurora.org>
parent a2c17c17
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -55,11 +55,16 @@ extern void *get_smmu_from_addr(struct iommu_device *iommu, void __iomem *addr);
extern void *arm_smmu_get_by_addr(void __iomem *addr);
/* Donot write to smmu global space with CONFIG_MSM_TZ_SMMU */
#undef writel_relaxed
#undef writeq_relaxed
#define writel_relaxed(v, c)	do {					\
	if (!arm_smmu_skip_write(c))					\
		((void)__raw_writel((u32)cpu_to_le32(v), (c)));	\
	} while (0)

#define writeq_relaxed(v, c) do {                              \
	if (!arm_smmu_skip_write(c))                            \
		((void)__raw_writeq((u64)cpu_to_le64(v), (c))); \
	} while (0)
#else

static inline int msm_tz_smmu_atos_start(struct device *dev, int cb_num)