summaryrefslogtreecommitdiff
path: root/include/linux/firmware
diff options
context:
space:
mode:
authorSilvano di Ninno <silvano.dininno@nxp.com>2019-12-02 19:21:01 +0100
committerFranck LENORMAND <franck.lenormand@nxp.com>2020-02-21 14:44:02 +0100
commitc334337d16879184e29c331767a94b3744c2bacd (patch)
tree8832ecda414ebf87f76d1e3c5a79328a6616966a /include/linux/firmware
parent73c8bbb404bd2873bd9d8d59cd1666f975c335b8 (diff)
LF-824: fw: imx: seco_mu: Add driver for SECO
This patch adds the driver to interact with the different APIs exposed by the SECO using a shared Messaging Unit. The driver exposes some char devices in user space allowing a user to send message to the SECO and read its response. The driver uses the mailbox framework instead of directly configuring the MU. Signed-off-by: Stephane Dion <stephane.dion_1@nxp.com> Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com> Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com> (cherry picked from commit 4985109d60164c842ee5d189621455db349b5212) (cherry picked from commit eb721810fdc309b6a32a7a64c7686eaa6052cdc7) (cherry picked from commit 4956bbf43349ab40a6a60765752a904d11bfcd18)
Diffstat (limited to 'include/linux/firmware')
-rw-r--r--include/linux/firmware/imx/seco_mu_ioctl.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/firmware/imx/seco_mu_ioctl.h b/include/linux/firmware/imx/seco_mu_ioctl.h
new file mode 100644
index 000000000000..bd8402b473a4
--- /dev/null
+++ b/include/linux/firmware/imx/seco_mu_ioctl.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause*/
+/*
+ * Copyright 2019-2020 NXP
+ */
+
+#ifndef SECO_MU_IOCTL_H
+#define SECO_MU_IOCTL_H
+
+/* IOCTL definitions. */
+struct seco_mu_ioctl_setup_iobuf {
+ u8 *user_buf;
+ u32 length;
+ u32 flags;
+ u64 seco_addr;
+};
+
+struct seco_mu_ioctl_shared_mem_cfg {
+ u32 base_offset;
+ u32 size;
+};
+
+struct seco_mu_ioctl_get_mu_info {
+ u8 seco_mu_idx;
+ u8 interrupt_idx;
+ u8 tz;
+ u8 did;
+};
+
+struct seco_mu_ioctl_signed_message {
+ u8 *message;
+ u32 msg_size;
+ u32 error_code;
+};
+
+#define SECO_MU_IO_FLAGS_IS_INPUT (0x01u)
+#define SECO_MU_IO_FLAGS_USE_SEC_MEM (0x02u)
+#define SECO_MU_IO_FLAGS_USE_SHORT_ADDR (0x04u)
+
+#define SECO_MU_IOCTL 0x0A /* like MISC_MAJOR. */
+#define SECO_MU_IOCTL_ENABLE_CMD_RCV _IO(SECO_MU_IOCTL, 0x01)
+#define SECO_MU_IOCTL_SHARED_BUF_CFG _IOW(SECO_MU_IOCTL, 0x02, \
+ struct seco_mu_ioctl_shared_mem_cfg)
+#define SECO_MU_IOCTL_SETUP_IOBUF _IOWR(SECO_MU_IOCTL, 0x03, \
+ struct seco_mu_ioctl_setup_iobuf)
+#define SECO_MU_IOCTL_GET_MU_INFO _IOR(SECO_MU_IOCTL, 0x04, \
+ struct seco_mu_ioctl_get_mu_info)
+#define SECO_MU_IOCTL_SIGNED_MESSAGE _IOWR(SECO_MU_IOCTL, 0x05, \
+ struct seco_mu_ioctl_signed_message)
+
+#endif