diff options
author | Victoria Milhoan <vicki.milhoan@freescale.com> | 2015-08-05 14:28:38 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-08-10 11:18:57 -0400 |
commit | 1f06ec1d48f31a454e4292f3761a4f4178bb916c (patch) | |
tree | 8dc69a307127575d7f8383cba081aeb06051b544 /drivers/crypto | |
parent | 24821c4652dbf85a69e732574874dc191a813da4 (diff) |
crypto: caam - Modify Freescale CAAM driver Scatter Gather entry definition
Modify the Scatter-Gather entry definitions for the Freescale
CAAM driver to include support for both 64- and 32-bit DMA pointers.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
Tested-by: Horia Geantă <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/desc.h | 25 | ||||
-rw-r--r-- | drivers/crypto/caam/sg_sw_sec4.h | 1 |
2 files changed, 21 insertions, 5 deletions
diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index d397ff9d56fd..405acbf13dac 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h | |||
@@ -8,12 +8,29 @@ | |||
8 | #ifndef DESC_H | 8 | #ifndef DESC_H |
9 | #define DESC_H | 9 | #define DESC_H |
10 | 10 | ||
11 | /* | ||
12 | * 16-byte hardware scatter/gather table | ||
13 | * An 8-byte table exists in the hardware spec, but has never been | ||
14 | * implemented to date. The 8/16 option is selected at RTL-compile-time. | ||
15 | * and this selection is visible in the Compile Time Parameters Register | ||
16 | */ | ||
17 | |||
18 | #define SEC4_SG_LEN_EXT 0x80000000 /* Entry points to table */ | ||
19 | #define SEC4_SG_LEN_FIN 0x40000000 /* Last ent in table */ | ||
20 | #define SEC4_SG_BPID_MASK 0x000000ff | ||
21 | #define SEC4_SG_BPID_SHIFT 16 | ||
22 | #define SEC4_SG_LEN_MASK 0x3fffffff /* Excludes EXT and FINAL */ | ||
23 | #define SEC4_SG_OFFS_MASK 0x00001fff | ||
24 | |||
11 | struct sec4_sg_entry { | 25 | struct sec4_sg_entry { |
12 | u64 ptr; | 26 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
13 | #define SEC4_SG_LEN_FIN 0x40000000 | 27 | dma_addr_t ptr; |
14 | #define SEC4_SG_LEN_EXT 0x80000000 | 28 | #else |
29 | u32 rsvd1; | ||
30 | dma_addr_t ptr; | ||
31 | #endif | ||
15 | u32 len; | 32 | u32 len; |
16 | u8 reserved; | 33 | u8 rsvd2; |
17 | u8 buf_pool_id; | 34 | u8 buf_pool_id; |
18 | u16 offset; | 35 | u16 offset; |
19 | }; | 36 | }; |
diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index b68b74cc7b77..711bb3949779 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h | |||
@@ -15,7 +15,6 @@ static inline void dma_to_sec4_sg_one(struct sec4_sg_entry *sec4_sg_ptr, | |||
15 | { | 15 | { |
16 | sec4_sg_ptr->ptr = dma; | 16 | sec4_sg_ptr->ptr = dma; |
17 | sec4_sg_ptr->len = len; | 17 | sec4_sg_ptr->len = len; |
18 | sec4_sg_ptr->reserved = 0; | ||
19 | sec4_sg_ptr->buf_pool_id = 0; | 18 | sec4_sg_ptr->buf_pool_id = 0; |
20 | sec4_sg_ptr->offset = offset; | 19 | sec4_sg_ptr->offset = offset; |
21 | #ifdef DEBUG | 20 | #ifdef DEBUG |