Skip to content

Commit 11bb42a

Browse files
iuliana-prodanmathieupoirier
authored andcommitted
remoteproc: imx_dsp_rproc: Add module parameter to ignore ready flag from remote processor
There are cases when we want to test a simple "hello world" application on the DSP and we don't have IPC between the cores. Therefore, do not wait for a confirmation from the remote processor at start. Added "no_mailboxes" flag while inserting the module to not initialize any mailboxes, and so ignore remote processor reply after start. By default, this is off - do not ignore reply from rproc. Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20230217094124.9440-1-iuliana.prodan@oss.nxp.com [Fixed checkpatch warning] Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent fe15c26 commit 11bb42a

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

drivers/remoteproc/imx_dsp_rproc.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828

2929
#define DSP_RPROC_CLK_MAX 5
3030

31+
/*
32+
* Module parameters
33+
*/
34+
static unsigned int no_mailboxes;
35+
module_param_named(no_mailboxes, no_mailboxes, int, 0644);
36+
MODULE_PARM_DESC(no_mailboxes,
37+
"There is no mailbox between cores, so ignore remote proc reply after start, default is 0 (off).");
38+
3139
#define REMOTE_IS_READY BIT(0)
3240
#define REMOTE_READY_WAIT_MAX_RETRIES 500
3341

@@ -172,6 +180,9 @@ static const struct imx_rproc_att imx_dsp_rproc_att_imx8ulp[] = {
172180
{ 0x30000000, 0x90000000, 0x10000000, 0},
173181
};
174182

183+
/* Initialize the mailboxes between cores, if exists */
184+
static int (*imx_dsp_rproc_mbox_init)(struct imx_dsp_rproc *priv);
185+
175186
/* Reset function for DSP on i.MX8MP */
176187
static int imx8mp_dsp_reset(struct imx_dsp_rproc *priv)
177188
{
@@ -492,12 +503,12 @@ static void imx_dsp_rproc_rxdb_callback(struct mbox_client *cl, void *data)
492503
}
493504

494505
/**
495-
* imx_dsp_rproc_mbox_init() - request mailbox channels
506+
* imx_dsp_rproc_mbox_alloc() - request mailbox channels
496507
* @priv: private data pointer
497508
*
498509
* Request three mailbox channels (tx, rx, rxdb).
499510
*/
500-
static int imx_dsp_rproc_mbox_init(struct imx_dsp_rproc *priv)
511+
static int imx_dsp_rproc_mbox_alloc(struct imx_dsp_rproc *priv)
501512
{
502513
struct device *dev = priv->rproc->dev.parent;
503514
struct mbox_client *cl;
@@ -560,6 +571,18 @@ static int imx_dsp_rproc_mbox_init(struct imx_dsp_rproc *priv)
560571
return ret;
561572
}
562573

574+
/*
575+
* imx_dsp_rproc_mbox_no_alloc()
576+
*
577+
* Empty function for no mailbox between cores
578+
*
579+
* Always return 0
580+
*/
581+
static int imx_dsp_rproc_mbox_no_alloc(struct imx_dsp_rproc *priv)
582+
{
583+
return 0;
584+
}
585+
563586
static void imx_dsp_rproc_free_mbox(struct imx_dsp_rproc *priv)
564587
{
565588
mbox_free_channel(priv->tx_ch);
@@ -903,6 +926,11 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev)
903926
priv->rproc = rproc;
904927
priv->dsp_dcfg = dsp_dcfg;
905928

929+
if (no_mailboxes)
930+
imx_dsp_rproc_mbox_init = imx_dsp_rproc_mbox_no_alloc;
931+
else
932+
imx_dsp_rproc_mbox_init = imx_dsp_rproc_mbox_alloc;
933+
906934
dev_set_drvdata(dev, rproc);
907935

908936
INIT_WORK(&priv->rproc_work, imx_dsp_rproc_vq_work);

0 commit comments

Comments
 (0)