]> git.karo-electronics.de Git - linux-beck.git/commitdiff
crypto: ux500 - Cleanup hardware identification
authorAndreas Westin <andreas.westin@stericsson.com>
Thu, 10 May 2012 08:14:08 +0000 (10:14 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 15 May 2012 07:25:33 +0000 (17:25 +1000)
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>
drivers/crypto/ux500/cryp/cryp.c
drivers/crypto/ux500/cryp/cryp_p.h
drivers/crypto/ux500/hash/hash_core.c

index bd206ffc25dfbf1f4c7876869ea714d02c60d4c9..e208ceaf81c9e37a721d4228b6c4b22fa18a7e30 100644 (file)
@@ -37,18 +37,16 @@ int cryp_check(struct cryp_device_data *device_data)
        if (NULL == device_data)
                return -EINVAL;
 
-       if (cpu_is_u8500())
-               peripheralid2 = CRYP_PERIPHERAL_ID2_DB8500;
-       else if (cpu_is_u5500())
-               peripheralid2 = CRYP_PERIPHERAL_ID2_DB5500;
+       peripheralid2 = readl_relaxed(&device_data->base->periphId2);
+
+       if (peripheralid2 != CRYP_PERIPHERAL_ID2_DB8500)
+               return -EPERM;
 
        /* Check Peripheral and Pcell Id Register for CRYP */
        if ((CRYP_PERIPHERAL_ID0 ==
                readl_relaxed(&device_data->base->periphId0))
            && (CRYP_PERIPHERAL_ID1 ==
                    readl_relaxed(&device_data->base->periphId1))
-           && (peripheralid2 ==
-                   readl_relaxed(&device_data->base->periphId2))
            && (CRYP_PERIPHERAL_ID3 ==
                    readl_relaxed(&device_data->base->periphId3))
            && (CRYP_PCELL_ID0 ==
index 0e070829edce15902f3edb54798dd4ec880b875d..6dcffe15c2bce16c97867781106a6943b142edfd 100644 (file)
@@ -41,7 +41,6 @@
 #define CRYP_PERIPHERAL_ID1            0x05
 
 #define CRYP_PERIPHERAL_ID2_DB8500     0x28
-#define CRYP_PERIPHERAL_ID2_DB5500     0x29
 #define CRYP_PERIPHERAL_ID3            0x00
 
 #define CRYP_PCELL_ID0                 0x0D
index 77f7508b60999580d5df7e403c0f9d70bdf39829..6dbb9ec709a388c4fe5c52a6db0441f812110970 100644 (file)
@@ -574,15 +574,6 @@ static int hash_init(struct ahash_request *req)
        memset(&req_ctx->state, 0, sizeof(struct hash_state));
        req_ctx->updated = 0;
        if (hash_mode == HASH_MODE_DMA) {
-               if ((ctx->config.oper_mode == HASH_OPER_MODE_HMAC) &&
-                               cpu_is_u5500()) {
-                       pr_debug(DEV_DBG_NAME " [%s] HMAC and DMA not working "
-                                       "on u5500, directing to CPU mode.",
-                                       __func__);
-                       req_ctx->dma_mode = false; /* Don't use DMA */
-                       goto out;
-               }
-
                if (req->nbytes < HASH_DMA_ALIGN_SIZE) {
                        req_ctx->dma_mode = false; /* Don't use DMA */
 
@@ -604,7 +595,6 @@ static int hash_init(struct ahash_request *req)
                        }
                }
        }
-out:
        return 0;
 }