diff options
author | Andreas Westin <andreas.westin@stericsson.com> | 2012-05-10 04:14:08 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-05-15 03:25:33 -0400 |
commit | d1cbb1447bca8eaa28b7a384365932b49c47811f (patch) | |
tree | 808a62ab2015d511f0dd1e6d0e0ed01ff70e1234 | |
parent | f7329e71626c977fee672710142eb34ed7d021c7 (diff) |
crypto: ux500 - Cleanup hardware identification
Don't use SOC specific functions to identify
which crypto hardware we are talking to and use
the ID provided in the module instead.
Signed-off-by: Andreas Westin <andreas.westin@stericsson.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/ux500/cryp/cryp.c | 10 | ||||
-rw-r--r-- | drivers/crypto/ux500/cryp/cryp_p.h | 1 | ||||
-rw-r--r-- | drivers/crypto/ux500/hash/hash_core.c | 10 |
3 files changed, 4 insertions, 17 deletions
diff --git a/drivers/crypto/ux500/cryp/cryp.c b/drivers/crypto/ux500/cryp/cryp.c index bd206ffc25df..e208ceaf81c9 100644 --- a/drivers/crypto/ux500/cryp/cryp.c +++ b/drivers/crypto/ux500/cryp/cryp.c | |||
@@ -37,18 +37,16 @@ int cryp_check(struct cryp_device_data *device_data) | |||
37 | if (NULL == device_data) | 37 | if (NULL == device_data) |
38 | return -EINVAL; | 38 | return -EINVAL; |
39 | 39 | ||
40 | if (cpu_is_u8500()) | 40 | peripheralid2 = readl_relaxed(&device_data->base->periphId2); |
41 | peripheralid2 = CRYP_PERIPHERAL_ID2_DB8500; | 41 | |
42 | else if (cpu_is_u5500()) | 42 | if (peripheralid2 != CRYP_PERIPHERAL_ID2_DB8500) |
43 | peripheralid2 = CRYP_PERIPHERAL_ID2_DB5500; | 43 | return -EPERM; |
44 | 44 | ||
45 | /* Check Peripheral and Pcell Id Register for CRYP */ | 45 | /* Check Peripheral and Pcell Id Register for CRYP */ |
46 | if ((CRYP_PERIPHERAL_ID0 == | 46 | if ((CRYP_PERIPHERAL_ID0 == |
47 | readl_relaxed(&device_data->base->periphId0)) | 47 | readl_relaxed(&device_data->base->periphId0)) |
48 | && (CRYP_PERIPHERAL_ID1 == | 48 | && (CRYP_PERIPHERAL_ID1 == |
49 | readl_relaxed(&device_data->base->periphId1)) | 49 | readl_relaxed(&device_data->base->periphId1)) |
50 | && (peripheralid2 == | ||
51 | readl_relaxed(&device_data->base->periphId2)) | ||
52 | && (CRYP_PERIPHERAL_ID3 == | 50 | && (CRYP_PERIPHERAL_ID3 == |
53 | readl_relaxed(&device_data->base->periphId3)) | 51 | readl_relaxed(&device_data->base->periphId3)) |
54 | && (CRYP_PCELL_ID0 == | 52 | && (CRYP_PCELL_ID0 == |
diff --git a/drivers/crypto/ux500/cryp/cryp_p.h b/drivers/crypto/ux500/cryp/cryp_p.h index 0e070829edce..6dcffe15c2bc 100644 --- a/drivers/crypto/ux500/cryp/cryp_p.h +++ b/drivers/crypto/ux500/cryp/cryp_p.h | |||
@@ -41,7 +41,6 @@ | |||
41 | #define CRYP_PERIPHERAL_ID1 0x05 | 41 | #define CRYP_PERIPHERAL_ID1 0x05 |
42 | 42 | ||
43 | #define CRYP_PERIPHERAL_ID2_DB8500 0x28 | 43 | #define CRYP_PERIPHERAL_ID2_DB8500 0x28 |
44 | #define CRYP_PERIPHERAL_ID2_DB5500 0x29 | ||
45 | #define CRYP_PERIPHERAL_ID3 0x00 | 44 | #define CRYP_PERIPHERAL_ID3 0x00 |
46 | 45 | ||
47 | #define CRYP_PCELL_ID0 0x0D | 46 | #define CRYP_PCELL_ID0 0x0D |
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 77f7508b6099..6dbb9ec709a3 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c | |||
@@ -574,15 +574,6 @@ static int hash_init(struct ahash_request *req) | |||
574 | memset(&req_ctx->state, 0, sizeof(struct hash_state)); | 574 | memset(&req_ctx->state, 0, sizeof(struct hash_state)); |
575 | req_ctx->updated = 0; | 575 | req_ctx->updated = 0; |
576 | if (hash_mode == HASH_MODE_DMA) { | 576 | if (hash_mode == HASH_MODE_DMA) { |
577 | if ((ctx->config.oper_mode == HASH_OPER_MODE_HMAC) && | ||
578 | cpu_is_u5500()) { | ||
579 | pr_debug(DEV_DBG_NAME " [%s] HMAC and DMA not working " | ||
580 | "on u5500, directing to CPU mode.", | ||
581 | __func__); | ||
582 | req_ctx->dma_mode = false; /* Don't use DMA */ | ||
583 | goto out; | ||
584 | } | ||
585 | |||
586 | if (req->nbytes < HASH_DMA_ALIGN_SIZE) { | 577 | if (req->nbytes < HASH_DMA_ALIGN_SIZE) { |
587 | req_ctx->dma_mode = false; /* Don't use DMA */ | 578 | req_ctx->dma_mode = false; /* Don't use DMA */ |
588 | 579 | ||
@@ -604,7 +595,6 @@ static int hash_init(struct ahash_request *req) | |||
604 | } | 595 | } |
605 | } | 596 | } |
606 | } | 597 | } |
607 | out: | ||
608 | return 0; | 598 | return 0; |
609 | } | 599 | } |
610 | 600 | ||