Skip to contentSkip to conversation

mailbox: arm_mhu: add support for mhuv2

PATCH Superseded Samarth Parikh 1 participant 1 message May 14, 2018 Mailbox API

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: arm_mhu: add support for mhuv2

ARM has launched a next version of MHU i.e. MHUv2 with its latest subsystems. The main change is that the MHUv2 is now a distributed IP with different peripheral views (registers) for the sender and receiver.

Another main difference is that MHUv1 duplex channels are now split into simplex/half duplex in MHUv2. MHUv2 has a configurable number of communication channels. There is a capability register (MSG_NO_CAP) to find out how many channels are available in a system.

The register offsets have also changed for STAT, SET & CLEAR registers from 0x0, 0x8 & 0x10 in MHUv1 to 0x0, 0xC & 0x8 in MHUv2 respectively.

0x0 0x4 0x8 0xC 0x1F
------------------------....-----
| STAT | | | SET | | |
------------------------....-----
Transmit Channel

0x0 0x4 0x8 0xC 0x1F
------------------------....-----
| STAT | | CLR | | | |
------------------------....-----
Receive Channel

The MHU controller can request the receiver to wake-up and once the request is removed, the receiver may go back to sleep, but the MHU itself does not actively puts a receiver to sleep.

So, in order to wake-up the receiver when the sender wants to send data, the sender has to set ACCESS_REQUEST register first in order to wake-up receiver, state of which can be detected using ACCESS_READY register. ACCESS_REQUEST has an offset of 0xF88 & ACCESS_READY has an offset of 0xF8C and are accessible only on any sender channel.

This patch adds necessary changes in a new file required to support the latest MHUv2 controller. This patch also need an update in DT binding for ARM MHUv2 as we need a second register base (tx base) which would be used as the send channel base.

---
 drivers/mailbox/Kconfig      |   9 ++
 drivers/mailbox/Makefile     |   2 +
 drivers/mailbox/arm_mhu_v2.c | 309 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 320 insertions(+)
 create mode 100644 drivers/mailbox/arm_mhu_v2.c
drivers/mailbox/Kconfig +9 -0
index a2bb274..416bc78 100644
@@ -15,6 +15,15 @@ config ARM_MHU
          The controller has 3 mailbox channels, the last of which can be
          used in Secure mode only.
 
+config ARM_MHU_V2
+       tristate "ARM MHUv2 Mailbox"
+       depends on ARM_AMBA
+       help
+         Say Y here if you want to build the ARM MHUv2 controller driver.
+         The controller is a distributed IP with different peripheral
+         views (registers) for the sender and receiver & has 3 mailbox
+         channels, the last of which can be used in Secure mode only.
+
 config PLATFORM_MHU
        tristate "Platform MHU Mailbox"
        depends on OF
drivers/mailbox/Makefile +2 -0
index cc23c3a..ae899a9 100644
@@ -7,6 +7,8 @@ obj-$(CONFIG_MAILBOX_TEST)      += mailbox-test.o
 
 obj-$(CONFIG_ARM_MHU)  += arm_mhu.o
 
+obj-$(CONFIG_ARM_MHU_V2)       += arm_mhu_v2.o
+
 obj-$(CONFIG_PLATFORM_MHU)     += platform_mhu.o
 
 obj-$(CONFIG_PL320_MBOX)       += pl320-ipc.o
drivers/mailbox/arm_mhu_v2.c new file +309 -0

309 lines not on this page · raw message

--
2.7.4

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.