MLK-23754-5 remoteproc: add support to skip firmware load when recovery

Remote processor such as M4 inside i.MX8QXP is not handled by Linux
when it is configured to run inside its own hardware partition by
system control unit(SCU). So even remote processor crash reset, it is
handled by SCU, not linux. To such case, firmware load should be
ignored, So need skip_fw_load when m4 reboot itself.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan 2020-02-19 15:27:39 +08:00
parent 44ff0e88bf
commit eb225e1d92
1 changed files with 11 additions and 8 deletions

View File

@ -1679,20 +1679,23 @@ int rproc_trigger_recovery(struct rproc *rproc)
if (ret)
goto unlock_mutex;
/* generate coredump */
rproc_coredump(rproc);
if (!rproc->skip_fw_load) {
/* generate coredump */
rproc_coredump(rproc);
/* load firmware */
ret = request_firmware(&firmware_p, rproc->firmware, dev);
if (ret < 0) {
dev_err(dev, "request_firmware failed: %d\n", ret);
goto unlock_mutex;
/* load firmware */
ret = request_firmware(&firmware_p, rproc->firmware, dev);
if (ret < 0) {
dev_err(dev, "request_firmware failed: %d\n", ret);
goto unlock_mutex;
}
}
/* boot the remote processor up again */
ret = rproc_start(rproc, firmware_p);
release_firmware(firmware_p);
if (!rproc->skip_fw_load)
release_firmware(firmware_p);
unlock_mutex:
mutex_unlock(&rproc->lock);