Commit 9afeefcf authored by Suman Anna's avatar Suman Anna Committed by Bjorn Andersson

remoteproc: pru: Fix firmware loading crashes on K3 SoCs

The K3 PRUs are 32-bit processors and in general have some limitations
in using the standard ARMv8 memcpy function for loading firmware segments,
so the driver already uses a custom memcpy implementation. This added
logic however is limited to only IRAMs at the moment, but the loading
into Data RAMs is not completely ok either and does generate a kernel
crash for unaligned accesses.

Fix these crashes by removing the existing IRAM logic limitation and
extending the custom memcpy usage to Data RAMs as well for all K3 SoCs.

Fixes: 1d39f4d1 ("remoteproc: pru: Add support for various PRU cores on K3 AM65x SoCs")
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20210315205859.19590-1-s-anna@ti.comSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent e6d9423d
...@@ -603,7 +603,7 @@ pru_rproc_load_elf_segments(struct rproc *rproc, const struct firmware *fw) ...@@ -603,7 +603,7 @@ pru_rproc_load_elf_segments(struct rproc *rproc, const struct firmware *fw)
break; break;
} }
if (pru->data->is_k3 && is_iram) { if (pru->data->is_k3) {
ret = pru_rproc_memcpy(ptr, elf_data + phdr->p_offset, ret = pru_rproc_memcpy(ptr, elf_data + phdr->p_offset,
filesz); filesz);
if (ret) { if (ret) {
......
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