msm: pil-riva: allow forcing of insecure mode

Don't check wcnss firmware metadata on load, this allows us to load
wcnss firmware from Xperia T and other models.

Change-Id: I36e6b7a41fa461d0b4c510ed56dc239832cb1404
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 3e50589..574f470 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -1958,6 +1958,12 @@
 	  Riva is the wireless subsystem processor used in bluetooth, wireless
 	  LAN, and FM software applications.
 
+config MSM_INSECURE_PIL_RIVA
+	bool "Force Riva PIL to insecure mode"
+	depends on MSM_PIL_RIVA
+	help
+	  Force Riva PIL to use non-secure boot.
+
 config MSM_PIL_TZAPPS
 	tristate "TZApps Boot Support"
 	depends on MSM_PIL
diff --git a/arch/arm/mach-msm/pil-riva.c b/arch/arm/mach-msm/pil-riva.c
index c7ae22b..59242e1 100644
--- a/arch/arm/mach-msm/pil-riva.c
+++ b/arch/arm/mach-msm/pil-riva.c
@@ -248,6 +248,7 @@
 	.proxy_unvote = pil_riva_remove_proxy_vote,
 };
 
+#ifndef CONFIG_MSM_INSECURE_PIL_RIVA
 static int pil_riva_init_image_trusted(struct pil_desc *pil,
 		const u8 *metadata, size_t size)
 {
@@ -271,6 +272,7 @@
 	.proxy_vote = pil_riva_make_proxy_vote,
 	.proxy_unvote = pil_riva_remove_proxy_vote,
 };
+#endif
 
 static int __devinit pil_riva_probe(struct platform_device *pdev)
 {
@@ -322,13 +324,17 @@
 	desc->owner = THIS_MODULE;
 	desc->proxy_timeout = 10000;
 
+#ifndef CONFIG_MSM_INSECURE_PIL_RIVA
 	if (pas_supported(PAS_WCNSS) > 0) {
 		desc->ops = &pil_riva_ops_trusted;
 		dev_info(&pdev->dev, "using secure boot\n");
 	} else {
+#endif
 		desc->ops = &pil_riva_ops;
 		dev_info(&pdev->dev, "using non-secure boot\n");
+#ifndef CONFIG_MSM_INSECURE_PIL_RIVA
 	}
+#endif
 
 	drv->xo = devm_clk_get(&pdev->dev, "cxo");
 	if (IS_ERR(drv->xo))