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-gss.c b/arch/arm/mach-msm/pil-gss.c
index a6d13d0..f4d4449 100644
--- a/arch/arm/mach-msm/pil-gss.c
+++ b/arch/arm/mach-msm/pil-gss.c
@@ -404,11 +404,6 @@
smsm_reset_modem(SMSM_RESET);
}
-/* FIXME: Get address, size from PIL */
-static struct ramdump_segment gss_segments[] = {
- {0x89000000, 0x00D00000}
-};
-
static struct ramdump_segment smem_segments[] = {
{0x80000000, 0x00200000},
};
@@ -418,20 +413,20 @@
int ret;
struct gss_data *drv = container_of(desc, struct gss_data, subsys_desc);
- if (enable) {
- ret = do_ramdump(drv->ramdump_dev, gss_segments,
- ARRAY_SIZE(gss_segments));
- if (ret < 0) {
- pr_err("Unable to dump gss memory\n");
- return ret;
- }
+ if (!enable)
+ return 0;
- ret = do_ramdump(drv->smem_ramdump_dev, smem_segments,
- ARRAY_SIZE(smem_segments));
- if (ret < 0) {
- pr_err("Unable to dump smem memory (rc = %d).\n", ret);
- return ret;
- }
+ ret = pil_do_ramdump(&drv->pil_desc, drv->ramdump_dev);
+ if (ret < 0) {
+ pr_err("Unable to dump gss memory\n");
+ return ret;
+ }
+
+ ret = do_elf_ramdump(drv->smem_ramdump_dev, smem_segments,
+ ARRAY_SIZE(smem_segments));
+ if (ret < 0) {
+ pr_err("Unable to dump smem memory (rc = %d).\n", ret);
+ return ret;
}
return 0;