Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mailbox: add support for clients to request channels by arguments
@ 2024-12-19 13:07 Tudor Ambarus
  2024-12-19 13:07 ` [PATCH 1/2] dt-bindings: mailbox: add support for referencing controllers solely by node Tudor Ambarus
  2024-12-19 13:07 ` [PATCH 2/2] mailbox: add support for clients to request channels by arguments Tudor Ambarus
  0 siblings, 2 replies; 8+ messages in thread
From: Tudor Ambarus @ 2024-12-19 13:07 UTC (permalink / raw)
  To: Jassi Brar, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-kernel, devicetree, linux-samsung-soc, linux-arm-kernel,
	andre.draszik, peter.griffin, kernel-team, willmcvicker,
	daniel.lezcano, vincent.guittot, ulf.hansson, arnd, Tudor Ambarus

There are clients that can discover channel identifiers at runtime by
parsing a shared memory for example, as in the ACPM interface's case.
For such cases passing the channel identifiers via DT is redundant.

Supply a new framework API: mbox_request_channel_by_args().

It works by supplying the usual client pointer as the first argument and
a pointer to a ``const struct mbox_xlate_args`` as a second. The newly
introduced struct is modeled after ``struct of_phandle_args``. The API
will search the client's node for a ``mbox`` phandle, identify the
controller's device node, and then call that controller's xlate() method
that will return a pointer to a mbox_chan or a ERR_PTR. The binding
between the channel and the client is done in the typical way.

This allows clients to reference the controller node as following:
        firmware {
                acpm_ipc: power-management {
                        compatible = "google,gs101-acpm-ipc";
-                       mboxes = <&ap2apm_mailbox 0 0
-                                 &ap2apm_mailbox 0 1
-                                 &ap2apm_mailbox 0 2
-                                 &ap2apm_mailbox 0 3
-                                 &ap2apm_mailbox 0 4
-                                 &ap2apm_mailbox 0 5
-                                 &ap2apm_mailbox 0 6
-                                 &ap2apm_mailbox 0 7
-                                 &ap2apm_mailbox 0 8
-                                 &ap2apm_mailbox 0 9
-                                 &ap2apm_mailbox 0 10
-                                 &ap2apm_mailbox 0 11
-                                 &ap2apm_mailbox 0 12
-                                 &ap2apm_mailbox 0 13
-                                 &ap2apm_mailbox 0 14>;
+                       mbox = <&ap2apm_mailbox>;
                        shmem = <&apm_sram>;
                };
        };

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
Tudor Ambarus (2):
      dt-bindings: mailbox: add support for referencing controllers solely by node
      mailbox: add support for clients to request channels by arguments

 .../devicetree/bindings/mailbox/mailbox.txt        | 19 ++++++--
 drivers/mailbox/mailbox.c                          | 57 ++++++++++++++++++++++
 include/linux/mailbox.h                            | 17 +++++++
 include/linux/mailbox_client.h                     |  3 ++
 include/linux/mailbox_controller.h                 |  4 ++
 5 files changed, 96 insertions(+), 4 deletions(-)
---
base-commit: 78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
change-id: 20241219-mbox_request_channel_by_args-7115089ed492

Best regards,
-- 
Tudor Ambarus <tudor.ambarus@linaro.org>



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

end of thread, other threads:[~2024-12-20 19:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 13:07 [PATCH 0/2] mailbox: add support for clients to request channels by arguments Tudor Ambarus
2024-12-19 13:07 ` [PATCH 1/2] dt-bindings: mailbox: add support for referencing controllers solely by node Tudor Ambarus
2024-12-19 14:11   ` Conor Dooley
2024-12-19 15:42     ` Tudor Ambarus
2024-12-19 18:58       ` Conor Dooley
2024-12-20  7:51         ` Tudor Ambarus
2024-12-20 19:41           ` Conor Dooley
2024-12-19 13:07 ` [PATCH 2/2] mailbox: add support for clients to request channels by arguments Tudor Ambarus

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