msm: pil: Allow MBA & Modem auth timeout to be set in module parameters

For convenient debugging of PBL and MBA code, allow the authentication
timeouts to be overridden with a module parameter. With this, the
timeouts can be extended or disabled entirely (by setting them to 0).

Change-Id: I2329a6ee10503b8b7f7d1d0c2fd52fe1aee42e5a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
(cherry picked from commit d251d8ec509cf22740c55bf98ac4edced1ad4a4d)
diff --git a/arch/arm/mach-msm/pil-q6v5-mss.c b/arch/arm/mach-msm/pil-q6v5-mss.c
index 6a30940..7c372ee 100644
--- a/arch/arm/mach-msm/pil-q6v5-mss.c
+++ b/arch/arm/mach-msm/pil-q6v5-mss.c
@@ -51,10 +51,12 @@
 #define RMB_PBL_STATUS			0x04
 #define RMB_MBA_STATUS			0x0C
 
-#define PBL_MBA_WAIT_TIMEOUT_US		100000
 #define PROXY_TIMEOUT_MS		10000
 #define POLL_INTERVAL_US		50
 
+static int pbl_mba_boot_timeout_ms = 100;
+module_param(pbl_mba_boot_timeout_ms, int, S_IRUGO | S_IWUSR);
+
 static int pil_mss_power_up(struct device *dev)
 {
 	int ret;
@@ -131,7 +133,7 @@
 
 	/* Wait for PBL completion. */
 	ret = readl_poll_timeout(drv->rmb_base + RMB_PBL_STATUS, status,
-		status != 0, POLL_INTERVAL_US, PBL_MBA_WAIT_TIMEOUT_US);
+		status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000);
 	if (ret) {
 		dev_err(dev, "PBL boot timed out\n");
 		return ret;
@@ -143,7 +145,7 @@
 
 	/* Wait for MBA completion. */
 	ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status,
-		status != 0, POLL_INTERVAL_US, PBL_MBA_WAIT_TIMEOUT_US);
+		status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000);
 	if (ret) {
 		dev_err(dev, "MBA boot timed out\n");
 		return ret;