xref: /openbmc/linux/drivers/dma/ste_dma40_ll.h (revision 5ed04b8575cb22920b1333aeb55121339449048f)
18d318a50SLinus Walleij /*
2767a9675SJonas Aaberg  * Copyright (C) ST-Ericsson SA 2007-2010
3767a9675SJonas Aaberg  * Author: Per Friden <per.friden@stericsson.com> for ST-Ericsson SA
4767a9675SJonas Aaberg  * Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson SA
58d318a50SLinus Walleij  * License terms: GNU General Public License (GPL) version 2
68d318a50SLinus Walleij  */
78d318a50SLinus Walleij #ifndef STE_DMA40_LL_H
88d318a50SLinus Walleij #define STE_DMA40_LL_H
98d318a50SLinus Walleij 
108d318a50SLinus Walleij #define D40_DREG_PCBASE		0x400
118d318a50SLinus Walleij #define D40_DREG_PCDELTA	(8 * 4)
128d318a50SLinus Walleij #define D40_LLI_ALIGN		16 /* LLI alignment must be 16 bytes. */
138d318a50SLinus Walleij 
14ef1872ecSLinus Walleij #define D40_LCPA_CHAN_SIZE 32
15ef1872ecSLinus Walleij #define D40_LCPA_CHAN_DST_DELTA 16
16ef1872ecSLinus Walleij 
178d318a50SLinus Walleij #define D40_TYPE_TO_GROUP(type) (type / 16)
188d318a50SLinus Walleij #define D40_TYPE_TO_EVENT(type) (type % 16)
198d318a50SLinus Walleij 
208d318a50SLinus Walleij /* Most bits of the CFG register are the same in log as in phy mode */
218d318a50SLinus Walleij #define D40_SREG_CFG_MST_POS		15
228d318a50SLinus Walleij #define D40_SREG_CFG_TIM_POS		14
238d318a50SLinus Walleij #define D40_SREG_CFG_EIM_POS		13
248d318a50SLinus Walleij #define D40_SREG_CFG_LOG_INCR_POS	12
258d318a50SLinus Walleij #define D40_SREG_CFG_PHY_PEN_POS	12
268d318a50SLinus Walleij #define D40_SREG_CFG_PSIZE_POS		10
278d318a50SLinus Walleij #define D40_SREG_CFG_ESIZE_POS		 8
288d318a50SLinus Walleij #define D40_SREG_CFG_PRI_POS		 7
298d318a50SLinus Walleij #define D40_SREG_CFG_LBE_POS		 6
308d318a50SLinus Walleij #define D40_SREG_CFG_LOG_GIM_POS	 5
318d318a50SLinus Walleij #define D40_SREG_CFG_LOG_MFU_POS	 4
328d318a50SLinus Walleij #define D40_SREG_CFG_PHY_TM_POS		 4
338d318a50SLinus Walleij #define D40_SREG_CFG_PHY_EVTL_POS	 0
348d318a50SLinus Walleij 
358d318a50SLinus Walleij 
368d318a50SLinus Walleij /* Standard channel parameters - basic mode (element register) */
378d318a50SLinus Walleij #define D40_SREG_ELEM_PHY_ECNT_POS	16
388d318a50SLinus Walleij #define D40_SREG_ELEM_PHY_EIDX_POS	 0
398d318a50SLinus Walleij 
408d318a50SLinus Walleij #define D40_SREG_ELEM_PHY_ECNT_MASK	(0xFFFF << D40_SREG_ELEM_PHY_ECNT_POS)
418d318a50SLinus Walleij 
428d318a50SLinus Walleij /* Standard channel parameters - basic mode (Link register) */
438d318a50SLinus Walleij #define D40_SREG_LNK_PHY_TCP_POS	0
448d318a50SLinus Walleij #define D40_SREG_LNK_PHY_LMP_POS	1
458d318a50SLinus Walleij #define D40_SREG_LNK_PHY_PRE_POS	2
468d318a50SLinus Walleij /*
478d318a50SLinus Walleij  * Source  destination link address. Contains the
488d318a50SLinus Walleij  * 29-bit byte word aligned address of the reload area.
498d318a50SLinus Walleij  */
508d318a50SLinus Walleij #define D40_SREG_LNK_PHYS_LNK_MASK	0xFFFFFFF8UL
518d318a50SLinus Walleij 
528d318a50SLinus Walleij /* Standard basic channel logical mode */
538d318a50SLinus Walleij 
548d318a50SLinus Walleij /* Element register */
558d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_ECNT_POS	16
568d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_LIDX_POS	 8
578d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_LOS_POS	 1
588d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_TCP_POS	 0
598d318a50SLinus Walleij 
608d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_LIDX_MASK	(0xFF << D40_SREG_ELEM_LOG_LIDX_POS)
618d318a50SLinus Walleij 
628d318a50SLinus Walleij /* Link register */
638d318a50SLinus Walleij #define D40_DEACTIVATE_EVENTLINE	0x0
648d318a50SLinus Walleij #define D40_ACTIVATE_EVENTLINE		0x1
658d318a50SLinus Walleij #define D40_EVENTLINE_POS(i)		(2 * i)
668d318a50SLinus Walleij #define D40_EVENTLINE_MASK(i)		(0x3 << D40_EVENTLINE_POS(i))
678d318a50SLinus Walleij 
688d318a50SLinus Walleij /* Standard basic channel logical params in memory */
698d318a50SLinus Walleij 
708d318a50SLinus Walleij /* LCSP0 */
718d318a50SLinus Walleij #define D40_MEM_LCSP0_ECNT_POS		16
728d318a50SLinus Walleij #define D40_MEM_LCSP0_SPTR_POS		 0
738d318a50SLinus Walleij 
748d318a50SLinus Walleij #define D40_MEM_LCSP0_ECNT_MASK		(0xFFFF << D40_MEM_LCSP0_ECNT_POS)
758d318a50SLinus Walleij #define D40_MEM_LCSP0_SPTR_MASK		(0xFFFF << D40_MEM_LCSP0_SPTR_POS)
768d318a50SLinus Walleij 
778d318a50SLinus Walleij /* LCSP1 */
788d318a50SLinus Walleij #define D40_MEM_LCSP1_SPTR_POS		16
798d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_MST_POS	15
808d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_TIM_POS	14
818d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_EIM_POS	13
828d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_INCR_POS	12
838d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_PSIZE_POS	10
848d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_ESIZE_POS	 8
858d318a50SLinus Walleij #define D40_MEM_LCSP1_SLOS_POS		 1
868d318a50SLinus Walleij #define D40_MEM_LCSP1_STCP_POS		 0
878d318a50SLinus Walleij 
888d318a50SLinus Walleij #define D40_MEM_LCSP1_SPTR_MASK		(0xFFFF << D40_MEM_LCSP1_SPTR_POS)
898d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_TIM_MASK	(0x1 << D40_MEM_LCSP1_SCFG_TIM_POS)
908d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_INCR_MASK	(0x1 << D40_MEM_LCSP1_SCFG_INCR_POS)
918d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_PSIZE_MASK	(0x3 << D40_MEM_LCSP1_SCFG_PSIZE_POS)
928d318a50SLinus Walleij #define D40_MEM_LCSP1_SLOS_MASK		(0x7F << D40_MEM_LCSP1_SLOS_POS)
938d318a50SLinus Walleij #define D40_MEM_LCSP1_STCP_MASK		(0x1 << D40_MEM_LCSP1_STCP_POS)
948d318a50SLinus Walleij 
958d318a50SLinus Walleij /* LCSP2 */
968d318a50SLinus Walleij #define D40_MEM_LCSP2_ECNT_POS		16
978d318a50SLinus Walleij 
988d318a50SLinus Walleij #define D40_MEM_LCSP2_ECNT_MASK		(0xFFFF << D40_MEM_LCSP2_ECNT_POS)
998d318a50SLinus Walleij 
1008d318a50SLinus Walleij /* LCSP3 */
1018d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_MST_POS	15
1028d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_TIM_POS	14
1038d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_EIM_POS	13
1048d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_INCR_POS	12
1058d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_PSIZE_POS	10
1068d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_ESIZE_POS	 8
1078d318a50SLinus Walleij #define D40_MEM_LCSP3_DLOS_POS		 1
1088d318a50SLinus Walleij #define D40_MEM_LCSP3_DTCP_POS		 0
1098d318a50SLinus Walleij 
1108d318a50SLinus Walleij #define D40_MEM_LCSP3_DLOS_MASK		(0x7F << D40_MEM_LCSP3_DLOS_POS)
1118d318a50SLinus Walleij #define D40_MEM_LCSP3_DTCP_MASK		(0x1 << D40_MEM_LCSP3_DTCP_POS)
1128d318a50SLinus Walleij 
1138d318a50SLinus Walleij 
1148d318a50SLinus Walleij /* Standard channel parameter register offsets */
1158d318a50SLinus Walleij #define D40_CHAN_REG_SSCFG	0x00
1168d318a50SLinus Walleij #define D40_CHAN_REG_SSELT	0x04
1178d318a50SLinus Walleij #define D40_CHAN_REG_SSPTR	0x08
1188d318a50SLinus Walleij #define D40_CHAN_REG_SSLNK	0x0C
1198d318a50SLinus Walleij #define D40_CHAN_REG_SDCFG	0x10
1208d318a50SLinus Walleij #define D40_CHAN_REG_SDELT	0x14
1218d318a50SLinus Walleij #define D40_CHAN_REG_SDPTR	0x18
1228d318a50SLinus Walleij #define D40_CHAN_REG_SDLNK	0x1C
1238d318a50SLinus Walleij 
1248d318a50SLinus Walleij /* DMA Register Offsets */
1258d318a50SLinus Walleij #define D40_DREG_GCC		0x000
1268d318a50SLinus Walleij #define D40_DREG_PRTYP		0x004
1278d318a50SLinus Walleij #define D40_DREG_PRSME		0x008
1288d318a50SLinus Walleij #define D40_DREG_PRSMO		0x00C
1298d318a50SLinus Walleij #define D40_DREG_PRMSE		0x010
1308d318a50SLinus Walleij #define D40_DREG_PRMSO		0x014
1318d318a50SLinus Walleij #define D40_DREG_PRMOE		0x018
1328d318a50SLinus Walleij #define D40_DREG_PRMOO		0x01C
13320a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_BASIC		0x1
13420a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_MODULO		0x2
13520a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_DOUBLE_DST		0x3
13620a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_PHY_DST_LOG	0x1
13720a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_LOG_DST_PHY	0x2
13820a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_LOG_DST_LOG	0x3
13920a5b6d0SRabin Vincent 
1408d318a50SLinus Walleij #define D40_DREG_LCPA		0x020
1418d318a50SLinus Walleij #define D40_DREG_LCLA		0x024
1428d318a50SLinus Walleij #define D40_DREG_ACTIVE		0x050
1438d318a50SLinus Walleij #define D40_DREG_ACTIVO		0x054
1448d318a50SLinus Walleij #define D40_DREG_FSEB1		0x058
1458d318a50SLinus Walleij #define D40_DREG_FSEB2		0x05C
1468d318a50SLinus Walleij #define D40_DREG_PCMIS		0x060
1478d318a50SLinus Walleij #define D40_DREG_PCICR		0x064
1488d318a50SLinus Walleij #define D40_DREG_PCTIS		0x068
1498d318a50SLinus Walleij #define D40_DREG_PCEIS		0x06C
1508d318a50SLinus Walleij #define D40_DREG_LCMIS0		0x080
1518d318a50SLinus Walleij #define D40_DREG_LCMIS1		0x084
1528d318a50SLinus Walleij #define D40_DREG_LCMIS2		0x088
1538d318a50SLinus Walleij #define D40_DREG_LCMIS3		0x08C
1548d318a50SLinus Walleij #define D40_DREG_LCICR0		0x090
1558d318a50SLinus Walleij #define D40_DREG_LCICR1		0x094
1568d318a50SLinus Walleij #define D40_DREG_LCICR2		0x098
1578d318a50SLinus Walleij #define D40_DREG_LCICR3		0x09C
1588d318a50SLinus Walleij #define D40_DREG_LCTIS0		0x0A0
1598d318a50SLinus Walleij #define D40_DREG_LCTIS1		0x0A4
1608d318a50SLinus Walleij #define D40_DREG_LCTIS2		0x0A8
1618d318a50SLinus Walleij #define D40_DREG_LCTIS3		0x0AC
1628d318a50SLinus Walleij #define D40_DREG_LCEIS0		0x0B0
1638d318a50SLinus Walleij #define D40_DREG_LCEIS1		0x0B4
1648d318a50SLinus Walleij #define D40_DREG_LCEIS2		0x0B8
1658d318a50SLinus Walleij #define D40_DREG_LCEIS3		0x0BC
166ac2c0a38SRabin Vincent #define D40_DREG_PSEG1		0x110
167ac2c0a38SRabin Vincent #define D40_DREG_PSEG2		0x114
168ac2c0a38SRabin Vincent #define D40_DREG_PSEG3		0x118
169ac2c0a38SRabin Vincent #define D40_DREG_PSEG4		0x11C
170ac2c0a38SRabin Vincent #define D40_DREG_PCEG1		0x120
171ac2c0a38SRabin Vincent #define D40_DREG_PCEG2		0x124
172ac2c0a38SRabin Vincent #define D40_DREG_PCEG3		0x128
173ac2c0a38SRabin Vincent #define D40_DREG_PCEG4		0x12C
174ac2c0a38SRabin Vincent #define D40_DREG_RSEG1		0x130
175ac2c0a38SRabin Vincent #define D40_DREG_RSEG2		0x134
176ac2c0a38SRabin Vincent #define D40_DREG_RSEG3		0x138
177ac2c0a38SRabin Vincent #define D40_DREG_RSEG4		0x13C
178ac2c0a38SRabin Vincent #define D40_DREG_RCEG1		0x140
179ac2c0a38SRabin Vincent #define D40_DREG_RCEG2		0x144
180ac2c0a38SRabin Vincent #define D40_DREG_RCEG3		0x148
181ac2c0a38SRabin Vincent #define D40_DREG_RCEG4		0x14C
1828d318a50SLinus Walleij #define D40_DREG_STFU		0xFC8
1838d318a50SLinus Walleij #define D40_DREG_ICFG		0xFCC
1848d318a50SLinus Walleij #define D40_DREG_PERIPHID0	0xFE0
1858d318a50SLinus Walleij #define D40_DREG_PERIPHID1	0xFE4
1868d318a50SLinus Walleij #define D40_DREG_PERIPHID2	0xFE8
1873ae0267fSJonas Aaberg #define D40_DREG_PERIPHID2_REV_POS 4
1883ae0267fSJonas Aaberg #define D40_DREG_PERIPHID2_REV_MASK (0xf << D40_DREG_PERIPHID2_REV_POS)
1893ae0267fSJonas Aaberg #define D40_DREG_PERIPHID2_DESIGNER_MASK 0xf
1908d318a50SLinus Walleij #define D40_DREG_PERIPHID3	0xFEC
1918d318a50SLinus Walleij #define D40_DREG_CELLID0	0xFF0
1928d318a50SLinus Walleij #define D40_DREG_CELLID1	0xFF4
1938d318a50SLinus Walleij #define D40_DREG_CELLID2	0xFF8
1948d318a50SLinus Walleij #define D40_DREG_CELLID3	0xFFC
1958d318a50SLinus Walleij 
1968d318a50SLinus Walleij /* LLI related structures */
1978d318a50SLinus Walleij 
1988d318a50SLinus Walleij /**
1998d318a50SLinus Walleij  * struct d40_phy_lli - The basic configration register for each physical
2008d318a50SLinus Walleij  * channel.
2018d318a50SLinus Walleij  *
2028d318a50SLinus Walleij  * @reg_cfg: The configuration register.
2038d318a50SLinus Walleij  * @reg_elt: The element register.
2048d318a50SLinus Walleij  * @reg_ptr: The pointer register.
2058d318a50SLinus Walleij  * @reg_lnk: The link register.
2068d318a50SLinus Walleij  *
2078d318a50SLinus Walleij  * These registers are set up for both physical and logical transfers
2088d318a50SLinus Walleij  * Note that the bit in each register means differently in logical and
2098d318a50SLinus Walleij  * physical(standard) mode.
2108d318a50SLinus Walleij  *
2118d318a50SLinus Walleij  * This struct must be 16 bytes aligned, and only contain physical registers
2128d318a50SLinus Walleij  * since it will be directly accessed by the DMA.
2138d318a50SLinus Walleij  */
2148d318a50SLinus Walleij struct d40_phy_lli {
2158d318a50SLinus Walleij 	u32 reg_cfg;
2168d318a50SLinus Walleij 	u32 reg_elt;
2178d318a50SLinus Walleij 	u32 reg_ptr;
2188d318a50SLinus Walleij 	u32 reg_lnk;
2198d318a50SLinus Walleij };
2208d318a50SLinus Walleij 
2218d318a50SLinus Walleij /**
2228d318a50SLinus Walleij  * struct d40_phy_lli_bidir - struct for a transfer.
2238d318a50SLinus Walleij  *
2248d318a50SLinus Walleij  * @src: Register settings for src channel.
2258d318a50SLinus Walleij  * @dst: Register settings for dst channel.
2268d318a50SLinus Walleij  *
2278d318a50SLinus Walleij  * All DMA transfers have a source and a destination.
2288d318a50SLinus Walleij  */
2298d318a50SLinus Walleij 
2308d318a50SLinus Walleij struct d40_phy_lli_bidir {
2318d318a50SLinus Walleij 	struct d40_phy_lli	*src;
2328d318a50SLinus Walleij 	struct d40_phy_lli	*dst;
2338d318a50SLinus Walleij };
2348d318a50SLinus Walleij 
2358d318a50SLinus Walleij 
2368d318a50SLinus Walleij /**
2378d318a50SLinus Walleij  * struct d40_log_lli - logical lli configuration
2388d318a50SLinus Walleij  *
2398d318a50SLinus Walleij  * @lcsp02: Either maps to register lcsp0 if src or lcsp2 if dst.
2408d318a50SLinus Walleij  * @lcsp13: Either maps to register lcsp1 if src or lcsp3 if dst.
2418d318a50SLinus Walleij  *
2428d318a50SLinus Walleij  * This struct must be 8 bytes aligned since it will be accessed directy by
2438d318a50SLinus Walleij  * the DMA. Never add any none hw mapped registers to this struct.
2448d318a50SLinus Walleij  */
2458d318a50SLinus Walleij 
2468d318a50SLinus Walleij struct d40_log_lli {
2478d318a50SLinus Walleij 	u32 lcsp02;
2488d318a50SLinus Walleij 	u32 lcsp13;
2498d318a50SLinus Walleij };
2508d318a50SLinus Walleij 
2518d318a50SLinus Walleij /**
2528d318a50SLinus Walleij  * struct d40_log_lli_bidir - For both src and dst
2538d318a50SLinus Walleij  *
2548d318a50SLinus Walleij  * @src: pointer to src lli configuration.
2558d318a50SLinus Walleij  * @dst: pointer to dst lli configuration.
2568d318a50SLinus Walleij  *
2578d318a50SLinus Walleij  * You always have a src and a dst when doing DMA transfers.
2588d318a50SLinus Walleij  */
2598d318a50SLinus Walleij 
2608d318a50SLinus Walleij struct d40_log_lli_bidir {
2618d318a50SLinus Walleij 	struct d40_log_lli *src;
2628d318a50SLinus Walleij 	struct d40_log_lli *dst;
2638d318a50SLinus Walleij };
2648d318a50SLinus Walleij 
2658d318a50SLinus Walleij /**
2668d318a50SLinus Walleij  * struct d40_log_lli_full - LCPA layout
2678d318a50SLinus Walleij  *
2688d318a50SLinus Walleij  * @lcsp0: Logical Channel Standard Param 0 - Src.
2698d318a50SLinus Walleij  * @lcsp1: Logical Channel Standard Param 1 - Src.
2708d318a50SLinus Walleij  * @lcsp2: Logical Channel Standard Param 2 - Dst.
2718d318a50SLinus Walleij  * @lcsp3: Logical Channel Standard Param 3 - Dst.
2728d318a50SLinus Walleij  *
2738d318a50SLinus Walleij  * This struct maps to LCPA physical memory layout. Must map to
2748d318a50SLinus Walleij  * the hw.
2758d318a50SLinus Walleij  */
2768d318a50SLinus Walleij struct d40_log_lli_full {
2778d318a50SLinus Walleij 	u32 lcsp0;
2788d318a50SLinus Walleij 	u32 lcsp1;
2798d318a50SLinus Walleij 	u32 lcsp2;
2808d318a50SLinus Walleij 	u32 lcsp3;
2818d318a50SLinus Walleij };
2828d318a50SLinus Walleij 
2838d318a50SLinus Walleij /**
2848d318a50SLinus Walleij  * struct d40_def_lcsp - Default LCSP1 and LCSP3 settings
2858d318a50SLinus Walleij  *
2868d318a50SLinus Walleij  * @lcsp3: The default configuration for dst.
2878d318a50SLinus Walleij  * @lcsp1: The default configuration for src.
2888d318a50SLinus Walleij  */
2898d318a50SLinus Walleij struct d40_def_lcsp {
2908d318a50SLinus Walleij 	u32 lcsp3;
2918d318a50SLinus Walleij 	u32 lcsp1;
2928d318a50SLinus Walleij };
2938d318a50SLinus Walleij 
2948d318a50SLinus Walleij /* Physical channels */
2958d318a50SLinus Walleij 
2968d318a50SLinus Walleij void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
297767a9675SJonas Aaberg 		 u32 *src_cfg,
298767a9675SJonas Aaberg 		 u32 *dst_cfg,
299767a9675SJonas Aaberg 		 bool is_log);
3008d318a50SLinus Walleij 
3018d318a50SLinus Walleij void d40_log_cfg(struct stedma40_chan_cfg *cfg,
302767a9675SJonas Aaberg 		 u32 *lcsp1,
303767a9675SJonas Aaberg 		 u32 *lcsp2);
3048d318a50SLinus Walleij 
3058d318a50SLinus Walleij int d40_phy_sg_to_lli(struct scatterlist *sg,
3068d318a50SLinus Walleij 		      int sg_len,
3078d318a50SLinus Walleij 		      dma_addr_t target,
3088d318a50SLinus Walleij 		      struct d40_phy_lli *lli,
3098d318a50SLinus Walleij 		      dma_addr_t lli_phys,
3108d318a50SLinus Walleij 		      u32 reg_cfg,
311d49278e3SPer Forlin 		      u32 data_width1,
312d49278e3SPer Forlin 		      u32 data_width2,
3130246e77bSJonas Aaberg 		      int psize);
3148d318a50SLinus Walleij 
3158d318a50SLinus Walleij /* Logical channels */
3168d318a50SLinus Walleij 
317d49278e3SPer Forlin struct d40_log_lli *d40_log_buf_to_lli(struct d40_log_lli *lli_sg,
318d49278e3SPer Forlin 				       dma_addr_t addr,
319d49278e3SPer Forlin 				       int size,
320d49278e3SPer Forlin 				       u32 lcsp13, /* src or dst*/
321d49278e3SPer Forlin 				       u32 data_width1, u32 data_width2,
322767a9675SJonas Aaberg 				       bool addr_inc);
3238d318a50SLinus Walleij 
324698e4732SJonas Aaberg int d40_log_sg_to_lli(struct scatterlist *sg,
3258d318a50SLinus Walleij 		      int sg_len,
326*5ed04b85SRabin Vincent 		      dma_addr_t dev_addr,
3278d318a50SLinus Walleij 		      struct d40_log_lli *lli_sg,
3288d318a50SLinus Walleij 		      u32 lcsp13, /* src or dst*/
329d49278e3SPer Forlin 		      u32 data_width1, u32 data_width2);
330698e4732SJonas Aaberg 
331698e4732SJonas Aaberg void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
332698e4732SJonas Aaberg 			    struct d40_log_lli *lli_dst,
333698e4732SJonas Aaberg 			    struct d40_log_lli *lli_src,
334698e4732SJonas Aaberg 			    int next);
335698e4732SJonas Aaberg 
336698e4732SJonas Aaberg void d40_log_lli_lcla_write(struct d40_log_lli *lcla,
337698e4732SJonas Aaberg 			    struct d40_log_lli *lli_dst,
338698e4732SJonas Aaberg 			    struct d40_log_lli *lli_src,
339698e4732SJonas Aaberg 			    int next);
3408d318a50SLinus Walleij 
3418d318a50SLinus Walleij #endif /* STE_DMA40_LLI_H */
342