Skip to contentSkip to conversation

dmaengine: fsl-dpaa2-qdma: Add the DPDMAI(Data Path DMA Interface) support

PATCH Superseded Peng Ma 2 participants 3 messages Mar 4, 2019 dmaengine

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Peng Ma

author
#0 lore raw

PATCH v2 1/2 dmaengine: fsl-dpaa2-qdma: Add the DPDMAI(Data Path DMA Interface) support

The MC exports the DPDMAI object as an interface to operate the DPAA2 QDMA Engine. The DPDMAI enables sending frame-based requests to QDMA and receiving back confirmation response on transaction completion, utilizing the DPAA2 QBMan infrastructure. DPDMAI object provides up to two priorities for processing QDMA requests.
The following list summarizes the DPDMAI main features and capabilities:
1. Supports up to two scheduling priorities for processing service requests.
- Each DPDMAI transmit queue is mapped to one of two service priorities, allowing further prioritization in hardware between requests from different DPDMAI objects.
2. Supports up to two receive queues for incoming transaction completion confirmations.
- Each DPDMAI receive queue is mapped to one of two receive priorities, allowing further prioritization between other interfaces when associating the DPDMAI receive queues to DPIO or DPCON objects.
3. Supports different scheduling options for processing received packets:
- Queues can be configured either in 'parked' mode (default), oattached to a DPIO object, or attached to DPCON object.
4. Allows interaction with one or more DPIO objects for dequeueing/enqueueing frame descriptors(FD) and for acquiring/releasing buffers.
5. Supports enable, disable, and reset operations.
Add DPDMAI to support some platforms with dpaa2 qdma engine.

