diff options
author | Alex Elder <elder@linaro.org> | 2014-04-21 17:53:10 -0400 |
---|---|---|
committer | Matt Porter <mporter@linaro.org> | 2014-04-25 08:51:37 -0400 |
commit | ed24f446ab82e3f39c4a45357186ca76368301e4 (patch) | |
tree | 7c9e49408f5a9e9c9cf9d3475632acf531972924 /arch/arm/mach-bcm | |
parent | 8b9c550e37ff4e4d0de2890a835f44a7813e3423 (diff) |
ARM: bcm: rewrite commentary for bcm_kona_do_smc()
The block of comments in bcm_kona_do_smc() are somewhat confusing.
This patch attempts to clarify what's going on.
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Reviewed-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
Diffstat (limited to 'arch/arm/mach-bcm')
-rw-r--r-- | arch/arm/mach-bcm/bcm_kona_smc.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c index cc81c86f24b5..a55a7ecf146a 100644 --- a/arch/arm/mach-bcm/bcm_kona_smc.c +++ b/arch/arm/mach-bcm/bcm_kona_smc.c | |||
@@ -77,16 +77,34 @@ int __init bcm_kona_smc_init(void) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | /* | 79 | /* |
80 | * Since interrupts are disabled in the open mode, we must keep | 80 | * int bcm_kona_do_smc(u32 service_id, u32 buffer_addr) |
81 | * interrupts disabled in secure mode by setting R5=0x3. If interrupts | 81 | * |
82 | * are enabled in open mode, we can set R5=0x0 to allow interrupts in | 82 | * Only core 0 can run the secure monitor code. If an "smc" request |
83 | * secure mode. If we did this, the secure monitor would return back | 83 | * is initiated on a different core it must be redirected to core 0 |
84 | * control to the open mode to handle the interrupt prior to completing | 84 | * for execution. We rely on the caller to handle this. |
85 | * the secure service. If this happened, R12 would not be | 85 | * |
86 | * SEC_EXIT_NORMAL and we would need to call SMC again after resetting | 86 | * Each "smc" request supplies a service id and the address of a |
87 | * R5 (it gets clobbered by the secure monitor) and setting R4 to | 87 | * buffer containing parameters related to the service to be |
88 | * SSAPI_RET_FROM_INT_SERV to indicate that we want the secure monitor | 88 | * performed. A flags value defines the behavior of the level 2 |
89 | * to finish up the previous uncompleted secure service. | 89 | * cache and interrupt handling while the secure monitor executes. |
90 | * | ||
91 | * Parameters to the "smc" request are passed in r4-r6 as follows: | ||
92 | * r4 service id | ||
93 | * r5 flags (SEC_ROM_*) | ||
94 | * r6 physical address of buffer with other parameters | ||
95 | * | ||
96 | * Execution of an "smc" request produces two distinct results. | ||
97 | * | ||
98 | * First, the secure monitor call itself (regardless of the specific | ||
99 | * service request) can succeed, or can produce an error. When an | ||
100 | * "smc" request completes this value is found in r12; it should | ||
101 | * always be SEC_EXIT_NORMAL. | ||
102 | * | ||
103 | * In addition, the particular service performed produces a result. | ||
104 | * The values that should be expected depend on the service. We | ||
105 | * therefore return this value to the caller, so it can handle the | ||
106 | * request result appropriately. This result value is found in r0 | ||
107 | * when the "smc" request completes. | ||
90 | */ | 108 | */ |
91 | static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) | 109 | static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) |
92 | { | 110 | { |