[PATCH v5 0/2] Add initial ARM MHUv3 mailbox support

From: Cristian Marussi
Date: Thu Apr 18 2024 - 06:53:06 EST


Hi,

This series adds support for the new ARM Message Handling Unit v3 mailbox
controller [1].

The ARM MHUv3 can optionally support various extensions, enabling the
usage of different transport protocols.

Patch [2/2] adds a platform driver which, as of now, provides support only
for the Doorbell extension using the combined interrupt.

On the other side, bindings in [1/2] are introduced for all the extensions
described by the specification, as long as they are of interest to an
entity running from Normal world, like Linux: as such, Doorbell, FIFO and
FastChannel extensions are documented.

In these regards, note that the ARM MHUv3 controller can optionally
implement a considerable number of interrupts to express a great deal of
events and many of such interrupts are defined as being per-channel: with
the total maximum amount of possibly implemented channels across all
extensions being 1216 (1024+128+64), it would mean *a lot* of
interrupt-names to enumerate in the bindings.

For the sake of simplicity the binding as of now only introduces interrupt
names for a mere 8-channels in the range (0,7) for each per-channel
interrupt type: the idea is to leave open the possibility to add more to
this list of numbered items only when (and if) new real HW appears that
effectively needs more than 8 channels. (like AMBA, where the maximum
number of IRQ was progressively increased when needed, AFAIU).

Based on v6.9-rc1, tested on ARM TCS23 [2]
(TCS23 reference SW stack is still to be made fully publicly available)

Thanks,
Cristian

[1]: https://developer.arm.com/documentation/aes0072/aa/?lang=en
[2]: https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/total-compute-solutions-platform-software-stack-and-fvp

---
v4 -> v5
- changed Kconfig to depend on just OF && HAS_IOMEM
- fixed LLVM warnings on FIELD_PREP and missing slab.h as reported-by <lkp@xxxxxxxxx>
v3 -> v4
- avoid magic numbers for regs padding holes
- renaming various enums terminators to count_ instead of max_
- using scoped_guards for spinlock_save
- dropping FIRST_EXT naming for 0-indexed enum
- reduce indentation by using early returns or continue on failure-paths
- use dev_err_probe where appropriate
- be less noisy with dev_dbg
- refactored mhuv3_mbx_comb_interrupt using __free cleanups for .read_data
- refactored doorbell lookups with scoped_guards
- fail on IRQ request failures: do not carry-on best effort
- drop usage of platform_set_drvdata and .remove in favour of
devm_add_action_or_reset
- review failures handling on extensions initialization
- removed name clashes
- more comments on regs decorations
- decreasing line-lengths definitions
- use __ffs instead of __builtin_ctz
- dropped used of bitfields in favour of bitmasks
- reading implementer/revision/variant/product_id
- fixed a few misspellings
- DT: using ARM GIC defines in example
- DT: defined MHUv3 Extensions types in new file dt-bindings/arm/mhuv3-dt.h
v2 -> v3
- fixed spurious tabs/spaces in DT binding
v1 -> v2
- clarified DT bindings extension descriptions around configurability
and discoverability
- removed unused labels from the DT example
- using pattern properties to define DT interrupt-names
- bumped DT interrupt maxItems to 74 (allowing uo to 8 channels per extension)
- fixed checkpatch warnings about side-effects on write/read bitfield macros
- fixed sparse errors as reported
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403290015.tCLXudqC-lkp@xxxxxxxxx/

Cristian Marussi (2):
dt-bindings: mailbox: arm,mhuv3: Add bindings
mailbox: arm_mhuv3: Add driver

.../bindings/mailbox/arm,mhuv3.yaml | 224 ++++
MAINTAINERS | 9 +
drivers/mailbox/Kconfig | 12 +
drivers/mailbox/Makefile | 2 +
drivers/mailbox/arm_mhuv3.c | 1103 +++++++++++++++++
include/dt-bindings/arm/mhuv3-dt.h | 13 +
6 files changed, 1363 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mailbox/arm,mhuv3.yaml
create mode 100644 drivers/mailbox/arm_mhuv3.c
create mode 100644 include/dt-bindings/arm/mhuv3-dt.h

--
2.34.1