aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>2017-08-21 07:17:24 -0400
committerTejun Heo <tj@kernel.org>2017-10-23 10:09:27 -0400
commitf0a559aae57cb824c8178d1042c60e5975ceb2a6 (patch)
tree2d773b115ac562ddc63c1ab877fa0f4adaf8f640
parent26bf3b6658a2137cd6a88b2f14f36d3c31c7b2ee (diff)
ata: ceva: Add SMMU support for SATA IP
AXI master interface in CEVA AHCI controller requires two unique Write/Read ID tags per port. This is because, ahci controller uses different AXI ID[3:0] bits for identifying non-data transfers(like reading descriptors, updating PRD tables, etc) and data transfers (like sending/receiving FIS).To make SMMU work with SATA we need to add correct SMMU stream id for SATA. SMMU stream id for SATA is determined based on the AXI ID[1:0] as shown below SATA SMMU ID = <TBU number>, 0011, 00, 00, AXI ID[1:0] Note: SATA in ZynqMp uses TBU1 so TBU number = 0x1, so SMMU ID = 001, 0011, 00, 00, AXI ID[1:0] Since we have four different AXI ID[3:0] (2 for port0 & 2 for port1 as said above) we get four different SMMU stream id's combinations for SATA. These AXI ID can be configured using PAXIC register. In this patch we assumed the below AXI ID values Read ID/ Write ID for Non-Data Port0 transfers = 0 Read ID/ Write ID for Data Port0 transfers = 1 Read ID/ Write ID for Non-Data Port1 transfers = 2 Read ID/ Write ID for Data Port1 transfers = 3 Based on the above values,SMMU stream ID's for SATA will be 0x4c0 & 0x4c1 for PORT0, 0x4c2 & 0x4c3 for PORT1. These values needed to be added to iommus dts property. This patch does the same. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/ahci_ceva.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index c0742cbe4faa..5ecc9d46cb54 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -38,8 +38,10 @@
38 38
39/* Vendor Specific Register bit definitions */ 39/* Vendor Specific Register bit definitions */
40#define PAXIC_ADBW_BW64 0x1 40#define PAXIC_ADBW_BW64 0x1
41#define PAXIC_MAWIDD (1 << 8) 41#define PAXIC_MAWID(i) (((i) * 2) << 4)
42#define PAXIC_MARIDD (1 << 16) 42#define PAXIC_MARID(i) (((i) * 2) << 12)
43#define PAXIC_MARIDD(i) ((((i) * 2) + 1) << 16)
44#define PAXIC_MAWIDD(i) ((((i) * 2) + 1) << 8)
43#define PAXIC_OTL (0x4 << 20) 45#define PAXIC_OTL (0x4 << 20)
44 46
45/* Register bit definitions for cache control */ 47/* Register bit definitions for cache control */
@@ -147,9 +149,11 @@ static void ahci_ceva_setup(struct ahci_host_priv *hpriv)
147 /* 149 /*
148 * AXI Data bus width to 64 150 * AXI Data bus width to 64
149 * Set Mem Addr Read, Write ID for data transfers 151 * Set Mem Addr Read, Write ID for data transfers
152 * Set Mem Addr Read ID, Write ID for non-data transfers
150 * Transfer limit to 72 DWord 153 * Transfer limit to 72 DWord
151 */ 154 */
152 tmp = PAXIC_ADBW_BW64 | PAXIC_MAWIDD | PAXIC_MARIDD | PAXIC_OTL; 155 tmp = PAXIC_ADBW_BW64 | PAXIC_MAWIDD(i) | PAXIC_MARIDD(i) |
156 PAXIC_MAWID(i) | PAXIC_MARID(i) | PAXIC_OTL;
153 writel(tmp, mmio + AHCI_VEND_PAXIC); 157 writel(tmp, mmio + AHCI_VEND_PAXIC);
154 158
155 /* Set AXI cache control register if CCi is enabled */ 159 /* Set AXI cache control register if CCi is enabled */