summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2026-08-11 00:35:05 +0200
committerTom Rini <[email protected]>2026-08-20 12:15:11 -0600
commit31bf91b6a44bad0d9bdae28f97a3192c51601b87 (patch)
treedce941d29c102cb34b2ced60d97d931b3a0b6a39
parente377488e85d13d315bea2b6113dfbe9773fb4771 (diff)
remoteproc: renesas: rsip: Reset SCP core on stop
Use SCP core init code, which resets the SCP core, as a SCP core stop. Once stop is invoked, the SCP core is reset and ready to be loaded with new software, which is practical for SCP firmware development. Signed-off-by: Marek Vasut <[email protected]>
-rw-r--r--drivers/remoteproc/renesas_rsip.c79
1 files changed, 39 insertions, 40 deletions
diff --git a/drivers/remoteproc/renesas_rsip.c b/drivers/remoteproc/renesas_rsip.c
index cbf999e88f2..96f3bf77eb8 100644
--- a/drivers/remoteproc/renesas_rsip.c
+++ b/drivers/remoteproc/renesas_rsip.c
@@ -170,6 +170,42 @@ static int renesas_rsip_rproc_load(struct udevice *dev, ulong addr, ulong size)
}
/**
+ * renesas_rsip_rproc_init() - Initialize the remote processor
+ * @dev: corresponding remote processor device
+ *
+ * Return: 0 if all went ok, else corresponding -ve error
+ */
+static int renesas_rsip_rproc_init(struct udevice *dev)
+{
+ struct renesas_rsip_rproc_privdata *priv = dev_get_priv(dev);
+ struct reset_ctl *rst = dev_get_priv(dev->parent);
+ u32 addr;
+
+ if (priv->core_id != 0) /* No init for non-SCP cores */
+ return 0;
+
+ /*
+ * Put SCP into reset, configure SCP entry point address and systick
+ * timer, release SCP from reset, and zero out SCP STCM regions.
+ */
+ reset_assert(rst);
+
+ writel(SCP_STCM, SCP_CFGVECTABLE);
+ writel(SCP_CFGNSSTCALIB_13_3MHZ, SCP_CFGNSSTCALIB);
+ setbits_le32(SCP_CPUWAIT, SCP_CPUWAIT_WAIT);
+
+ reset_deassert(rst);
+
+ /* Fill zero to SCP STCM regions 0 ... 27 */
+ for (addr = SCP_STCM; addr < 0xc1061b00; addr += 8)
+ writeq(0, addr);
+
+ asm volatile("dsb sy");
+
+ return 0;
+}
+
+/**
* renesas_rsip_rproc_start() - Start the remote processor
* @dev: corresponding remote processor device
*
@@ -211,9 +247,9 @@ static int renesas_rsip_rproc_stop(struct udevice *dev)
{
struct renesas_rsip_rproc_privdata *priv = dev_get_priv(dev);
- if (priv->core_id == 0) { /* SCP */
- setbits_le32(SCP_CPUWAIT, SCP_CPUWAIT_WAIT);
- return 0;
+ if (priv->core_id == 0) {
+ /* SCP */
+ return renesas_rsip_rproc_init(dev);
}
return 0;
@@ -245,43 +281,6 @@ static int renesas_rsip_rproc_is_running(struct udevice *dev)
}
/**
- * renesas_rsip_rproc_init() - Initialize the remote processor
- * @dev: corresponding remote processor device
- *
- * Return: 0 if all went ok, else corresponding -ve error
- */
-static int renesas_rsip_rproc_init(struct udevice *dev)
-{
- struct renesas_rsip_rproc_privdata *priv = dev_get_priv(dev);
- struct reset_ctl *rst = dev_get_priv(dev->parent);
- u32 addr;
-
- if (priv->core_id != 0) /* No init for non-SCP cores */
- return 0;
-
- /*
- * Put SCP into reset, configure SCP entry point address and systick
- * timer, release SCP from reset, and zero out SCP STCM regions.
- */
-
- reset_assert(rst);
-
- writel(SCP_STCM, SCP_CFGVECTABLE);
- writel(SCP_CFGNSSTCALIB_13_3MHZ, SCP_CFGNSSTCALIB);
- setbits_le32(SCP_CPUWAIT, SCP_CPUWAIT_WAIT);
-
- reset_deassert(rst);
-
- /* Fill zero to SCP STCM regions 0 ... 27 */
- for (addr = SCP_STCM; addr < 0xc1061b00; addr += 8)
- writeq(0, addr);
-
- asm volatile("dsb sy");
-
- return 0;
-}
-
-/**
* renesas_rsip_rproc_device_to_virt() - Convert device address to virtual address
* @dev: corresponding remote processor device
* @da: device address