]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00232945-2: CAAM: Add SNVS state handler startup
authorSteve Cornelius <steve.cornelius@freescale.com>
Thu, 8 Nov 2012 07:39:05 +0000 (00:39 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:41 +0000 (08:35 +0200)
Add SNVS state handler startup to CAAM controller driver.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/intern.h
drivers/crypto/caam/snvsregs.h

index 2eba900de1c2fcba08d6b61be0583c2eff1f2af9..0cadb8ef29b4b79283acdad1ee0865423c4cb3c4 100644 (file)
@@ -26,6 +26,10 @@ static int caam_remove(struct platform_device *pdev)
        topregs = (struct caam_full __iomem *)ctrlpriv->ctrl;
 
 #ifndef CONFIG_OF
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO
+       caam_secvio_shutdown(pdev);
+#endif /* SECVIO */
+
 #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_SM
        caam_sm_shutdown(pdev);
 #endif
@@ -296,7 +300,9 @@ static int caam_probe(struct platform_device *pdev)
        ctrlpriv->sm_base = (void __force *)sm_base;
        ctrlpriv->sm_size = res->end - res->start + 1;
 
-       /* Get the IRQ for security violations only */
+       /*
+        * Get the IRQ for security violations
+        */
 #ifdef CONFIG_OF
        ctrlpriv->secvio_irq = of_irq_to_resource(nprop, 0, NULL);
 #else
@@ -585,6 +591,10 @@ static int caam_probe(struct platform_device *pdev)
 #endif /* SM_TEST */
 #endif /* SM */
 
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO
+       caam_secvio_startup(pdev);
+#endif /* SECVIO */
+
 #endif /* CONFIG_OF */
        return status;
 }
index 87c3b68193d6471e58a9ff6273fb558ef4549311..991ce0b586da71aff3f20829fb93f05ab81a3338 100644 (file)
@@ -124,6 +124,11 @@ struct caam_drv_private {
 #ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_SM
        struct device *smdev;   /* Secure Memory dev */
 #endif
+
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO
+       struct device *secviodev;
+#endif
+
        /*
         * debugfs entries for developer view into driver/device
         * variables at runtime.
@@ -173,6 +178,11 @@ void caam_sm_shutdown(struct platform_device *pdev);
 int caam_sm_example_init(struct platform_device *pdev);
 #endif
 
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO
+int caam_secvio_startup(struct platform_device *pdev);
+void caam_secvio_shutdown(struct platform_device *pdev);
+#endif /* SECVIO */
+
 #endif /* CONFIG_OF */
 
 #endif /* INTERN_H */
index 4a1e4a8b414a0af27d2f0933a7d51e4975a57d20..5655f6e88b4b93cd180de837846c89cb4430176e 100644 (file)
@@ -77,6 +77,7 @@ struct snvs_hp {
 #define HP_SECVIO_INTEN_SRC2   0x00000004
 #define HP_SECVIO_INTEN_SRC1   0x00000002
 #define HP_SECVIO_INTEN_SRC0   0x00000001
+#define HP_SECVIO_INTEN_ALL    0x8000003f
 
 #define HP_SECVIO_ICTL_CFG_SHIFT       30
 #define HP_SECVIO_ICTL_CFG_MASK                (0x3 << HP_SECVIO_ICTL_CFG_SHIFT)
@@ -109,12 +110,13 @@ struct snvs_hp {
 #define HP_SECVIOST_ZMK_ECC_FAIL       0x08000000      /* write to clear */
 #define HP_SECVIOST_ZMK_SYN_SHIFT      16
 #define HP_SECVIOST_ZMK_SYN_MASK       (0x1ff << HP_SECVIOST_ZMK_SYN_SHIFT)
-#define HP_SECVIOST_ZMK_SECVIO5                0x00000020
-#define HP_SECVIOST_ZMK_SECVIO4                0x00000010
-#define HP_SECVIOST_ZMK_SECVIO3                0x00000008
-#define HP_SECVIOST_ZMK_SECVIO2                0x00000004
-#define HP_SECVIOST_ZMK_SECVIO1                0x00000002
-#define HP_SECVIOST_ZMK_SECVIO0                0x00000001
+#define HP_SECVIOST_SECVIO5            0x00000020
+#define HP_SECVIOST_SECVIO4            0x00000010
+#define HP_SECVIOST_SECVIO3            0x00000008
+#define HP_SECVIOST_SECVIO2            0x00000004
+#define HP_SECVIOST_SECVIO1            0x00000002
+#define HP_SECVIOST_SECVIO0            0x00000001
+#define HP_SECVIOST_SECVIOMASK         0x0000003f
 
 /*
  * SNVS Low Power Domain