#ifndef DESC_CONSTR_H
#define DESC_CONSTR_H
#include "desc.h"
#include "regs.h"
#define IMMEDIATE …
#define CAAM_CMD_SZ …
#define CAAM_PTR_SZ …
#define CAAM_PTR_SZ_MAX …
#define CAAM_PTR_SZ_MIN …
#define CAAM_DESC_BYTES_MAX …
#define __DESC_JOB_IO_LEN(n) …
#define DESC_JOB_IO_LEN …
#define DESC_JOB_IO_LEN_MAX …
#define DESC_JOB_IO_LEN_MIN …
#define MAX_SDLEN …
#ifdef DEBUG
#define PRINT_POS …
#else
#define PRINT_POS
#endif
#define SET_OK_NO_PROP_ERRORS …
#define DISABLE_AUTO_INFO_FIFO …
#define ENABLE_AUTO_INFO_FIFO …
extern bool caam_little_end;
extern size_t caam_ptr_sz;
static inline int pad_sg_nents(int sg_nents)
{ … }
static inline int desc_len(u32 * const desc)
{ … }
static inline int desc_bytes(void * const desc)
{ … }
static inline u32 *desc_end(u32 * const desc)
{ … }
static inline void *sh_desc_pdb(u32 * const desc)
{ … }
static inline void init_desc(u32 * const desc, u32 options)
{ … }
static inline void init_sh_desc(u32 * const desc, u32 options)
{ … }
static inline void init_sh_desc_pdb(u32 * const desc, u32 options,
size_t pdb_bytes)
{ … }
static inline void init_job_desc(u32 * const desc, u32 options)
{ … }
static inline void init_job_desc_pdb(u32 * const desc, u32 options,
size_t pdb_bytes)
{ … }
static inline void append_ptr(u32 * const desc, dma_addr_t ptr)
{ … }
static inline void init_job_desc_shared(u32 * const desc, dma_addr_t ptr,
int len, u32 options)
{ … }
static inline void append_data(u32 * const desc, const void *data, int len)
{ … }
static inline void append_cmd(u32 * const desc, u32 command)
{ … }
#define append_u32 …
static inline void append_u64(u32 * const desc, u64 data)
{ … }
static inline u32 *write_cmd(u32 * const desc, u32 command)
{ … }
static inline void append_cmd_ptr(u32 * const desc, dma_addr_t ptr, int len,
u32 command)
{ … }
static inline void append_cmd_ptr_extlen(u32 * const desc, dma_addr_t ptr,
unsigned int len, u32 command)
{ … }
static inline void append_cmd_data(u32 * const desc, const void *data, int len,
u32 command)
{ … }
#define APPEND_CMD_RET(cmd, op) …
APPEND_CMD_RET(…)
APPEND_CMD_RET(…)
APPEND_CMD_RET(…)
static inline void set_jump_tgt_here(u32 * const desc, u32 *jump_cmd)
{ … }
static inline void set_move_tgt_here(u32 * const desc, u32 *move_cmd)
{ … }
#define APPEND_CMD(cmd, op) …
APPEND_CMD(…)
#define APPEND_CMD_LEN(cmd, op) …
APPEND_CMD_LEN(…)
APPEND_CMD_LEN(…)
APPEND_CMD_LEN(…)
APPEND_CMD_LEN(…)
#define APPEND_CMD_PTR(cmd, op) …
APPEND_CMD_PTR(…)
APPEND_CMD_PTR(…)
APPEND_CMD_PTR(…)
APPEND_CMD_PTR(…)
static inline void append_store(u32 * const desc, dma_addr_t ptr,
unsigned int len, u32 options)
{ … }
#define APPEND_SEQ_PTR_INTLEN(cmd, op) …
APPEND_SEQ_PTR_INTLEN(…)
APPEND_SEQ_PTR_INTLEN(…)
#define APPEND_CMD_PTR_TO_IMM(cmd, op) …
APPEND_CMD_PTR_TO_IMM(load, LOAD);
APPEND_CMD_PTR_TO_IMM(fifo_load, FIFO_LOAD);
#define APPEND_CMD_PTR_EXTLEN(cmd, op) …
APPEND_CMD_PTR_EXTLEN(…)
APPEND_CMD_PTR_EXTLEN(…)
#define APPEND_CMD_PTR_LEN(cmd, op, type) …
APPEND_CMD_PTR_LEN(…)
APPEND_CMD_PTR_LEN(…)
#define APPEND_CMD_PTR_TO_IMM2(cmd, op) …
APPEND_CMD_PTR_TO_IMM2(key, KEY);
#define APPEND_CMD_RAW_IMM(cmd, op, type) …
APPEND_CMD_RAW_IMM(load, LOAD, u32);
#define APPEND_CMD_RAW_IMM2(cmd, op, ee, size) …
APPEND_CMD_RAW_IMM2(load, LOAD, be, 32);
#define APPEND_MATH(op, desc, dest, src_0, src_1, len) …
#define append_math_add(desc, dest, src0, src1, len) …
#define append_math_sub(desc, dest, src0, src1, len) …
#define append_math_add_c(desc, dest, src0, src1, len) …
#define append_math_sub_b(desc, dest, src0, src1, len) …
#define append_math_and(desc, dest, src0, src1, len) …
#define append_math_or(desc, dest, src0, src1, len) …
#define append_math_xor(desc, dest, src0, src1, len) …
#define append_math_lshift(desc, dest, src0, src1, len) …
#define append_math_rshift(desc, dest, src0, src1, len) …
#define append_math_ldshift(desc, dest, src0, src1, len) …
#define APPEND_MATH_IMM_u32(op, desc, dest, src_0, src_1, data) …
#define append_math_add_imm_u32(desc, dest, src0, src1, data) …
#define append_math_sub_imm_u32(desc, dest, src0, src1, data) …
#define append_math_add_c_imm_u32(desc, dest, src0, src1, data) …
#define append_math_sub_b_imm_u32(desc, dest, src0, src1, data) …
#define append_math_and_imm_u32(desc, dest, src0, src1, data) …
#define append_math_or_imm_u32(desc, dest, src0, src1, data) …
#define append_math_xor_imm_u32(desc, dest, src0, src1, data) …
#define append_math_lshift_imm_u32(desc, dest, src0, src1, data) …
#define append_math_rshift_imm_u32(desc, dest, src0, src1, data) …
#define APPEND_MATH_IMM_u64(op, desc, dest, src_0, src_1, data) …
#define append_math_add_imm_u64(desc, dest, src0, src1, data) …
#define append_math_sub_imm_u64(desc, dest, src0, src1, data) …
#define append_math_add_c_imm_u64(desc, dest, src0, src1, data) …
#define append_math_sub_b_imm_u64(desc, dest, src0, src1, data) …
#define append_math_and_imm_u64(desc, dest, src0, src1, data) …
#define append_math_or_imm_u64(desc, dest, src0, src1, data) …
#define append_math_xor_imm_u64(desc, dest, src0, src1, data) …
#define append_math_lshift_imm_u64(desc, dest, src0, src1, data) …
#define append_math_rshift_imm_u64(desc, dest, src0, src1, data) …
struct alginfo { … };
static inline int desc_inline_query(unsigned int sd_base_len,
unsigned int jd_len, unsigned int *data_len,
u32 *inl_mask, unsigned int count)
{ … }
static inline void append_proto_dkp(u32 * const desc, struct alginfo *adata)
{ … }
#endif