Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Iuliana Prodan and committed by
Mathieu Poirier
11bb42a9 fe15c26e

+30 -2
+30 -2
drivers/remoteproc/imx_dsp_rproc.c
··· 28 28 29 29 #define DSP_RPROC_CLK_MAX 5 30 30 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 + 31 39 #define REMOTE_IS_READY BIT(0) 32 40 #define REMOTE_READY_WAIT_MAX_RETRIES 500 33 41 ··· 179 171 { 0x0c000000, 0x80000000, 0x10000000, 0}, 180 172 { 0x30000000, 0x90000000, 0x10000000, 0}, 181 173 }; 174 + 175 + /* Initialize the mailboxes between cores, if exists */ 176 + static int (*imx_dsp_rproc_mbox_init)(struct imx_dsp_rproc *priv); 182 177 183 178 /* Reset function for DSP on i.MX8MP */ 184 179 static int imx8mp_dsp_reset(struct imx_dsp_rproc *priv) ··· 503 492 } 504 493 505 494 /** 506 - * imx_dsp_rproc_mbox_init() - request mailbox channels 495 + * imx_dsp_rproc_mbox_alloc() - request mailbox channels 507 496 * @priv: private data pointer 508 497 * 509 498 * Request three mailbox channels (tx, rx, rxdb). 510 499 */ 511 - static int imx_dsp_rproc_mbox_init(struct imx_dsp_rproc *priv) 500 + static int imx_dsp_rproc_mbox_alloc(struct imx_dsp_rproc *priv) 512 501 { 513 502 struct device *dev = priv->rproc->dev.parent; 514 503 struct mbox_client *cl; ··· 569 558 mbox_free_channel(priv->rxdb_ch); 570 559 571 560 return ret; 561 + } 562 + 563 + /* 564 + * imx_dsp_rproc_mbox_no_alloc() 565 + * 566 + * Empty function for no mailbox between cores 567 + * 568 + * Always return 0 569 + */ 570 + static int imx_dsp_rproc_mbox_no_alloc(struct imx_dsp_rproc *priv) 571 + { 572 + return 0; 572 573 } 573 574 574 575 static void imx_dsp_rproc_free_mbox(struct imx_dsp_rproc *priv) ··· 925 902 priv = rproc->priv; 926 903 priv->rproc = rproc; 927 904 priv->dsp_dcfg = dsp_dcfg; 905 + 906 + if (no_mailboxes) 907 + imx_dsp_rproc_mbox_init = imx_dsp_rproc_mbox_no_alloc; 908 + else 909 + imx_dsp_rproc_mbox_init = imx_dsp_rproc_mbox_alloc; 928 910 929 911 dev_set_drvdata(dev, rproc); 930 912