Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/arch/arm/include/ffa.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
#define FFA_CONSOLE_LOG_32 U(0x8400008A)
#define FFA_CONSOLE_LOG_64 U(0xC400008A)

#define FFA_FEATURES_FUNC_ID_MASK BIT32(31)
#define FFA_FEATURES_FEATURE_ID_MASK GENMASK_32(7, 0)

#define FFA_FEATURE_NOTIF_PEND_INTR U(0x1)
#define FFA_FEATURE_SCHEDULE_RECV_INTR U(0x2)
#define FFA_FEATURE_MANAGED_EXIT_INTR U(0x3)
Expand Down
12 changes: 11 additions & 1 deletion core/arch/arm/include/kernel/thread_spmc.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (c) 2021, Arm Limited.
* Copyright (c) 2023, Linaro Limited
*/
#ifndef __KERNEL_THREAD_SPMC_H
#define __KERNEL_THREAD_SPMC_H

#include <compiler.h>
#include <ffa.h>
#include <kernel/panic.h>
#include <kernel/thread.h>

/* FF-A endpoint base ID when OP-TEE is used as a S-EL1 endpoint */
Expand Down Expand Up @@ -37,7 +40,14 @@ TEE_Result spmc_fill_partition_entry(uint32_t ffa_vers, void *buf, size_t blen,
int spmc_read_mem_transaction(uint32_t ffa_vers, void *buf, size_t blen,
struct ffa_mem_transaction_x *trans);

#if !defined(CFG_CORE_SEL1_SPMC)
#if defined(CFG_CORE_SEL1_SPMC)
void thread_spmc_set_async_notif_intid(int intid);
#else
static inline void __noreturn
thread_spmc_set_async_notif_intid(int intid __unused)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: would fit in a single line with s/intid/id/.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but I prefer using the same name for the argument.

{
panic();
}
struct mobj_ffa *thread_spmc_populate_mobj_from_rx(uint64_t cookie);
void thread_spmc_relinquish(uint64_t memory_region_handle);
#endif
Expand Down
25 changes: 21 additions & 4 deletions core/arch/arm/include/optee_ffa.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,25 @@
*
* Call register usage:
* w3: Service ID, OPTEE_FFA_EXCHANGE_CAPABILITIES
* w4-w7: Note used (MBZ)
* w4-w7: Not used (MBZ)
*
* Return register usage:
* w3: Error code, 0 on success
* w4: Bit[7:0]: Number of parameters needed for RPC to be supplied
* as the second MSG arg struct for
* OPTEE_FFA_YIELDING_CALL_WITH_ARG.
* Bit[31:8]: Reserved (MBZ)
* w5: Bitfield of secure world capabilities OPTEE_FFA_SEC_CAP_* below,
* unused bits MBZ.
* w6-w7: Not used (MBZ)
* w5: Bitfield of OP-TEE capabilities OPTEE_FFA_SEC_CAP_*
* w6: The maximum secure world notification number
* w7: Not used (MBZ)
*/
/*
* Secure world supports using an offset into the argument shared memory
* object, see also OPTEE_FFA_YIELDING_CALL_WITH_ARG
*/
#define OPTEE_FFA_SEC_CAP_ARG_OFFSET BIT(0)
/* OP-TEE supports asynchronous notification via FF-A */
#define OPTEE_FFA_SEC_CAP_ASYNC_NOTIF BIT(1)

#define OPTEE_FFA_EXCHANGE_CAPABILITIES OPTEE_FFA_BLOCKING_CALL(2)

Expand All @@ -109,6 +111,21 @@
*/
#define OPTEE_FFA_UNREGISTER_SHM OPTEE_FFA_BLOCKING_CALL(3)

/*
* Inform OP-TEE that normal world is able to receive asynchronous
* notifications.
*
* Call register usage:
* w3: Service ID, OPTEE_FFA_ENABLE_ASYNC_NOTIF
* w4: Notification value to request bottom half processing
* w5-w7: Not used (MBZ)
*
* Return register usage:
* w3: Error code, 0 on success
* w4-w7: Not used (MBZ)
*/
#define OPTEE_FFA_ENABLE_ASYNC_NOTIF OPTEE_FFA_BLOCKING_CALL(5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using ID 4?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what happened with ID 4, but this has to be kept in synch with the kernel patches so changing this now might be more trouble than it's worth.


/*
* Call with struct optee_msg_arg as argument in the supplied shared memory
* with a zero internal offset and normal cached memory attributes.
Expand Down
Loading