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()
170 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + in append_data()
174 static inline void append_cmd(u32 * const desc, u32 command) in append_cmd() argument
176 u32 *cmd = desc_end(desc); in append_cmd()
180 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + 1); in append_cmd()
185 static inline void append_u64(u32 * const desc, u64 data) in append_u64() argument
187 u32 *offset = desc_end(desc); in append_u64()
198 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + 2); in append_u64()
202 static inline u32 *write_cmd(u32 * const desc, u32 command) in write_cmd() argument
204 *desc = cpu_to_caam32(command); in write_cmd()
206 return desc + 1; in write_cmd()
209 static inline void append_cmd_ptr(u32 * const desc, dma_addr_t ptr, int len, in append_cmd_ptr() argument
212 append_cmd(desc, command | len); in append_cmd_ptr()
213 append_ptr(desc, ptr); in append_cmd_ptr()
217 static inline void append_cmd_ptr_extlen(u32 * const desc, dma_addr_t ptr, in append_cmd_ptr_extlen() argument
220 append_cmd(desc, command); in append_cmd_ptr_extlen()
222 append_ptr(desc, ptr); in append_cmd_ptr_extlen()
223 append_cmd(desc, len); in append_cmd_ptr_extlen()
226 static inline void append_cmd_data(u32 * const desc, const void *data, int len, in append_cmd_data() argument
229 append_cmd(desc, command | IMMEDIATE | len); in append_cmd_data()
230 append_data(desc, data, len); in append_cmd_data()
234 static inline u32 *append_##cmd(u32 * const desc, u32 options) \
236 u32 *cmd = desc_end(desc); \
238 append_cmd(desc, CMD_##op | options); \
245 static inline void set_jump_tgt_here(u32 * const desc, u32 *jump_cmd) in APPEND_CMD_RET()
248 (desc_len(desc) - (jump_cmd - desc))); in APPEND_CMD_RET()
251 static inline void set_move_tgt_here(u32 * const desc, u32 *move_cmd) in set_move_tgt_here() argument
256 val |= (desc_len(desc) << (MOVE_OFFSET_SHIFT + 2)) & MOVE_OFFSET_MASK; in set_move_tgt_here()
261 static inline void append_##cmd(u32 * const desc, u32 options) \
264 append_cmd(desc, CMD_##op | options); \
269 static inline void append_##cmd(u32 * const desc, unsigned int len, \ in APPEND_CMD()
273 append_cmd(desc, CMD_##op | len | options); \ in APPEND_CMD()
282 static inline void append_##cmd(u32 * const desc, dma_addr_t ptr, \
286 append_cmd_ptr(desc, ptr, len, CMD_##op | options); \
293 static inline void append_store(u32 * const desc, dma_addr_t ptr,
300 append_cmd(desc, CMD_STORE | options | len);
307 append_ptr(desc, ptr);
311 static inline void append_seq_##cmd##_ptr_intlen(u32 * const desc, \
318 append_cmd(desc, CMD_SEQ_##op##_PTR | len | options); \
320 append_cmd_ptr(desc, ptr, len, CMD_SEQ_##op##_PTR | options); \
326 static inline void append_##cmd##_as_imm(u32 * const desc, const void *data, \
330 append_cmd_data(desc, data, len, CMD_##op | options); \
336 static inline void append_##cmd##_extlen(u32 * const desc, dma_addr_t ptr, \
340 append_cmd_ptr_extlen(desc, ptr, len, CMD_##op | SQIN_EXT | options); \
350 static inline void append_##cmd(u32 * const desc, dma_addr_t ptr, \
355 append_##cmd##_extlen(desc, ptr, len, options); \
357 append_##cmd##_intlen(desc, ptr, len, options); \
367 static inline void append_##cmd##_as_imm(u32 * const desc, const void *data, \
372 append_cmd(desc, CMD_##op | IMMEDIATE | len | options); \
373 append_data(desc, data, data_len); \
378 static inline void append_##cmd##_imm_##type(u32 * const desc, type immediate, \
383 append_cmd(desc, CMD_##op | IMMEDIATE | options); \
385 append_cmd(desc, CMD_##op | IMMEDIATE | options | \
387 append_cmd(desc, immediate); \
396 static inline void append_##cmd##_imm_##ee##size(u32 *desc, \
402 append_cmd(desc, CMD_##op | IMMEDIATE | options | sizeof(data)); \
403 append_data(desc, &data, sizeof(data)); \
412 #define APPEND_MATH(op, desc, dest, src_0, src_1, len) \ argument
413 append_cmd(desc, CMD_MATH | MATH_FUN_##op | MATH_DEST_##dest | \
416 #define append_math_add(desc, dest, src0, src1, len) \ argument
417 APPEND_MATH(ADD, desc, dest, src0, src1, len)
418 #define append_math_sub(desc, dest, src0, src1, len) \ argument
419 APPEND_MATH(SUB, desc, dest, src0, src1, len)
420 #define append_math_add_c(desc, dest, src0, src1, len) \ argument
421 APPEND_MATH(ADDC, desc, dest, src0, src1, len)
422 #define append_math_sub_b(desc, dest, src0, src1, len) \ argument
423 APPEND_MATH(SUBB, desc, dest, src0, src1, len)
424 #define append_math_and(desc, dest, src0, src1, len) \ argument
425 APPEND_MATH(AND, desc, dest, src0, src1, len)
426 #define append_math_or(desc, dest, src0, src1, len) \ argument
427 APPEND_MATH(OR, desc, dest, src0, src1, len)
428 #define append_math_xor(desc, dest, src0, src1, len) \ argument
429 APPEND_MATH(XOR, desc, dest, src0, src1, len)
430 #define append_math_lshift(desc, dest, src0, src1, len) \ argument
431 APPEND_MATH(LSHIFT, desc, dest, src0, src1, len)
432 #define append_math_rshift(desc, dest, src0, src1, len) \ argument
433 APPEND_MATH(RSHIFT, desc, dest, src0, src1, len)
434 #define append_math_ldshift(desc, dest, src0, src1, len) \ argument
435 APPEND_MATH(SHLD, desc, dest, src0, src1, len)
438 #define APPEND_MATH_IMM_u32(op, desc, dest, src_0, src_1, data) \ argument
440 APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ); \
441 append_cmd(desc, data); \
444 #define append_math_add_imm_u32(desc, dest, src0, src1, data) \ argument
445 APPEND_MATH_IMM_u32(ADD, desc, dest, src0, src1, data)
446 #define append_math_sub_imm_u32(desc, dest, src0, src1, data) \ argument
447 APPEND_MATH_IMM_u32(SUB, desc, dest, src0, src1, data)
448 #define append_math_add_c_imm_u32(desc, dest, src0, src1, data) \ argument
449 APPEND_MATH_IMM_u32(ADDC, desc, dest, src0, src1, data)
450 #define append_math_sub_b_imm_u32(desc, dest, src0, src1, data) \ argument
451 APPEND_MATH_IMM_u32(SUBB, desc, dest, src0, src1, data)
452 #define append_math_and_imm_u32(desc, dest, src0, src1, data) \ argument
453 APPEND_MATH_IMM_u32(AND, desc, dest, src0, src1, data)
454 #define append_math_or_imm_u32(desc, dest, src0, src1, data) \ argument
455 APPEND_MATH_IMM_u32(OR, desc, dest, src0, src1, data)
456 #define append_math_xor_imm_u32(desc, dest, src0, src1, data) \ argument
457 APPEND_MATH_IMM_u32(XOR, desc, dest, src0, src1, data)
458 #define append_math_lshift_imm_u32(desc, dest, src0, src1, data) \ argument
459 APPEND_MATH_IMM_u32(LSHIFT, desc, dest, src0, src1, data)
460 #define append_math_rshift_imm_u32(desc, dest, src0, src1, data) \ argument
461 APPEND_MATH_IMM_u32(RSHIFT, desc, dest, src0, src1, data)
464 #define APPEND_MATH_IMM_u64(op, desc, dest, src_0, src_1, data) \ argument
467 APPEND_MATH(op, desc, dest, src_0, src_1, CAAM_CMD_SZ * 2 | \
470 append_u64(desc, data); \
472 append_u32(desc, lower_32_bits(data)); \
475 #define append_math_add_imm_u64(desc, dest, src0, src1, data) \ argument
476 APPEND_MATH_IMM_u64(ADD, desc, dest, src0, src1, data)
477 #define append_math_sub_imm_u64(desc, dest, src0, src1, data) \ argument
478 APPEND_MATH_IMM_u64(SUB, desc, dest, src0, src1, data)
479 #define append_math_add_c_imm_u64(desc, dest, src0, src1, data) \ argument
480 APPEND_MATH_IMM_u64(ADDC, desc, dest, src0, src1, data)
481 #define append_math_sub_b_imm_u64(desc, dest, src0, src1, data) \ argument
482 APPEND_MATH_IMM_u64(SUBB, desc, dest, src0, src1, data)
483 #define append_math_and_imm_u64(desc, dest, src0, src1, data) \ argument
484 APPEND_MATH_IMM_u64(AND, desc, dest, src0, src1, data)
485 #define append_math_or_imm_u64(desc, dest, src0, src1, data) \ argument
486 APPEND_MATH_IMM_u64(OR, desc, dest, src0, src1, data)
487 #define append_math_xor_imm_u64(desc, dest, src0, src1, data) \ argument
488 APPEND_MATH_IMM_u64(XOR, desc, dest, src0, src1, data)
489 #define append_math_lshift_imm_u64(desc, dest, src0, src1, data) \ argument
490 APPEND_MATH_IMM_u64(LSHIFT, desc, dest, src0, src1, data)
491 #define append_math_rshift_imm_u64(desc, dest, src0, src1, data) \ argument
492 APPEND_MATH_IMM_u64(RSHIFT, desc, dest, src0, src1, data)
562 static inline void append_proto_dkp(u32 * const desc, struct alginfo *adata) in append_proto_dkp() argument
577 append_operation(desc, OP_TYPE_UNI_PROTOCOL | protid | in append_proto_dkp()
580 append_ptr(desc, adata->key_dma); in append_proto_dkp()
585 append_operation(desc, OP_TYPE_UNI_PROTOCOL | protid | in append_proto_dkp()
588 append_data(desc, adata->key_virt, adata->keylen); in append_proto_dkp()
597 (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) + words); in append_proto_dkp()
599 append_operation(desc, OP_TYPE_UNI_PROTOCOL | protid | in append_proto_dkp()
602 append_ptr(desc, adata->key_dma); in append_proto_dkp()