xref: /openbmc/linux/drivers/dma/ste_dma40_ll.h (revision 7fb3e75e1833743d5faf3adbae46b63f503c6fdf)
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)
19*7fb3e75eSNarayanan G #define D40_GROUP_SIZE 8
20*7fb3e75eSNarayanan G #define D40_PHYS_TO_GROUP(phys) ((phys & (D40_GROUP_SIZE - 1)) / 2)
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
128*7fb3e75eSNarayanan G #define D40_DREG_GCC_ENA	0x1
129*7fb3e75eSNarayanan G /* This assumes that there are only 4 event groups */
130*7fb3e75eSNarayanan G #define D40_DREG_GCC_ENABLE_ALL	0xff01
131*7fb3e75eSNarayanan G #define D40_DREG_GCC_EVTGRP_POS 8
132*7fb3e75eSNarayanan G #define D40_DREG_GCC_SRC 0
133*7fb3e75eSNarayanan G #define D40_DREG_GCC_DST 1
134*7fb3e75eSNarayanan G #define D40_DREG_GCC_EVTGRP_ENA(x, y) \
135*7fb3e75eSNarayanan G 	(1 << (D40_DREG_GCC_EVTGRP_POS + 2 * x + y))
136*7fb3e75eSNarayanan G 
1378d318a50SLinus Walleij #define D40_DREG_PRTYP		0x004
1388d318a50SLinus Walleij #define D40_DREG_PRSME		0x008
1398d318a50SLinus Walleij #define D40_DREG_PRSMO		0x00C
1408d318a50SLinus Walleij #define D40_DREG_PRMSE		0x010
1418d318a50SLinus Walleij #define D40_DREG_PRMSO		0x014
1428d318a50SLinus Walleij #define D40_DREG_PRMOE		0x018
1438d318a50SLinus Walleij #define D40_DREG_PRMOO		0x01C
14420a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_BASIC		0x1
14520a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_MODULO		0x2
14620a5b6d0SRabin Vincent #define D40_DREG_PRMO_PCHAN_DOUBLE_DST		0x3
14720a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_PHY_DST_LOG	0x1
14820a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_LOG_DST_PHY	0x2
14920a5b6d0SRabin Vincent #define D40_DREG_PRMO_LCHAN_SRC_LOG_DST_LOG	0x3
15020a5b6d0SRabin Vincent 
1518d318a50SLinus Walleij #define D40_DREG_LCPA		0x020
1528d318a50SLinus Walleij #define D40_DREG_LCLA		0x024
1538d318a50SLinus Walleij #define D40_DREG_ACTIVE		0x050
1548d318a50SLinus Walleij #define D40_DREG_ACTIVO		0x054
1558d318a50SLinus Walleij #define D40_DREG_FSEB1		0x058
1568d318a50SLinus Walleij #define D40_DREG_FSEB2		0x05C
1578d318a50SLinus Walleij #define D40_DREG_PCMIS		0x060
1588d318a50SLinus Walleij #define D40_DREG_PCICR		0x064
1598d318a50SLinus Walleij #define D40_DREG_PCTIS		0x068
1608d318a50SLinus Walleij #define D40_DREG_PCEIS		0x06C
1618d318a50SLinus Walleij #define D40_DREG_LCMIS0		0x080
1628d318a50SLinus Walleij #define D40_DREG_LCMIS1		0x084
1638d318a50SLinus Walleij #define D40_DREG_LCMIS2		0x088
1648d318a50SLinus Walleij #define D40_DREG_LCMIS3		0x08C
1658d318a50SLinus Walleij #define D40_DREG_LCICR0		0x090
1668d318a50SLinus Walleij #define D40_DREG_LCICR1		0x094
1678d318a50SLinus Walleij #define D40_DREG_LCICR2		0x098
1688d318a50SLinus Walleij #define D40_DREG_LCICR3		0x09C
1698d318a50SLinus Walleij #define D40_DREG_LCTIS0		0x0A0
1708d318a50SLinus Walleij #define D40_DREG_LCTIS1		0x0A4
1718d318a50SLinus Walleij #define D40_DREG_LCTIS2		0x0A8
1728d318a50SLinus Walleij #define D40_DREG_LCTIS3		0x0AC
1738d318a50SLinus Walleij #define D40_DREG_LCEIS0		0x0B0
1748d318a50SLinus Walleij #define D40_DREG_LCEIS1		0x0B4
1758d318a50SLinus Walleij #define D40_DREG_LCEIS2		0x0B8
1768d318a50SLinus Walleij #define D40_DREG_LCEIS3		0x0BC
177ac2c0a38SRabin Vincent #define D40_DREG_PSEG1		0x110
178ac2c0a38SRabin Vincent #define D40_DREG_PSEG2		0x114
179ac2c0a38SRabin Vincent #define D40_DREG_PSEG3		0x118
180ac2c0a38SRabin Vincent #define D40_DREG_PSEG4		0x11C
181ac2c0a38SRabin Vincent #define D40_DREG_PCEG1		0x120
182ac2c0a38SRabin Vincent #define D40_DREG_PCEG2		0x124
183ac2c0a38SRabin Vincent #define D40_DREG_PCEG3		0x128
184ac2c0a38SRabin Vincent #define D40_DREG_PCEG4		0x12C
185ac2c0a38SRabin Vincent #define D40_DREG_RSEG1		0x130
186ac2c0a38SRabin Vincent #define D40_DREG_RSEG2		0x134
187ac2c0a38SRabin Vincent #define D40_DREG_RSEG3		0x138
188ac2c0a38SRabin Vincent #define D40_DREG_RSEG4		0x13C
189ac2c0a38SRabin Vincent #define D40_DREG_RCEG1		0x140
190ac2c0a38SRabin Vincent #define D40_DREG_RCEG2		0x144
191ac2c0a38SRabin Vincent #define D40_DREG_RCEG3		0x148
192ac2c0a38SRabin Vincent #define D40_DREG_RCEG4		0x14C
1938d318a50SLinus Walleij #define D40_DREG_STFU		0xFC8
1948d318a50SLinus Walleij #define D40_DREG_ICFG		0xFCC
1958d318a50SLinus Walleij #define D40_DREG_PERIPHID0	0xFE0
1968d318a50SLinus Walleij #define D40_DREG_PERIPHID1	0xFE4
1978d318a50SLinus Walleij #define D40_DREG_PERIPHID2	0xFE8
1988d318a50SLinus Walleij #define D40_DREG_PERIPHID3	0xFEC
1998d318a50SLinus Walleij #define D40_DREG_CELLID0	0xFF0
2008d318a50SLinus Walleij #define D40_DREG_CELLID1	0xFF4
2018d318a50SLinus Walleij #define D40_DREG_CELLID2	0xFF8
2028d318a50SLinus Walleij #define D40_DREG_CELLID3	0xFFC
2038d318a50SLinus Walleij 
2048d318a50SLinus Walleij /* LLI related structures */
2058d318a50SLinus Walleij 
2068d318a50SLinus Walleij /**
2078d318a50SLinus Walleij  * struct d40_phy_lli - The basic configration register for each physical
2088d318a50SLinus Walleij  * channel.
2098d318a50SLinus Walleij  *
2108d318a50SLinus Walleij  * @reg_cfg: The configuration register.
2118d318a50SLinus Walleij  * @reg_elt: The element register.
2128d318a50SLinus Walleij  * @reg_ptr: The pointer register.
2138d318a50SLinus Walleij  * @reg_lnk: The link register.
2148d318a50SLinus Walleij  *
2158d318a50SLinus Walleij  * These registers are set up for both physical and logical transfers
2168d318a50SLinus Walleij  * Note that the bit in each register means differently in logical and
2178d318a50SLinus Walleij  * physical(standard) mode.
2188d318a50SLinus Walleij  *
2198d318a50SLinus Walleij  * This struct must be 16 bytes aligned, and only contain physical registers
2208d318a50SLinus Walleij  * since it will be directly accessed by the DMA.
2218d318a50SLinus Walleij  */
2228d318a50SLinus Walleij struct d40_phy_lli {
2238d318a50SLinus Walleij 	u32 reg_cfg;
2248d318a50SLinus Walleij 	u32 reg_elt;
2258d318a50SLinus Walleij 	u32 reg_ptr;
2268d318a50SLinus Walleij 	u32 reg_lnk;
2278d318a50SLinus Walleij };
2288d318a50SLinus Walleij 
2298d318a50SLinus Walleij /**
2308d318a50SLinus Walleij  * struct d40_phy_lli_bidir - struct for a transfer.
2318d318a50SLinus Walleij  *
2328d318a50SLinus Walleij  * @src: Register settings for src channel.
2338d318a50SLinus Walleij  * @dst: Register settings for dst channel.
2348d318a50SLinus Walleij  *
2358d318a50SLinus Walleij  * All DMA transfers have a source and a destination.
2368d318a50SLinus Walleij  */
2378d318a50SLinus Walleij 
2388d318a50SLinus Walleij struct d40_phy_lli_bidir {
2398d318a50SLinus Walleij 	struct d40_phy_lli	*src;
2408d318a50SLinus Walleij 	struct d40_phy_lli	*dst;
2418d318a50SLinus Walleij };
2428d318a50SLinus Walleij 
2438d318a50SLinus Walleij 
2448d318a50SLinus Walleij /**
2458d318a50SLinus Walleij  * struct d40_log_lli - logical lli configuration
2468d318a50SLinus Walleij  *
2478d318a50SLinus Walleij  * @lcsp02: Either maps to register lcsp0 if src or lcsp2 if dst.
2488d318a50SLinus Walleij  * @lcsp13: Either maps to register lcsp1 if src or lcsp3 if dst.
2498d318a50SLinus Walleij  *
2508d318a50SLinus Walleij  * This struct must be 8 bytes aligned since it will be accessed directy by
2518d318a50SLinus Walleij  * the DMA. Never add any none hw mapped registers to this struct.
2528d318a50SLinus Walleij  */
2538d318a50SLinus Walleij 
2548d318a50SLinus Walleij struct d40_log_lli {
2558d318a50SLinus Walleij 	u32 lcsp02;
2568d318a50SLinus Walleij 	u32 lcsp13;
2578d318a50SLinus Walleij };
2588d318a50SLinus Walleij 
2598d318a50SLinus Walleij /**
2608d318a50SLinus Walleij  * struct d40_log_lli_bidir - For both src and dst
2618d318a50SLinus Walleij  *
2628d318a50SLinus Walleij  * @src: pointer to src lli configuration.
2638d318a50SLinus Walleij  * @dst: pointer to dst lli configuration.
2648d318a50SLinus Walleij  *
2658d318a50SLinus Walleij  * You always have a src and a dst when doing DMA transfers.
2668d318a50SLinus Walleij  */
2678d318a50SLinus Walleij 
2688d318a50SLinus Walleij struct d40_log_lli_bidir {
2698d318a50SLinus Walleij 	struct d40_log_lli *src;
2708d318a50SLinus Walleij 	struct d40_log_lli *dst;
2718d318a50SLinus Walleij };
2728d318a50SLinus Walleij 
2738d318a50SLinus Walleij /**
2748d318a50SLinus Walleij  * struct d40_log_lli_full - LCPA layout
2758d318a50SLinus Walleij  *
2768d318a50SLinus Walleij  * @lcsp0: Logical Channel Standard Param 0 - Src.
2778d318a50SLinus Walleij  * @lcsp1: Logical Channel Standard Param 1 - Src.
2788d318a50SLinus Walleij  * @lcsp2: Logical Channel Standard Param 2 - Dst.
2798d318a50SLinus Walleij  * @lcsp3: Logical Channel Standard Param 3 - Dst.
2808d318a50SLinus Walleij  *
2818d318a50SLinus Walleij  * This struct maps to LCPA physical memory layout. Must map to
2828d318a50SLinus Walleij  * the hw.
2838d318a50SLinus Walleij  */
2848d318a50SLinus Walleij struct d40_log_lli_full {
2858d318a50SLinus Walleij 	u32 lcsp0;
2868d318a50SLinus Walleij 	u32 lcsp1;
2878d318a50SLinus Walleij 	u32 lcsp2;
2888d318a50SLinus Walleij 	u32 lcsp3;
2898d318a50SLinus Walleij };
2908d318a50SLinus Walleij 
2918d318a50SLinus Walleij /**
2928d318a50SLinus Walleij  * struct d40_def_lcsp - Default LCSP1 and LCSP3 settings
2938d318a50SLinus Walleij  *
2948d318a50SLinus Walleij  * @lcsp3: The default configuration for dst.
2958d318a50SLinus Walleij  * @lcsp1: The default configuration for src.
2968d318a50SLinus Walleij  */
2978d318a50SLinus Walleij struct d40_def_lcsp {
2988d318a50SLinus Walleij 	u32 lcsp3;
2998d318a50SLinus Walleij 	u32 lcsp1;
3008d318a50SLinus Walleij };
3018d318a50SLinus Walleij 
3028d318a50SLinus Walleij /* Physical channels */
3038d318a50SLinus Walleij 
3047f933bedSRabin Vincent enum d40_lli_flags {
3057f933bedSRabin Vincent 	LLI_ADDR_INC	= 1 << 0,
3067f933bedSRabin Vincent 	LLI_TERM_INT	= 1 << 1,
3070c842b55SRabin Vincent 	LLI_CYCLIC	= 1 << 2,
3080c842b55SRabin Vincent 	LLI_LAST_LINK	= 1 << 3,
3097f933bedSRabin Vincent };
3107f933bedSRabin Vincent 
3118d318a50SLinus Walleij void d40_phy_cfg(struct stedma40_chan_cfg *cfg,
312767a9675SJonas Aaberg 		 u32 *src_cfg,
313767a9675SJonas Aaberg 		 u32 *dst_cfg,
314767a9675SJonas Aaberg 		 bool is_log);
3158d318a50SLinus Walleij 
3168d318a50SLinus Walleij void d40_log_cfg(struct stedma40_chan_cfg *cfg,
317767a9675SJonas Aaberg 		 u32 *lcsp1,
318767a9675SJonas Aaberg 		 u32 *lcsp2);
3198d318a50SLinus Walleij 
3208d318a50SLinus Walleij int d40_phy_sg_to_lli(struct scatterlist *sg,
3218d318a50SLinus Walleij 		      int sg_len,
3228d318a50SLinus Walleij 		      dma_addr_t target,
3238d318a50SLinus Walleij 		      struct d40_phy_lli *lli,
3248d318a50SLinus Walleij 		      dma_addr_t lli_phys,
3258d318a50SLinus Walleij 		      u32 reg_cfg,
326cc31b6f7SRabin Vincent 		      struct stedma40_half_channel_info *info,
3270c842b55SRabin Vincent 		      struct stedma40_half_channel_info *otherinfo,
3280c842b55SRabin Vincent 		      unsigned long flags);
3298d318a50SLinus Walleij 
3308d318a50SLinus Walleij /* Logical channels */
3318d318a50SLinus Walleij 
332698e4732SJonas Aaberg int d40_log_sg_to_lli(struct scatterlist *sg,
3338d318a50SLinus Walleij 		      int sg_len,
3345ed04b85SRabin Vincent 		      dma_addr_t dev_addr,
3358d318a50SLinus Walleij 		      struct d40_log_lli *lli_sg,
3368d318a50SLinus Walleij 		      u32 lcsp13, /* src or dst*/
337d49278e3SPer Forlin 		      u32 data_width1, u32 data_width2);
338698e4732SJonas Aaberg 
339698e4732SJonas Aaberg void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
340698e4732SJonas Aaberg 			    struct d40_log_lli *lli_dst,
341698e4732SJonas Aaberg 			    struct d40_log_lli *lli_src,
3420c842b55SRabin Vincent 			    int next, unsigned int flags);
343698e4732SJonas Aaberg 
344698e4732SJonas Aaberg void d40_log_lli_lcla_write(struct d40_log_lli *lcla,
345698e4732SJonas Aaberg 			    struct d40_log_lli *lli_dst,
346698e4732SJonas Aaberg 			    struct d40_log_lli *lli_src,
3470c842b55SRabin Vincent 			    int next, unsigned int flags);
3488d318a50SLinus Walleij 
3498d318a50SLinus Walleij #endif /* STE_DMA40_LLI_H */
350