LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/3] mailbox/firmware: imx: support SCU channel type
@ 2020-02-24 12:14 peng.fan
  2020-02-24 12:14 ` [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property peng.fan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: peng.fan @ 2020-02-24 12:14 UTC (permalink / raw)
  To: shawnguo, s.hauer, jassisinghbrar, leonard.crestez, o.rempel
  Cc: kernel, festevam, linux-imx, m.felsch, hongxing.zhu,
	aisheng.dong, devicetree, linux-kernel, linux-arm-kernel,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Sorry to bind the mailbox/firmware patch together. This is make it
to understand what changed to support using 1 TX and 1 RX channel
for SCFW message.

Per i.MX8QXP Reference mannual, there are several message using
examples. One of them is:
Passing short messages: Transmit register(s) can be used to pass
short messages from one to four words in length. For example,
when a four-word message is desired, only one of the registers
needs to have its corresponding interrupt enable bit set at the
receiver side.

This patchset is to using this for SCFW message to replace four TX
and four RX method.

Pachset based on i.MX Shawn's for-next branch, commit fd7eba9fa1f534b710.

To test this patchset, I applied the below diff:
 diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
 index fb5f752b15fe..c5636624726e 100644
 --- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
 +++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi
 @@ -140,17 +140,11 @@
 
         scu {
                 compatible = "fsl,imx-scu";
 -               mbox-names = "tx0", "tx1", "tx2", "tx3",
 -                            "rx0", "rx1", "rx2", "rx3",
 +               mbox-names = "tx0",
 +                            "rx0",
                              "gip3";
                 mboxes = <&lsio_mu1 0 0
 -                         &lsio_mu1 0 1
 -                         &lsio_mu1 0 2
 -                         &lsio_mu1 0 3
                           &lsio_mu1 1 0
 -                         &lsio_mu1 1 1
 -                         &lsio_mu1 1 2
 -                         &lsio_mu1 1 3
                           &lsio_mu1 3 3>;
 
                 clk: clock-controller {
 @@ -546,6 +540,7 @@
                         reg = <0x5d1c0000 0x10000>;
                         interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>;
                         #mbox-cells = <2>;
 +                       fsl,scu;
                 };
 
                 lsio_mu2: mailbox@5d1d0000 {


Peng Fan (3):
  dt-bindings: mailbox: imx-mu: add fsl,scu property
  mailbox: imx: support SCU channel type
  firmware: imx-scu: Support one TX and one RX

 .../devicetree/bindings/mailbox/fsl,mu.txt         |  1 +
 drivers/firmware/imx/imx-scu.c                     | 54 +++++++++++++++++-----
 drivers/mailbox/imx-mailbox.c                      | 42 +++++++++++++++--
 3 files changed, 82 insertions(+), 15 deletions(-)


base-commit: fd7eba9fa1f534b7102f4762e25c991f78ec283d
-- 
2.16.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
  2020-02-24 12:14 [PATCH 0/3] mailbox/firmware: imx: support SCU channel type peng.fan
@ 2020-02-24 12:14 ` peng.fan
  2020-02-24 13:06   ` Oleksij Rempel
  2020-02-28 15:13   ` Rob Herring
  2020-02-24 12:14 ` [PATCH 2/3] mailbox: imx: support SCU channel type peng.fan
  2020-02-24 12:14 ` [PATCH 3/3] firmware: imx-scu: Support one TX and one RX peng.fan
  2 siblings, 2 replies; 8+ messages in thread
From: peng.fan @ 2020-02-24 12:14 UTC (permalink / raw)
  To: shawnguo, s.hauer, jassisinghbrar, leonard.crestez, o.rempel
  Cc: kernel, festevam, linux-imx, m.felsch, hongxing.zhu,
	aisheng.dong, devicetree, linux-kernel, linux-arm-kernel,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add fsl,scu property, this needs to be enabled for SCU channel type.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Documentation/devicetree/bindings/mailbox/fsl,mu.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
index 9c43357c5924..5b502bcf7122 100644
--- a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
+++ b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
@@ -45,6 +45,7 @@ Optional properties:
 -------------------
 - clocks :	phandle to the input clock.
 - fsl,mu-side-b : Should be set for side B MU.
+- fsl,scu: Support i.MX8/8X SCU channel type
 
 Examples:
 --------
