• Home
  • Raw
  • Download

Lines Matching refs:desc

17 #define PRINT_POS do { printk(KERN_DEBUG "%02d: %s\n", desc_len(desc),\
36 static inline int desc_len(u32 *desc) in desc_len() argument
38 return caam32_to_cpu(*desc) & HDR_DESCLEN_MASK; in desc_len()
41 static inline int desc_bytes(void *desc) in desc_bytes() argument
43 return desc_len(desc) * CAAM_CMD_SZ; in desc_bytes()
46 static inline u32 *desc_end(u32 *desc) in desc_end() argument
48 return desc + desc_len(desc); in desc_end()
51 static inline void *sh_desc_pdb(u32 *desc) in sh_desc_pdb() argument
53 return desc + 1; in sh_desc_pdb()
56 static inline void init_desc(u32 *desc, u32 options) in init_desc() argument
58 *desc = cpu_to_caam32((options | HDR_ONE) + 1); in init_desc()
61 static inline void init_sh_desc(u32 *desc, u32 options) in init_sh_desc() argument
64 init_desc(desc, CMD_SHARED_DESC_HDR | options); in init_sh_desc()
67 static inline void init_sh_desc_pdb(u32 *desc, u32 options, size_t pdb_bytes) in init_sh_desc_pdb() argument
71 init_sh_desc(desc, (((pdb_len + 1) << HDR_START_IDX_SHIFT) + pdb_len) | in init_sh_desc_pdb()
75 static inline void init_job_desc(u32 *desc, u32 options) in init_job_desc() argument
77 init_desc(desc, CMD_DESC_HDR | options); in init_job_desc()
80 static inline void init_job_desc_pdb(u32 *desc, u32 options, size_t pdb_bytes) in init_job_desc_pdb() argument
84 init_job_desc(desc, (((pdb_len + 1) << HDR_START_IDX_SHIFT)) | options); in init_job_desc_pdb()
87 static inline void append_ptr(u32 *desc, dma_addr_t ptr) in append_ptr() argument
89 dma_addr_t *offset = (dma_addr_t *)desc_end(desc); in append_ptr()
93 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + in append_ptr()
97 static inline void init_job_desc_shared(u32 *desc, dma_addr_t ptr, int len, in init_job_desc_shared() argument
101 init_job_desc(desc, HDR_SHARED | options | in init_job_desc_shared()
103 append_ptr(desc, ptr); in init_job_desc_shared()
106 static inline void append_data(u32 *desc, void *data, int len) in append_data() argument
108 u32 *offset = desc_end(desc); in append_data()
113 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + in append_data()
117 static inline void append_cmd(u32 *desc, u32 command) in append_cmd() argument
119 u32 *cmd = desc_end(desc); in append_cmd()
123 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + 1); in append_cmd()
128 static inline void append_u64(u32 *desc, u64 data) in append_u64() argument
130 u32 *offset = desc_end(desc); in append_u64()
141 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + 2); in append_u64()
145 static inline u32 *write_cmd(u32 *desc, u32 command) in write_cmd() argument
147 *desc = cpu_to_caam32(command); in write_cmd()
149 return desc + 1; in write_cmd()
152 static inline void append_cmd_ptr(u32 *desc, dma_addr_t ptr, int len, in append_cmd_ptr() argument
155 append_cmd(desc, command | len); in append_cmd_ptr()
156 append_ptr(desc, ptr); in append_cmd_ptr()
160 static inline void append_cmd_ptr_extlen(u32 *desc, dma_addr_t ptr, in append_cmd_ptr_extlen() argument
163 append_cmd(desc, command); in append_cmd_ptr_extlen()
165 append_ptr(desc, ptr); in append_cmd_ptr_extlen()
166 append_cmd(desc, len); in append_cmd_ptr_extlen()
169 static inline void append_cmd_data(u32 *desc, void *data, int len, in append_cmd_data() argument
172 append_cmd(desc, command | IMMEDIATE | len); in append_cmd_data()
173 append_data(desc, data, len); in append_cmd_data()
177 static inline u32 *append_##cmd(u32 *desc, u32 options) \
179 u32 *cmd = desc_end(desc); \
181 append_cmd(desc, CMD_##op | options); \
187 static inline void set_jump_tgt_here(u32 *desc, u32 *jump_cmd) in APPEND_CMD_RET()
190 (desc_len(desc) - (jump_cmd - desc))); in APPEND_CMD_RET()
193 static inline void set_move_tgt_here(u32 *desc, u32 *move_cmd) in set_move_tgt_here() argument
198 val |= (desc_len(desc) << (MOVE_OFFSET_SHIFT + 2)) & MOVE_OFFSET_MASK; in set_move_tgt_here()
203 static inline void append_##cmd(u32 *desc, u32 options) \
206 append_cmd(desc, CMD_##op | options); \
211 static inline void append_##cmd(u32 *desc, unsigned int len, u32 options) \ in APPEND_CMD()
214 append_cmd(desc, CMD_##op | len | options); \ in APPEND_CMD()
223 static inline void append_##cmd(u32 *desc, dma_addr_t ptr, unsigned int len, \
227 append_cmd_ptr(desc, ptr, len, CMD_##op | options); \
234 static inline void append_store(u32 *desc, dma_addr_t ptr, unsigned int len,
241 append_cmd(desc, CMD_STORE | options | len);
248 append_ptr(desc, ptr);
252 static inline void append_seq_##cmd##_ptr_intlen(u32 *desc, dma_addr_t ptr, \
258 append_cmd(desc, CMD_SEQ_##op##_PTR | len | options); \
260 append_cmd_ptr(desc, ptr, len, CMD_SEQ_##op##_PTR | options); \
266 static inline void append_##cmd##_as_imm(u32 *desc, void *data, \
270 append_cmd_data(desc, data, len, CMD_##op | options); \
276 static inline void append_##cmd##_extlen(u32 *desc, dma_addr_t ptr, \
280 append_cmd_ptr_extlen(desc, ptr, len, CMD_##op | SQIN_EXT | options); \
290 static inline void append_##cmd(u32 *desc, dma_addr_t ptr, \
295 append_##cmd##_extlen(desc, ptr, len, options); \
297 append_##cmd##_intlen(desc, ptr, len, options); \
307 static inline void append_##cmd##_as_imm(u32 *desc, void *data, \
312 append_cmd(desc, CMD_##op | IMMEDIATE | len | options); \
313 append_data(desc, data, data_len); \
318 static inline void append_##cmd##_imm_##type(u32 *desc, type immediate, \
322 append_cmd(desc, CMD_##op | IMMEDIATE | options | sizeof(type)); \
323 append_cmd(desc, immediate); \
332 static inline void append_##cmd##_imm_##ee##size(u32 *desc, \
338 append_cmd(desc, CMD_##op | IMMEDIATE | options | sizeof(data)); \
339 append_data(desc, &data, sizeof(data)); \
348 #define APPEND_MATH(op, desc, dest, src_0, src_1, len) \ argument
349 append_cmd(desc, CMD_MATH | MATH_FUN_##op | MATH_DEST_##dest | \
352 #define append_math_add(desc, dest, src0, src1, len) \ argument
353 APPEND_MATH(ADD, desc, dest, src0, src1, len)
354 #define append_math_sub(desc, dest, src0, src1, len) \ argument
355 APPEND_MATH(SUB, desc, dest, src0, src1, len)
356 #define append_math_add_c(desc, dest, src0, src1, len) \ argument
357 APPEND_MATH(ADDC, desc, dest, src0, src1, len)
358 #define append_math_sub_b(desc, dest, src0, src1, len) \ argument
359 APPEND_MATH(SUBB, desc, dest, src0, src1, len)
360 #define append_math_and(desc, dest, src0, src1, len) \ argument
361 APPEND_MATH(AND, desc, dest, src0, src1, len)
362 #define append_math_or(desc, dest, src0, src1, len) \ argument
363 APPEND_MATH(OR, desc, dest, src0, src1, len)
364 #define append_math_xor(desc, dest, src0, src1, len) \ argument
365 APPEND_MATH(XOR, desc, dest, src0, src1, len)
366 #define append_math_lshift(desc, dest, src0, src1, len) \ argument
367 APPEND_MATH(LSHIFT, desc, dest, src0, src1, len)
368 #define append_math_rshift(desc, dest, src0, src1, len) \ argument
369 APPEND_MATH(RSHIFT, desc, dest, src0, src1, len)
370 #define append_math_ldshift(desc, dest, src0, src1, len) \ argument
371 APPEND_MATH(SHLD, desc, dest, src0, src1, len)
374 #define APPEND_MATH_IMM_u32(op, desc, dest, src_0, src_1, data) \ argument
376 APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ); \
377 append_cmd(desc, data); \
380 #define append_math_add_imm_u32(desc, dest, src0, src1, data) \ argument
381 APPEND_MATH_IMM_u32(ADD, desc, dest, src0, src1, data)
382 #define append_math_sub_imm_u32(desc, dest, src0, src1, data) \ argument
383 APPEND_MATH_IMM_u32(SUB, desc, dest, src0, src1, data)
384 #define append_math_add_c_imm_u32(desc, dest, src0, src1, data) \ argument
385 APPEND_MATH_IMM_u32(ADDC, desc, dest, src0, src1, data)
386 #define append_math_sub_b_imm_u32(desc, dest, src0, src1, data) \ argument
387 APPEND_MATH_IMM_u32(SUBB, desc, dest, src0, src1, data)
388 #define append_math_and_imm_u32(desc, dest, src0, src1, data) \ argument
389 APPEND_MATH_IMM_u32(AND, desc, dest, src0, src1, data)
390 #define append_math_or_imm_u32(desc, dest, src0, src1, data) \ argument
391 APPEND_MATH_IMM_u32(OR, desc, dest, src0, src1, data)
392 #define append_math_xor_imm_u32(desc, dest, src0, src1, data) \ argument
393 APPEND_MATH_IMM_u32(XOR, desc, dest, src0, src1, data)
394 #define append_math_lshift_imm_u32(desc, dest, src0, src1, data) \ argument
395 APPEND_MATH_IMM_u32(LSHIFT, desc, dest, src0, src1, data)
396 #define append_math_rshift_imm_u32(desc, dest, src0, src1, data) \ argument
397 APPEND_MATH_IMM_u32(RSHIFT, desc, dest, src0, src1, data)
400 #define APPEND_MATH_IMM_u64(op, desc, dest, src_0, src_1, data) \ argument
403 APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ * 2 | \
406 append_u64(desc, data); \
408 append_u32(desc, lower_32_bits(data)); \
411 #define append_math_add_imm_u64(desc, dest, src0, src1, data) \ argument
412 APPEND_MATH_IMM_u64(ADD, desc, dest, src0, src1, data)
413 #define append_math_sub_imm_u64(desc, dest, src0, src1, data) \ argument
414 APPEND_MATH_IMM_u64(SUB, desc, dest, src0, src1, data)
415 #define append_math_add_c_imm_u64(desc, dest, src0, src1, data) \ argument
416 APPEND_MATH_IMM_u64(ADDC, desc, dest, src0, src1, data)
417 #define append_math_sub_b_imm_u64(desc, dest, src0, src1, data) \ argument
418 APPEND_MATH_IMM_u64(SUBB, desc, dest, src0, src1, data)
419 #define append_math_and_imm_u64(desc, dest, src0, src1, data) \ argument
420 APPEND_MATH_IMM_u64(AND, desc, dest, src0, src1, data)
421 #define append_math_or_imm_u64(desc, dest, src0, src1, data) \ argument
422 APPEND_MATH_IMM_u64(OR, desc, dest, src0, src1, data)
423 #define append_math_xor_imm_u64(desc, dest, src0, src1, data) \ argument
424 APPEND_MATH_IMM_u64(XOR, desc, dest, src0, src1, data)
425 #define append_math_lshift_imm_u64(desc, dest, src0, src1, data) \ argument
426 APPEND_MATH_IMM_u64(LSHIFT, desc, dest, src0, src1, data)
427 #define append_math_rshift_imm_u64(desc, dest, src0, src1, data) \ argument
428 APPEND_MATH_IMM_u64(RSHIFT, desc, dest, src0, src1, data)