diff options
| author | Arve Hjønnevåg <arve@android.com> | 2015-01-23 20:55:48 -0500 |
|---|---|---|
| committer | Stephen Wolfe <swolfe@nvidia.com> | 2018-07-27 17:12:44 -0400 |
| commit | b2a435cf6598473a194b4f7168225420f57c218f (patch) | |
| tree | 1ed04ae9eb71af4af0db80c15295b859658a24f5 /include/linux | |
| parent | 7abcf768d24edb227bc809d819e6b2544c496f34 (diff) | |
trusty: Add smp support
Add an unlocked nop call to allow multiple cpus to enter trusty.
Other standard calls are still serialized to avoid return codes
getting mixed up.
A new return code is used to indicate that the standard call is
running on another cpu.
Change-Id: Iccc0785138fbc3eb9daebf22fd79d6c1f9b23f6a
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/trusty/sm_err.h | 3 | ||||
| -rw-r--r-- | include/linux/trusty/smcall.h | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/trusty/sm_err.h b/include/linux/trusty/sm_err.h index 7de09b46f..32ee08e49 100644 --- a/include/linux/trusty/sm_err.h +++ b/include/linux/trusty/sm_err.h | |||
| @@ -36,5 +36,8 @@ | |||
| 36 | #define SM_ERR_END_OF_INPUT -10 | 36 | #define SM_ERR_END_OF_INPUT -10 |
| 37 | #define SM_ERR_PANIC -11 /* Secure OS crashed */ | 37 | #define SM_ERR_PANIC -11 /* Secure OS crashed */ |
| 38 | #define SM_ERR_FIQ_INTERRUPTED -12 /* Got interrupted by FIQ. Call back with SMC_SC_RESTART_FIQ on same CPU */ | 38 | #define SM_ERR_FIQ_INTERRUPTED -12 /* Got interrupted by FIQ. Call back with SMC_SC_RESTART_FIQ on same CPU */ |
| 39 | #define SM_ERR_CPU_IDLE -13 /* SMC call waiting for another CPU */ | ||
| 40 | #define SM_ERR_NOP_INTERRUPTED -14 /* Got interrupted. Call back with new SMC_SC_NOP */ | ||
| 41 | #define SM_ERR_NOP_DONE -15 /* Cpu idle after SMC_SC_NOP (not an error) */ | ||
| 39 | 42 | ||
| 40 | #endif | 43 | #endif |
diff --git a/include/linux/trusty/smcall.h b/include/linux/trusty/smcall.h index 7d8950a88..2e43803d9 100644 --- a/include/linux/trusty/smcall.h +++ b/include/linux/trusty/smcall.h | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | 56 | ||
| 57 | /* FC = Fast call, SC = Standard call */ | 57 | /* FC = Fast call, SC = Standard call */ |
| 58 | #define SMC_SC_RESTART_LAST SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 0) | 58 | #define SMC_SC_RESTART_LAST SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 0) |
| 59 | #define SMC_SC_NOP SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 1) | 59 | #define SMC_SC_LOCKED_NOP SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 1) |
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | * SMC_SC_RESTART_FIQ - Re-enter trusty after it was interrupted by an fiq | 62 | * SMC_SC_RESTART_FIQ - Re-enter trusty after it was interrupted by an fiq |
| @@ -70,6 +70,18 @@ | |||
| 70 | */ | 70 | */ |
| 71 | #define SMC_SC_RESTART_FIQ SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 2) | 71 | #define SMC_SC_RESTART_FIQ SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 2) |
| 72 | 72 | ||
| 73 | /** | ||
| 74 | * SMC_SC_NOP - Enter trusty to run pending work. | ||
| 75 | * | ||
| 76 | * No arguments. | ||
| 77 | * | ||
| 78 | * Returns SM_ERR_NOP_INTERRUPTED or SM_ERR_NOP_DONE. | ||
| 79 | * If SM_ERR_NOP_INTERRUPTED is returned, the call must be repeated. | ||
| 80 | * | ||
| 81 | * Enable by selecting api version TRUSTY_API_VERSION_SMP (2) or later. | ||
| 82 | */ | ||
| 83 | #define SMC_SC_NOP SMC_STDCALL_NR (SMC_ENTITY_SECURE_MONITOR, 3) | ||
| 84 | |||
| 73 | /* | 85 | /* |
| 74 | * Return from secure os to non-secure os with return value in r1 | 86 | * Return from secure os to non-secure os with return value in r1 |
| 75 | */ | 87 | */ |
| @@ -107,7 +119,8 @@ | |||
| 107 | * This call must be made before any calls that are affected by the api version. | 119 | * This call must be made before any calls that are affected by the api version. |
| 108 | */ | 120 | */ |
| 109 | #define TRUSTY_API_VERSION_RESTART_FIQ (1) | 121 | #define TRUSTY_API_VERSION_RESTART_FIQ (1) |
| 110 | #define TRUSTY_API_VERSION_CURRENT (1) | 122 | #define TRUSTY_API_VERSION_SMP (2) |
| 123 | #define TRUSTY_API_VERSION_CURRENT (2) | ||
| 111 | #define SMC_FC_API_VERSION SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 11) | 124 | #define SMC_FC_API_VERSION SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 11) |
| 112 | 125 | ||
| 113 | /* TRUSTED_OS entity calls */ | 126 | /* TRUSTED_OS entity calls */ |
