Lines Matching refs:desc

54 #define PRINT_POS do { printk(KERN_DEBUG "%02d: %s\n", desc_len(desc),\
84 static inline int desc_len(u32 * const desc) in desc_len() argument
86 return caam32_to_cpu(*desc) & HDR_DESCLEN_MASK; in desc_len()
89 static inline int desc_bytes(void * const desc) in desc_bytes() argument
91 return desc_len(desc) * CAAM_CMD_SZ; in desc_bytes()
94 static inline u32 *desc_end(u32 * const desc) in desc_end() argument
96 return desc + desc_len(desc); in desc_end()
99 static inline void *sh_desc_pdb(u32 * const desc) in sh_desc_pdb() argument
101 return desc + 1; in sh_desc_pdb()
104 static inline void init_desc(u32 * const desc, u32 options) in init_desc() argument
106 *desc = cpu_to_caam32((options | HDR_ONE) + 1); in init_desc()
109 static inline void init_sh_desc(u32 * const desc, u32 options) in init_sh_desc() argument
112 init_desc(desc, CMD_SHARED_DESC_HDR | options); in init_sh_desc()
115 static inline void init_sh_desc_pdb(u32 * const desc, u32 options, in init_sh_desc_pdb() argument
120 init_sh_desc(desc, (((pdb_len + 1) << HDR_START_IDX_SHIFT) + pdb_len) | in init_sh_desc_pdb()
124 static inline void init_job_desc(u32 * const desc, u32 options) in init_job_desc() argument
126 init_desc(desc, CMD_DESC_HDR | options); in init_job_desc()
129 static inline void init_job_desc_pdb(u32 * const desc, u32 options, in init_job_desc_pdb() argument
134 init_job_desc(desc, (((pdb_len + 1) << HDR_START_IDX_SHIFT)) | options); in init_job_desc_pdb()
137 static inline void append_ptr(u32 * const desc, dma_addr_t ptr) in append_ptr() argument
140 dma_addr_t *offset = (dma_addr_t *)desc_end(desc); in append_ptr()
144 u32 *offset = (u32 *)desc_end(desc); in append_ptr()
149 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + in append_ptr()
153 static inline void init_job_desc_shared(u32 * const desc, dma_addr_t ptr, in init_job_desc_shared() argument
157 init_job_desc(desc, HDR_SHARED | options | in init_job_desc_shared()
159 append_ptr(desc, ptr); in init_job_desc_shared()
162 static inline void append_data(u32 * const desc, const void *data, int len) in append_data() argument
164 u32 *offset = desc_end(desc); in append_data()
169 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + in append_data()
173 static inline void append_cmd(u32 * const desc, u32 command) in append_cmd() argument
175 u32 *cmd = desc_end(desc); in append_cmd()
179 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + 1); in append_cmd()
184 static inline void append_u64(u32 * const desc, u64 data) in append_u64() argument
186 u32 *offset = desc_end(desc); in append_u64()
197 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + 2); in append_u64()
201 static inline u32 *write_cmd(u32 * const desc, u32 command) in write_cmd() argument
203 *desc = cpu_to_caam32(command); in write_cmd()
205 return desc + 1; in write_cmd()
208 static inline void append_cmd_ptr(u32 * const desc, dma_addr_t ptr, int len, in append_cmd_ptr() argument
211 append_cmd(desc, command | len); in append_cmd_ptr()
212 append_ptr(desc, ptr); in append_cmd_ptr()
216 static inline void append_cmd_ptr_extlen(u32 * const desc, dma_addr_t ptr, in append_cmd_ptr_extlen() argument
219 append_cmd(desc, command); in append_cmd_ptr_extlen()
221 append_ptr(desc, ptr); in append_cmd_ptr_extlen()
222 append_cmd(desc, len); in append_cmd_ptr_extlen()
225 static inline void append_cmd_data(u32 * const desc, const void *data, int len, in append_cmd_data() argument
228 append_cmd(desc, command | IMMEDIATE | len); in append_cmd_data()
229 append_data(desc, data, len); in append_cmd_data()
233 static inline u32 *append_##cmd(u32 * const desc, u32 options) \
235 u32 *cmd = desc_end(desc); \
237 append_cmd(desc, CMD_##op | options); \
244 static inline void set_jump_tgt_here(u32 * const desc, u32 *jump_cmd) in APPEND_CMD_RET()
247 (desc_len(desc) - (jump_cmd - desc))); in APPEND_CMD_RET()
250 static inline void set_move_tgt_here(u32 * const desc, u32 *move_cmd) in set_move_tgt_here() argument
255 val |= (desc_len(desc) << (MOVE_OFFSET_SHIFT + 2)) & MOVE_OFFSET_MASK; in set_move_tgt_here()
260 static inline void append_##cmd(u32 * const desc, u32 options) \
263 append_cmd(desc, CMD_##op | options); \
268 static inline void append_##cmd(u32 * const desc, unsigned int len, \ in APPEND_CMD()
272 append_cmd(desc, CMD_##op | len | options); \ in APPEND_CMD()
281 static inline void append_##cmd(u32 * const desc, dma_addr_t ptr, \
285 append_cmd_ptr(desc, ptr, len, CMD_##op | options); \
292 static inline void append_store(u32 * const desc, dma_addr_t ptr,
299 append_cmd(desc, CMD_STORE | options | len);
306 append_ptr(desc, ptr);
310 static inline void append_seq_##cmd##_ptr_intlen(u32 * const desc, \
317 append_cmd(desc, CMD_SEQ_##op##_PTR | len | options); \
319 append_cmd_ptr(desc, ptr, len, CMD_SEQ_##op##_PTR | options); \
325 static inline void append_##cmd##_as_imm(u32 * const desc, const void *data, \
329 append_cmd_data(desc, data, len, CMD_##op | options); \
335 static inline void append_##cmd##_extlen(u32 * const desc, dma_addr_t ptr, \
339 append_cmd_ptr_extlen(desc, ptr, len, CMD_##op | SQIN_EXT | options); \
349 static inline void append_##cmd(u32 * const desc, dma_addr_t ptr, \
354 append_##cmd##_extlen(desc, ptr, len, options); \
356 append_##cmd##_intlen(desc, ptr, len, options); \
366 static inline void append_##cmd##_as_imm(u32 * const desc, const void *data, \
371 append_cmd(desc, CMD_##op | IMMEDIATE | len | options); \
372 append_data(desc, data, data_len); \
377 static inline void append_##cmd##_imm_##type(u32 * const desc, type immediate, \
382 append_cmd(desc, CMD_##op | IMMEDIATE | options); \
384 append_cmd(desc, CMD_##op | IMMEDIATE | options | \
386 append_cmd(desc, immediate); \
395 static inline void append_##cmd##_imm_##ee##size(u32 *desc, \
401 append_cmd(desc, CMD_##op | IMMEDIATE | options | sizeof(data)); \
402 append_data(desc, &data, sizeof(data)); \
411 #define APPEND_MATH(op, desc, dest, src_0, src_1, len) \ argument
412 append_cmd(desc, CMD_MATH | MATH_FUN_##op | MATH_DEST_##dest | \
415 #define append_math_add(desc, dest, src0, src1, len) \ argument
416 APPEND_MATH(ADD, desc, dest, src0, src1, len)
417 #define append_math_sub(desc, dest, src0, src1, len) \ argument
418 APPEND_MATH(SUB, desc, dest, src0, src1, len)
419 #define append_math_add_c(desc, dest, src0, src1, len) \ argument
420 APPEND_MATH(ADDC, desc, dest, src0, src1, len)
421 #define append_math_sub_b(desc, dest, src0, src1, len) \ argument
422 APPEND_MATH(SUBB, desc, dest, src0, src1, len)
423 #define append_math_and(desc, dest, src0, src1, len) \ argument
424 APPEND_MATH(AND, desc, dest, src0, src1, len)
425 #define append_math_or(desc, dest, src0, src1, len) \ argument
426 APPEND_MATH(OR, desc, dest, src0, src1, len)
427 #define append_math_xor(desc, dest, src0, src1, len) \ argument
428 APPEND_MATH(XOR, desc, dest, src0, src1, len)
429 #define append_math_lshift(desc, dest, src0, src1, len) \ argument
430 APPEND_MATH(LSHIFT, desc, dest, src0, src1, len)
431 #define append_math_rshift(desc, dest, src0, src1, len) \ argument
432 APPEND_MATH(RSHIFT, desc, dest, src0, src1, len)
433 #define append_math_ldshift(desc, dest, src0, src1, len) \ argument
434 APPEND_MATH(SHLD, desc, dest, src0, src1, len)
437 #define APPEND_MATH_IMM_u32(op, desc, dest, src_0, src_1, data) \ argument
439 APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ); \
440 append_cmd(desc, data); \
443 #define append_math_add_imm_u32(desc, dest, src0, src1, data) \ argument
444 APPEND_MATH_IMM_u32(ADD, desc, dest, src0, src1, data)
445 #define append_math_sub_imm_u32(desc, dest, src0, src1, data) \ argument
446 APPEND_MATH_IMM_u32(SUB, desc, dest, src0, src1, data)
447 #define append_math_add_c_imm_u32(desc, dest, src0, src1, data) \ argument
448 APPEND_MATH_IMM_u32(ADDC, desc, dest, src0, src1, data)
449 #define append_math_sub_b_imm_u32(desc, dest, src0, src1, data) \ argument
450 APPEND_MATH_IMM_u32(SUBB, desc, dest, src0, src1, data)
451 #define append_math_and_imm_u32(desc, dest, src0, src1, data) \ argument
452 APPEND_MATH_IMM_u32(AND, desc, dest, src0, src1, data)
453 #define append_math_or_imm_u32(desc, dest, src0, src1, data) \ argument
454 APPEND_MATH_IMM_u32(OR, desc, dest, src0, src1, data)
455 #define append_math_xor_imm_u32(desc, dest, src0, src1, data) \ argument
456 APPEND_MATH_IMM_u32(XOR, desc, dest, src0, src1, data)
457 #define append_math_lshift_imm_u32(desc, dest, src0, src1, data) \ argument
458 APPEND_MATH_IMM_u32(LSHIFT, desc, dest, src0, src1, data)
459 #define append_math_rshift_imm_u32(desc, dest, src0, src1, data) \ argument
460 APPEND_MATH_IMM_u32(RSHIFT, desc, dest, src0, src1, data)
463 #define APPEND_MATH_IMM_u64(op, desc, dest, src_0, src_1, data) \ argument
466 APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ * 2 | \
469 append_u64(desc, data); \
471 append_u32(desc, lower_32_bits(data)); \
474 #define append_math_add_imm_u64(desc, dest, src0, src1, data) \ argument
475 APPEND_MATH_IMM_u64(ADD, desc, dest, src0, src1, data)
476 #define append_math_sub_imm_u64(desc, dest, src0, src1, data) \ argument
477 APPEND_MATH_IMM_u64(SUB, desc, dest, src0, src1, data)
478 #define append_math_add_c_imm_u64(desc, dest, src0, src1, data) \ argument
479 APPEND_MATH_IMM_u64(ADDC, desc, dest, src0, src1, data)
480 #define append_math_sub_b_imm_u64(desc, dest, src0, src1, data) \ argument
481 APPEND_MATH_IMM_u64(SUBB, desc, dest, src0, src1, data)
482 #define append_math_and_imm_u64(desc, dest, src0, src1, data) \ argument
483 APPEND_MATH_IMM_u64(AND, desc, dest, src0, src1, data)
484 #define append_math_or_imm_u64(desc, dest, src0, src1, data) \ argument
485 APPEND_MATH_IMM_u64(OR, desc, dest, src0, src1, data)
486 #define append_math_xor_imm_u64(desc, dest, src0, src1, data) \ argument
487 APPEND_MATH_IMM_u64(XOR, desc, dest, src0, src1, data)
488 #define append_math_lshift_imm_u64(desc, dest, src0, src1, data) \ argument
489 APPEND_MATH_IMM_u64(LSHIFT, desc, dest, src0, src1, data)
490 #define append_math_rshift_imm_u64(desc, dest, src0, src1, data) \ argument
491 APPEND_MATH_IMM_u64(RSHIFT, desc, dest, src0, src1, data)
561 static inline void append_proto_dkp(u32 * const desc, struct alginfo *adata) in append_proto_dkp() argument
576 append_operation(desc, OP_TYPE_UNI_PROTOCOL | protid | in append_proto_dkp()
579 append_ptr(desc, adata->key_dma); in append_proto_dkp()
584 append_operation(desc, OP_TYPE_UNI_PROTOCOL | protid | in append_proto_dkp()
587 append_data(desc, adata->key_virt, adata->keylen); in append_proto_dkp()
596 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + words); in append_proto_dkp()
598 append_operation(desc, OP_TYPE_UNI_PROTOCOL | protid | in append_proto_dkp()
601 append_ptr(desc, adata->key_dma); in append_proto_dkp()