Commit fec2601f authored by Leonard Crestez's avatar Leonard Crestez Committed by Mathieu Poirier

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: default avatarLeonard Crestez <cdleonard@gmail.com>
Link: https://lore.kernel.org/r/d4556268-8274-4089-949f-3b97d67793c7@gmail.comSigned-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
parent 331f91d8
...@@ -486,6 +486,7 @@ static int add_mem_regions_carveout(struct rproc *rproc) ...@@ -486,6 +486,7 @@ static int add_mem_regions_carveout(struct rproc *rproc)
} }
rproc_add_carveout(rproc, rproc_mem); 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", dev_dbg(&rproc->dev, "reserved mem carveout %s addr=%llx, size=0x%llx",
it.node->name, rmem->base, rmem->size); it.node->name, rmem->base, rmem->size);
...@@ -597,6 +598,7 @@ static int add_tcm_carveout_split_mode(struct rproc *rproc) ...@@ -597,6 +598,7 @@ static int add_tcm_carveout_split_mode(struct rproc *rproc)
} }
rproc_add_carveout(rproc, rproc_mem); rproc_add_carveout(rproc, rproc_mem);
rproc_coredump_add_segment(rproc, da, bank_size);
} }
return 0; return 0;
...@@ -676,6 +678,7 @@ static int add_tcm_carveout_lockstep_mode(struct rproc *rproc) ...@@ -676,6 +678,7 @@ static int add_tcm_carveout_lockstep_mode(struct rproc *rproc)
/* If registration is success, add carveouts */ /* If registration is success, add carveouts */
rproc_add_carveout(rproc, rproc_mem); 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", dev_dbg(dev, "TCM carveout lockstep mode %s addr=0x%llx, da=0x%x, size=0x%lx",
bank_name, bank_addr, da, bank_size); bank_name, bank_addr, da, bank_size);
...@@ -853,6 +856,8 @@ static struct zynqmp_r5_core *zynqmp_r5_add_rproc_core(struct device *cdev) ...@@ -853,6 +856,8 @@ static struct zynqmp_r5_core *zynqmp_r5_add_rproc_core(struct device *cdev)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
rproc_coredump_set_elf_info(r5_rproc, ELFCLASS32, EM_ARM);
r5_rproc->auto_boot = false; r5_rproc->auto_boot = false;
r5_core = r5_rproc->priv; r5_core = r5_rproc->priv;
r5_core->dev = cdev; r5_core->dev = cdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment