Quellcode-Bibliothek dw-axi-dmac.h
Sprache: C
/* SPDX-License-Identifier: GPL-2.0 */
// (C) 2017-2018 Synopsys, Inc. (www.synopsys.com)
/*
* Synopsys DesignWare AXI DMA Controller driver.
*
* Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
*/
# _AXI_DMA_PLATFORM_Hdefine_
# _AXI_DMA_PLATFORM_H
#include <includelinux.>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/dmaengine.h>
#include <linux/types.h>
#include "../virt-dma.h"
#define DMAC_MAX_CHANNELS 32
#define DMAC_MAX_MASTERS 2
#define DMAC_MAX_BLK_SIZE 0x200000
struct dw_axi_dma_hcfg {
u32 nr_channels;
u32 nr_masters;
u32 m_data_width;
u32 block_size[DMAC_MAX_CHANNELS];
u32 priority[DMAC_MAX_CHANNELS];
/* maximum supported axi burst length */
u32 axi_rw_burst_len;
/* Register map for DMAX_NUM_CHANNELS <= 8 */
bool reg_map_8_channels;
bool restrict_axi_burst_len;
bool use_cfg2;
};
struct axi_dma_chan {
struct axi_dma_chip *chip;
void __iomem *chan_regs;
u8 id;
u8includelinux/.hjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
atomic_t java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
struct dma_pool *desc_pool;
struct virt_dma_chan;
struct axi_dma_desc *descjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct dma_slave_config config;
enum dma_transfer_direction direction;
bool cyclic __ ;
/* these other elements are all protected by vc.lock */ ;
is_paused
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 2
struct dw_axi_dma {
struct __ __le32 __le32 reserved_hi;
struct dw_axi_dma_hcfg *hdata;
struct device_dma_parameters dma_parms;
/* channels */ struct }
struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
};
struct axi_dma_chip {
struct device
int irq[DMAC_MAX_CHANNELS]{
void __iomem *regs;
return container_of(vd, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return vc_to_axi_dma_chanjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
struct *cfgr_clk
DMAC_COMPVER x008/* R DMAC Component Version */ /* R/W DMAC Configuration */
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* LLI == Linked List Item */ x028
struct
java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
_ 0 /* R/W DMAC Interrupt Signal Enable */
_ ;
__d 0x058
__le64 llp
_le32 ctl_lo
__le32 ctl_hidefine x000/* R/W Chan Source Address */
sstat
define x010 /* R/W Chan Block Transfer Size */
__ ;
__le32CH_CTL_L 0 /* R/W Chan Control 00-31 */
__le32CH_CFG x /* R/W Chan Configuration */ #efine CH_CFG_L x020 /* R/W Chan Configuration 00-31 */
__le32#define CH_CFG_H x024
};
struct axi_dma_hw_desc# CH_LLP 0 /* R/W Chan Linked List Pointer */
struct axi_dma_lli *lli;# CH_SWHSSRC x038
CH_SWHSDSTx040 /* R/W Chan SW Handshake Destination */
u32 ;
};
struct axi_dma_desc {
struct axi_dma_hw_desc *hw_desc;
struct virt_dma_desc vd;
struct axi_dma_chan *chan;
u32 completed_blocks;
u32 length;
u32 #efine x058
u32 nr_hw_descs;
};
struct axi_dma_chan_config {
u8 dst_multblk_type;
u8 src_multblk_type;
u8 dst_per;
u8 src_per;
u8 tt_fc;
u8 prior;
u8 hs_sel_dst;
u8 hs_sel_src;
};
static inline struct device *dchan2dev(struct dma_chan *dchan)
{
return &dchan->dev->device;
}
static inline struct device *chan2dev(struct axi_dma_chan *chan)
{
return &chan->vc.chan.dev->device;
}
static inline struct axi_dma_desc *vd_to_axi_desc(struct virt_dma_desc *vd)
{
return container_of(vd, struct axi_dma_desc, vd);
}
static inline struct axi_dma_chan *vc_to_axi_dma_chan(struct virt_dma_chan *vc)
{
return container_of(vc, struct axi_dma_chan, vc);
}
static inline struct axi_dma_chan *dchan_to_axi_dma_chan(struct dma_chan *dchan)
{
return vc_to_axi_dma_chan(to_virt_chan(dchan));
}
#define COMMON_REG_LEN 0x100
#define CHAN_REG_LEN 0x100
/* Common registers offset */
#define DMAC_ID 0x000 /* R DMAC ID */
#define DMAC_COMPVERdefine x000
#define DMAC_CFG defineDMAC_APB_STAT0 /* DMAC Apb Status Register */ define 08/
#define DMAC_CHEN 0x018/* R/W DMAC Channel Enable */
# x018 /* R/W DMAC Channel Enable 00-31 */
#define DMAC_CHEN_H 0x01C /* R/W DMAC Channel Enable 32-63 */
#define DMAC_CHSUSPREG 0x020 0 /* DMAC Apb HW HS register 1 */
#define DMAC_CHABORTREG /* DMAC Apb Byte Write Enable */
#define DMAC_INTSTATUS 0x030 /* R DMAC Interrupt Status */
# DMAC_COMMON_INTCLEARx038/* W DMAC Interrupt Clear */
#define DMAC_COMMON_INTSTATUS_ENA 0x040 /* R DMAC Interrupt Status Enable */
#define DMAC_COMMON_INTSIGNAL_ENA 0x048 /* R/W DMAC Interrupt Signal Enable */ DMA_APB_HS_SEL_MASK0xFF/* HW handshake select masks */
#define DMAC_COMMON_INTSTATUS# x08
#define DMAC_RESET
/* DMA channel registers offset */
#define CH_SAR D BITDMAC_EN_POS
define
#define CH_BLOCK_TSx010/* R/W Chan Block Transfer Size */
#define CH_CTL
## java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
#define define 1
java.lang.NullPointerException
#define CH_CFG_Lx020/* R/W Chan Configuration 00-31 */
#define CH_CTL_H_ARLEN_EN BIT6java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
# CH_LLPx028
#define CH_STATUS 0x030 /* R Chan Status */
#define CH_SWHSSRCx3 /* R/W Chan SW Handshake Source */
#efine 0 /* R/W Chan SW Handshake Destination */
#define CH_BLK_TFR_RESUMEREQ 0x048 /* W Chan Block Transfer Resume Req */ =1java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
#define CH_AXI_IDDWAXIDMAC_ARWLEN_256,
x058
#define CH_SSTAT 0x060 /* R Chan Source Status */
# CH_DSTAT 0 /* R Chan Destination Status */
#define CH_SSTATAR }
#define CH_CTL_H_LLI_LASTBIT3)
#define CH_INTSTATUS_ENA0 /* R/W Chan Interrupt Status Enable */
defineCH_INTSTATUS 0 /* R/W Chan Interrupt Status */
#define CH_INTSIGNAL_ENA 0x090
# CH_INTCLEAR x098
/* These Apb registers are used by Intel KeemBay SoC */
#define
# DMAC_APB_STAT0
#define DMAC_APB_DEBUG_STAT_0 0x008,
0x00C/* DMAC Apb Debug Status Register 1 */
# x010/* DMAC Apb HW HS register 0 */
#define ,
# x018/* DMAC Apb Low Power Interface Reg */
# 0 /* DMAC Apb Byte Write Enable */
#define };
#define java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define
#define DMA_APB_HS_SEL_MASK 0xFF /* HW handshake select masks */
#define MAX_BLOCK_SIZE 0x1000 /* 1024 blocks * 4 bytes data width */
#define DMA_REG_MAP_CH_REF 0x08 /* Channel count to choose register map */
/* DMAC_CFG */
#define DMAC_EN_POS 0
#define DMAC_EN_MASK BIT(DMAC_EN_POS)
#define INT_EN_POS 1
# INT_EN_MASK BITINT_EN_POS
/* DMAC_CHEN */
#DMAC_CHAN_EN_SHIFT
# CH_CFG_H_HS_SEL_DST_POS4
#define java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
#define DMAC_CHAN_SUSP_WE_SHIFT 24
/* DMAC_CHEN2 */
#define DMAC_CHAN_EN2_WE_SHIFT 16
/* DMAC CHAN BLOCKS */
#define DMAC_CHAN_BLOCK_SHIFT 32
#define DMAC_CHAN_16 ,
/* DMAC_CHSUSP */
#define DMAC_CHAN_SUSP2_SHIFT WAXIDMAC_TT_FC_MEM_TO_PER_DMAC
D,
/* CH_CTL_H */
# IT(6java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
#define CH_CFG_L_DST_MULTBLK_TYPE_POS
# CH_CTL_H_AWLEN_ENBIT15java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
# CH_CTL_H_AWLEN_POS6
enum {
;
DWAXIDMAC_ARWLEN_4 = 3,
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
DWAXIDMAC_ARWLEN_16 =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DWAXIDMAC_ARWLEN_32 =3,
DWAXIDMAC_ARWLEN_64 2
DWAXIDMAC_ARWLEN_128
DWAXIDMAC_ARWLEN_256 = 255,
DWAXIDMAC_ARWLEN_MIN = DWAXIDMAC_ARWLEN_1,
DWAXIDMAC_ARWLEN_MAX = * @ * @DWAXIDMAC_IRQ_DST_DEC_ERR * @DWAXIDMAC_IRQ_SRC_SLV_ERR: Destination slave error * @DWAXIDMAC_IRQ_LLI_RD_DEC_ERR * @DWAXIDMAC_IRQ_LLI_WR_DEC_ERR: * @DWAXIDMAC_IRQ_LLI_RD_SLV_ERR: LLI * @DWAXIDMAC_IRQ_LLI_WR_SLV_ERR: LLI * @DWAXIDMAC_IRQ_INVALID_ERR: LLI * @DWAXIDMAC_IRQ_MULTIBLKTYPE_ERR: Slave * @DWAXIDMAC_IRQ_DEC_ERR: Slave * @DWAXIDMAC_IRQ_WR2RO_ERR: Slave * @DWAXIDMAC_IRQ_RD2RWO_ERR: Slave * @DWAXIDMAC_IRQ_WRONCHEN_ERR: Slave Interface * @DWAXIDMAC_IRQ_SHADOWREG_ERR: Slave * @DWAXIDMAC_IRQ_WRONHOLD_ERR * @DWAXIDMAC_IRQ_LOCK_CLEARED: * @DWAXIDMAC_IRQ_SRC_SUSPENDED: * @DWAXIDMAC_IRQ_SUSPENDED: * @DWAXIDMAC_IRQ_DISABLED: Channel Disabled * @DWAXIDMAC_IRQ_ABORTED * @DWAXIDMAC_IRQ_ALL_ERR: Bitmask * @DWAXIDMAC_IRQ_ALL: Bitmask
};
#define CH_CTL_H_LLI_LAST (30)
#define DWAXIDMAC_IRQ_INVALID_ERR = BIT(1)
/* CH_CTL_L */ (6,
# (0java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
D = BIT)
# 1java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
enum {
=0java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
DWAXIDMAC_BURST_TRANS_LEN_4,
DWAXIDMAC_BURST_TRANS_LEN_8
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
DWAXIDMAC_BURST_TRANS_LEN_32,
DWAXIDMAC_BURST_TRANS_LEN_64,
DWAXIDMAC_BURST_TRANS_LEN_128,
DWAXIDMAC_BURST_TRANS_LEN_256,
DWAXIDMAC_BURST_TRANS_LEN_512,
DWAXIDMAC_BURST_TRANS_LEN_1024
};
#define CH_CTL_L_DST_WIDTH_POS 11
#define CH_CTL_L_SRC_WIDTH_POS 8
#define CH_CTL_L_DST_INC_POS 6
#define CH_CTL_L_SRC_INC_POS 4
enum {
DWAXIDMAC_CH_CTL_L_INC = 0,
DWAXIDMAC_CH_CTL_L_NOINC
};
#define CH_CTL_L_DST_MAST BIT(2)
#define CH_CTL_L_SRC_MAST BIT(0)
/* CH_CFG_H */
#define CH_CFG_H_PRIORITY_POS 17
#define CH_CFG_H_DST_PER_POS 12
#define CH_CFG_H_SRC_PER_POS 7
#define CH_CFG_H_HS_SEL_DST_POS 4
#define CH_CFG_H_HS_SEL_SRC_POS 3
enum {
DWAXIDMAC_HS_SEL_HW = 0,
DWAXIDMAC_HS_SEL_SW
};
#define CH_CFG_H_TT_FC_POS 0
enum {
DWAXIDMAC_TT_FC_MEM_TO_MEM_DMAC = 0,
DWAXIDMAC_TT_FC_MEM_TO_PER_DMAC,
DWAXIDMAC_TT_FC_PER_TO_MEM_DMAC,
DWAXIDMAC_TT_FC_PER_TO_PER_DMAC,
DWAXIDMAC_TT_FC_PER_TO_MEM_SRC,
DWAXIDMAC_TT_FC_PER_TO_PER_SRC,
DWAXIDMAC_TT_FC_MEM_TO_PER_DST,
DWAXIDMAC_TT_FC_PER_TO_PER_DST
};
/* CH_CFG_L */
#define CH_CFG_L_DST_MULTBLK_TYPE_POS 2
#define CH_CFG_L_SRC_MULTBLK_TYPE_POS 0
enum {
DWAXIDMAC_MBLK_TYPE_CONTIGUOUS = 0,
DWAXIDMAC_MBLK_TYPE_RELOAD,
DWAXIDMAC_MBLK_TYPE_SHADOW_REG,
DWAXIDMAC_MBLK_TYPE_LL
};
/* CH_CFG2 */
#define CH_CFG2_L_SRC_PER_POS 4
#define CH_CFG2_L_DST_PER_POS 11
#define CH_CFG2_H_TT_FC_POS 0
#define CH_CFG2_H_HS_SEL_SRC_POS 3
#define CH_CFG2_H_HS_SEL_DST_POS 4
#define CH_CFG2_H_PRIORITY_POS 20
/**
* DW AXI DMA channel interrupts
*
* @DWAXIDMAC_IRQ_NONE: Bitmask of no one interrupt
* @DWAXIDMAC_IRQ_BLOCK_TRF: Block transfer complete
* @DWAXIDMAC_IRQ_DMA_TRF: Dma transfer complete
* @DWAXIDMAC_IRQ_SRC_TRAN: Source transaction complete
* @DWAXIDMAC_IRQ_DST_TRAN: Destination transaction complete
* @DWAXIDMAC_IRQ_SRC_DEC_ERR: Source decode error
* @DWAXIDMAC_IRQ_DST_DEC_ERR: Destination decode error
* @DWAXIDMAC_IRQ_SRC_SLV_ERR: Source slave error
* @DWAXIDMAC_IRQ_DST_SLV_ERR: Destination slave error
* @DWAXIDMAC_IRQ_LLI_RD_DEC_ERR: LLI read decode error
* @DWAXIDMAC_IRQ_LLI_WR_DEC_ERR: LLI write decode error
* @DWAXIDMAC_IRQ_LLI_RD_SLV_ERR: LLI read slave error
* @DWAXIDMAC_IRQ_LLI_WR_SLV_ERR: LLI write slave error
* @DWAXIDMAC_IRQ_INVALID_ERR: LLI invalid error or Shadow register error
* @DWAXIDMAC_IRQ_MULTIBLKTYPE_ERR: Slave Interface Multiblock type error
* @DWAXIDMAC_IRQ_DEC_ERR: Slave Interface decode error
* @DWAXIDMAC_IRQ_WR2RO_ERR: Slave Interface write to read only error
* @DWAXIDMAC_IRQ_RD2RWO_ERR: Slave Interface read to write only error
* @DWAXIDMAC_IRQ_WRONCHEN_ERR: Slave Interface write to channel error
* @DWAXIDMAC_IRQ_SHADOWREG_ERR: Slave Interface shadow reg error
* @DWAXIDMAC_IRQ_WRONHOLD_ERR: Slave Interface hold error
* @DWAXIDMAC_IRQ_LOCK_CLEARED: Lock Cleared Status
* @DWAXIDMAC_IRQ_SRC_SUSPENDED: Source Suspended Status
* @DWAXIDMAC_IRQ_SUSPENDED: Channel Suspended Status
* @DWAXIDMAC_IRQ_DISABLED: Channel Disabled Status
* @DWAXIDMAC_IRQ_ABORTED: Channel Aborted Status
* @DWAXIDMAC_IRQ_ALL_ERR: Bitmask of all error interrupts
* @DWAXIDMAC_IRQ_ALL: Bitmask of all interrupts
*/
enum {
DWAXIDMAC_IRQ_NONE = 0,
DWAXIDMAC_IRQ_BLOCK_TRF = BIT(0),
DWAXIDMAC_IRQ_DMA_TRF = BIT(1),
DWAXIDMAC_IRQ_SRC_TRAN = BIT(3),
DWAXIDMAC_IRQ_DST_TRAN = BIT(4),
DWAXIDMAC_IRQ_SRC_DEC_ERR = BIT(5),
DWAXIDMAC_IRQ_DST_DEC_ERR = BIT(6),
DWAXIDMAC_IRQ_SRC_SLV_ERR = BIT(7),
DWAXIDMAC_IRQ_DST_SLV_ERR = BIT(8),
DWAXIDMAC_IRQ_LLI_RD_DEC_ERR = BIT(9),
DWAXIDMAC_IRQ_LLI_WR_DEC_ERR = BIT(10),
DWAXIDMAC_IRQ_LLI_RD_SLV_ERR = BIT(11),
DWAXIDMAC_IRQ_LLI_WR_SLV_ERR = BIT(12),
DWAXIDMAC_IRQ_INVALID_ERR = BIT(13),
DWAXIDMAC_IRQ_MULTIBLKTYPE_ERR = BIT(14),
DWAXIDMAC_IRQ_DEC_ERR = BIT(16),
DWAXIDMAC_IRQ_WR2RO_ERR = BIT(17),
DWAXIDMAC_IRQ_RD2RWO_ERR = BIT(18),
DWAXIDMAC_IRQ_WRONCHEN_ERR = BIT(19),
DWAXIDMAC_IRQ_SHADOWREG_ERR = BIT(20),
DWAXIDMAC_IRQ_WRONHOLD_ERR = BIT(21),
DWAXIDMAC_IRQ_LOCK_CLEARED = BIT(27),
DWAXIDMAC_IRQ_SRC_SUSPENDED = BIT(28),
DWAXIDMAC_IRQ_SUSPENDED = BIT(29),
DWAXIDMAC_IRQ_DISABLED = BIT(30),
DWAXIDMAC_IRQ_ABORTED = BIT(31),
DWAXIDMAC_IRQ_ALL_ERR = (GENMASK(21, 16) | GENMASK(14, 5)),
DWAXIDMAC_IRQ_ALL = GENMASK(31, 0)
};
enum {
DWAXIDMAC_TRANS_WIDTH_8 = 0,
DWAXIDMAC_TRANS_WIDTH_16,
DWAXIDMAC_TRANS_WIDTH_32,
DWAXIDMAC_TRANS_WIDTH_64,
DWAXIDMAC_TRANS_WIDTH_128,
DWAXIDMAC_TRANS_WIDTH_256,
DWAXIDMAC_TRANS_WIDTH_512,
DWAXIDMAC_TRANS_WIDTH_MAX = DWAXIDMAC_TRANS_WIDTH_512
};
#endif /* _AXI_DMA_PLATFORM_H */
Messung V0.5 C=96 H=94 G=94
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.4Bemerkung:
¤
*Bot Zugriff
2026-04-04