summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorjiaheng.fan <jiaheng.fan@nxp.com>2017-05-25 03:16:15 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:39 (GMT)
commit2294df192fa3e69cf3712348cfa899d08dd9fe80 (patch)
tree9d06d3beefd22aeb3279e2010dbef9e993911a6d /drivers/dma
parent3bd4ba576ba49efdc1b7da4db6afc5ee1de53a8a (diff)
downloadlinux-2294df192fa3e69cf3712348cfa899d08dd9fe80.tar.xz
dma: fsl-dpaa-qdma: support qDMA from LS2 rev2
Update qDMA driver to work with qDMA IP ver 1.1 from LS2 rev2. The driver is still compatible with IP v1.0 from rev1. Set the transaction type for command field for both source and destination descriptors to coherent copy of cacheable memory. Don't enable source prefetchable (SPF) in IP v1.0 FD since it overlaps with IP v1.1 source read transaction QoS field. Signed-off-by: Catalin Horghidan <catalin.horghidan@nxp.com> Signed-off-by: jiaheng.fan <jiaheng.fan@nxp.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/dpaa2-qdma/dpaa2-qdma.c7
-rw-r--r--drivers/dma/dpaa2-qdma/dpaa2-qdma.h7
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/dma/dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/dpaa2-qdma/dpaa2-qdma.c
index 24019b8..270ccfa 100644
--- a/drivers/dma/dpaa2-qdma/dpaa2-qdma.c
+++ b/drivers/dma/dpaa2-qdma/dpaa2-qdma.c
@@ -130,7 +130,7 @@ static void dpaa2_qdma_populate_fd(uint32_t format,
fd->simple.bpid = QMAN_FD_BMT_ENABLE;
fd->simple.format_offset = QMAN_FD_FMT_ENABLE | QMAN_FD_SL_DISABLE;
- fd->simple.frc = format | QDMA_SER_CTX | QDMA_FD_SPF_ENALBE;
+ fd->simple.frc = format | QDMA_SER_CTX;
fd->simple.ctrl = QMAN_FD_VA_DISABLE |
QMAN_FD_CBMT_ENABLE | QMAN_FD_SC_DISABLE;
}
@@ -143,10 +143,11 @@ static void dpaa2_qdma_populate_first_framel(
struct dpaa2_qdma_sd_d *sdd;
sdd = (struct dpaa2_qdma_sd_d *)dpaa2_comp->desc_virt_addr;
+ memset(sdd, 0, 2 * (sizeof(*sdd)));
/* source and destination descriptor */
- sdd->cmd = CMD_TTYPE_RW; /* source descriptor CMD */
+ sdd->cmd = QDMA_SD_CMD_RDTTYPE_COHERENT; /* source descriptor CMD */
sdd++;
- sdd->cmd = CMD_TTYPE_RW; /* destination descriptor CMD */
+ sdd->cmd = QDMA_DD_CMD_WRTTYPE_COHERENT; /* dest descriptor CMD */
memset(f_list, 0, sizeof(struct dpaa2_frame_list));
/* first frame list to source descriptor */
diff --git a/drivers/dma/dpaa2-qdma/dpaa2-qdma.h b/drivers/dma/dpaa2-qdma/dpaa2-qdma.h
index 5dd8dd2..c5101e1 100644
--- a/drivers/dma/dpaa2-qdma/dpaa2-qdma.h
+++ b/drivers/dma/dpaa2-qdma/dpaa2-qdma.h
@@ -61,7 +61,12 @@ struct dpaa2_qdma_sd_d {
uint32_t rbpcmd; /* Route-by-port command */
uint32_t cmd;
} __attribute__((__packed__));
-#define CMD_TTYPE_RW (0x4 << 28)
+/* Source descriptor command read transaction type for RBP=0:
+ coherent copy of cacheable memory */
+#define QDMA_SD_CMD_RDTTYPE_COHERENT (0xb << 28)
+/* Destination descriptor command write transaction type for RBP=0:
+ coherent copy of cacheable memory */
+#define QDMA_DD_CMD_WRTTYPE_COHERENT (0x6 << 28)
#define QDMA_SG_FMT_SDB 0x0 /* single data buffer */
#define QDMA_SG_FMT_FDS 0x1 /* frame data section */