blob: e1cbb809193a2069fb28a8a56c9a3cc88b0a6990 [file] [log] [blame]
Patrick Williams8dd68482022-10-04 07:57:18 -05001From f88153a427046f92d52694708adc5ee0eefa8d55 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>
Brad Bishopbec4ebc2022-08-03 09:55:16 -040017---
18 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
19 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 +
20 2 files changed, 2 insertions(+)
21
22diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
Patrick Williams8dd68482022-10-04 07:57:18 -050023index 79edfdca6607..ded17e199ee4 100644
Brad Bishopbec4ebc2022-08-03 09:55:16 -040024--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
25+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
Patrick Williams8dd68482022-10-04 07:57:18 -050026@@ -1725,6 +1725,7 @@ arm_smmu_atc_inv_to_cmd(int ssid, unsigned long iova, size_t size,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040027 };
28
29 if (!size) {
30+ cmd->atc.addr = ATC_INV_ADDR_ALL;
31 cmd->atc.size = ATC_INV_SIZE_ALL;
32 return;
33 }
34diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
35index 4cb136f07914..5615ffd24e46 100644
36--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
37+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
38@@ -473,6 +473,7 @@ struct arm_smmu_cmdq_ent {
39
40 #define CMDQ_OP_ATC_INV 0x40
41 #define ATC_INV_SIZE_ALL 52
42+ #define ATC_INV_ADDR_ALL 0x7FFFFFFFFFFFF000UL
43 struct {
44 u32 sid;
45 u32 ssid;