crypto: caam - save Era in driver's private data
authorHoria Geantă <horia.geanta@nxp.com>
Tue, 19 Dec 2017 10:16:06 +0000 (12:16 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 28 Dec 2017 06:56:47 +0000 (17:56 +1100)
Save Era in driver's private data for further usage,
like deciding whether an erratum applies or a feature is available
based on its value.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/intern.h

index 027e121c6f70aa9214a29692e8a3ef1e6d886496..75d280cb2dc057f20e26e20362aabd1d1d6bd7c8 100644 (file)
@@ -611,6 +611,8 @@ static int caam_probe(struct platform_device *pdev)
                goto iounmap_ctrl;
        }
 
+       ctrlpriv->era = caam_get_era();
+
        ret = of_platform_populate(nprop, caam_match, NULL, dev);
        if (ret) {
                dev_err(dev, "JR platform devices creation error\n");
@@ -742,7 +744,7 @@ static int caam_probe(struct platform_device *pdev)
 
        /* Report "alive" for developer to see */
        dev_info(dev, "device ID = 0x%016llx (Era %d)\n", caam_id,
-                caam_get_era());
+                ctrlpriv->era);
        dev_info(dev, "job rings = %d, qi = %d, dpaa2 = %s\n",
                 ctrlpriv->total_jobrs, ctrlpriv->qi_present,
                 caam_dpaa2 ? "yes" : "no");
index 91f1107276e56446ff9866b82ef1f2eca0dfb430..7696a774a3628dcbd0ac43c94ea3024b14cb84d0 100644 (file)
@@ -84,6 +84,7 @@ struct caam_drv_private {
        u8 qi_present;          /* Nonzero if QI present in device */
        int secvio_irq;         /* Security violation interrupt number */
        int virt_en;            /* Virtualization enabled in CAAM */
+       int era;                /* CAAM Era (internal HW revision) */
 
 #define        RNG4_MAX_HANDLES 2
        /* RNG4 block */