-- 
2.16.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/3] mailbox: imx: support SCU channel type
  2020-02-24 12:14 [PATCH 0/3] mailbox/firmware: imx: support SCU channel type peng.fan
  2020-02-24 12:14 ` [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property peng.fan
@ 2020-02-24 12:14 ` peng.fan
  2020-02-24 12:14 ` [PATCH 3/3] firmware: imx-scu: Support one TX and one RX peng.fan
  2 siblings, 0 replies; 8+ messages in thread
From: peng.fan @ 2020-02-24 12:14 UTC (permalink / raw)
  To: shawnguo, s.hauer, jassisinghbrar, leonard.crestez, o.rempel
  Cc: kernel, festevam, linux-imx, m.felsch, hongxing.zhu,
	aisheng.dong, devicetree, linux-kernel, linux-arm-kernel,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Per i.MX8QXP Reference mannual, Chapter "12.9.2.3.2 Messaging Examples",
 Passing short messages: Transmit register(s) can be used to pass
 short messages from one to four words in length. For example, when
 a four-word message is desired, only one of the registers needs to
 have its corresponding interrupt enable bit set at the receiver side;
 the message’s first three words are written to the registers whose
 interrupt is masked, and the fourth word is written to the other
 register (which triggers an interrupt at the receiver side).

i.MX8/8X SCU firmware IPC is an implementation of passing short
messages. But current imx-mailbox driver only support one word
message, i.MX8/8X linux side firmware has to request four TX
and four RX to support IPC to SCU firmware. This is low efficent
and more interrupts triggered compared with one TX and
one RX.

To make SCU channel type work,
  - parse the size of msg.
  - Only enable TR0/RR0 interrupt for transmit/receive message.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/mailbox/imx-mailbox.c | 42 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 4 deletions(-)

diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index 2cdcdc5f1119..7d9aafff5f6d 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -4,6 +4,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/firmware/imx/ipc.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -65,8 +66,14 @@ struct imx_mu_priv {
 	int			irq;
 
 	bool			side_b;
+	bool			scu;
 };
 
+struct imx_sc_rpc_msg_max {
+	struct imx_sc_rpc_msg hdr;
+	u32 data[7];
+} __packed __aligned(4);;
+
 static const struct imx_mu_dcfg imx_mu_cfg_imx6sx = {
 	.xTR	= {0x0, 0x4, 0x8, 0xc},
 	.xRR	= {0x10, 0x14, 0x18, 0x1c},
@@ -123,7 +130,10 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
 	struct mbox_chan *chan = p;
 	struct imx_mu_priv *priv = to_imx_mu_priv(chan->mbox);
 	struct imx_mu_con_priv *cp = chan->con_priv;
+	struct imx_sc_rpc_msg_max msg;
+	u32 *p_msg = (u32 *)&msg;
 	u32 val, ctrl, dat;
+	int i;
 
 	ctrl = imx_mu_read(priv, priv->dcfg->xCR);
 	val = imx_mu_read(priv, priv->dcfg->xSR);
@@ -152,8 +162,19 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
 		imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx));
 		mbox_chan_txdone(chan, 0);
 	} else if (val == IMX_MU_xSR_RFn(cp->idx)) {
-		dat = imx_mu_read(priv, priv->dcfg->xRR[cp->idx]);
-		mbox_chan_received_data(chan, (void *)&dat);
+		if (!priv->scu) {
+			dat = imx_mu_read(priv, priv->dcfg->xRR[cp->idx]);
+			mbox_chan_received_data(chan, (void *)&dat);
+		} else {
+			imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(0));
+			*p_msg++ = imx_mu_read(priv, priv->dcfg->xRR[0]);
+			for (i = 1; i < msg.hdr.size; i++) {
+				*p_msg++ = imx_mu_read(priv,
+						       priv->dcfg->xRR[i % 4]);
+			}
+			imx_mu_xcr_rmw(priv, IMX_MU_xCR_RIEn(0), 0);
+			mbox_chan_received_data(chan, (void *)&msg);
+		}
 	} else if (val == IMX_MU_xSR_GIPn(cp->idx)) {
 		imx_mu_write(priv, IMX_MU_xSR_GIPn(cp->idx), priv->dcfg->xSR);
 		mbox_chan_received_data(chan, NULL);
@@ -169,11 +190,20 @@ static int imx_mu_send_data(struct mbox_chan *chan, void *data)
 {
 	struct imx_mu_priv *priv = to_imx_mu_priv(chan->mbox);
 	struct imx_mu_con_priv *cp = chan->con_priv;
+	struct imx_sc_rpc_msg_max *msg = data;
 	u32 *arg = data;
+	int i;
 
 	switch (cp->type) {
 	case IMX_MU_TYPE_TX:
-		imx_mu_write(priv, *arg, priv->dcfg->xTR[cp->idx]);
+		if (priv->scu) {
+			for (i = 0; i < msg->hdr.size; i++) {
+				imx_mu_write(priv, *arg++,
+					     priv->dcfg->xTR[i % 4]);
+			}
+		} else {
+			imx_mu_write(priv, *arg, priv->dcfg->xTR[cp->idx]);
+		}
 		imx_mu_xcr_rmw(priv, IMX_MU_xCR_TIEn(cp->idx), 0);
 		break;
 	case IMX_MU_TYPE_TXDB:
@@ -259,6 +289,7 @@ static const struct mbox_chan_ops imx_mu_ops = {
 static struct mbox_chan * imx_mu_xlate(struct mbox_controller *mbox,
 				       const struct of_phandle_args *sp)
 {
+	struct imx_mu_priv *priv = to_imx_mu_priv(mbox);
 	u32 type, idx, chan;
 
 	if (sp->args_count != 2) {
@@ -270,7 +301,9 @@ static struct mbox_chan * imx_mu_xlate(struct mbox_controller *mbox,
 	idx = sp->args[1]; /* index */
 	chan = type * 4 + idx;
 
-	if (chan >= mbox->num_chans) {
+	/* For TX/RX SCU, only one channel supported */
+	if ((chan >= mbox->num_chans) ||
+	    (priv->scu && type < 1 && idx >= 1)) {
 		dev_err(mbox->dev, "Not supported channel number: %d. (type: %d, idx: %d)\n", chan, type, idx);
 		return ERR_PTR(-EINVAL);
 	}
@@ -341,6 +374,7 @@ static int imx_mu_probe(struct platform_device *pdev)
 	}
 
 	priv->side_b = of_property_read_bool(np, "fsl,mu-side-b");
+	priv->scu = of_property_read_bool(np, "fsl,scu");
 
 	spin_lock_init(&priv->xcr_lock);
 
-- 
2.16.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/3] firmware: imx-scu: Support one TX and one RX
  2020-02-24 12:14 [PATCH 0/3] mailbox/firmware: imx: support SCU channel type peng.fan
  2020-02-24 12:14 ` [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property peng.fan
  2020-02-24 12:14 ` [PATCH 2/3] mailbox: imx: support SCU channel type peng.fan
@ 2020-02-24 12:14 ` peng.fan
  2 siblings, 0 replies; 8+ messages in thread
From: peng.fan @ 2020-02-24 12:14 UTC (permalink / raw)
  To: shawnguo, s.hauer, jassisinghbrar, leonard.crestez, o.rempel
  Cc: kernel, festevam, linux-imx, m.felsch, hongxing.zhu,
	aisheng.dong, devicetree, linux-kernel, linux-arm-kernel,
	Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Current imx-scu requires four TX and four RX to communicate with
SCU. This is low efficient and causes lots of mailbox interrupts.

With imx-mailbox driver could support one TX to use all four transmit
registers and one RX to use all four receive registers, imx-scu
could use one TX and one RX.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/imx/imx-scu.c | 54 +++++++++++++++++++++++++++++++++---------
 1 file changed, 43 insertions(+), 11 deletions(-)

diff --git a/drivers/firmware/imx/imx-scu.c b/drivers/firmware/imx/imx-scu.c
index f71eaa5bf52d..953446b3d5e5 100644
--- a/drivers/firmware/imx/imx-scu.c
+++ b/drivers/firmware/imx/imx-scu.c
@@ -38,6 +38,7 @@ struct imx_sc_ipc {
 	struct device *dev;
 	struct mutex lock;
 	struct completion done;
+	bool fast_ipc;
 
 	/* temporarily store the SCU msg */
 	u32 *msg;
@@ -115,6 +116,7 @@ static void imx_scu_rx_callback(struct mbox_client *c, void *msg)
 	struct imx_sc_ipc *sc_ipc = sc_chan->sc_ipc;
 	struct imx_sc_rpc_msg *hdr;
 	u32 *data = msg;
+	int i;
 
 	if (!sc_ipc->msg) {
 		dev_warn(sc_ipc->dev, "unexpected rx idx %d 0x%08x, ignore!\n",
@@ -122,6 +124,19 @@ static void imx_scu_rx_callback(struct mbox_client *c, void *msg)
 		return;
 	}
 
+	if (sc_ipc->fast_ipc) {
+		hdr = msg;
+		sc_ipc->rx_size = hdr->size;
+		sc_ipc->msg[0] = *data++;
+
+		for (i = 1; i < sc_ipc->rx_size; i++)
+			sc_ipc->msg[i] = *data++;
+
+		complete(&sc_ipc->done);
+
+		return;
+	}
+
 	if (sc_chan->idx == 0) {
 		hdr = msg;
 		sc_ipc->rx_size = hdr->size;
@@ -147,6 +162,7 @@ static int imx_scu_ipc_write(struct imx_sc_ipc *sc_ipc, void *msg)
 	struct imx_sc_chan *sc_chan;
 	u32 *data = msg;
 	int ret;
+	int size;
 	int i;
 
 	/* Check size */
@@ -156,7 +172,8 @@ static int imx_scu_ipc_write(struct imx_sc_ipc *sc_ipc, void *msg)
 	dev_dbg(sc_ipc->dev, "RPC SVC %u FUNC %u SIZE %u\n", hdr->svc,
 		hdr->func, hdr->size);
 
-	for (i = 0; i < hdr->size; i++) {
+	size = sc_ipc->fast_ipc ? 1 : hdr->size;
+	for (i = 0; i < size; i++) {
 		sc_chan = &sc_ipc->chans[i % 4];
 
 		/*
@@ -168,8 +185,10 @@ static int imx_scu_ipc_write(struct imx_sc_ipc *sc_ipc, void *msg)
 		 * Wait for tx_done before every send to ensure that no
 		 * queueing happens at the mailbox channel level.
 		 */
-		wait_for_completion(&sc_chan->tx_done);
-		reinit_completion(&sc_chan->tx_done);
+		if (!sc_ipc->fast_ipc) {
+			wait_for_completion(&sc_chan->tx_done);
+			reinit_completion(&sc_chan->tx_done);
+		}
 
 		ret = mbox_send_message(sc_chan->ch, &data[i]);
 		if (ret < 0)
@@ -246,6 +265,8 @@ static int imx_scu_probe(struct platform_device *pdev)
 	struct imx_sc_chan *sc_chan;
 	struct mbox_client *cl;
 	char *chan_name;
+	struct of_phandle_args args;
+	int num_channel;
 	int ret;
 	int i;
 
@@ -253,11 +274,20 @@ static int imx_scu_probe(struct platform_device *pdev)
 	if (!sc_ipc)
 		return -ENOMEM;
 
-	for (i = 0; i < SCU_MU_CHAN_NUM; i++) {
-		if (i < 4)
+	ret = of_parse_phandle_with_args(pdev->dev.of_node, "mboxes",
+					 "#mbox-cells", 0, &args);
+	if (ret)
+		return ret;
+
+	sc_ipc->fast_ipc = of_property_read_bool(args.np, "fsl,scu");
+
+	num_channel = sc_ipc->fast_ipc ? 2 : SCU_MU_CHAN_NUM;
+	for (i = 0; i < num_channel; i++) {
+		if (i < num_channel / 2)
 			chan_name = kasprintf(GFP_KERNEL, "tx%d", i);
 		else
-			chan_name = kasprintf(GFP_KERNEL, "rx%d", i - 4);
+			chan_name = kasprintf(GFP_KERNEL, "rx%d",
+					      i - num_channel / 2);
 
 		if (!chan_name)
 			return -ENOMEM;
@@ -269,13 +299,15 @@ static int imx_scu_probe(struct platform_device *pdev)
 		cl->knows_txdone = true;
 		cl->rx_callback = imx_scu_rx_callback;
 
-		/* Initial tx_done completion as "done" */
-		cl->tx_done = imx_scu_tx_done;
-		init_completion(&sc_chan->tx_done);
-		complete(&sc_chan->tx_done);
+		if (!sc_ipc->fast_ipc) {
+			/* Initial tx_done completion as "done" */
+			cl->tx_done = imx_scu_tx_done;
+			init_completion(&sc_chan->tx_done);
+			complete(&sc_chan->tx_done);
+		}
 
 		sc_chan->sc_ipc = sc_ipc;
-		sc_chan->idx = i % 4;
+		sc_chan->idx = i % (num_channel / 2);
 		sc_chan->ch = mbox_request_channel_byname(cl, chan_name);
 		if (IS_ERR(sc_chan->ch)) {
 			ret = PTR_ERR(sc_chan->ch);
-- 
2.16.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
  2020-02-24 12:14 ` [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property peng.fan
@ 2020-02-24 13:06   ` Oleksij Rempel
  2020-02-24 13:33     ` Peng Fan
  2020-02-28 15:13   ` Rob Herring
  1 sibling, 1 reply; 8+ messages in thread
From: Oleksij Rempel @ 2020-02-24 13:06 UTC (permalink / raw)
  To: peng.fan, shawnguo, s.hauer, jassisinghbrar, leonard.crestez
  Cc: aisheng.dong, devicetree, hongxing.zhu, m.felsch, linux-kernel,
	linux-imx, kernel, festevam, linux-arm-kernel

Hi Peng,

On 24.02.20 13:14, peng.fan@nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add fsl,scu property, this needs to be enabled for SCU channel type.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>   Documentation/devicetree/bindings/mailbox/fsl,mu.txt | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> index 9c43357c5924..5b502bcf7122 100644
> --- a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> +++ b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> @@ -45,6 +45,7 @@ Optional properties:
>   -------------------
>   - clocks :	phandle to the input clock.
>   - fsl,mu-side-b : Should be set for side B MU.
> +- fsl,scu: Support i.MX8/8X SCU channel type

Hm.. what you are doing is a "link aggregation" with round-robin scheduling:
https://en.wikipedia.org/wiki/Link_aggregation

I would be happy if we can define a generic mailbox property for this.

Kind regards,
Oleksij Rempel

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
  2020-02-24 13:06   ` Oleksij Rempel
@ 2020-02-24 13:33     ` Peng Fan
  0 siblings, 0 replies; 8+ messages in thread
From: Peng Fan @ 2020-02-24 13:33 UTC (permalink / raw)
  To: Oleksij Rempel, shawnguo, s.hauer, jassisinghbrar, Leonard Crestez
  Cc: Aisheng Dong, devicetree, Richard Zhu, m.felsch, linux-kernel,
	dl-linux-imx, kernel, festevam, linux-arm-kernel

Hi Oleksij,

> Subject: Re: [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
> 
> Hi Peng,
> 
> On 24.02.20 13:14, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Add fsl,scu property, this needs to be enabled for SCU channel type.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >   Documentation/devicetree/bindings/mailbox/fsl,mu.txt | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> > index 9c43357c5924..5b502bcf7122 100644
> > --- a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> > +++ b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> > @@ -45,6 +45,7 @@ Optional properties:
> >   -------------------
> >   - clocks :	phandle to the input clock.
> >   - fsl,mu-side-b : Should be set for side B MU.
> > +- fsl,scu: Support i.MX8/8X SCU channel type

From RM, one of the MU using example.
12.9.2.3.2 Messaging Examples
The following are messaging examples:
• Passing short messages: Transmit register(s) can be used to pass short messages
from one to four words in length. For example, when a four-word message is desired,
only one of the registers needs to have its corresponding interrupt enable bit set at the
receiver side; the message’s first three words are written to the registers whose
interrupt is masked, and the fourth word is written to the other register (which
triggers an interrupt at the receiver side).

So we could define flexible channel, but not restricted only one TR0 or RR0 register.

And SCFW SCU side IPC is using "Passing short messages" method.

> 
> Hm.. what you are doing is a "link aggregation" with round-robin scheduling:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wik
> ipedia.org%2Fwiki%2FLink_aggregation&amp;data=02%7C01%7Cpeng.fan%4
> 0nxp.com%7C23f8a75e19a4484159d908d7b92a6524%7C686ea1d3bc2b4c6f
> a92cd99c5c301635%7C0%7C0%7C637181464049069832&amp;sdata=yGyL3
> GwLvzkNh%2Btsl8Qc%2B5CgAtpooOocxXpUrsJ7Kg8%3D&amp;reserved=0

Due to SCFW message is not fixed length, driver has to parse the msg header
to know how many to transmit and how many to receive.

> 
> I would be happy if we can define a generic mailbox property for this.

Any suggestions? I am thinking mbox_send_message_size with an extra
size parameter from firmware client side. But not have good idea
on rx.

Thanks,
Peng.

> 
> Kind regards,
> Oleksij Rempel
> 
> --
> Pengutronix e.K.                           |
> |
> Industrial Linux Solutions                 |
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.p
> engutronix.de%2F&amp;data=02%7C01%7Cpeng.fan%40nxp.com%7C23f8a7
> 5e19a4484159d908d7b92a6524%7C686ea1d3bc2b4c6fa92cd99c5c301635%
> 7C0%7C0%7C637181464049079826&amp;sdata=1hEs2jScRBEGAS%2FrzD8i6l
> R%2FRybXu8hiq8hfQ3wDQ8I%3D&amp;reserved=0  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0
> |
> Amtsgericht Hildesheim, HRA 2686           | Fax:
> +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
  2020-02-24 12:14 ` [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property peng.fan
  2020-02-24 13:06   ` Oleksij Rempel
@ 2020-02-28 15:13   ` Rob Herring
  2020-02-29  2:09     ` Peng Fan
  1 sibling, 1 reply; 8+ messages in thread
From: Rob Herring @ 2020-02-28 15:13 UTC (permalink / raw)
  To: peng.fan
  Cc: shawnguo, s.hauer, jassisinghbrar, leonard.crestez, o.rempel,
	kernel, festevam, linux-imx, m.felsch, hongxing.zhu,
	aisheng.dong, devicetree, linux-kernel, linux-arm-kernel

On Mon, Feb 24, 2020 at 08:14:32PM +0800, peng.fan@nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Add fsl,scu property, this needs to be enabled for SCU channel type.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/mailbox/fsl,mu.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> index 9c43357c5924..5b502bcf7122 100644
> --- a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> +++ b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> @@ -45,6 +45,7 @@ Optional properties:
>  -------------------
>  - clocks :	phandle to the input clock.
>  - fsl,mu-side-b : Should be set for side B MU.
> +- fsl,scu: Support i.MX8/8X SCU channel type

What's the type for this?

Perhaps update the example.

>  
>  Examples:
>  --------
> -- 
> 2.16.4
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
  2020-02-28 15:13   ` Rob Herring
@ 2020-02-29  2:09     ` Peng Fan
  0 siblings, 0 replies; 8+ messages in thread
From: Peng Fan @ 2020-02-29  2:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: shawnguo, s.hauer, jassisinghbrar, Leonard Crestez, o.rempel,
	kernel, festevam, dl-linux-imx, m.felsch, Richard Zhu,
	Aisheng Dong, devicetree, linux-kernel, linux-arm-kernel

Hi Rob,

> Subject: Re: [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property
> 
> On Mon, Feb 24, 2020 at 08:14:32PM +0800, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Add fsl,scu property, this needs to be enabled for SCU channel type.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/mailbox/fsl,mu.txt | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> > index 9c43357c5924..5b502bcf7122 100644
> > --- a/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> > +++ b/Documentation/devicetree/bindings/mailbox/fsl,mu.txt
> > @@ -45,6 +45,7 @@ Optional properties:
> >  -------------------
> >  - clocks :	phandle to the input clock.
> >  - fsl,mu-side-b : Should be set for side B MU.
> > +- fsl,scu: Support i.MX8/8X SCU channel type
> 
> What's the type for this?
> 
> Perhaps update the example.

This patch is deprecated, please help review
https://lore.kernel.org/patchwork/patch/1200460/

Thanks,
Peng.

> 
> >
> >  Examples:
> >  --------
> > --
> > 2.16.4
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-29  2:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 12:14 [PATCH 0/3] mailbox/firmware: imx: support SCU channel type peng.fan
2020-02-24 12:14 ` [PATCH 1/3] dt-bindings: mailbox: imx-mu: add fsl,scu property peng.fan
2020-02-24 13:06   ` Oleksij Rempel
2020-02-24 13:33     ` Peng Fan
2020-02-28 15:13   ` Rob Herring
2020-02-29  2:09     ` Peng Fan
2020-02-24 12:14 ` [PATCH 2/3] mailbox: imx: support SCU channel type peng.fan
2020-02-24 12:14 ` [PATCH 3/3] firmware: imx-scu: Support one TX and one RX peng.fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).