---
change for v2:
- split the v1 patch to two patchs
- add detail comments

 drivers/dma/fsl-dpaa2-qdma/dpdmai.c     |  483 ++++++++++++++++++++++++++++
 drivers/dma/fsl-dpaa2-qdma/dpdmai.h     |  524 +++++++++++++++++++++++++++++++
 drivers/dma/fsl-dpaa2-qdma/dpdmai_cmd.h |  197 ++++++++++++
 3 files changed, 1204 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/dpdmai.c
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/dpdmai.h
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/dpdmai_cmd.h
drivers/dma/fsl-dpaa2-qdma/dpdmai.c new file +483 -0
new file mode 100644
index 0000000..685eabe
@@ -0,0 +1,483 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright 2014-2018 NXP
+
+#include <linux/types.h>
+#include <linux/io.h>
+#include "dpdmai.h"
+#include "dpdmai_cmd.h"
+#include <linux/fsl/mc.h>
+
+struct dpdmai_cmd_open {
+	__le32 dpdmai_id;
+};
+
+struct dpdmai_rsp_get_attributes {
+	__le32 id;
+	u8 num_of_priorities;
+	u8 pad0[3];
+	__le16 major;
+	__le16 minor;
+};
+
+struct dpdmai_cmd_queue {
+	__le32 dest_id;
+	u8 priority;
+	u8 queue;
+	u8 dest_type;
+	u8 pad;
+	__le64 user_ctx;
+	union {
+		__le32 options;
+		__le32 fqid;
+	};
+};
+
+struct dpdmai_rsp_get_tx_queue {
+	__le64 pad;
+	__le32 fqid;
+};
+
+int dpdmai_open(struct fsl_mc_io *mc_io,
+		u32 cmd_flags,
+		int dpdmai_id,
+		u16 *token)
+{
+	struct fsl_mc_command cmd = { 0 };
+	struct dpdmai_cmd_open *cmd_params;
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_OPEN,
+					  cmd_flags,
+					  0);
+
+	cmd_params = (struct dpdmai_cmd_open *)cmd.params;
+	cmd_params->dpdmai_id = cpu_to_le32(dpdmai_id);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	*token = mc_cmd_hdr_read_token(&cmd);
+	return 0;
+}
+
+int dpdmai_close(struct fsl_mc_io *mc_io,
+		 u32 cmd_flags,
+		 u16 token)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_CLOSE,
+					  cmd_flags, token);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_create(struct fsl_mc_io *mc_io,
+		  u32 cmd_flags,
+		  const struct dpdmai_cfg *cfg,
+		  u16 *token)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_CREATE,
+					  cmd_flags,
+					  0);
+	DPDMAI_CMD_CREATE(cmd, cfg);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	*token = MC_CMD_HDR_READ_TOKEN(cmd.header);
+
+	return 0;
+}
+
+int dpdmai_destroy(struct fsl_mc_io *mc_io,
+		   u32 cmd_flags,
+		   u16 token)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_DESTROY,
+					  cmd_flags,
+					  token);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_enable(struct fsl_mc_io *mc_io,
+		  u32 cmd_flags,
+		  u16 token)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_ENABLE,
+					  cmd_flags,
+					  token);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_disable(struct fsl_mc_io *mc_io,
+		   u32 cmd_flags,
+		   u16 token)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_DISABLE,
+					  cmd_flags,
+					  token);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_is_enabled(struct fsl_mc_io *mc_io,
+		      u32 cmd_flags,
+		      u16 token,
+		      int *en)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_IS_ENABLED,
+					  cmd_flags,
+					  token);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	DPDMAI_RSP_IS_ENABLED(cmd, *en);
+
+	return 0;
+}
+
+int dpdmai_reset(struct fsl_mc_io *mc_io,
+		 u32 cmd_flags,
+		 u16 token)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_RESET,
+					  cmd_flags,
+					  token);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_get_irq(struct fsl_mc_io *mc_io,
+		   u32 cmd_flags,
+		   u16 token,
+		   u8 irq_index,
+		   int *type,
+		   struct dpdmai_irq_cfg	*irq_cfg)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_IRQ,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_GET_IRQ(cmd, irq_index);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	DPDMAI_RSP_GET_IRQ(cmd, *type, irq_cfg);
+
+	return 0;
+}
+
+int dpdmai_set_irq(struct fsl_mc_io *mc_io,
+		   u32 cmd_flags,
+		   u16 token,
+		   u8 irq_index,
+		   struct dpdmai_irq_cfg *irq_cfg)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_SET_IRQ,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_SET_IRQ(cmd, irq_index, irq_cfg);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_get_irq_enable(struct fsl_mc_io *mc_io,
+			  u32 cmd_flags,
+			  u16 token,
+			  u8 irq_index,
+			  u8 *en)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_IRQ_ENABLE,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_GET_IRQ_ENABLE(cmd, irq_index);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	DPDMAI_RSP_GET_IRQ_ENABLE(cmd, *en);
+
+	return 0;
+}
+
+int dpdmai_set_irq_enable(struct fsl_mc_io *mc_io,
+			  u32 cmd_flags,
+			  u16 token,
+			  u8 irq_index,
+			  u8 en)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_SET_IRQ_ENABLE,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_SET_IRQ_ENABLE(cmd, irq_index, en);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_get_irq_mask(struct fsl_mc_io *mc_io,
+			u32 cmd_flags,
+			u16 token,
+			u8 irq_index,
+			u32 *mask)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_IRQ_MASK,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_GET_IRQ_MASK(cmd, irq_index);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	DPDMAI_RSP_GET_IRQ_MASK(cmd, *mask);
+
+	return 0;
+}
+
+int dpdmai_set_irq_mask(struct fsl_mc_io *mc_io,
+			u32 cmd_flags,
+			u16 token,
+			u8 irq_index,
+			u32 mask)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_SET_IRQ_MASK,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_SET_IRQ_MASK(cmd, irq_index, mask);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_get_irq_status(struct fsl_mc_io *mc_io,
+			  u32 cmd_flags,
+			  u16 token,
+			  u8 irq_index,
+			  u32 *status)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_IRQ_STATUS,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_GET_IRQ_STATUS(cmd, irq_index, *status);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	DPDMAI_RSP_GET_IRQ_STATUS(cmd, *status);
+
+	return 0;
+}
+
+int dpdmai_clear_irq_status(struct fsl_mc_io *mc_io,
+			    u32 cmd_flags,
+			    u16 token,
+			    u8 irq_index,
+			    u32 status)
+{
+	struct fsl_mc_command cmd = { 0 };
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_CLEAR_IRQ_STATUS,
+					  cmd_flags,
+					  token);
+	DPDMAI_CMD_CLEAR_IRQ_STATUS(cmd, irq_index, status);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_get_attributes(struct fsl_mc_io *mc_io,
+			  u32 cmd_flags,
+			  u16 token,
+			  struct dpdmai_attr *attr)
+{
+	struct fsl_mc_command cmd = { 0 };
+	int err;
+	struct dpdmai_rsp_get_attributes *rsp_params;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_ATTR,
+					  cmd_flags,
+					  token);
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	rsp_params = (struct dpdmai_rsp_get_attributes *)cmd.params;
+	attr->id = le32_to_cpu(rsp_params->id);
+	attr->version.major = le16_to_cpu(rsp_params->major);
+	attr->version.minor = le16_to_cpu(rsp_params->minor);
+	attr->num_of_priorities = rsp_params->num_of_priorities;
+
+	return 0;
+}
+
+int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io,
+			u32 cmd_flags,
+			u16 token,
+			u8 priority,
+			const struct dpdmai_rx_queue_cfg *cfg)
+{
+	struct fsl_mc_command cmd = { 0 };
+	struct dpdmai_cmd_queue *cmd_params;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_SET_RX_QUEUE,
+					  cmd_flags,
+					  token);
+
+	cmd_params = (struct dpdmai_cmd_queue *)cmd.params;
+	cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id);
+	cmd_params->priority = cfg->dest_cfg.priority;
+	cmd_params->queue = priority;
+	cmd_params->dest_type = cfg->dest_cfg.dest_type;
+	cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx);
+	cmd_params->options = cpu_to_le32(cfg->options);
+
+	/* send command to mc*/
+	return mc_send_command(mc_io, &cmd);
+}
+
+int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io,
+			u32 cmd_flags,
+			u16 token,
+			u8 priority, struct dpdmai_rx_queue_attr *attr)
+{
+	struct fsl_mc_command cmd = { 0 };
+	struct dpdmai_cmd_queue *cmd_params;
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_RX_QUEUE,
+					  cmd_flags,
+					  token);
+
+	cmd_params = (struct dpdmai_cmd_queue *)cmd.params;
+	cmd_params->queue = priority;
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+	attr->dest_cfg.dest_id = le32_to_cpu(cmd_params->dest_id);
+	attr->dest_cfg.priority = cmd_params->priority;
+	attr->dest_cfg.dest_type = cmd_params->dest_type;
+	attr->user_ctx = le64_to_cpu(cmd_params->user_ctx);
+	attr->fqid = le32_to_cpu(cmd_params->fqid);
+
+	return 0;
+}
+
+int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io,
+			u32 cmd_flags,
+			u16 token,
+			u8 priority,
+			struct dpdmai_tx_queue_attr *attr)
+{
+	struct fsl_mc_command cmd = { 0 };
+	struct dpdmai_cmd_queue *cmd_params;
+	struct dpdmai_rsp_get_tx_queue *rsp_params;
+	int err;
+
+	/* prepare command */
+	cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_GET_TX_QUEUE,
+					  cmd_flags,
+					  token);
+
+	cmd_params = (struct dpdmai_cmd_queue *)cmd.params;
+	cmd_params->queue = priority;
+
+	/* send command to mc*/
+	err = mc_send_command(mc_io, &cmd);
+	if (err)
+		return err;
+
+	/* retrieve response parameters */
+
+	rsp_params = (struct dpdmai_rsp_get_tx_queue *)cmd.params;
+	attr->fqid = le32_to_cpu(rsp_params->fqid);
+
+	return 0;
+}
drivers/dma/fsl-dpaa2-qdma/dpdmai.h new file +524 -0

