summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephane Dion <stephane.dion_1@nxp.com>2019-06-13 16:20:31 +0200
committerSilvano di Ninno <silvano.dininno@nxp.com>2019-12-05 16:26:17 +0100
commit50148f0aebd61d324cf694ef1842f313c2955c53 (patch)
treeec8ad95933da8ce392d27c9f53ab89ceb0efc04a /include
parent8517b82c84a544778f1f27f130c236cd30fb082d (diff)
SHE-17 soc: imx8: SECO MU driver
Driver to communicate with SECO over messaging unit. Expose a char device to user-space so user can write messages that will be sent to SECO and read messages received from it. Data that should be exchanged with SECO through shared memory are indicated to this driver through ioctl calls. Signed-off-by: Stephane Dion <stephane.dion_1@nxp.com> (cherry picked from commit eb721810fdc309b6a32a7a64c7686eaa6052cdc7) (cherry picked from commit db41bf52c2edf7c0936686d806eb4b2373b385a0)
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/seco_mu_ioctl.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/uapi/linux/seco_mu_ioctl.h b/include/uapi/linux/seco_mu_ioctl.h
new file mode 100644
index 000000000000..578e38a5732f
--- /dev/null
+++ b/include/uapi/linux/seco_mu_ioctl.h
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause*/
+/*
+ * Copyright 2019 NXP
+ */
+
+#ifndef SECO_MU_IOCTL_H
+#define SECO_MU_IOCTL_H
+
+/* IOCTL definitions. */
+struct seco_mu_ioctl_setup_iobuf {
+ uint8_t *user_buf;
+ uint32_t length;
+ uint32_t flags;
+ uint64_t seco_addr;
+};
+struct seco_mu_ioctl_shared_mem_cfg {
+ uint32_t base_offset;
+ uint32_t size;
+};
+
+struct seco_mu_ioctl_get_mu_info {
+ uint8_t seco_mu_idx;
+ uint8_t interrupt_idx;
+ uint8_t tz;
+ uint8_t did;
+};
+
+struct seco_mu_ioctl_signed_message {
+ uint8_t *message;
+ uint32_t msg_size;
+ uint32_t 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