|
|
@@ -56,6 +56,15 @@
|
|
|
#include "io-pgtable.h"
|
|
|
#include "arm-smmu-regs.h"
|
|
|
|
|
|
+/*
|
|
|
+ * Apparently, some Qualcomm arm64 platforms which appear to expose their SMMU
|
|
|
+ * global register space are still, in fact, using a hypervisor to mediate it
|
|
|
+ * by trapping and emulating register accesses. Sadly, some deployed versions
|
|
|
+ * of said trapping code have bugs wherein they go horribly wrong for stores
|
|
|
+ * using r31 (i.e. XZR/WZR) as the source register.
|
|
|
+ */
|
|
|
+#define QCOM_DUMMY_VAL -1
|
|
|
+
|
|
|
#define ARM_MMU500_ACTLR_CPRE (1 << 1)
|
|
|
|
|
|
#define ARM_MMU500_ACR_CACHE_LOCK (1 << 26)
|
|
|
@@ -398,7 +407,7 @@ static void __arm_smmu_tlb_sync(struct arm_smmu_device *smmu,
|
|
|
{
|
|
|
unsigned int spin_cnt, delay;
|
|
|
|
|
|
- writel_relaxed(0, sync);
|
|
|
+ writel_relaxed(QCOM_DUMMY_VAL, sync);
|
|
|
for (delay = 1; delay < TLB_LOOP_TIMEOUT; delay *= 2) {
|
|
|
for (spin_cnt = TLB_SPIN_COUNT; spin_cnt > 0; spin_cnt--) {
|
|
|
if (!(readl_relaxed(status) & sTLBGSTATUS_GSACTIVE))
|
|
|
@@ -1637,8 +1646,8 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu)
|
|
|
}
|
|
|
|
|
|
/* Invalidate the TLB, just in case */
|
|
|
- writel_relaxed(0, gr0_base + ARM_SMMU_GR0_TLBIALLH);
|
|
|
- writel_relaxed(0, gr0_base + ARM_SMMU_GR0_TLBIALLNSNH);
|
|
|
+ writel_relaxed(QCOM_DUMMY_VAL, gr0_base + ARM_SMMU_GR0_TLBIALLH);
|
|
|
+ writel_relaxed(QCOM_DUMMY_VAL, gr0_base + ARM_SMMU_GR0_TLBIALLNSNH);
|
|
|
|
|
|
reg = readl_relaxed(ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
|
|
|
|