U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: scmi: smt: Interrupt communication enable
@ 2025-04-01  7:56 Alice Guo (OSS)
  2025-04-01 12:05 ` Marek Vasut
  2025-04-11 14:17 ` Fabio Estevam
  0 siblings, 2 replies; 3+ messages in thread
From: Alice Guo (OSS) @ 2025-04-01  7:56 UTC (permalink / raw)
  To: marex, trini, festevam, sbabic, sjg, seanga2, lukma,
	alpernebiyasak
  Cc: u-boot, peng.fan, viorel.suman, ye.li

From: Viorel Suman <viorel.suman@nxp.com>

i.MX95 System Manager uses interrupt driven communication which requires
the caller to set Bit[0] of channel flags to 1. When transmission
completes and the previous general purpose interrupt has been processed
by the other core, i.MX95 System Manager will set General Purpose
Interrupt Control Register (GCR). U-Boot polls General-purpose Status
(GSR) to check if the operation is finished.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
---
 drivers/firmware/scmi/smt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/firmware/scmi/smt.c b/drivers/firmware/scmi/smt.c
index 67d2f450024..3253f4211d6 100644
--- a/drivers/firmware/scmi/smt.c
+++ b/drivers/firmware/scmi/smt.c
@@ -20,6 +20,16 @@
 
 #include "smt.h"
 
+static void scmi_smt_enable_intr(struct scmi_smt *smt, bool enable)
+{
+	struct scmi_smt_header *hdr = (void *)smt->buf;
+
+	if (enable)
+		hdr->flags |= SCMI_SHMEM_FLAG_INTR_ENABLED;
+	else
+		hdr->flags &= ~SCMI_SHMEM_FLAG_INTR_ENABLED;
+}
+
 /**
  * Get shared memory configuration defined by the referred DT phandle
  * Return with a errno compliant value.
@@ -48,6 +58,9 @@ int scmi_dt_get_smt_buffer(struct udevice *dev, struct scmi_smt *smt)
 	if (!smt->buf)
 		return -ENOMEM;
 
+	if (device_is_compatible(dev, "arm,scmi") && ofnode_has_property(dev_ofnode(dev), "mboxes"))
+		scmi_smt_enable_intr(smt, true);
+
 #ifdef CONFIG_ARM
 	if (dcache_status())
 		mmu_set_region_dcache_behaviour(ALIGN_DOWN((uintptr_t)smt->buf, MMU_SECTION_SIZE),
-- 
2.43.0


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

* Re: [PATCH] firmware: scmi: smt: Interrupt communication enable
  2025-04-01  7:56 [PATCH] firmware: scmi: smt: Interrupt communication enable Alice Guo (OSS)
@ 2025-04-01 12:05 ` Marek Vasut
  2025-04-11 14:17 ` Fabio Estevam
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2025-04-01 12:05 UTC (permalink / raw)
  To: Alice Guo (OSS), trini, festevam, sbabic, sjg, seanga2, lukma,
	alpernebiyasak
  Cc: u-boot, peng.fan, viorel.suman, ye.li

On 4/1/25 9:56 AM, Alice Guo (OSS) wrote:
> From: Viorel Suman <viorel.suman@nxp.com>
> 
> i.MX95 System Manager uses interrupt driven communication which requires
> the caller to set Bit[0] of channel flags to 1. When transmission
> completes and the previous general purpose interrupt has been processed
> by the other core, i.MX95 System Manager will set General Purpose
> Interrupt Control Register (GCR). U-Boot polls General-purpose Status
> (GSR) to check if the operation is finished.
> 
> Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>

Thank you !

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

* Re: [PATCH] firmware: scmi: smt: Interrupt communication enable
  2025-04-01  7:56 [PATCH] firmware: scmi: smt: Interrupt communication enable Alice Guo (OSS)
  2025-04-01 12:05 ` Marek Vasut
@ 2025-04-11 14:17 ` Fabio Estevam
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2025-04-11 14:17 UTC (permalink / raw)
  To: Alice Guo (OSS)
  Cc: marex, trini, sbabic, sjg, seanga2, lukma, alpernebiyasak, u-boot,
	peng.fan, viorel.suman, ye.li

On Tue, Apr 1, 2025 at 4:57 AM Alice Guo (OSS) <alice.guo@oss.nxp.com> wrote:
>
> From: Viorel Suman <viorel.suman@nxp.com>
>
> i.MX95 System Manager uses interrupt driven communication which requires
> the caller to set Bit[0] of channel flags to 1. When transmission
> completes and the previous general purpose interrupt has been processed
> by the other core, i.MX95 System Manager will set General Purpose
> Interrupt Control Register (GCR). U-Boot polls General-purpose Status
> (GSR) to check if the operation is finished.
>
> Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> Reviewed-by: Ye Li <ye.li@nxp.com>

Applied, thanks.

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

end of thread, other threads:[~2025-04-11 14:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01  7:56 [PATCH] firmware: scmi: smt: Interrupt communication enable Alice Guo (OSS)
2025-04-01 12:05 ` Marek Vasut
2025-04-11 14:17 ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox