]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00215228-9: Add hash and RNG initializers for non-OF builds
authorSteve Cornelius <steve.cornelius@freescale.com>
Tue, 26 Jun 2012 00:51:58 +0000 (17:51 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:54 +0000 (08:34 +0200)
Inserted explicit initializers for split-out startup and shutdown functions
needed for kernels using platform devices in place of OF-device-tree
initialization and detection.

Also added necessary ahash algorithm list head to driver private storage
block.

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

index 3a245aa19dc8fb772f57f2d0ae13414c0838f40a..89699e1a11fc03d1cdafacefc7586e469bf9957b 100644 (file)
@@ -24,6 +24,15 @@ static int caam_remove(struct platform_device *pdev)
 
 #ifndef CONFIG_OF
        caam_algapi_shutdown(pdev);
+
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API
+       caam_algapi_hash_shutdown(pdev);
+#endif
+
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API
+       caam_rng_shutdown();
+#endif
+
 #endif
        /* shut down JobRs */
        for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) {
@@ -335,8 +344,15 @@ static int caam_probe(struct platform_device *pdev)
 #ifndef CONFIG_OF
        /* FIXME: check status */
        caam_algapi_startup(pdev);
+
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API
+       caam_algapi_hash_startup(pdev);
 #endif
 
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API
+       caam_rng_startup(pdev);
+#endif
+#endif /* CONFIG_OF */
        return 0;
 }
 
index 19e4f25c25a847648445fb50415d6ffa5746fe82..8550598870455b55643a738045edc5acff95a886 100644 (file)
@@ -107,6 +107,8 @@ struct caam_drv_private {
        struct device **algapi_jr;
        /* list of registered crypto algorithms (mk generic context handle?) */
        struct list_head alg_list;
+       /* list of registered hash algorithms (mk generic context handle?) */
+       struct list_head hash_list;
 
 #ifdef CONFIG_ARM
        struct clk *caam_clk;
@@ -129,7 +131,28 @@ struct caam_drv_private {
 #endif
 };
 
+/*
+ * These startup/shutdown functions exist to enable API startup/shutdown
+ * outside of the OF device detection framework. It's necessary for ARM
+ * kernels as presently delivered.
+ *
+ * Once ARM kernels are shipping with OF support, these functions can
+ * be re-integrated into the normal probe startup/exit functions,
+ * and these prototypes can then be removed.
+ */
+#ifndef CONFIG_OF
 void caam_algapi_shutdown(struct platform_device *pdev);
 int caam_algapi_startup(struct platform_device *pdev);
 
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API
+int caam_algapi_hash_startup(struct platform_device *pdev);
+void caam_algapi_hash_shutdown(struct platform_device *pdev);
+#endif
+
+#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API
+int caam_rng_startup(struct platform_device *pdev);
+void caam_rng_shutdown(void);
+#endif
+#endif /* CONFIG_OF */
+
 #endif /* INTERN_H */