Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Leonard Crestez and committed by
Mathieu Poirier
fec2601f 331f91d8

+5
+5
drivers/remoteproc/xlnx_r5_remoteproc.c
··· 486 486 } 487 487 488 488 rproc_add_carveout(rproc, rproc_mem); 489 + rproc_coredump_add_segment(rproc, rmem->base, rmem->size); 489 490 490 491 dev_dbg(&rproc->dev, "reserved mem carveout %s addr=%llx, size=0x%llx", 491 492 it.node->name, rmem->base, rmem->size); ··· 598 597 } 599 598 600 599 rproc_add_carveout(rproc, rproc_mem); 600 + rproc_coredump_add_segment(rproc, da, bank_size); 601 601 } 602 602 603 603 return 0; ··· 678 676 679 677 /* If registration is success, add carveouts */ 680 678 rproc_add_carveout(rproc, rproc_mem); 679 + rproc_coredump_add_segment(rproc, da, bank_size); 681 680 682 681 dev_dbg(dev, "TCM carveout lockstep mode %s addr=0x%llx, da=0x%x, size=0x%lx", 683 682 bank_name, bank_addr, da, bank_size); ··· 855 852 dev_err(cdev, "failed to allocate memory for rproc instance\n"); 856 853 return ERR_PTR(-ENOMEM); 857 854 } 855 + 856 + rproc_coredump_set_elf_info(r5_rproc, ELFCLASS32, EM_ARM); 858 857 859 858 r5_rproc->auto_boot = false; 860 859 r5_core = r5_rproc->priv;