crypto: ccree - add support for CryptoCell 713
authorGilad Ben-Yossef <gilad@benyossef.com>
Mon, 29 Oct 2018 09:50:12 +0000 (09:50 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Nov 2018 09:36:49 +0000 (17:36 +0800)
Add support for Arm TrustZone CryptoCell 713.
Note that this patch just enables using a 713 in backwards compatible mode
to 712. Newer 713 specific features will follow.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/Kconfig
drivers/crypto/ccree/cc_driver.c
drivers/crypto/ccree/cc_driver.h

index caa98a7fe3923bb752cec40f5459633627cc42fa..75d401c32a16a10cd0ce86fb003c970d69e375b0 100644 (file)
@@ -765,7 +765,7 @@ config CRYPTO_DEV_CCREE
        help
          Say 'Y' to enable a driver for the REE interface of the Arm
          TrustZone CryptoCell family of processors. Currently the
-         CryptoCell 712, 710 and 630 are supported.
+         CryptoCell 713, 712, 710 and 630 are supported.
          Choose this if you wish to use hardware acceleration of
          cryptographic operations on the system REE.
          If unsure say Y.
index 1ff229c2aeab13a464ad573af163fb61783959cf..630c598af627c33d7d12ca949914cc103ac9ba0c 100644 (file)
@@ -43,6 +43,10 @@ struct cc_hw_data {
 
 /* Hardware revisions defs. */
 
+static const struct cc_hw_data cc713_hw = {
+       .name = "713", .rev = CC_HW_REV_713
+};
+
 static const struct cc_hw_data cc712_hw = {
        .name = "712", .rev = CC_HW_REV_712, .sig =  0xDCC71200U
 };
@@ -56,6 +60,7 @@ static const struct cc_hw_data cc630p_hw = {
 };
 
 static const struct of_device_id arm_ccree_dev_of_match[] = {
+       { .compatible = "arm,cryptocell-713-ree", .data = &cc713_hw },
        { .compatible = "arm,cryptocell-712-ree", .data = &cc712_hw },
        { .compatible = "arm,cryptocell-710-ree", .data = &cc710_hw },
        { .compatible = "arm,cryptocell-630p-ree", .data = &cc630p_hw },
@@ -297,15 +302,17 @@ static int init_cc_resources(struct platform_device *plat_dev)
                return rc;
        }
 
-       /* Verify correct mapping */
-       signature_val = cc_ioread(new_drvdata, new_drvdata->sig_offset);
-       if (signature_val != hw_rev->sig) {
-               dev_err(dev, "Invalid CC signature: SIGNATURE=0x%08X != expected=0x%08X\n",
-                       signature_val, hw_rev->sig);
-               rc = -EINVAL;
-               goto post_clk_err;
+       if (hw_rev->rev <= CC_HW_REV_712) {
+               /* Verify correct mapping */
+               signature_val = cc_ioread(new_drvdata, new_drvdata->sig_offset);
+               if (signature_val != hw_rev->sig) {
+                       dev_err(dev, "Invalid CC signature: SIGNATURE=0x%08X != expected=0x%08X\n",
+                               signature_val, hw_rev->sig);
+                       rc = -EINVAL;
+                       goto post_clk_err;
+               }
+               dev_dbg(dev, "CC SIGNATURE=0x%08X\n", signature_val);
        }
-       dev_dbg(dev, "CC SIGNATURE=0x%08X\n", signature_val);
 
        /* Display HW versions */
        dev_info(dev, "ARM CryptoCell %s Driver: HW version 0x%08X, Driver version %s\n",
index d608a4faf662255260b23c6a508e11a12c34e3e8..a06e5c90fb6808f0c4bc197361f065cf3ab04918 100644 (file)
 extern bool cc_dump_desc;
 extern bool cc_dump_bytes;
 
-#define DRV_MODULE_VERSION "4.0"
+#define DRV_MODULE_VERSION "5.0"
 
 enum cc_hw_rev {
        CC_HW_REV_630 = 630,
        CC_HW_REV_710 = 710,
-       CC_HW_REV_712 = 712
+       CC_HW_REV_712 = 712,
+       CC_HW_REV_713 = 713
 };
 
 #define CC_COHERENT_CACHE_PARAMS 0xEEE