[PATCH v2 3/5] drivers: remoteproc: imx: add autoboot support for A-core remoteproc

Jiafei Pan
2026-04-29T03:08:30Z

From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

Add autoboot support for Cortex-A Core remoteproc.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
---
drivers/remoteproc/imx_rproc.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 8a3de27c96b7..e8d239bef5c9 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -1286,7 +1286,24 @@ static int imx_rproc_sm_detect_mode(struct rproc *rproc)

static int imx_rproc_psci_detect_mode(struct rproc *rproc)
{
- rproc->state = RPROC_OFFLINE;
+ struct imx_rproc *priv = rproc->priv;
+ unsigned int cpu;
+ int cpu_aff;
+
+ rproc->state = RPROC_DETACHED;
+ for_each_cpu(cpu, &priv->cpus) {
+ cpu_aff = psci_ops.affinity_info(cpu_logical_map(cpu), 0);
+ if (cpu_aff == PSCI_0_2_AFFINITY_LEVEL_OFF) {
+ rproc->state = RPROC_OFFLINE;
+ break;
+ }
+
+ /* in psci on state but running Linux */
+ if (cpu_online(cpu)) {
+ rproc->state = RPROC_OFFLINE;
+ break;
+ }
+ }

return 0;
}
@@ -1391,7 +1408,6 @@ static int imx_rproc_probe(struct platform_device *pdev)
bitmap_copy(cpumask_bits(&priv->cpus), &cpus_bits,
min((unsigned int)nr_cpumask_bits,
(unsigned int)sizeof(unsigned long)));
- rproc->auto_boot = false;
}

ret = imx_rproc_detect_mode(priv);
--
2.43.0