xref: /openbmc/linux/drivers/dma/ste_dma40_ll.h (revision ef1872ec652b3bc472d6c0995d0b64d5058878ea)
18d318a50SLinus Walleij /*
28d318a50SLinus Walleij  * driver/dma/ste_dma40_ll.h
38d318a50SLinus Walleij  *
48d318a50SLinus Walleij  * Copyright (C) ST-Ericsson 2007-2010
58d318a50SLinus Walleij  * License terms: GNU General Public License (GPL) version 2
68d318a50SLinus Walleij  * Author: Per Friden <per.friden@stericsson.com>
78d318a50SLinus Walleij  * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
88d318a50SLinus Walleij  */
98d318a50SLinus Walleij #ifndef STE_DMA40_LL_H
108d318a50SLinus Walleij #define STE_DMA40_LL_H
118d318a50SLinus Walleij 
128d318a50SLinus Walleij #define D40_DREG_PCBASE		0x400
138d318a50SLinus Walleij #define D40_DREG_PCDELTA	(8 * 4)
148d318a50SLinus Walleij #define D40_LLI_ALIGN		16 /* LLI alignment must be 16 bytes. */
158d318a50SLinus Walleij 
16*ef1872ecSLinus Walleij #define D40_LCPA_CHAN_SIZE 32
17*ef1872ecSLinus Walleij #define D40_LCPA_CHAN_DST_DELTA 16
18*ef1872ecSLinus Walleij 
198d318a50SLinus Walleij #define D40_TYPE_TO_GROUP(type) (type / 16)
208d318a50SLinus Walleij #define D40_TYPE_TO_EVENT(type) (type % 16)
218d318a50SLinus Walleij 
228d318a50SLinus Walleij /* Most bits of the CFG register are the same in log as in phy mode */
238d318a50SLinus Walleij #define D40_SREG_CFG_MST_POS		15
248d318a50SLinus Walleij #define D40_SREG_CFG_TIM_POS		14
258d318a50SLinus Walleij #define D40_SREG_CFG_EIM_POS		13
268d318a50SLinus Walleij #define D40_SREG_CFG_LOG_INCR_POS	12
278d318a50SLinus Walleij #define D40_SREG_CFG_PHY_PEN_POS	12
288d318a50SLinus Walleij #define D40_SREG_CFG_PSIZE_POS		10
298d318a50SLinus Walleij #define D40_SREG_CFG_ESIZE_POS		 8
308d318a50SLinus Walleij #define D40_SREG_CFG_PRI_POS		 7
318d318a50SLinus Walleij #define D40_SREG_CFG_LBE_POS		 6
328d318a50SLinus Walleij #define D40_SREG_CFG_LOG_GIM_POS	 5
338d318a50SLinus Walleij #define D40_SREG_CFG_LOG_MFU_POS	 4
348d318a50SLinus Walleij #define D40_SREG_CFG_PHY_TM_POS		 4
358d318a50SLinus Walleij #define D40_SREG_CFG_PHY_EVTL_POS	 0
368d318a50SLinus Walleij 
378d318a50SLinus Walleij 
388d318a50SLinus Walleij /* Standard channel parameters - basic mode (element register) */
398d318a50SLinus Walleij #define D40_SREG_ELEM_PHY_ECNT_POS	16
408d318a50SLinus Walleij #define D40_SREG_ELEM_PHY_EIDX_POS	 0
418d318a50SLinus Walleij 
428d318a50SLinus Walleij #define D40_SREG_ELEM_PHY_ECNT_MASK	(0xFFFF << D40_SREG_ELEM_PHY_ECNT_POS)
438d318a50SLinus Walleij 
448d318a50SLinus Walleij /* Standard channel parameters - basic mode (Link register) */
458d318a50SLinus Walleij #define D40_SREG_LNK_PHY_TCP_POS	0
468d318a50SLinus Walleij #define D40_SREG_LNK_PHY_LMP_POS	1
478d318a50SLinus Walleij #define D40_SREG_LNK_PHY_PRE_POS	2
488d318a50SLinus Walleij /*
498d318a50SLinus Walleij  * Source  destination link address. Contains the
508d318a50SLinus Walleij  * 29-bit byte word aligned address of the reload area.
518d318a50SLinus Walleij  */
528d318a50SLinus Walleij #define D40_SREG_LNK_PHYS_LNK_MASK	0xFFFFFFF8UL
538d318a50SLinus Walleij 
548d318a50SLinus Walleij /* Standard basic channel logical mode */
558d318a50SLinus Walleij 
568d318a50SLinus Walleij /* Element register */
578d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_ECNT_POS	16
588d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_LIDX_POS	 8
598d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_LOS_POS	 1
608d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_TCP_POS	 0
618d318a50SLinus Walleij 
628d318a50SLinus Walleij #define D40_SREG_ELEM_LOG_LIDX_MASK	(0xFF << D40_SREG_ELEM_LOG_LIDX_POS)
638d318a50SLinus Walleij 
648d318a50SLinus Walleij /* Link register */
658d318a50SLinus Walleij #define D40_DEACTIVATE_EVENTLINE	0x0
668d318a50SLinus Walleij #define D40_ACTIVATE_EVENTLINE		0x1
678d318a50SLinus Walleij #define D40_EVENTLINE_POS(i)		(2 * i)
688d318a50SLinus Walleij #define D40_EVENTLINE_MASK(i)		(0x3 << D40_EVENTLINE_POS(i))
698d318a50SLinus Walleij 
708d318a50SLinus Walleij /* Standard basic channel logical params in memory */
718d318a50SLinus Walleij 
728d318a50SLinus Walleij /* LCSP0 */
738d318a50SLinus Walleij #define D40_MEM_LCSP0_ECNT_POS		16
748d318a50SLinus Walleij #define D40_MEM_LCSP0_SPTR_POS		 0
758d318a50SLinus Walleij 
768d318a50SLinus Walleij #define D40_MEM_LCSP0_ECNT_MASK		(0xFFFF << D40_MEM_LCSP0_ECNT_POS)
778d318a50SLinus Walleij #define D40_MEM_LCSP0_SPTR_MASK		(0xFFFF << D40_MEM_LCSP0_SPTR_POS)
788d318a50SLinus Walleij 
798d318a50SLinus Walleij /* LCSP1 */
808d318a50SLinus Walleij #define D40_MEM_LCSP1_SPTR_POS		16
818d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_MST_POS	15
828d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_TIM_POS	14
838d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_EIM_POS	13
848d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_INCR_POS	12
858d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_PSIZE_POS	10
868d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_ESIZE_POS	 8
878d318a50SLinus Walleij #define D40_MEM_LCSP1_SLOS_POS		 1
888d318a50SLinus Walleij #define D40_MEM_LCSP1_STCP_POS		 0
898d318a50SLinus Walleij 
908d318a50SLinus Walleij #define D40_MEM_LCSP1_SPTR_MASK		(0xFFFF << D40_MEM_LCSP1_SPTR_POS)
918d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_TIM_MASK	(0x1 << D40_MEM_LCSP1_SCFG_TIM_POS)
928d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_INCR_MASK	(0x1 << D40_MEM_LCSP1_SCFG_INCR_POS)
938d318a50SLinus Walleij #define D40_MEM_LCSP1_SCFG_PSIZE_MASK	(0x3 << D40_MEM_LCSP1_SCFG_PSIZE_POS)
948d318a50SLinus Walleij #define D40_MEM_LCSP1_SLOS_MASK		(0x7F << D40_MEM_LCSP1_SLOS_POS)
958d318a50SLinus Walleij #define D40_MEM_LCSP1_STCP_MASK		(0x1 << D40_MEM_LCSP1_STCP_POS)
968d318a50SLinus Walleij 
978d318a50SLinus Walleij /* LCSP2 */
988d318a50SLinus Walleij #define D40_MEM_LCSP2_ECNT_POS		16
998d318a50SLinus Walleij 
1008d318a50SLinus Walleij #define D40_MEM_LCSP2_ECNT_MASK		(0xFFFF << D40_MEM_LCSP2_ECNT_POS)
1018d318a50SLinus Walleij 
1028d318a50SLinus Walleij /* LCSP3 */
1038d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_MST_POS	15
1048d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_TIM_POS	14
1058d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_EIM_POS	13
1068d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_INCR_POS	12
1078d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_PSIZE_POS	10
1088d318a50SLinus Walleij #define D40_MEM_LCSP3_DCFG_ESIZE_POS	 8
1098d318a50SLinus Walleij #define D40_MEM_LCSP3_DLOS_POS		 1
1108d318a50SLinus Walleij #define D40_MEM_LCSP3_DTCP_POS		 0
1118d318a50SLinus Walleij 
1128d318a50SLinus Walleij #define D40_MEM_LCSP3_DLOS_MASK		(0x7F << D40_MEM_LCSP3_DLOS_POS)
1138d318a50SLinus Walleij #define D40_MEM_LCSP3_DTCP_MASK		(0x1 << D40_MEM_LCSP3_DTCP_POS)
1148d318a50SLinus Walleij 
1158d318a50SLinus Walleij 
1168d318a50SLinus Walleij /* Standard channel parameter register offsets */
1178d318a50SLinus Walleij #define D40_CHAN_REG_SSCFG	0x00
1188d318a50SLinus Walleij #define D40_CHAN_REG_SSELT	0x04
1198d318a50SLinus Walleij #define D40_CHAN_REG_SSPTR	0x08
1208d318a50SLinus Walleij #define D40_CHAN_REG_SSLNK	0x0C
1218d318a50SLinus Walleij #define D40_CHAN_REG_SDCFG	0x10
1228d318a50SLinus Walleij #define D40_CHAN_REG_SDELT	0x14
1238d318a50SLinus Walleij #define D40_CHAN_REG_SDPTR	0x18
1248d318a50SLinus Walleij #define D40_CHAN_REG_SDLNK	0x1C
1258d318a50SLinus Walleij 
1268d318a50SLinus Walleij /* DMA Register Offsets */
1278d318a50SLinus Walleij #define D40_DREG_GCC		0x000
1288d318a50SLinus Walleij #define D40_DREG_PRTYP		0x004
1298d318a50SLinus Walleij #define D40_DREG_PRSME		0x008
1308d318a50SLinus Walleij #define D40_DREG_PRSMO		0x00C
1318d318a50SLinus Walleij #define D40_DREG_PRMSE		0x010
1328d318a50SLinus Walleij #define D40_DREG_PRMSO		0x014
1338d318a50SLinus Walleij #define D40_DREG_PRMOE		0x018
1348d318a50SLinus Walleij #define D40_DREG_PRMOO		0x01C
1358d318a50SLinus Walleij #define D40_DREG_LCPA		0x020
1368d318a50SLinus Walleij #define D40_DREG_LCLA		0x024
1378d318a50SLinus Walleij #define D40_DREG_ACTIVE		0x050
1388d318a50SLinus Walleij #define D40_DREG_ACTIVO		0x054
1398d318a50SLinus Walleij #define D40_DREG_FSEB1		0x058
1408d318a50SLinus Walleij #define D40_DREG_FSEB2		0x05C
1418d318a50SLinus Walleij #define D40_DREG_PCMIS		0x060
1428d318a50SLinus Walleij #define D40_DREG_PCICR		0x064
1438d318a50SLinus Walleij #define D40_DREG_PCTIS		0x068
1448d318a50SLinus Walleij #define D40_DREG_PCEIS		0x06C
1458d318a50SLinus Walleij #define D40_DREG_LCMIS0		0x080
1468d318a50SLinus Walleij #define D40_DREG_LCMIS1		0x084
1478d318a50SLinus Walleij #define D40_DREG_LCMIS2		0x088
1488d318a50SLinus Walleij #define D40_DREG_LCMIS3		0x08C
1498d318a50SLinus Walleij #define D40_DREG_LCICR0		0x090
1508d318a50SLinus Walleij #define D40_DREG_LCICR1		0x094
1518d318a50SLinus Walleij #define D40_DREG_LCICR2		0x098
1528d318a50SLinus Walleij #define D40_DREG_LCICR3		0x09C
1538d318a50SLinus Walleij #define D40_DREG_LCTIS0		0x0A0
1548d318a50SLinus Walleij #define D40_DREG_LCTIS1		0x0A4
1558d318a50SLinus Walleij #define D40_DREG_LCTIS2		0x0A8
1568d318a50SLinus Walleij #define D40_DREG_LCTIS3		0x0AC
1578d318a50SLinus Walleij #define D40_DREG_LCEIS0		0x0B0
1588d318a50SLinus Walleij #define D40_DREG_LCEIS1		0x0B4
1598d318a50SLinus Walleij #define D40_DREG_LCEIS2		0x0B8
1608d318a50SLinus Walleij #define D40_DREG_LCEIS3		0x0BC
1618d318a50SLinus Walleij #define D40_DREG_STFU		0xFC8
1628d318a50SLinus Walleij #define D40_DREG_ICFG		0xFCC
1638d318a50SLinus Walleij #define D40_DREG_PERIPHID0	0xFE0
1648d318a50SLinus Walleij #define D40_DREG_PERIPHID1	0xFE4
1658d318a50SLinus Walleij #define D40_DREG_PERIPHID2	0xFE8
1668d318a50SLinus Walleij #define D40_DREG_PERIPHID3	0xFEC
1678d318a50SLinus Walleij #define D40_DREG_CELLID0	0xFF0
1688d318a50SLinus Walleij #define D40_DREG_CELLID1	0xFF4
1698d318a50SLinus Walleij #define D40_DREG_CELLID2	0xFF8
1708d318a50SLinus Walleij #define D40_DREG_CELLID3	0xFFC
1718d318a50SLinus Walleij 
1728d318a50SLinus Walleij /* LLI related structures */
1738d318a50SLinus Walleij 
1748d318a50SLinus Walleij /**
1758d318a50SLinus Walleij  * struct d40_phy_lli - The basic configration register for each physical
1768d318a50SLinus Walleij  * channel.
1778d318a50SLinus Walleij  *
1788d318a50SLinus Walleij  * @reg_cfg: The configuration register.
1798d318a50SLinus Walleij  * @reg_elt: The element register.
1808d318a50SLinus Walleij  * @reg_ptr: The pointer register.
1818d318a50SLinus Walleij  * @reg_lnk: The link register.
1828d318a50SLinus Walleij  *
1838d318a50SLinus Walleij  * These registers are set up for both physical and logical transfers
1848d318a50SLinus Walleij  * Note that the bit in each register means differently in logical and
1858d318a50SLinus Walleij  * physical(standard) mode.
1868d318a50SLinus Walleij  *
1878d318a50SLinus Walleij  * This struct must be 16 bytes aligned, and only contain physical registers
1888d318a50SLinus Walleij  * since it will be directly accessed by the DMA.
1898d318a50SLinus Walleij  */
1908d318a50SLinus Walleij struct d40_phy_lli {
1918d318a50SLinus Walleij 	u32 reg_cfg;
1928d318a50SLinus Walleij 	u32 reg_elt;
1938d318a50SLinus Walleij 	u32 reg_ptr;
1948d318a50SLinus Walleij 	u32 reg_lnk;
1958d318a50SLinus Walleij };
1968d318a50SLinus Walleij 
1978d318a50SLinus Walleij /**
1988d318a50SLinus Walleij  * struct d40_phy_lli_bidir - struct for a transfer.
1998d318a50SLinus Walleij  *
2008d318a50SLinus Walleij  * @src: Register settings for src channel.
2018d318a50SLinus Walleij  * @dst: Register settings for dst channel.
2028d318a50SLinus Walleij  * @dst_addr: Physical destination address.
2038d318a50SLinus Walleij  * @src_addr: Physical source address.
2048d318a50SLinus Walleij  *
2058d318a50SLinus Walleij  * All DMA transfers have a source and a destination.
2068d318a50SLinus Walleij  */
2078d318a50SLinus Walleij 
2088d318a50SLinus Walleij struct d40_phy_lli_bidir {
2098d318a50SLinus Walleij 	struct d40_phy_lli	*src;
2108d318a50SLinus Walleij 	struct d40_phy_lli	*dst;
2118d318a50SLinus Walleij 	dma_addr_t		 dst_addr;
2128d318a50SLinus Walleij 	dma_addr_t		 src_addr;
2138d318a50SLinus Walleij };
2148d318a50SLinus Walleij 
2158d318a50SLinus Walleij 
2168d318a50SLinus Walleij /**
2178d318a50SLinus Walleij  * struct d40_log_lli - logical lli configuration
2188d318a50SLinus Walleij  *
2198d318a50SLinus Walleij  * @lcsp02: Either maps to register lcsp0 if src or lcsp2 if dst.
2208d318a50SLinus Walleij  * @lcsp13: Either maps to register lcsp1 if src or lcsp3 if dst.
2218d318a50SLinus Walleij  *
2228d318a50SLinus Walleij  * This struct must be 8 bytes aligned since it will be accessed directy by
2238d318a50SLinus Walleij  * the DMA. Never add any none hw mapped registers to this struct.
2248d318a50SLinus Walleij  */
2258d318a50SLinus Walleij 
2268d318a50SLinus Walleij struct d40_log_lli {
2278d318a50SLinus Walleij 	u32 lcsp02;
2288d318a50SLinus Walleij 	u32 lcsp13;
2298d318a50SLinus Walleij };
2308d318a50SLinus Walleij 
2318d318a50SLinus Walleij /**
2328d318a50SLinus Walleij  * struct d40_log_lli_bidir - For both src and dst
2338d318a50SLinus Walleij  *
2348d318a50SLinus Walleij  * @src: pointer to src lli configuration.
2358d318a50SLinus Walleij  * @dst: pointer to dst lli configuration.
2368d318a50SLinus Walleij  *
2378d318a50SLinus Walleij  * You always have a src and a dst when doing DMA transfers.
2388d318a50SLinus Walleij  */
2398d318a50SLinus Walleij 
2408d318a50SLinus Walleij struct d40_log_lli_bidir {
2418d318a50SLinus Walleij 	struct d40_log_lli *src;
2428d318a50SLinus Walleij 	struct d40_log_lli *dst;
2438d318a50SLinus Walleij };
2448d318a50SLinus Walleij 
2458d318a50SLinus Walleij /**
2468d318a50SLinus Walleij  * struct d40_log_lli_full - LCPA layout
2478d318a50SLinus Walleij  *
2488d318a50SLinus Walleij  * @lcsp0: Logical Channel Standard Param 0 - Src.
2498d318a50SLinus Walleij  * @lcsp1: Logical Channel Standard Param 1 - Src.
2508d318a50SLinus Walleij  * @lcsp2: Logical Channel Standard Param 2 - Dst.
2518d318a50SLinus Walleij  * @lcsp3: Logical Channel Standard Param 3 - Dst.
2528d318a50SLinus Walleij  *
2538d318a50SLinus Walleij  * This struct maps to LCPA physical memory layout. Must map to
2548d318a50SLinus Walleij  * the hw.
2558d318a50SLinus Walleij  */
2568d318a50SLinus Walleij struct d40_log_lli_full {
2578d318a50SLinus Walleij 	u32 lcsp0;
2588d318a50SLinus Walleij 	u32 lcsp1;
2598d318a50SLinus Walleij 	u32 lcsp2;
2608d318a50SLinus Walleij 	u32 lcsp3;
2618d318a50SLinus Walleij };
2628d318a50SLinus Walleij 
2638d318a50SLinus Walleij /**
2648d318a50SLinus Walleij  * struct d40_def_lcsp - Default LCSP1 and LCSP3 settings
2658d318a50SLinus Walleij  *
2668d318a50SLinus Walleij  * @lcsp3: The default configuration for dst.
2678d318a50SLinus Walleij  * @lcsp1: The default configuration for src.
2688d318a50SLinus Walleij  */
2698d318a50SLinus Walleij struct d40_def_lcsp {
2708d318a50SLinus Walleij 	u32 lcsp3;
2718d318a50SLinus Walleij 	u32 lcsp1;
2728d318a50SLinus Walleij };
2738d318a50SLinus Walleij 
2748d318a50SLinus Walleij /**
2758d318a50SLinus Walleij  * struct d40_lcla_elem - Info for one LCA element.
2768d318a50SLinus Walleij  *
2778d318a50SLinus Walleij  * @src_id: logical channel src id
2788d318a50SLinus Walleij  * @dst_id: logical channel dst id
2798d318a50SLinus Walleij  * @src: LCPA formated src parameters
2808d318a50SLinus Walleij  * @dst: LCPA formated dst parameters
2818d318a50SLinus Walleij  *
2828d318a50SLinus Walleij  */
2838d318a50SLinus Walleij struct d40_lcla_elem {
2848d318a50SLinus Walleij 	int			src_id;
2858d318a50SLinus Walleij 	int			dst_id;
2868d318a50SLinus Walleij 	struct d40_log_lli     *src;
2878d318a50SLinus Walleij 	struct d40_log_lli     *dst;
2888d318a50SLinus Walleij };
2898d318a50SLinus Walleij 
2908d318a50SLinus Walleij /* Physical channels */
2918d318a50SLinus Walleij 
2928d318a50SLinus Walleij void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
2938d318a50SLinus Walleij 		 u32 *src_cfg, u32 *dst_cfg, bool is_log);
2948d318a50SLinus Walleij 
2958d318a50SLinus Walleij void d40_log_cfg(struct stedma40_chan_cfg *cfg,
2968d318a50SLinus Walleij 		 u32 *lcsp1, u32 *lcsp2);
2978d318a50SLinus Walleij 
2988d318a50SLinus Walleij int d40_phy_sg_to_lli(struct scatterlist *sg,
2998d318a50SLinus Walleij 		      int sg_len,
3008d318a50SLinus Walleij 		      dma_addr_t target,
3018d318a50SLinus Walleij 		      struct d40_phy_lli *lli,
3028d318a50SLinus Walleij 		      dma_addr_t lli_phys,
3038d318a50SLinus Walleij 		      u32 reg_cfg,
3048d318a50SLinus Walleij 		      u32 data_width,
3058d318a50SLinus Walleij 		      int psize,
3068d318a50SLinus Walleij 		      bool term_int);
3078d318a50SLinus Walleij 
3088d318a50SLinus Walleij int d40_phy_fill_lli(struct d40_phy_lli *lli,
3098d318a50SLinus Walleij 		     dma_addr_t data,
3108d318a50SLinus Walleij 		     u32 data_size,
3118d318a50SLinus Walleij 		     int psize,
3128d318a50SLinus Walleij 		     dma_addr_t next_lli,
3138d318a50SLinus Walleij 		     u32 reg_cfg,
3148d318a50SLinus Walleij 		     bool term_int,
3158d318a50SLinus Walleij 		     u32 data_width,
3168d318a50SLinus Walleij 		     bool is_device);
3178d318a50SLinus Walleij 
3188d318a50SLinus Walleij void d40_phy_lli_write(void __iomem *virtbase,
3198d318a50SLinus Walleij 		       u32 phy_chan_num,
3208d318a50SLinus Walleij 		       struct d40_phy_lli *lli_dst,
3218d318a50SLinus Walleij 		       struct d40_phy_lli *lli_src);
3228d318a50SLinus Walleij 
3238d318a50SLinus Walleij /* Logical channels */
3248d318a50SLinus Walleij 
3258d318a50SLinus Walleij void d40_log_fill_lli(struct d40_log_lli *lli,
3268d318a50SLinus Walleij 		      dma_addr_t data, u32 data_size,
3278d318a50SLinus Walleij 		      u32 lli_next_off, u32 reg_cfg,
3288d318a50SLinus Walleij 		      u32 data_width,
3298d318a50SLinus Walleij 		      bool term_int, bool addr_inc);
3308d318a50SLinus Walleij 
3318d318a50SLinus Walleij int d40_log_sg_to_dev(struct d40_lcla_elem *lcla,
3328d318a50SLinus Walleij 		      struct scatterlist *sg,
3338d318a50SLinus Walleij 		      int sg_len,
3348d318a50SLinus Walleij 		      struct d40_log_lli_bidir *lli,
3358d318a50SLinus Walleij 		      struct d40_def_lcsp *lcsp,
3368d318a50SLinus Walleij 		      u32 src_data_width,
3378d318a50SLinus Walleij 		      u32 dst_data_width,
3388d318a50SLinus Walleij 		      enum dma_data_direction direction,
3398d318a50SLinus Walleij 		      bool term_int, dma_addr_t dev_addr, int max_len,
3408d318a50SLinus Walleij 		      int llis_per_log);
3418d318a50SLinus Walleij 
3428d318a50SLinus Walleij void d40_log_lli_write(struct d40_log_lli_full *lcpa,
3438d318a50SLinus Walleij 		       struct d40_log_lli *lcla_src,
3448d318a50SLinus Walleij 		       struct d40_log_lli *lcla_dst,
3458d318a50SLinus Walleij 		       struct d40_log_lli *lli_dst,
3468d318a50SLinus Walleij 		       struct d40_log_lli *lli_src,
3478d318a50SLinus Walleij 		       int llis_per_log);
3488d318a50SLinus Walleij 
3498d318a50SLinus Walleij int d40_log_sg_to_lli(int lcla_id,
3508d318a50SLinus Walleij 		      struct scatterlist *sg,
3518d318a50SLinus Walleij 		      int sg_len,
3528d318a50SLinus Walleij 		      struct d40_log_lli *lli_sg,
3538d318a50SLinus Walleij 		      u32 lcsp13, /* src or dst*/
3548d318a50SLinus Walleij 		      u32 data_width,
3558d318a50SLinus Walleij 		      bool term_int, int max_len, int llis_per_log);
3568d318a50SLinus Walleij 
3578d318a50SLinus Walleij #endif /* STE_DMA40_LLI_H */
358