Commit 281669df authored by Horia Geantă's avatar Horia Geantă Committed by Herbert Xu

crypto: caam - rewrite some generic inline append cmds

A few descriptor commands are generated using generic
inline append "append_cmd" function.
Rewrite them using specific inline append functions.
Signed-off-by: default avatarHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 4cbe79cc
...@@ -1853,9 +1853,9 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, ...@@ -1853,9 +1853,9 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
ctx->cdata.keylen, CLASS_1 | KEY_DEST_CLASS_REG); ctx->cdata.keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load sector size with index 40 bytes (0x28) */ /* Load sector size with index 40 bytes (0x28) */
append_cmd(desc, CMD_LOAD | IMMEDIATE | LDST_SRCDST_BYTE_CONTEXT | append_load_as_imm(desc, (void *)&sector_size, 8, LDST_CLASS_1_CCB |
LDST_CLASS_1_CCB | (0x28 << LDST_OFFSET_SHIFT) | 8); LDST_SRCDST_BYTE_CONTEXT |
append_data(desc, (void *)&sector_size, 8); (0x28 << LDST_OFFSET_SHIFT));
set_jump_tgt_here(desc, key_jump_cmd); set_jump_tgt_here(desc, key_jump_cmd);
...@@ -1864,8 +1864,8 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, ...@@ -1864,8 +1864,8 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
* Upper 8B of IV - will be used as sector index * Upper 8B of IV - will be used as sector index
* Lower 8B of IV - will be discarded * Lower 8B of IV - will be discarded
*/ */
append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | append_seq_load(desc, 8, LDST_SRCDST_BYTE_CONTEXT | LDST_CLASS_1_CCB |
LDST_CLASS_1_CCB | (0x20 << LDST_OFFSET_SHIFT) | 8); (0x20 << LDST_OFFSET_SHIFT));
append_seq_fifo_load(desc, 8, FIFOLD_CLASS_SKIP); append_seq_fifo_load(desc, 8, FIFOLD_CLASS_SKIP);
/* Load operation */ /* Load operation */
...@@ -1900,9 +1900,9 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, ...@@ -1900,9 +1900,9 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
ctx->cdata.keylen, CLASS_1 | KEY_DEST_CLASS_REG); ctx->cdata.keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load sector size with index 40 bytes (0x28) */ /* Load sector size with index 40 bytes (0x28) */
append_cmd(desc, CMD_LOAD | IMMEDIATE | LDST_SRCDST_BYTE_CONTEXT | append_load_as_imm(desc, (void *)&sector_size, 8, LDST_CLASS_1_CCB |
LDST_CLASS_1_CCB | (0x28 << LDST_OFFSET_SHIFT) | 8); LDST_SRCDST_BYTE_CONTEXT |
append_data(desc, (void *)&sector_size, 8); (0x28 << LDST_OFFSET_SHIFT));
set_jump_tgt_here(desc, key_jump_cmd); set_jump_tgt_here(desc, key_jump_cmd);
...@@ -1911,8 +1911,8 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, ...@@ -1911,8 +1911,8 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher,
* Upper 8B of IV - will be used as sector index * Upper 8B of IV - will be used as sector index
* Lower 8B of IV - will be discarded * Lower 8B of IV - will be discarded
*/ */
append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | append_seq_load(desc, 8, LDST_SRCDST_BYTE_CONTEXT | LDST_CLASS_1_CCB |
LDST_CLASS_1_CCB | (0x20 << LDST_OFFSET_SHIFT) | 8); (0x20 << LDST_OFFSET_SHIFT));
append_seq_fifo_load(desc, 8, FIFOLD_CLASS_SKIP); append_seq_fifo_load(desc, 8, FIFOLD_CLASS_SKIP);
/* Load operation */ /* Load operation */
......
...@@ -272,8 +272,8 @@ static inline void ahash_ctx_data_to_out(u32 *desc, u32 op, u32 state, ...@@ -272,8 +272,8 @@ static inline void ahash_ctx_data_to_out(u32 *desc, u32 op, u32 state,
init_sh_desc_key_ahash(desc, ctx); init_sh_desc_key_ahash(desc, ctx);
/* Import context from software */ /* Import context from software */
append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | append_seq_load(desc, ctx->ctx_len, LDST_CLASS_2_CCB |
LDST_CLASS_2_CCB | ctx->ctx_len); LDST_SRCDST_BYTE_CONTEXT);
/* Class 2 operation */ /* Class 2 operation */
append_operation(desc, op | state | OP_ALG_ENCRYPT); append_operation(desc, op | state | OP_ALG_ENCRYPT);
...@@ -316,8 +316,8 @@ static int ahash_set_sh_desc(struct crypto_ahash *ahash) ...@@ -316,8 +316,8 @@ static int ahash_set_sh_desc(struct crypto_ahash *ahash)
init_sh_desc(desc, HDR_SHARE_SERIAL); init_sh_desc(desc, HDR_SHARE_SERIAL);
/* Import context from software */ /* Import context from software */
append_cmd(desc, CMD_SEQ_LOAD | LDST_SRCDST_BYTE_CONTEXT | append_seq_load(desc, ctx->ctx_len, LDST_CLASS_2_CCB |
LDST_CLASS_2_CCB | ctx->ctx_len); LDST_SRCDST_BYTE_CONTEXT);
/* Class 2 operation */ /* Class 2 operation */
append_operation(desc, ctx->adata.algtype | OP_ALG_AS_UPDATE | append_operation(desc, ctx->adata.algtype | OP_ALG_AS_UPDATE |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment