crypto: Add support to choose the CE type based on taget.

Change-Id: I82bd992382c59ddeecbf49a294878c4eb2a71be2
diff --git a/target/msm8960/init.c b/target/msm8960/init.c
index 0673dea..d39022e 100644
--- a/target/msm8960/init.c
+++ b/target/msm8960/init.c
@@ -45,6 +45,7 @@
 #include <platform.h>
 #include <baseband.h>
 #include <uart_dm.h>
+#include <crypto_hash.h>
 
 /* 8960 */
 #define LINUX_MACHTYPE_8960_SIM     3230
@@ -84,6 +85,15 @@
 
 static pm8921_dev_t pmic;
 
+/* Setting this variable to different values defines the
+ * behavior of CE engine:
+ * platform_ce_type = CRYPTO_ENGINE_TYPE_NONE : No CE engine
+ * platform_ce_type = CRYPTO_ENGINE_TYPE_SW : Software CE engine
+ * platform_ce_type = CRYPTO_ENGINE_TYPE_HW : Hardware CE engine
+ * Behavior is determined in the target code.
+ */
+static crypto_engine_type platform_ce_type = CRYPTO_ENGINE_TYPE_SW;
+
 static void target_detect(void);
 static void target_uart_init(void);
 
@@ -151,6 +161,11 @@
 	}
 #endif
 
+	if ((platform_id == MSM8960) || (platform_id == MSM8660A)
+        || (platform_id == MSM8260A) || (platform_id == APQ8060A))
+		/* Enable Hardware CE */
+		platform_ce_type = CRYPTO_ENGINE_TYPE_HW;
+
 	/* Trying Slot 1 first */
 	slot = 1;
 	base_addr = mmc_sdc_base[slot - 1];
@@ -175,6 +190,11 @@
 	return platform_id;
 }
 
+crypto_engine_type board_ce_type(void)
+{
+	return platform_ce_type;
+}
+
 void target_detect(void)
 {
 	struct smem_board_info_v6 board_info_v6;