524 lines not on this page · raw message

drivers/dma/fsl-dpaa2-qdma/dpdmai_cmd.h new file +197 -0

197 lines not on this page · raw message

author
#1 lore raw

PATCH v2 2/2 dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs

DPPA2(Data Path Acceleration Architecture 2) qDMA
The qDMA supports channel virtualization by allowing DMA jobs to be enqueued into different frame queues. Core can initiate a DMA transaction by preparing a frame descriptor(FD) for each DMA job and enqueuing this job to a frame queue. through a hardware portal. The qDMA prefetches DMA jobs from the frame queues. It then schedules and dispatches to internal DMA hardware engines, which generate read and write requests. Both qDMA source data and destination data can be either contiguous or non-contiguous using one or more scatter/gather tables. The qDMA supports global bandwidth flow control where all DMA transactions are stalled if the bandwidth threshold has been reached. Also supported are transaction based read throttling.

Add NXP dppa2 qDMA to support some of Layerscape SoCs. such as: LS1088A, LS208xA, LX2, etc.

---
change for v2:
- split the v1 patch to two patchs
- add detail comments

 drivers/dma/Kconfig                     |    2 +
 drivers/dma/Makefile                    |    1 +
 drivers/dma/fsl-dpaa2-qdma/Kconfig      |    8 +
 drivers/dma/fsl-dpaa2-qdma/Makefile     |    3 +
 drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c |  781 +++++++++++++++++++++++++++++++
 drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.h |  152 ++++++
 6 files changed, 947 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/Kconfig
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/Makefile
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c
 create mode 100644 drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.h
