optee: ffa_abi: add asynchronous notifications
authorJens Wiklander <jens.wiklander@linaro.org>
Thu, 7 Sep 2023 11:27:42 +0000 (13:27 +0200)
committerJens Wiklander <jens.wiklander@linaro.org>
Fri, 17 Nov 2023 14:55:41 +0000 (15:55 +0100)
commitd0476a59de064205f4aaa8f7c6d6f32bc28a44d4
tree908e2096d8804e29480cc6c0b8cb02ac7debc603
parent6dea6352bec3ab9f8f71d1694ca91002844a5067
optee: ffa_abi: add asynchronous notifications

Adds support for asynchronous notifications from OP-TEE in secure world
when communicating via FF-A. In principle from OP-TEE and kernel driver
point of view this works in the same way as for the SMC ABI based
implementation.

The OP-TEE FF-A ABI is expanded in OPTEE_FFA_EXCHANGE_CAPABILITIES with
the capability OPTEE_FFA_SEC_CAP_ASYNC_NOTIF to indicate that OP-TEE
supports asynchronous notifications. OPTEE_FFA_ENABLE_ASYNC_NOTIF is
also added to tell that the driver has successfully initialized these
notifications.

Notification capability is negotiated while the driver is initialized.
If both sides supports these notifications then they are enabled.

The notification concept in this driver is merged with the FF-A concept,
the lower 64 values are reserved for FF-A as asynchronous notifications
while the synchronous notifications use the higher values.

So a FF-A notification has to be allocated for each discrete
asynchronous notification value needed. Only one asynchronous
notification value is used at the moment, the "do bottom half"
notification.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/tee/optee/ffa_abi.c
drivers/tee/optee/optee_ffa.h
drivers/tee/optee/optee_private.h