msm: pil: Add start address querying API

Almost every PIL driver needs to parse the elf header to
determine what the entry point is so they can configure hardware.
Instead of forcing every driver to copy the same code, parse the
entry point in the core PIL code and expose an API to get the
address via pil_get_start_addr().

For safety, add a check to make sure the start address lies
within the range of the segments that we load unless a 'quirk' is
filled out indicating we should skip the check.

In addition, make the init_image callback optional to reduce code
even further because most of the init_image callbacks are empty
after this change.

Change-Id: Ib721eefc41278bcf3e0d8faba642cc427e7643ec
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/pil-dsps.c b/arch/arm/mach-msm/pil-dsps.c
index 4e5f2ac..e19db58 100644
--- a/arch/arm/mach-msm/pil-dsps.c
+++ b/arch/arm/mach-msm/pil-dsps.c
@@ -13,7 +13,6 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/elf.h>
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/delay.h>
@@ -267,6 +266,7 @@
 	desc->name = pdev->dev.platform_data;
 	desc->dev = &pdev->dev;
 	desc->owner = THIS_MODULE;
+	desc->flags = PIL_SKIP_ENTRY_CHECK;
 	if (pas_supported(PAS_DSPS) > 0) {
 		desc->ops = &pil_dsps_ops_trusted;
 		dev_info(&pdev->dev, "using secure boot\n");