diff options
author | Andrei Varvara <andrei.varvara@freescale.com> | 2013-05-28 03:37:05 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-05-28 03:37:05 -0400 |
commit | e2d4ea9444024e38217e4b7e380c6b9f39f9a5f2 (patch) | |
tree | 8a9f6eefa6e23b361b1806bc732c285c2bbbf379 | |
parent | 74d24d838be0ee64c1085558238e5c51e1659817 (diff) |
crypto: caam - fix SEQ IN PTR command when RTO or PRE bit is set
SEQ IN PTR command does not require pointer if RTO or PRE bit is set
Updated desc_constr.h accordingly.
Signed-off-by: Andrei Varvara <andrei.varvara@freescale.com>
Reviewed-by: Phillips Kim-R1AAHA <Kim.Phillips@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/caam/desc.h | 4 | ||||
-rw-r--r-- | drivers/crypto/caam/desc_constr.h | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index f7f833be8c67..89fa3d045612 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h | |||
@@ -1294,10 +1294,10 @@ struct sec4_sg_entry { | |||
1294 | #define SQOUT_SGF 0x01000000 | 1294 | #define SQOUT_SGF 0x01000000 |
1295 | 1295 | ||
1296 | /* Appends to a previous pointer */ | 1296 | /* Appends to a previous pointer */ |
1297 | #define SQOUT_PRE 0x00800000 | 1297 | #define SQOUT_PRE SQIN_PRE |
1298 | 1298 | ||
1299 | /* Restore sequence with pointer/length */ | 1299 | /* Restore sequence with pointer/length */ |
1300 | #define SQOUT_RTO 0x00200000 | 1300 | #define SQOUT_RTO SQIN_RTO |
1301 | 1301 | ||
1302 | /* Use extended length following pointer */ | 1302 | /* Use extended length following pointer */ |
1303 | #define SQOUT_EXT 0x00400000 | 1303 | #define SQOUT_EXT 0x00400000 |
diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index c85c1f058401..19501b548db4 100644 --- a/drivers/crypto/caam/desc_constr.h +++ b/drivers/crypto/caam/desc_constr.h | |||
@@ -122,7 +122,8 @@ static inline void append_cmd_ptr_extlen(u32 *desc, dma_addr_t ptr, | |||
122 | unsigned int len, u32 command) | 122 | unsigned int len, u32 command) |
123 | { | 123 | { |
124 | append_cmd(desc, command); | 124 | append_cmd(desc, command); |
125 | append_ptr(desc, ptr); | 125 | if (!(command & (SQIN_RTO | SQIN_PRE))) |
126 | append_ptr(desc, ptr); | ||
126 | append_cmd(desc, len); | 127 | append_cmd(desc, len); |
127 | } | 128 | } |
128 | 129 | ||
@@ -186,7 +187,10 @@ static inline void append_seq_##cmd##_ptr_intlen(u32 *desc, dma_addr_t ptr, \ | |||
186 | u32 options) \ | 187 | u32 options) \ |
187 | { \ | 188 | { \ |
188 | PRINT_POS; \ | 189 | PRINT_POS; \ |
189 | append_cmd_ptr(desc, ptr, len, CMD_SEQ_##op##_PTR | options); \ | 190 | if (options & (SQIN_RTO | SQIN_PRE)) \ |
191 | append_cmd(desc, CMD_SEQ_##op##_PTR | len | options); \ | ||
192 | else \ | ||
193 | append_cmd_ptr(desc, ptr, len, CMD_SEQ_##op##_PTR | options); \ | ||
190 | } | 194 | } |
191 | APPEND_SEQ_PTR_INTLEN(in, IN) | 195 | APPEND_SEQ_PTR_INTLEN(in, IN) |
192 | APPEND_SEQ_PTR_INTLEN(out, OUT) | 196 | APPEND_SEQ_PTR_INTLEN(out, OUT) |