summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Crestez <cdleonard@gmail.com>2024-03-16 21:16:42 +0300
committerMathieu Poirier <mathieu.poirier@linaro.org>2024-04-08 19:33:03 +0300
commitfec2601f2003b9e9820ab5057607df7fff61cfaf (patch)
tree5a8632e9d0141054e22c13a53452e91896a45e97
parent331f91d86f71d0bb89a44217cc0b2a22810bbd42 (diff)
downloadlinux-fec2601f2003b9e9820ab5057607df7fff61cfaf.tar.xz
remoteproc: zynqmp: Add coredump support
Supporting remoteproc coredump requires the platform-specific driver to register coredump segments to be dumped. Do this by calling rproc_coredump_add_segment for every carveout. Also call rproc_coredump_set_elf_info when then rproc is created. If the ELFCLASS parameter is not provided then coredump fails with an error. Other drivers seem to pass EM_NONE for the machine argument but for me this shows a warning in gdb. Pass EM_ARM because this is an ARM R5. Signed-off-by: Leonard Crestez <cdleonard@gmail.com> Link: https://lore.kernel.org/r/d4556268-8274-4089-949f-3b97d67793c7@gmail.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r--drivers/remoteproc/xlnx_r5_remoteproc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index 4395edea9a64..cfbd97b89c26 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -486,6 +486,7 @@ static int add_mem_regions_carveout(struct rproc *rproc)
}
rproc_add_carveout(rproc, rproc_mem);
+ rproc_coredump_add_segment(rproc, rmem->base, rmem->size);
dev_dbg(&rproc->dev, "reserved mem carveout %s addr=%llx, size=0x%llx",
it.node->name, rmem->base, rmem->size);
@@ -597,6 +598,7 @@ static int add_tcm_carveout_split_mode(struct rproc *rproc)
}
rproc_add_carveout(rproc, rproc_mem);
+ rproc_coredump_add_segment(rproc, da, bank_size);
}
return 0;
@@ -676,6 +678,7 @@ static int add_tcm_carveout_lockstep_mode(struct rproc *rproc)
/* If registration is success, add carveouts */
rproc_add_carveout(rproc, rproc_mem);
+ rproc_coredump_add_segment(rproc, da, bank_size);
dev_dbg(dev, "TCM carveout lockstep mode %s addr=0x%llx, da=0x%x, size=0x%lx",
bank_name, bank_addr, da, bank_size);
@@ -853,6 +856,8 @@ static struct zynqmp_r5_core *zynqmp_r5_add_rproc_core(struct device *cdev)
return ERR_PTR(-ENOMEM);
}
+ rproc_coredump_set_elf_info(r5_rproc, ELFCLASS32, EM_ARM);
+
r5_rproc->auto_boot = false;
r5_core = r5_rproc->priv;
r5_core->dev = cdev;