msm: pil: Migrate to pil_do_ramdump() and do_elf_ramdump() APIs
Use the pil_do_ramdump() and do_elf_ramdump() functions to
simplify the PIL ramdumping code. This saves lines of code and
makes ramdumps work for relocatable images in addition to
removing many hard-coded constants and TODOs in the PIL drivers.
Change-Id: I0d22787b035d28fcf7fbaffa9c157a973c375211
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/pil-q6v4-mss.c b/arch/arm/mach-msm/pil-q6v4-mss.c
index ee01f04..f2b090f 100644
--- a/arch/arm/mach-msm/pil-q6v4-mss.c
+++ b/arch/arm/mach-msm/pil-q6v4-mss.c
@@ -243,14 +243,6 @@
smsm_reset_modem(SMSM_RESET);
}
-static struct ramdump_segment sw_segments[] = {
- {0x89000000, 0x8D400000 - 0x89000000},
-};
-
-static struct ramdump_segment fw_segments[] = {
- {0x8D400000, 0x8DA00000 - 0x8D400000},
-};
-
static struct ramdump_segment smem_segments[] = {
{0x80000000, 0x00200000},
};
@@ -263,17 +255,15 @@
if (!enable)
return 0;
- ret = do_ramdump(drv->sw_ramdump_dev, sw_segments,
- ARRAY_SIZE(sw_segments));
+ ret = pil_do_ramdump(&drv->q6_sw.desc, drv->sw_ramdump_dev);
if (ret < 0)
return ret;
- ret = do_ramdump(drv->fw_ramdump_dev, fw_segments,
- ARRAY_SIZE(fw_segments));
+ ret = pil_do_ramdump(&drv->q6_fw.desc, drv->fw_ramdump_dev);
if (ret < 0)
return ret;
- ret = do_ramdump(drv->smem_ramdump_dev, smem_segments,
+ ret = do_elf_ramdump(drv->smem_ramdump_dev, smem_segments,
ARRAY_SIZE(smem_segments));
if (ret < 0)
return ret;