Skip to content

Commit 97ec554

Browse files
oleksiimoisieievnashif
authored andcommitted
tests: drivers: optee: handle exchange capabilities call
Capabilities should be set correctly or optee will show error message: [00:00:00.000,000] <err> optee: OPTEE does not support dynamic shared memory Test suite should set optee UID or the following error message should be displayed: [00:00:00.000,000] <err> optee: OPTEE API UID mismatch Signed-off-by: Oleksii Moisieiev <[email protected]>
1 parent 3301c45 commit 97ec554

File tree

1 file changed

+12
-0
lines changed
  • tests/drivers/tee/optee/src

1 file changed

+12
-0
lines changed

tests/drivers/tee/optee/src/main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2, unsigne
5555
unsigned long a4, unsigned long a5, unsigned long a6, unsigned long a7,
5656
struct arm_smccc_res *res)
5757
{
58+
if (a0 == OPTEE_SMC_CALLS_UID) {
59+
res->a0 = OPTEE_MSG_UID_0;
60+
res->a1 = OPTEE_MSG_UID_1;
61+
res->a2 = OPTEE_MSG_UID_2;
62+
res->a3 = OPTEE_MSG_UID_3;
63+
return;
64+
}
65+
66+
if (a0 == OPTEE_SMC_EXCHANGE_CAPABILITIES) {
67+
res->a1 = OPTEE_SMC_SEC_CAP_DYNAMIC_SHM;
68+
return;
69+
}
5870
if (t_call.pending && t_call.smc_cb) {
5971
t_call.smc_cb(a0, a1, a2, a3, a4, a5, a6, a7, res);
6072
}

0 commit comments

Comments
 (0)