blob: 188616f599bd5ed353896bc7c82aefdcc4c4ef33 [file] [log] [blame]
Patrick Williams2194f502022-10-16 14:26:09 -05001From 97caa9365f221b5aff93274a29ea894da55dce88 Mon Sep 17 00:00:00 2001
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002From: Manoj Kumar <manoj.kumar3@arm.com>
3Date: Mon, 1 Feb 2021 21:36:43 +0530
Patrick Williams8dd68482022-10-04 07:57:18 -05004Subject: [PATCH] iommu/arm-smmu-v3: workaround for ATC_INV_SIZE_ALL in N1SDP
Brad Bishopbec4ebc2022-08-03 09:55:16 -04005
6ATC_INV_SIZE_ALL request should automatically translate to ATS
7address which is not happening in SMMUv3 version gone into
8N1SDP platform. This workaround manually sets the ATS address
9field to proper value for ATC_INV_SIZE_ALL command.
10
11Change-Id: If89465be94720a62be85e1e6612f17e93fa9b8a5
12Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
13Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
Patrick Williams8dd68482022-10-04 07:57:18 -050014
15Upstream-Status: Inappropriate [Workaround]
16Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Patrick Williams2194f502022-10-16 14:26:09 -050017Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
18Signed-off-by: Adam Johnston <adam.johnston@arm.com>
Brad Bishopbec4ebc2022-08-03 09:55:16 -040019---
20 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
21 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
22 2 files changed, 2 insertions(+)
23
24diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
Patrick Williams2194f502022-10-16 14:26:09 -050025index 88817a3376ef..80e252d59a3a 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040026--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
27+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
Patrick Williams2194f502022-10-16 14:26:09 -050028@@ -1731,6 +1731,7 @@ arm_smmu_atc_inv_to_cmd(int ssid, unsigned long iova, size_t size,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040029 };
30
31 if (!size) {
32+ cmd->atc.addr = ATC_INV_ADDR_ALL;
33 cmd->atc.size = ATC_INV_SIZE_ALL;
34 return;
35 }
36diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
Patrick Williams2194f502022-10-16 14:26:09 -050037index cd48590ada30..20892b2bfe1d 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040038--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
39+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
Patrick Williams2194f502022-10-16 14:26:09 -050040@@ -472,6 +472,7 @@ struct arm_smmu_cmdq_ent {
Brad Bishopbec4ebc2022-08-03 09:55:16 -040041
42 #define CMDQ_OP_ATC_INV 0x40
43 #define ATC_INV_SIZE_ALL 52
44+ #define ATC_INV_ADDR_ALL 0x7FFFFFFFFFFFF000UL
45 struct {
46 u32 sid;
47 u32 ssid;