drivers/dma/Kconfig +2 -0
index 0b1dfb5..d590412 100644
@@ -671,6 +671,8 @@ source "drivers/dma/sh/Kconfig"
 
 source "drivers/dma/ti/Kconfig"
 
+source "drivers/dma/fsl-dpaa2-qdma/Kconfig"
+
 # clients
 comment "DMA Clients"
 	depends on DMA_ENGINE
drivers/dma/Makefile +1 -0
index 6126e1c..2499ed8 100644
@@ -75,6 +75,7 @@ obj-$(CONFIG_UNIPHIER_MDMAC) += uniphier-mdmac.o
 obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
 obj-$(CONFIG_ZX_DMA) += zx_dma.o
 obj-$(CONFIG_ST_FDMA) += st_fdma.o
+obj-$(CONFIG_FSL_DPAA2_QDMA) += fsl-dpaa2-qdma/
 
 obj-y += mediatek/
 obj-y += qcom/
drivers/dma/fsl-dpaa2-qdma/Kconfig new file +8 -0
new file mode 100644
index 0000000..ec591fc
@@ -0,0 +1,8 @@
+menuconfig FSL_DPAA2_QDMA
+	tristate "NXP DPAA2 QDMA"
+	depends on FSL_MC_BUS && FSL_MC_DPIO
+	select DMA_ENGINE
+	select DMA_VIRTUAL_CHANNELS
+	help
+	  NXP Data Path Acceleration Architecture 2 QDMA driver,
+	  using the NXP MC bus driver.
drivers/dma/fsl-dpaa2-qdma/Makefile new file +3 -0
new file mode 100644
index 0000000..c1d0226
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+# Makefile for the NXP DPAA2 qDMA controllers
+obj-$(CONFIG_FSL_DPAA2_QDMA) += dpaa2-qdma.o dpdmai.o
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c new file +781 -0

781 lines not on this page · raw message

drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.h new file +152 -0

152 lines not on this page · raw message

#2 lore raw

Re: [v2 2/2] dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs

Thank you for the patch! Perhaps something to improve:

Hi Peng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.0 next-20190304]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Peng-Ma/dmaengine-fsl-dpaa2-qdma-Add-the-DPDMAI-Data-Path-DMA-Interface-support/20190304-204911
reproduce:

        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

All warnings (new ones prefixed by >>):

>> drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:151:18: sparse: warning: incorrect type in assignment (different base types)

drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:151:18: sparse: expected unsigned int [usertype] cmd
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:151:18: sparse: got restricted __le32 [usertype]
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:156:26: sparse: warning: incorrect type in assignment (different base types)
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:156:26: sparse: expected unsigned int [usertype] cmd
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:156:26: sparse: got restricted __le32 [usertype]
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:158:26: sparse: warning: incorrect type in assignment (different base types)
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:158:26: sparse: expected unsigned int [usertype] cmd
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:158:26: sparse: got restricted __le32 [usertype]
---

>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse: warning: invalid assignment: |=
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    left side has type restricted __le64
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    right side has type unsigned long long
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse: warning: invalid assignment: |=
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    left side has type restricted __le64
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    right side has type unsigned long long
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:101:18: sparse: warning: incorrect type in argument 1 (different base types)

