mtd: msm_qpic_nand: Use address from APPS partition for ONFI probe
The ONFI device probe involves requesting the device for ONFI params.
This request is sent as a page-read with zeroth address (from MTD
partition table) as the address used is considered DONT CARE by the
device. But MPU/XPU would flag it Nand Access violation as that page
address may not be accessible by APPS proc
So instead pass the page address of 'APPS' partition on which APPS proc
has read/write permissions.
CRs-Fixed: 465463
Change-Id: I9f1715c0385fa7732e2879417305ebfdecbf8679
Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
diff --git a/drivers/mtd/devices/msm_qpic_nand.c b/drivers/mtd/devices/msm_qpic_nand.c
index de7dd13..570c257 100644
--- a/drivers/mtd/devices/msm_qpic_nand.c
+++ b/drivers/mtd/devices/msm_qpic_nand.c
@@ -689,6 +689,14 @@
if (ret < 0)
goto free_dma;
+ /* Lookup the 'APPS' partition's first page address */
+ for (i = 0; i < FLASH_PTABLE_MAX_PARTS_V4; i++) {
+ if (!strncmp("apps", ptable.part_entry[i].name,
+ strlen(ptable.part_entry[i].name))) {
+ page_address = ptable.part_entry[i].offset << 6;
+ break;
+ }
+ }
data.cfg.cmd = MSM_NAND_CMD_PAGE_READ_ALL;
data.exec = 1;
data.cfg.addr0 = (page_address << 16) |