8 #include <linux/kernel.h>
55 u32 *src_cfg,
u32 *dst_cfg,
bool is_log)
136 int psize = info->
psize;
142 num_elems = 2 << psize;
149 if (data_size < num_elems * (0x1 << data_width))
185 static int d40_seg_size(
int size,
int data_width1,
int data_width2)
187 u32 max_w =
max(data_width1, data_width2);
188 u32 min_w =
min(data_width1, data_width2);
192 seg_max -= (1 << max_w);
197 if (size <= 2 * seg_max)
198 return ALIGN(size / 2, 1 << max_w);
216 int size_rest =
size;
224 flags &= ~LLI_TERM_INT;
227 size_seg = d40_seg_size(size_rest, info->
data_width,
229 size_rest -= size_seg;
231 if (size_rest == 0 && term_int)
234 if (size_rest == 0 && lastlink)
235 next = cyclic ? first_phys : 0;
240 err = d40_phy_fill_lli(lli, addr, size_seg, next,
241 reg_cfg, info, flags);
286 l_phys =
ALIGN(lli_phys + (lli - lli_sg) *
289 lli = d40_phy_buf_to_lli(lli, dst, len, l_phys, lli_phys,
290 reg_cfg, info, otherinfo, flags);
302 static void d40_log_lli_link(
struct d40_log_lli *lli_dst,
304 int next,
unsigned int flags)
330 int next,
unsigned int flags)
332 d40_log_lli_link(lli_dst, lli_src, next, flags);
343 int next,
unsigned int flags)
345 d40_log_lli_link(lli_dst, lli_src, next, flags);
353 static void d40_log_fill_lli(
struct d40_log_lli *lli,
389 int size_rest =
size;
393 size_seg = d40_seg_size(size_rest, data_width1, data_width2);
394 size_rest -= size_seg;
396 d40_log_fill_lli(lli,
414 u32 data_width1,
u32 data_width2)
420 unsigned long flags = 0;
432 lli = d40_log_buf_to_lli(lli, addr, len,