static int proxy_timeout_ms = -1;
module_param(proxy_timeout_ms, int, S_IRUGO | S_IWUSR);
+static bool disable_timeouts;
/**
* struct pil_mdt - Representation of <name>.mdt file in memory
* @hdr: ELF32 header
static DEFINE_IDA(pil_ida);
+bool is_timeout_disabled(void)
+{
+ return disable_timeouts;
+}
/**
* pil_desc_init() - Initialize a pil descriptor
* @desc: descriptor to intialize
pr_warn("pil: could not map imem region\n");
goto out;
}
+ if (__raw_readl(pil_info_base) == 0x53444247) {
+ pr_info("pil: pil-imem set to disable pil timeouts\n");
+ disable_timeouts = true;
+ }
for (i = 0; i < resource_size(&res)/sizeof(u32); i++)
writel_relaxed(0, pil_info_base + (i * sizeof(u32)));
-/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
phys_addr_t addr, size_t size);
extern int pil_reclaim_mem(struct pil_desc *desc, phys_addr_t addr, size_t size,
int VMid);
+extern bool is_timeout_disabled(void);
#else
static inline int pil_desc_init(struct pil_desc *desc) { return 0; }
static inline int pil_boot(struct pil_desc *desc) { return 0; }
{
return 0;
}
+extern bool is_timeout_disabled(void) { return false; }
#endif
#endif
struct device *dev = drv->desc.dev;
int ret;
u32 status;
+ u64 val = is_timeout_disabled() ? 0 : pbl_mba_boot_timeout_ms * 1000;
/* Wait for PBL completion. */
ret = readl_poll_timeout(drv->rmb_base + RMB_PBL_STATUS, status,
- status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000);
+ status != 0, POLL_INTERVAL_US, val);
if (ret) {
dev_err(dev, "PBL boot timed out\n");
return ret;
/* Wait for MBA completion. */
ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status,
- status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000);
+ status != 0, POLL_INTERVAL_US, val);
if (ret) {
dev_err(dev, "MBA boot timed out\n");
return ret;
struct q6v5_data *q6_drv = container_of(pil, struct q6v5_data, desc);
int ret = 0;
s32 status;
+ u64 val = is_timeout_disabled() ? 0 : pbl_mba_boot_timeout_ms * 1000;
if (err_path) {
writel_relaxed(CMD_PILFAIL_NFY_MBA,
drv->rmb_base + RMB_MBA_COMMAND);
ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status,
- status == STATUS_MBA_UNLOCKED || status < 0,
- POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000);
+ status == STATUS_MBA_UNLOCKED || status < 0,
+ POLL_INTERVAL_US, val);
if (ret)
dev_err(pil->dev, "MBA region unlock timed out\n");
else if (status < 0)
dma_addr_t mdata_phys;
s32 status;
int ret;
+ u64 val = is_timeout_disabled() ? 0 : modem_auth_timeout_ms * 1000;
DEFINE_DMA_ATTRS(attrs);
drv->mba_mem_dev.coherent_dma_mask =
writel_relaxed(mdata_phys, drv->rmb_base + RMB_PMI_META_DATA);
writel_relaxed(CMD_META_DATA_READY, drv->rmb_base + RMB_MBA_COMMAND);
ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status,
- status == STATUS_META_DATA_AUTH_SUCCESS || status < 0,
- POLL_INTERVAL_US, modem_auth_timeout_ms * 1000);
+ status == STATUS_META_DATA_AUTH_SUCCESS || status < 0,
+ POLL_INTERVAL_US, val);
if (ret) {
dev_err(pil->dev, "MBA authentication of headers timed out\n");
} else if (status < 0) {
struct q6v5_data *q6_drv = container_of(pil, struct q6v5_data, desc);
int ret;
s32 status;
+ u64 val = is_timeout_disabled() ? 0 : modem_auth_timeout_ms * 1000;
/* Wait for all segments to be authenticated or an error to occur */
ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status,
- status == STATUS_AUTH_COMPLETE || status < 0,
- 50, modem_auth_timeout_ms * 1000);
+ status == STATUS_AUTH_COMPLETE || status < 0, 50, val);
if (ret) {
dev_err(pil->dev, "MBA authentication of image timed out\n");
} else if (status < 0) {