public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Philippe Schenker <dev@pschenker.ch>
To: u-boot@lists.denx.de
Cc: stefan@embear.ch,
	Philippe Schenker <philippe.schenker@impulsing.ch>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Beleswar Padhi <b-padhi@ti.com>,
	Daniel Schultz <d.schultz@phytec.de>,
	Hari Nagalla <hnagalla@ti.com>, Tom Rini <trini@konsulko.com>
Subject: [PATCH v1 6/6] remoteproc: k3-r5: Implement is_running operation
Date: Thu, 23 Oct 2025 11:46:24 +0200	[thread overview]
Message-ID: <20251023094631.16742-7-dev@pschenker.ch> (raw)
In-Reply-To: <20251023094631.16742-1-dev@pschenker.ch>

From: Philippe Schenker <philippe.schenker@impulsing.ch>

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 <philippe.schenker@impulsing.ch>

---

 drivers/remoteproc/ti_k3_r5f_rproc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/remoteproc/ti_k3_r5f_rproc.c b/drivers/remoteproc/ti_k3_r5f_rproc.c
index 40163e992da8..a2d3b817e406 100644
--- a/drivers/remoteproc/ti_k3_r5f_rproc.c
+++ b/drivers/remoteproc/ti_k3_r5f_rproc.c
@@ -570,6 +570,22 @@ static void *k3_r5f_da_to_va(struct udevice *dev, ulong da, ulong size)
 	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;
@@ -587,6 +603,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)
-- 
2.51.1


  parent reply	other threads:[~2025-10-23  9:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23  9:46 [PATCH v1 0/6] remoteproc: k3-r5: Build fixes and security improvements Philippe Schenker
2025-10-23  9:46 ` [PATCH v1 1/6] arm: dts: k3-am642-evm: Remove duplicate node Philippe Schenker
2025-10-23  9:46 ` [PATCH v1 2/6] remoteproc: k3-r5: cast size to size_t Philippe Schenker
2025-10-23 14:22   ` Andrew Davis
2025-10-23  9:46 ` [PATCH v1 3/6] soc: ti: pruss: Fix size ptr type in probe Philippe Schenker
2025-10-23  9:46 ` [PATCH v1 4/6] mach-k3: security: Propagate verified image addr Philippe Schenker
2025-10-23 14:24   ` Andrew Davis
2025-11-06 12:33     ` Philippe Schenker
2025-10-23  9:46 ` [PATCH v1 5/6] remoteproc: k3-r5: Use verified image address Philippe Schenker
2025-10-23  9:46 ` Philippe Schenker [this message]
2025-11-06 19:35 ` [PATCH v1 0/6] remoteproc: k3-r5: Build fixes and security improvements Tom Rini
2025-11-07  8:21   ` Philippe Schenker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251023094631.16742-7-dev@pschenker.ch \
    --to=dev@pschenker.ch \
    --cc=andrew.goodbody@linaro.org \
    --cc=b-padhi@ti.com \
    --cc=d.schultz@phytec.de \
    --cc=hnagalla@ti.com \
    --cc=philippe.schenker@impulsing.ch \
    --cc=stefan@embear.ch \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox