From: Steve Cornelius Date: Thu, 8 Nov 2012 07:39:05 +0000 (-0700) Subject: ENGR00232945-2: CAAM: Add SNVS state handler startup X-Git-Tag: v3.0.35-fsl~267 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bea878f09e64c7b95021891dcfbe497dc0d7fb97;p=karo-tx-linux.git ENGR00232945-2: CAAM: Add SNVS state handler startup Add SNVS state handler startup to CAAM controller driver. Signed-off-by: Steve Cornelius Signed-off-by: Terry Lv --- diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 2eba900de1c2..0cadb8ef29b4 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -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; } diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h index 87c3b68193d6..991ce0b586da 100644 --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h @@ -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 */ diff --git a/drivers/crypto/caam/snvsregs.h b/drivers/crypto/caam/snvsregs.h index 4a1e4a8b414a..5655f6e88b4b 100644 --- a/drivers/crypto/caam/snvsregs.h +++ b/drivers/crypto/caam/snvsregs.h @@ -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