18c2ecf20Sopenharmony_ci// SPDX-License-Identifier:  GPL-2.0
28c2ecf20Sopenharmony_ci// (C) 2017-2018 Synopsys, Inc. (www.synopsys.com)
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci/*
58c2ecf20Sopenharmony_ci * Synopsys DesignWare AXI DMA Controller driver.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef _AXI_DMA_PLATFORM_H
118c2ecf20Sopenharmony_ci#define _AXI_DMA_PLATFORM_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/bitops.h>
148c2ecf20Sopenharmony_ci#include <linux/clk.h>
158c2ecf20Sopenharmony_ci#include <linux/device.h>
168c2ecf20Sopenharmony_ci#include <linux/dmaengine.h>
178c2ecf20Sopenharmony_ci#include <linux/types.h>
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#include "../virt-dma.h"
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define DMAC_MAX_CHANNELS	8
228c2ecf20Sopenharmony_ci#define DMAC_MAX_MASTERS	2
238c2ecf20Sopenharmony_ci#define DMAC_MAX_BLK_SIZE	0x200000
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_cistruct dw_axi_dma_hcfg {
268c2ecf20Sopenharmony_ci	u32	nr_channels;
278c2ecf20Sopenharmony_ci	u32	nr_masters;
288c2ecf20Sopenharmony_ci	u32	m_data_width;
298c2ecf20Sopenharmony_ci	u32	block_size[DMAC_MAX_CHANNELS];
308c2ecf20Sopenharmony_ci	u32	priority[DMAC_MAX_CHANNELS];
318c2ecf20Sopenharmony_ci	/* maximum supported axi burst length */
328c2ecf20Sopenharmony_ci	u32	axi_rw_burst_len;
338c2ecf20Sopenharmony_ci	bool	restrict_axi_burst_len;
348c2ecf20Sopenharmony_ci};
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistruct axi_dma_chan {
378c2ecf20Sopenharmony_ci	struct axi_dma_chip		*chip;
388c2ecf20Sopenharmony_ci	void __iomem			*chan_regs;
398c2ecf20Sopenharmony_ci	u8				id;
408c2ecf20Sopenharmony_ci	atomic_t			descs_allocated;
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci	struct virt_dma_chan		vc;
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci	/* these other elements are all protected by vc.lock */
458c2ecf20Sopenharmony_ci	bool				is_paused;
468c2ecf20Sopenharmony_ci};
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_cistruct dw_axi_dma {
498c2ecf20Sopenharmony_ci	struct dma_device	dma;
508c2ecf20Sopenharmony_ci	struct dw_axi_dma_hcfg	*hdata;
518c2ecf20Sopenharmony_ci	struct dma_pool		*desc_pool;
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	/* channels */
548c2ecf20Sopenharmony_ci	struct axi_dma_chan	*chan;
558c2ecf20Sopenharmony_ci};
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_cistruct axi_dma_chip {
588c2ecf20Sopenharmony_ci	struct device		*dev;
598c2ecf20Sopenharmony_ci	int			irq;
608c2ecf20Sopenharmony_ci	void __iomem		*regs;
618c2ecf20Sopenharmony_ci	struct clk		*core_clk;
628c2ecf20Sopenharmony_ci	struct clk		*cfgr_clk;
638c2ecf20Sopenharmony_ci	struct dw_axi_dma	*dw;
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* LLI == Linked List Item */
678c2ecf20Sopenharmony_cistruct __packed axi_dma_lli {
688c2ecf20Sopenharmony_ci	__le64		sar;
698c2ecf20Sopenharmony_ci	__le64		dar;
708c2ecf20Sopenharmony_ci	__le32		block_ts_lo;
718c2ecf20Sopenharmony_ci	__le32		block_ts_hi;
728c2ecf20Sopenharmony_ci	__le64		llp;
738c2ecf20Sopenharmony_ci	__le32		ctl_lo;
748c2ecf20Sopenharmony_ci	__le32		ctl_hi;
758c2ecf20Sopenharmony_ci	__le32		sstat;
768c2ecf20Sopenharmony_ci	__le32		dstat;
778c2ecf20Sopenharmony_ci	__le32		status_lo;
788c2ecf20Sopenharmony_ci	__le32		status_hi;
798c2ecf20Sopenharmony_ci	__le32		reserved_lo;
808c2ecf20Sopenharmony_ci	__le32		reserved_hi;
818c2ecf20Sopenharmony_ci};
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_cistruct axi_dma_desc {
848c2ecf20Sopenharmony_ci	struct axi_dma_lli		lli;
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci	struct virt_dma_desc		vd;
878c2ecf20Sopenharmony_ci	struct axi_dma_chan		*chan;
888c2ecf20Sopenharmony_ci	struct list_head		xfer_list;
898c2ecf20Sopenharmony_ci};
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_cistatic inline struct device *dchan2dev(struct dma_chan *dchan)
928c2ecf20Sopenharmony_ci{
938c2ecf20Sopenharmony_ci	return &dchan->dev->device;
948c2ecf20Sopenharmony_ci}
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cistatic inline struct device *chan2dev(struct axi_dma_chan *chan)
978c2ecf20Sopenharmony_ci{
988c2ecf20Sopenharmony_ci	return &chan->vc.chan.dev->device;
998c2ecf20Sopenharmony_ci}
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_cistatic inline struct axi_dma_desc *vd_to_axi_desc(struct virt_dma_desc *vd)
1028c2ecf20Sopenharmony_ci{
1038c2ecf20Sopenharmony_ci	return container_of(vd, struct axi_dma_desc, vd);
1048c2ecf20Sopenharmony_ci}
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_cistatic inline struct axi_dma_chan *vc_to_axi_dma_chan(struct virt_dma_chan *vc)
1078c2ecf20Sopenharmony_ci{
1088c2ecf20Sopenharmony_ci	return container_of(vc, struct axi_dma_chan, vc);
1098c2ecf20Sopenharmony_ci}
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_cistatic inline struct axi_dma_chan *dchan_to_axi_dma_chan(struct dma_chan *dchan)
1128c2ecf20Sopenharmony_ci{
1138c2ecf20Sopenharmony_ci	return vc_to_axi_dma_chan(to_virt_chan(dchan));
1148c2ecf20Sopenharmony_ci}
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci#define COMMON_REG_LEN		0x100
1188c2ecf20Sopenharmony_ci#define CHAN_REG_LEN		0x100
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci/* Common registers offset */
1218c2ecf20Sopenharmony_ci#define DMAC_ID			0x000 /* R DMAC ID */
1228c2ecf20Sopenharmony_ci#define DMAC_COMPVER		0x008 /* R DMAC Component Version */
1238c2ecf20Sopenharmony_ci#define DMAC_CFG		0x010 /* R/W DMAC Configuration */
1248c2ecf20Sopenharmony_ci#define DMAC_CHEN		0x018 /* R/W DMAC Channel Enable */
1258c2ecf20Sopenharmony_ci#define DMAC_CHEN_L		0x018 /* R/W DMAC Channel Enable 00-31 */
1268c2ecf20Sopenharmony_ci#define DMAC_CHEN_H		0x01C /* R/W DMAC Channel Enable 32-63 */
1278c2ecf20Sopenharmony_ci#define DMAC_INTSTATUS		0x030 /* R DMAC Interrupt Status */
1288c2ecf20Sopenharmony_ci#define DMAC_COMMON_INTCLEAR	0x038 /* W DMAC Interrupt Clear */
1298c2ecf20Sopenharmony_ci#define DMAC_COMMON_INTSTATUS_ENA 0x040 /* R DMAC Interrupt Status Enable */
1308c2ecf20Sopenharmony_ci#define DMAC_COMMON_INTSIGNAL_ENA 0x048 /* R/W DMAC Interrupt Signal Enable */
1318c2ecf20Sopenharmony_ci#define DMAC_COMMON_INTSTATUS	0x050 /* R DMAC Interrupt Status */
1328c2ecf20Sopenharmony_ci#define DMAC_RESET		0x058 /* R DMAC Reset Register1 */
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/* DMA channel registers offset */
1358c2ecf20Sopenharmony_ci#define CH_SAR			0x000 /* R/W Chan Source Address */
1368c2ecf20Sopenharmony_ci#define CH_DAR			0x008 /* R/W Chan Destination Address */
1378c2ecf20Sopenharmony_ci#define CH_BLOCK_TS		0x010 /* R/W Chan Block Transfer Size */
1388c2ecf20Sopenharmony_ci#define CH_CTL			0x018 /* R/W Chan Control */
1398c2ecf20Sopenharmony_ci#define CH_CTL_L		0x018 /* R/W Chan Control 00-31 */
1408c2ecf20Sopenharmony_ci#define CH_CTL_H		0x01C /* R/W Chan Control 32-63 */
1418c2ecf20Sopenharmony_ci#define CH_CFG			0x020 /* R/W Chan Configuration */
1428c2ecf20Sopenharmony_ci#define CH_CFG_L		0x020 /* R/W Chan Configuration 00-31 */
1438c2ecf20Sopenharmony_ci#define CH_CFG_H		0x024 /* R/W Chan Configuration 32-63 */
1448c2ecf20Sopenharmony_ci#define CH_LLP			0x028 /* R/W Chan Linked List Pointer */
1458c2ecf20Sopenharmony_ci#define CH_STATUS		0x030 /* R Chan Status */
1468c2ecf20Sopenharmony_ci#define CH_SWHSSRC		0x038 /* R/W Chan SW Handshake Source */
1478c2ecf20Sopenharmony_ci#define CH_SWHSDST		0x040 /* R/W Chan SW Handshake Destination */
1488c2ecf20Sopenharmony_ci#define CH_BLK_TFR_RESUMEREQ	0x048 /* W Chan Block Transfer Resume Req */
1498c2ecf20Sopenharmony_ci#define CH_AXI_ID		0x050 /* R/W Chan AXI ID */
1508c2ecf20Sopenharmony_ci#define CH_AXI_QOS		0x058 /* R/W Chan AXI QOS */
1518c2ecf20Sopenharmony_ci#define CH_SSTAT		0x060 /* R Chan Source Status */
1528c2ecf20Sopenharmony_ci#define CH_DSTAT		0x068 /* R Chan Destination Status */
1538c2ecf20Sopenharmony_ci#define CH_SSTATAR		0x070 /* R/W Chan Source Status Fetch Addr */
1548c2ecf20Sopenharmony_ci#define CH_DSTATAR		0x078 /* R/W Chan Destination Status Fetch Addr */
1558c2ecf20Sopenharmony_ci#define CH_INTSTATUS_ENA	0x080 /* R/W Chan Interrupt Status Enable */
1568c2ecf20Sopenharmony_ci#define CH_INTSTATUS		0x088 /* R/W Chan Interrupt Status */
1578c2ecf20Sopenharmony_ci#define CH_INTSIGNAL_ENA	0x090 /* R/W Chan Interrupt Signal Enable */
1588c2ecf20Sopenharmony_ci#define CH_INTCLEAR		0x098 /* W Chan Interrupt Clear */
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci/* DMAC_CFG */
1628c2ecf20Sopenharmony_ci#define DMAC_EN_POS			0
1638c2ecf20Sopenharmony_ci#define DMAC_EN_MASK			BIT(DMAC_EN_POS)
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci#define INT_EN_POS			1
1668c2ecf20Sopenharmony_ci#define INT_EN_MASK			BIT(INT_EN_POS)
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#define DMAC_CHAN_EN_SHIFT		0
1698c2ecf20Sopenharmony_ci#define DMAC_CHAN_EN_WE_SHIFT		8
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci#define DMAC_CHAN_SUSP_SHIFT		16
1728c2ecf20Sopenharmony_ci#define DMAC_CHAN_SUSP_WE_SHIFT		24
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci/* CH_CTL_H */
1758c2ecf20Sopenharmony_ci#define CH_CTL_H_ARLEN_EN		BIT(6)
1768c2ecf20Sopenharmony_ci#define CH_CTL_H_ARLEN_POS		7
1778c2ecf20Sopenharmony_ci#define CH_CTL_H_AWLEN_EN		BIT(15)
1788c2ecf20Sopenharmony_ci#define CH_CTL_H_AWLEN_POS		16
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_cienum {
1818c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_1		= 0,
1828c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_2		= 1,
1838c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_4		= 3,
1848c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_8		= 7,
1858c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_16		= 15,
1868c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_32		= 31,
1878c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_64		= 63,
1888c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_128		= 127,
1898c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_256		= 255,
1908c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_MIN		= DWAXIDMAC_ARWLEN_1,
1918c2ecf20Sopenharmony_ci	DWAXIDMAC_ARWLEN_MAX		= DWAXIDMAC_ARWLEN_256
1928c2ecf20Sopenharmony_ci};
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci#define CH_CTL_H_LLI_LAST		BIT(30)
1958c2ecf20Sopenharmony_ci#define CH_CTL_H_LLI_VALID		BIT(31)
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci/* CH_CTL_L */
1988c2ecf20Sopenharmony_ci#define CH_CTL_L_LAST_WRITE_EN		BIT(30)
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci#define CH_CTL_L_DST_MSIZE_POS		18
2018c2ecf20Sopenharmony_ci#define CH_CTL_L_SRC_MSIZE_POS		14
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_cienum {
2048c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_1	= 0,
2058c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_4,
2068c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_8,
2078c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_16,
2088c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_32,
2098c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_64,
2108c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_128,
2118c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_256,
2128c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_512,
2138c2ecf20Sopenharmony_ci	DWAXIDMAC_BURST_TRANS_LEN_1024
2148c2ecf20Sopenharmony_ci};
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define CH_CTL_L_DST_WIDTH_POS		11
2178c2ecf20Sopenharmony_ci#define CH_CTL_L_SRC_WIDTH_POS		8
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci#define CH_CTL_L_DST_INC_POS		6
2208c2ecf20Sopenharmony_ci#define CH_CTL_L_SRC_INC_POS		4
2218c2ecf20Sopenharmony_cienum {
2228c2ecf20Sopenharmony_ci	DWAXIDMAC_CH_CTL_L_INC		= 0,
2238c2ecf20Sopenharmony_ci	DWAXIDMAC_CH_CTL_L_NOINC
2248c2ecf20Sopenharmony_ci};
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci#define CH_CTL_L_DST_MAST		BIT(2)
2278c2ecf20Sopenharmony_ci#define CH_CTL_L_SRC_MAST		BIT(0)
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci/* CH_CFG_H */
2308c2ecf20Sopenharmony_ci#define CH_CFG_H_PRIORITY_POS		17
2318c2ecf20Sopenharmony_ci#define CH_CFG_H_HS_SEL_DST_POS		4
2328c2ecf20Sopenharmony_ci#define CH_CFG_H_HS_SEL_SRC_POS		3
2338c2ecf20Sopenharmony_cienum {
2348c2ecf20Sopenharmony_ci	DWAXIDMAC_HS_SEL_HW		= 0,
2358c2ecf20Sopenharmony_ci	DWAXIDMAC_HS_SEL_SW
2368c2ecf20Sopenharmony_ci};
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define CH_CFG_H_TT_FC_POS		0
2398c2ecf20Sopenharmony_cienum {
2408c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_MEM_TO_MEM_DMAC	= 0,
2418c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_MEM_TO_PER_DMAC,
2428c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_PER_TO_MEM_DMAC,
2438c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_PER_TO_PER_DMAC,
2448c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_PER_TO_MEM_SRC,
2458c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_PER_TO_PER_SRC,
2468c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_MEM_TO_PER_DST,
2478c2ecf20Sopenharmony_ci	DWAXIDMAC_TT_FC_PER_TO_PER_DST
2488c2ecf20Sopenharmony_ci};
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ci/* CH_CFG_L */
2518c2ecf20Sopenharmony_ci#define CH_CFG_L_DST_MULTBLK_TYPE_POS	2
2528c2ecf20Sopenharmony_ci#define CH_CFG_L_SRC_MULTBLK_TYPE_POS	0
2538c2ecf20Sopenharmony_cienum {
2548c2ecf20Sopenharmony_ci	DWAXIDMAC_MBLK_TYPE_CONTIGUOUS	= 0,
2558c2ecf20Sopenharmony_ci	DWAXIDMAC_MBLK_TYPE_RELOAD,
2568c2ecf20Sopenharmony_ci	DWAXIDMAC_MBLK_TYPE_SHADOW_REG,
2578c2ecf20Sopenharmony_ci	DWAXIDMAC_MBLK_TYPE_LL
2588c2ecf20Sopenharmony_ci};
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci/**
2618c2ecf20Sopenharmony_ci * DW AXI DMA channel interrupts
2628c2ecf20Sopenharmony_ci *
2638c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_NONE: Bitmask of no one interrupt
2648c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_BLOCK_TRF: Block transfer complete
2658c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_DMA_TRF: Dma transfer complete
2668c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_SRC_TRAN: Source transaction complete
2678c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_DST_TRAN: Destination transaction complete
2688c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_SRC_DEC_ERR: Source decode error
2698c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_DST_DEC_ERR: Destination decode error
2708c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_SRC_SLV_ERR: Source slave error
2718c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_DST_SLV_ERR: Destination slave error
2728c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_LLI_RD_DEC_ERR: LLI read decode error
2738c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_LLI_WR_DEC_ERR: LLI write decode error
2748c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_LLI_RD_SLV_ERR: LLI read slave error
2758c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_LLI_WR_SLV_ERR: LLI write slave error
2768c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_INVALID_ERR: LLI invalid error or Shadow register error
2778c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_MULTIBLKTYPE_ERR: Slave Interface Multiblock type error
2788c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_DEC_ERR: Slave Interface decode error
2798c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_WR2RO_ERR: Slave Interface write to read only error
2808c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_RD2RWO_ERR: Slave Interface read to write only error
2818c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_WRONCHEN_ERR: Slave Interface write to channel error
2828c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_SHADOWREG_ERR: Slave Interface shadow reg error
2838c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_WRONHOLD_ERR: Slave Interface hold error
2848c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_LOCK_CLEARED: Lock Cleared Status
2858c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_SRC_SUSPENDED: Source Suspended Status
2868c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_SUSPENDED: Channel Suspended Status
2878c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_DISABLED: Channel Disabled Status
2888c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_ABORTED: Channel Aborted Status
2898c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_ALL_ERR: Bitmask of all error interrupts
2908c2ecf20Sopenharmony_ci * @DWAXIDMAC_IRQ_ALL: Bitmask of all interrupts
2918c2ecf20Sopenharmony_ci */
2928c2ecf20Sopenharmony_cienum {
2938c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_NONE		= 0,
2948c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_BLOCK_TRF		= BIT(0),
2958c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_DMA_TRF		= BIT(1),
2968c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_SRC_TRAN		= BIT(3),
2978c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_DST_TRAN		= BIT(4),
2988c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_SRC_DEC_ERR	= BIT(5),
2998c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_DST_DEC_ERR	= BIT(6),
3008c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_SRC_SLV_ERR	= BIT(7),
3018c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_DST_SLV_ERR	= BIT(8),
3028c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_LLI_RD_DEC_ERR	= BIT(9),
3038c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_LLI_WR_DEC_ERR	= BIT(10),
3048c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_LLI_RD_SLV_ERR	= BIT(11),
3058c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_LLI_WR_SLV_ERR	= BIT(12),
3068c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_INVALID_ERR	= BIT(13),
3078c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_MULTIBLKTYPE_ERR	= BIT(14),
3088c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_DEC_ERR		= BIT(16),
3098c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_WR2RO_ERR		= BIT(17),
3108c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_RD2RWO_ERR	= BIT(18),
3118c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_WRONCHEN_ERR	= BIT(19),
3128c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_SHADOWREG_ERR	= BIT(20),
3138c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_WRONHOLD_ERR	= BIT(21),
3148c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_LOCK_CLEARED	= BIT(27),
3158c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_SRC_SUSPENDED	= BIT(28),
3168c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_SUSPENDED		= BIT(29),
3178c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_DISABLED		= BIT(30),
3188c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_ABORTED		= BIT(31),
3198c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_ALL_ERR		= (GENMASK(21, 16) | GENMASK(14, 5)),
3208c2ecf20Sopenharmony_ci	DWAXIDMAC_IRQ_ALL		= GENMASK(31, 0)
3218c2ecf20Sopenharmony_ci};
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_cienum {
3248c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_8		= 0,
3258c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_16,
3268c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_32,
3278c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_64,
3288c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_128,
3298c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_256,
3308c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_512,
3318c2ecf20Sopenharmony_ci	DWAXIDMAC_TRANS_WIDTH_MAX	= DWAXIDMAC_TRANS_WIDTH_512
3328c2ecf20Sopenharmony_ci};
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci#endif /* _AXI_DMA_PLATFORM_H */
335