remoteproc: k3: Refactor .start rproc ops into common driver

The k3_dsp_rproc_start() function sets the boot vector and releases the
reset on the remote processor. Whereas, the k3_m4_rproc_start() function
only needs to release the reset.

Refactor the k3_m4_rproc_start() into ti_k3_common.c as k3_rproc_start()
and align the DSP and M4 drivers to invoke this common function when
releasing the reset on the remote processor.

Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
Tested-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250513054510.3439842-28-b-padhi@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
Beleswar Padhi 2025-05-13 11:15:01 +05:30 committed by Mathieu Poirier
parent 3059abb7d3
commit f55ab2fa24
4 changed files with 19 additions and 16 deletions

View File

@ -267,5 +267,20 @@ int k3_rproc_unprepare(struct rproc *rproc)
}
EXPORT_SYMBOL_GPL(k3_rproc_unprepare);
/*
* Power up the remote processor.
*
* This function will be invoked only after the firmware for this rproc
* was loaded, parsed successfully, and all of its resource requirements
* were met. This callback is invoked only in remoteproc mode.
*/
int k3_rproc_start(struct rproc *rproc)
{
struct k3_rproc *kproc = rproc->priv;
return k3_rproc_release(kproc);
}
EXPORT_SYMBOL_GPL(k3_rproc_start);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TI K3 common Remoteproc code");

View File

@ -100,4 +100,5 @@ int k3_rproc_release(struct k3_rproc *kproc);
int k3_rproc_request_mbox(struct rproc *rproc);
int k3_rproc_prepare(struct rproc *rproc);
int k3_rproc_unprepare(struct rproc *rproc);
int k3_rproc_start(struct rproc *rproc);
#endif /* REMOTEPROC_TI_K3_COMMON_H */

View File

@ -50,7 +50,8 @@ static int k3_dsp_rproc_start(struct rproc *rproc)
if (ret)
return ret;
ret = k3_rproc_release(kproc);
/* Call the K3 common start function after doing DSP specific stuff */
ret = k3_rproc_start(rproc);
if (ret)
return ret;

View File

@ -244,20 +244,6 @@ static void k3_m4_release_tsp(void *data)
ti_sci_proc_release(tsp);
}
/*
* Power up the M4 remote processor.
*
* This function will be invoked only after the firmware for this rproc
* was loaded, parsed successfully, and all of its resource requirements
* were met. This callback is invoked only in remoteproc mode.
*/
static int k3_m4_rproc_start(struct rproc *rproc)
{
struct k3_rproc *kproc = rproc->priv;
return k3_rproc_release(kproc);
}
/*
* Stop the M4 remote processor.
*
@ -298,7 +284,7 @@ static int k3_m4_rproc_detach(struct rproc *rproc)
static const struct rproc_ops k3_m4_rproc_ops = {
.prepare = k3_rproc_prepare,
.unprepare = k3_rproc_unprepare,
.start = k3_m4_rproc_start,
.start = k3_rproc_start,
.stop = k3_m4_rproc_stop,
.attach = k3_m4_rproc_attach,
.detach = k3_m4_rproc_detach,