aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUdit Kumar <u-kumar1@ti.com>2023-11-25 23:59:39 +0530
committerTom Rini <trini@konsulko.com>2023-12-19 10:07:48 -0500
commit34fc1861239f1c6b92252359127eb3b74ca792a5 (patch)
tree145859dc975836eb9618e84e0610ca0de179c5d1
parentc86c1d0383e56e4ac08bf21227a2fdd0af167e4b (diff)
downloadu-boot-34fc1861239f1c6b92252359127eb3b74ca792a5.zip
u-boot-34fc1861239f1c6b92252359127eb3b74ca792a5.tar.gz
u-boot-34fc1861239f1c6b92252359127eb3b74ca792a5.tar.bz2
remoteproc: k3-dsp: Avoid reloading of firmware
DSP core is going into abnormal state when load callback is called after starting of DSP core. Reload of firmware needs core to be stopped first, followed by load. So avoid loading of firmware, when core is started. Signed-off-by: Udit Kumar <u-kumar1@ti.com>
-rw-r--r--drivers/remoteproc/ti_k3_dsp_rproc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/remoteproc/ti_k3_dsp_rproc.c b/drivers/remoteproc/ti_k3_dsp_rproc.c
index 576de4b..1c6515f 100644
--- a/drivers/remoteproc/ti_k3_dsp_rproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_rproc.c
@@ -56,6 +56,7 @@ struct k3_dsp_boot_data {
* @data: Pointer to DSP specific boot data structure
* @mem: Array of available memories
* @num_mem: Number of available memories
+ * @in_use: flag to tell if the core is already in use.
*/
struct k3_dsp_privdata {
struct reset_ctl dsp_rst;
@@ -63,6 +64,7 @@ struct k3_dsp_privdata {
struct k3_dsp_boot_data *data;
struct k3_dsp_mem *mem;
int num_mems;
+ bool in_use;
};
/*
@@ -128,6 +130,13 @@ static int k3_dsp_load(struct udevice *dev, ulong addr, ulong size)
u32 boot_vector;
int ret;
+ if (dsp->in_use) {
+ dev_err(dev,
+ "Invalid op: Trying to load/start on already running core %d\n",
+ dsp->tsp.proc_id);
+ return -EINVAL;
+ }
+
dev_dbg(dev, "%s addr = 0x%lx, size = 0x%lx\n", __func__, addr, size);
ret = ti_sci_proc_request(&dsp->tsp);
if (ret)
@@ -195,6 +204,7 @@ static int k3_dsp_start(struct udevice *dev)
ti_sci_proc_power_domain_off(&dsp->tsp);
}
+ dsp->in_use = true;
proc_release:
ti_sci_proc_release(&dsp->tsp);
@@ -207,6 +217,7 @@ static int k3_dsp_stop(struct udevice *dev)
dev_dbg(dev, "%s\n", __func__);
+ dsp->in_use = false;
ti_sci_proc_request(&dsp->tsp);
reset_assert(&dsp->dsp_rst);
ti_sci_proc_power_domain_off(&dsp->tsp);