drivers/dma/fsl-dpaa2-qdma/dpdmai.c:101:18: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:101:18: sparse: got restricted __le64 [addressable] [assigned] [usertype] header
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:169:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:169:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:169:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:203:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:203:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:203:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:247:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:247:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:247:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:255:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:255:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:255:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:291:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:291:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:291:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:299:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:299:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:299:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:343:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:343:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:343:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: right side has type unsigned long long

sparse warnings: (new ones prefixed by >>)

drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:151:18: sparse: warning: incorrect type in assignment (different base types)

>> drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:151:18: sparse:    expected unsigned int [usertype] cmd
>> drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:151:18: sparse:    got restricted __le32 [usertype]

drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:156:26: sparse: warning: incorrect type in assignment (different base types)
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:156:26: sparse: expected unsigned int [usertype] cmd
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:156:26: sparse: got restricted __le32 [usertype]
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:158:26: sparse: warning: incorrect type in assignment (different base types)
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:158:26: sparse: expected unsigned int [usertype] cmd
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c:158:26: sparse: got restricted __le32 [usertype]
--
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse: warning: invalid assignment: |=

>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    left side has type restricted __le64
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    right side has type unsigned long long
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse: warning: invalid assignment: |=
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    left side has type restricted __le64
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:93:9: sparse:    right side has type unsigned long long
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:101:18: sparse: warning: incorrect type in argument 1 (different base types)
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:101:18: sparse:    expected unsigned long long [usertype] val
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:101:18: sparse:    got restricted __le64 [addressable] [assigned] [usertype] header
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:169:9: sparse: warning: incorrect type in argument 1 (different base types)
   drivers/dma/fsl-dpaa2-qdma/dpdmai.c:169:9: sparse:    expected unsigned long long [usertype] val
>> drivers/dma/fsl-dpaa2-qdma/dpdmai.c:169:9: sparse:    got restricted __le64

drivers/dma/fsl-dpaa2-qdma/dpdmai.c:203:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:203:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:203:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:211:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:228:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:247:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:247:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:247:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:255:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:255:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:255:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:272:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:291:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:291:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:291:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:299:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:299:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:299:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:316:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:335:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:343:9: sparse: warning: incorrect type in argument 1 (different base types)
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:343:9: sparse: expected unsigned long long [usertype] val
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:343:9: sparse: got restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: right side has type unsigned long long
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: warning: invalid assignment: |=
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: left side has type restricted __le64
drivers/dma/fsl-dpaa2-qdma/dpdmai.c:360:9: sparse: right side has type unsigned long long

vim +151 drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c

138
139 /* first frame list for descriptor buffer */
140 static void
141 dpaa2_qdma_populate_first_framel(struct dpaa2_fl_entry *f_list,
142 struct dpaa2_qdma_comp *dpaa2_comp,
143 bool wrt_changed)
144 {
145 struct dpaa2_qdma_sd_d *sdd;
146
147 sdd = (struct dpaa2_qdma_sd_d *)dpaa2_comp->desc_virt_addr;
148 memset(sdd, 0, 2 * (sizeof(*sdd)));
149
150 /* source descriptor CMD */

 > 151		sdd->cmd = cpu_to_le32(QDMA_SD_CMD_RDTTYPE_COHERENT);

152 sdd++;
153
154 /* dest descriptor CMD */
155 if (wrt_changed)
156 sdd->cmd = cpu_to_le32(LX2160_QDMA_DD_CMD_WRTTYPE_COHERENT);
157 else
158 sdd->cmd = cpu_to_le32(QDMA_DD_CMD_WRTTYPE_COHERENT);
159
160 memset(f_list, 0, sizeof(struct dpaa2_fl_entry));
161
162 /* first frame list to source descriptor */
163 dpaa2_fl_set_addr(f_list, dpaa2_comp->desc_bus_addr);
164 dpaa2_fl_set_len(f_list, 0x20);
165 dpaa2_fl_set_format(f_list, QDMA_FL_FMT_SBF | QDMA_FL_SL_LONG);
166
167 /* bypass memory translation */
168 if (smmu_disable)
169 f_list->bpid = cpu_to_le16(QDMA_FL_BMT_ENABLE);
170 }
171

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation