diff options
| author | Philippe Schenker <[email protected]> | 2025-11-11 08:16:30 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-18 12:50:05 -0600 |
| commit | 0c192f52cfb8a4b1c29d61750f48e016ba6b978b (patch) | |
| tree | daebf9d1b9cc27e9db308c67ef3dea8581d40a90 /drivers | |
| parent | 3a43fc9016c3c37eefca10ed404c95ac7cecd3dc (diff) | |
remoteproc: k3-r5: Implement is_running operation
Add is_running callback to query the R5F core halt status via the
TI-SCI processor control API. This allows the remoteproc framework
to determine whether the R5F core is currently runnin.
The core is considered running when the PROC_BOOT_CTRL_FLAG_R5_CORE_HALT
bit is not set in the control flags.
Signed-off-by: Philippe Schenker <[email protected]>
Reviewed-by: Andrew Davis <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/remoteproc/ti_k3_r5f_rproc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/remoteproc/ti_k3_r5f_rproc.c b/drivers/remoteproc/ti_k3_r5f_rproc.c index c6356729e9d..7326f5a4b30 100644 --- a/drivers/remoteproc/ti_k3_r5f_rproc.c +++ b/drivers/remoteproc/ti_k3_r5f_rproc.c @@ -573,6 +573,22 @@ static void *k3_r5f_da_to_va(struct udevice *dev, ulong da, ulong size, bool *is return map_physmem(da, size, MAP_NOCACHE); } +static int k3_r5f_is_running(struct udevice *dev) +{ + struct k3_r5f_core *core = dev_get_priv(dev); + u32 cfg, ctrl, sts; + u64 boot_vec; + int ret; + + dev_dbg(dev, "%s\n", __func__); + + ret = ti_sci_proc_get_status(&core->tsp, &boot_vec, &cfg, &ctrl, &sts); + if (ret) + return -1; + + return !!(ctrl & PROC_BOOT_CTRL_FLAG_R5_CORE_HALT); +} + static int k3_r5f_init(struct udevice *dev) { return 0; @@ -590,6 +606,7 @@ static const struct dm_rproc_ops k3_r5f_rproc_ops = { .stop = k3_r5f_stop, .load = k3_r5f_load, .device_to_virt = k3_r5f_da_to_va, + .is_running = k3_r5f_is_running, }; static int k3_r5f_rproc_configure(struct k3_r5f_core *core) |
