summaryrefslogtreecommitdiff
path: root/drivers/tee/optee/optee_private.h
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2023-03-22 16:22:12 +0300
committerJens Wiklander <jens.wiklander@linaro.org>2023-03-30 09:27:05 +0300
commitb3b4ced12c1bc829888803ce07fff317e590ec1c (patch)
treee09b21a6b40c98ecddc1a233b4c66138fa55ca53 /drivers/tee/optee/optee_private.h
parent0d0eaa780ba3b8a02a1ac87f38c34dfe365f27d6 (diff)
downloadlinux-b3b4ced12c1bc829888803ce07fff317e590ec1c.tar.xz
optee: add per cpu asynchronous notification
Implements use of per-cpu irq for optee asynchronous notification. Existing optee async notif implementation allows OP-TEE world to raise an interrupt on which Linux optee driver will query some pending events. This change allows the signaling interrupt to be a per-cpu interrupt as with Arm GIC PPIs. Using a PPI instead of an SPI is useful when no GIC lines are provisioned in the chip design and there are spare PPI lines. Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Sumit Garg <sumit.garg@linaro.org> Cc: Marc Zyngier <maz@kernel.org> Co-developed-by: Alexandre Torgue <alexandre.torgue@foss.st.com> Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> [JW: fixing a spell error in @notif_pcpu_wq description] Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'drivers/tee/optee/optee_private.h')
-rw-r--r--drivers/tee/optee/optee_private.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h
index 04ae58892608..72685ee0d53f 100644
--- a/drivers/tee/optee/optee_private.h
+++ b/drivers/tee/optee/optee_private.h
@@ -94,11 +94,35 @@ struct optee_supp {
struct completion reqs_c;
};
+/*
+ * struct optee_pcpu - per cpu notif private struct passed to work functions
+ * @optee optee device reference
+ */
+struct optee_pcpu {
+ struct optee *optee;
+};
+
+/*
+ * struct optee_smc - optee smc communication struct
+ * @invoke_fn handler function to invoke secure monitor
+ * @memremaped_shm virtual address of memory in shared memory pool
+ * @sec_caps: secure world capabilities defined by
+ * OPTEE_SMC_SEC_CAP_* in optee_smc.h
+ * @notif_irq interrupt used as async notification by OP-TEE or 0
+ * @optee_pcpu per_cpu optee instance for per cpu work or NULL
+ * @notif_pcpu_wq workqueue for per cpu asynchronous notification or NULL
+ * @notif_pcpu_work work for per cpu asynchronous notification
+ * @notif_cpuhp_state CPU hotplug state assigned for pcpu interrupt management
+ */
struct optee_smc {
optee_invoke_fn *invoke_fn;
void *memremaped_shm;
u32 sec_caps;
unsigned int notif_irq;
+ struct optee_pcpu __percpu *optee_pcpu;
+ struct workqueue_struct *notif_pcpu_wq;
+ struct work_struct notif_pcpu_work;
+ unsigned int notif_cpuhp_state;
};
/**