summaryrefslogtreecommitdiff
path: root/drivers/crypto/fsl/fsl_hash.c
diff options
context:
space:
mode:
authorAneesh Bansal <aneesh.bansal@freescale.com>2015-10-29 22:58:03 +0530
committerYork Sun <yorksun@freescale.com>2015-10-29 10:33:57 -0700
commitf59e69cbd38ff297a07687ba28437c257cd5757c (patch)
tree78ad61cb12919f0a5aa68892e1e6c58c302f4930 /drivers/crypto/fsl/fsl_hash.c
parentf4f0b7403a06d2642ca40e6a0b18ee7336f276a8 (diff)
downloadu-boot-imx-f59e69cbd38ff297a07687ba28437c257cd5757c.zip
u-boot-imx-f59e69cbd38ff297a07687ba28437c257cd5757c.tar.gz
u-boot-imx-f59e69cbd38ff297a07687ba28437c257cd5757c.tar.bz2
crypto/fsl: SEC driver cleanup for 64 bit and endianness
The SEC driver code has been cleaned up to work for 64 bit physical addresses and systems where endianess of SEC block is different from the Core. Changes: 1. Descriptor created on Core is modified as per SEC block endianness before the job is submitted. 2. The read/write of physical addresses to Job Rings will be depend on endianness of SEC block as 32 bit low and high part of the 64 bit address will vary. 3. The 32 bit low and high part of the 64 bit address in descriptor will vary depending on endianness of SEC. Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'drivers/crypto/fsl/fsl_hash.c')
-rw-r--r--drivers/crypto/fsl/fsl_hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/fsl/fsl_hash.c b/drivers/crypto/fsl/fsl_hash.c
index c298404..887e88c 100644
--- a/drivers/crypto/fsl/fsl_hash.c
+++ b/drivers/crypto/fsl/fsl_hash.c
@@ -84,7 +84,7 @@ static int caam_hash_update(void *hash_ctx, const void *buf,
enum caam_hash_algos caam_algo)
{
uint32_t final = 0;
- dma_addr_t addr = virt_to_phys((void *)buf);
+ phys_addr_t addr = virt_to_phys((void *)buf);
struct sha_ctx *ctx = hash_ctx;
if (ctx->sg_num >= MAX_SG_32) {
@@ -93,11 +93,11 @@ static int caam_hash_update(void *hash_ctx, const void *buf,
}
#ifdef CONFIG_PHYS_64BIT
- ctx->sg_tbl[ctx->sg_num].addr_hi = addr >> 32;
+ sec_out32(&ctx->sg_tbl[ctx->sg_num].addr_hi, (uint32_t)(addr >> 32));
#else
- ctx->sg_tbl[ctx->sg_num].addr_hi = 0x0;
+ sec_out32(&ctx->sg_tbl[ctx->sg_num].addr_hi, 0x0);
#endif
- ctx->sg_tbl[ctx->sg_num].addr_lo = addr;
+ sec_out32(&ctx->sg_tbl[ctx->sg_num].addr_lo, (uint32_t)addr);
sec_out32(&ctx->sg_tbl[ctx->sg_num].len_flag,
(size & SG_ENTRY_LENGTH_MASK));