xref: /openbmc/linux/drivers/dma/ste_dma40_ll.h (revision 20a5b6d043a9a12d01cec76993ba3658a6d36ba7)
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
133*20a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_BASIC		0x1
134*20a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_MODULO		0x2
135*20a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_DOUBLE_DST		0x3
136*20a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_PHY_DST_LOG	0x1
137*20a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_LOG_DST_PHY	0x2
138*20a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_LOG_DST_LOG	0x3
139*20a5b6d0SRabin 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
1668d318a50SLinus Walleij #define D40_DREG_STFU		0xFC8
1678d318a50SLinus Walleij #define D40_DREG_ICFG		0xFCC
1688d318a50SLinus Walleij #define D40_DREG_PERIPHID0	0xFE0
1698d318a50SLinus Walleij #define D40_DREG_PERIPHID1	0xFE4
1708d318a50SLinus Walleij #define D40_DREG_PERIPHID2	0xFE8
1713ae0267fSJonas Aaberg #define D40_DREG_PERIPHID2_REV_POS 4
1723ae0267fSJonas Aaberg #define D40_DREG_PERIPHID2_REV_MASK (0xf << D40_DREG_PERIPHID2_REV_POS)
1733ae0267fSJonas Aaberg #define D40_DREG_PERIPHID2_DESIGNER_MASK 0xf
1748d318a50SLinus Walleij #define D40_DREG_PERIPHID3	0xFEC
1758d318a50SLinus Walleij #define D40_DREG_CELLID0	0xFF0
1768d318a50SLinus Walleij #define D40_DREG_CELLID1	0xFF4
1778d318a50SLinus Walleij #define D40_DREG_CELLID2	0xFF8
1788d318a50SLinus Walleij #define D40_DREG_CELLID3	0xFFC
1798d318a50SLinus Walleij 
1808d318a50SLinus Walleij /* LLI related structures */
1818d318a50SLinus Walleij 
1828d318a50SLinus Walleij /**
1838d318a50SLinus Walleij  * struct d40_phy_lli - The basic configration register for each physical
1848d318a50SLinus Walleij  * channel.
1858d318a50SLinus Walleij  *
1868d318a50SLinus Walleij  * @reg_cfg: The configuration register.
1878d318a50SLinus Walleij  * @reg_elt: The element register.
1888d318a50SLinus Walleij  * @reg_ptr: The pointer register.
1898d318a50SLinus Walleij  * @reg_lnk: The link register.
1908d318a50SLinus Walleij  *
1918d318a50SLinus Walleij  * These registers are set up for both physical and logical transfers
1928d318a50SLinus Walleij  * Note that the bit in each register means differently in logical and
1938d318a50SLinus Walleij  * physical(standard) mode.
1948d318a50SLinus Walleij  *
1958d318a50SLinus Walleij  * This struct must be 16 bytes aligned, and only contain physical registers
1968d318a50SLinus Walleij  * since it will be directly accessed by the DMA.
1978d318a50SLinus Walleij  */
1988d318a50SLinus Walleij struct d40_phy_lli {
1998d318a50SLinus Walleij 	u32 reg_cfg;
2008d318a50SLinus Walleij 	u32 reg_elt;
2018d318a50SLinus Walleij 	u32 reg_ptr;
2028d318a50SLinus Walleij 	u32 reg_lnk;
2038d318a50SLinus Walleij };
2048d318a50SLinus Walleij 
2058d318a50SLinus Walleij /**
2068d318a50SLinus Walleij  * struct d40_phy_lli_bidir - struct for a transfer.
2078d318a50SLinus Walleij  *
2088d318a50SLinus Walleij  * @src: Register settings for src channel.
2098d318a50SLinus Walleij  * @dst: Register settings for dst channel.
2108d318a50SLinus Walleij  *
2118d318a50SLinus Walleij  * All DMA transfers have a source and a destination.
2128d318a50SLinus Walleij  */
2138d318a50SLinus Walleij 
2148d318a50SLinus Walleij struct d40_phy_lli_bidir {
2158d318a50SLinus Walleij 	struct d40_phy_lli	*src;
2168d318a50SLinus Walleij 	struct d40_phy_lli	*dst;
2178d318a50SLinus Walleij };
2188d318a50SLinus Walleij 
2198d318a50SLinus Walleij 
2208d318a50SLinus Walleij /**
2218d318a50SLinus Walleij  * struct d40_log_lli - logical lli configuration
2228d318a50SLinus Walleij  *
2238d318a50SLinus Walleij  * @lcsp02: Either maps to register lcsp0 if src or lcsp2 if dst.
2248d318a50SLinus Walleij  * @lcsp13: Either maps to register lcsp1 if src or lcsp3 if dst.
2258d318a50SLinus Walleij  *
2268d318a50SLinus Walleij  * This struct must be 8 bytes aligned since it will be accessed directy by
2278d318a50SLinus Walleij  * the DMA. Never add any none hw mapped registers to this struct.
2288d318a50SLinus Walleij  */
2298d318a50SLinus Walleij 
2308d318a50SLinus Walleij struct d40_log_lli {
2318d318a50SLinus Walleij 	u32 lcsp02;
2328d318a50SLinus Walleij 	u32 lcsp13;
2338d318a50SLinus Walleij };
2348d318a50SLinus Walleij 
2358d318a50SLinus Walleij /**
2368d318a50SLinus Walleij  * struct d40_log_lli_bidir - For both src and dst
2378d318a50SLinus Walleij  *
2388d318a50SLinus Walleij  * @src: pointer to src lli configuration.
2398d318a50SLinus Walleij  * @dst: pointer to dst lli configuration.
2408d318a50SLinus Walleij  *
2418d318a50SLinus Walleij  * You always have a src and a dst when doing DMA transfers.
2428d318a50SLinus Walleij  */
2438d318a50SLinus Walleij 
2448d318a50SLinus Walleij struct d40_log_lli_bidir {
2458d318a50SLinus Walleij 	struct d40_log_lli *src;
2468d318a50SLinus Walleij 	struct d40_log_lli *dst;
2478d318a50SLinus Walleij };
2488d318a50SLinus Walleij 
2498d318a50SLinus Walleij /**
2508d318a50SLinus Walleij  * struct d40_log_lli_full - LCPA layout
2518d318a50SLinus Walleij  *
2528d318a50SLinus Walleij  * @lcsp0: Logical Channel Standard Param 0 - Src.
2538d318a50SLinus Walleij  * @lcsp1: Logical Channel Standard Param 1 - Src.
2548d318a50SLinus Walleij  * @lcsp2: Logical Channel Standard Param 2 - Dst.
2558d318a50SLinus Walleij  * @lcsp3: Logical Channel Standard Param 3 - Dst.
2568d318a50SLinus Walleij  *
2578d318a50SLinus Walleij  * This struct maps to LCPA physical memory layout. Must map to
2588d318a50SLinus Walleij  * the hw.
2598d318a50SLinus Walleij  */
2608d318a50SLinus Walleij struct d40_log_lli_full {
2618d318a50SLinus Walleij 	u32 lcsp0;
2628d318a50SLinus Walleij 	u32 lcsp1;
2638d318a50SLinus Walleij 	u32 lcsp2;
2648d318a50SLinus Walleij 	u32 lcsp3;
2658d318a50SLinus Walleij };
2668d318a50SLinus Walleij 
2678d318a50SLinus Walleij /**
2688d318a50SLinus Walleij  * struct d40_def_lcsp - Default LCSP1 and LCSP3 settings
2698d318a50SLinus Walleij  *
2708d318a50SLinus Walleij  * @lcsp3: The default configuration for dst.
2718d318a50SLinus Walleij  * @lcsp1: The default configuration for src.
2728d318a50SLinus Walleij  */
2738d318a50SLinus Walleij struct d40_def_lcsp {
2748d318a50SLinus Walleij 	u32 lcsp3;
2758d318a50SLinus Walleij 	u32 lcsp1;
2768d318a50SLinus Walleij };
2778d318a50SLinus Walleij 
2788d318a50SLinus Walleij /* Physical channels */
2798d318a50SLinus Walleij 
2808d318a50SLinus Walleij void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
281767a9675SJonas Aaberg 		 u32 *src_cfg,
282767a9675SJonas Aaberg 		 u32 *dst_cfg,
283767a9675SJonas Aaberg 		 bool is_log);
2848d318a50SLinus Walleij 
2858d318a50SLinus Walleij void d40_log_cfg(struct stedma40_chan_cfg *cfg,
286767a9675SJonas Aaberg 		 u32 *lcsp1,
287767a9675SJonas Aaberg 		 u32 *lcsp2);
2888d318a50SLinus Walleij 
2898d318a50SLinus Walleij int d40_phy_sg_to_lli(struct scatterlist *sg,
2908d318a50SLinus Walleij 		      int sg_len,
2918d318a50SLinus Walleij 		      dma_addr_t target,
2928d318a50SLinus Walleij 		      struct d40_phy_lli *lli,
2938d318a50SLinus Walleij 		      dma_addr_t lli_phys,
2948d318a50SLinus Walleij 		      u32 reg_cfg,
2958d318a50SLinus Walleij 		      u32 data_width,
2960246e77bSJonas Aaberg 		      int psize);
2978d318a50SLinus Walleij 
2988d318a50SLinus Walleij int d40_phy_fill_lli(struct d40_phy_lli *lli,
2998d318a50SLinus Walleij 		     dma_addr_t data,
3008d318a50SLinus Walleij 		     u32 data_size,
3018d318a50SLinus Walleij 		     int psize,
3028d318a50SLinus Walleij 		     dma_addr_t next_lli,
3038d318a50SLinus Walleij 		     u32 reg_cfg,
3048d318a50SLinus Walleij 		     bool term_int,
3058d318a50SLinus Walleij 		     u32 data_width,
3068d318a50SLinus Walleij 		     bool is_device);
3078d318a50SLinus Walleij 
3088d318a50SLinus Walleij void d40_phy_lli_write(void __iomem *virtbase,
3098d318a50SLinus Walleij 		       u32 phy_chan_num,
3108d318a50SLinus Walleij 		       struct d40_phy_lli *lli_dst,
3118d318a50SLinus Walleij 		       struct d40_phy_lli *lli_src);
3128d318a50SLinus Walleij 
3138d318a50SLinus Walleij /* Logical channels */
3148d318a50SLinus Walleij 
3158d318a50SLinus Walleij void d40_log_fill_lli(struct d40_log_lli *lli,
316767a9675SJonas Aaberg 		      dma_addr_t data,
317767a9675SJonas Aaberg 		      u32 data_size,
318767a9675SJonas Aaberg 		      u32 reg_cfg,
3198d318a50SLinus Walleij 		      u32 data_width,
320767a9675SJonas Aaberg 		      bool addr_inc);
3218d318a50SLinus Walleij 
322698e4732SJonas Aaberg int d40_log_sg_to_dev(struct scatterlist *sg,
3238d318a50SLinus Walleij 		      int sg_len,
3248d318a50SLinus Walleij 		      struct d40_log_lli_bidir *lli,
3258d318a50SLinus Walleij 		      struct d40_def_lcsp *lcsp,
3268d318a50SLinus Walleij 		      u32 src_data_width,
3278d318a50SLinus Walleij 		      u32 dst_data_width,
3288d318a50SLinus Walleij 		      enum dma_data_direction direction,
329698e4732SJonas Aaberg 		      dma_addr_t dev_addr);
3308d318a50SLinus Walleij 
331698e4732SJonas Aaberg int d40_log_sg_to_lli(struct scatterlist *sg,
3328d318a50SLinus Walleij 		      int sg_len,
3338d318a50SLinus Walleij 		      struct d40_log_lli *lli_sg,
3348d318a50SLinus Walleij 		      u32 lcsp13, /* src or dst*/
335698e4732SJonas Aaberg 		      u32 data_width);
336698e4732SJonas Aaberg 
337698e4732SJonas Aaberg void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
338698e4732SJonas Aaberg 			    struct d40_log_lli *lli_dst,
339698e4732SJonas Aaberg 			    struct d40_log_lli *lli_src,
340698e4732SJonas Aaberg 			    int next);
341698e4732SJonas Aaberg 
342698e4732SJonas Aaberg void d40_log_lli_lcla_write(struct d40_log_lli *lcla,
343698e4732SJonas Aaberg 			    struct d40_log_lli *lli_dst,
344698e4732SJonas Aaberg 			    struct d40_log_lli *lli_src,
345698e4732SJonas Aaberg 			    int next);
3468d318a50SLinus Walleij 
3478d318a50SLinus Walleij #endif /* STE_DMA40_LLI_H */
348