diff options
author | Christian Daudt <csd@broadcom.com> | 2013-02-27 00:48:49 -0500 |
---|---|---|
committer | Christian Daudt <csd@broadcom.com> | 2013-04-09 12:18:13 -0400 |
commit | b8eb35fd594aa5b635e329d5c8efab8aaceb8619 (patch) | |
tree | 8c664f4d4daabc0a83435ef90cead2eeff751e5b /arch/arm/mach-bcm/bcm_kona_smc_asm.S | |
parent | 07961ac7c0ee8b546658717034fe692fd12eefa9 (diff) |
ARM: bcm281xx: Add L2 cache enable code
- Adds a module to provide calls into secure monitor mode
- Uses this module to make secure monitor calls to enable L2 cache.
Updates from V1:
- Split DT portion into separate patch
- replace #ifdef-ed L2 code with "if".
- move init call to board init
Signed-off-by: Christian Daudt <csd@broadcom.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-bcm/bcm_kona_smc_asm.S')
-rw-r--r-- | arch/arm/mach-bcm/bcm_kona_smc_asm.S | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-bcm/bcm_kona_smc_asm.S b/arch/arm/mach-bcm/bcm_kona_smc_asm.S new file mode 100644 index 000000000000..a1608480d60d --- /dev/null +++ b/arch/arm/mach-bcm/bcm_kona_smc_asm.S | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 Broadcom Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
9 | * kind, whether express or implied; without even the implied warranty | ||
10 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #include <linux/linkage.h> | ||
15 | #include "bcm_kona_smc.h" | ||
16 | |||
17 | /* | ||
18 | * int bcm_kona_smc_asm(u32 service_id, u32 buffer_addr) | ||
19 | */ | ||
20 | |||
21 | ENTRY(bcm_kona_smc_asm) | ||
22 | stmfd sp!, {r4-r12, lr} | ||
23 | mov r4, r0 @ service_id | ||
24 | mov r5, #3 @ Keep IRQ and FIQ off in SM | ||
25 | /* | ||
26 | * Since interrupts are disabled in the open mode, we must keep | ||
27 | * interrupts disabled in secure mode by setting R5=0x3. If interrupts | ||
28 | * are enabled in open mode, we can set R5=0x0 to allow interrupts in | ||
29 | * secure mode. If we did this, the secure monitor would return back | ||
30 | * control to the open mode to handle the interrupt prior to completing | ||
31 | * the secure service. If this happened, R12 would not be | ||
32 | * SEC_EXIT_NORMAL and we would need to call SMC again after resetting | ||
33 | * R5 (it gets clobbered by the secure monitor) and setting R4 to | ||
34 | * SSAPI_RET_FROM_INT_SERV to indicate that we want the secure monitor | ||
35 | * to finish up the previous uncompleted secure service. | ||
36 | */ | ||
37 | mov r6, r1 @ buffer_addr | ||
38 | smc #0 | ||
39 | /* Check r12 for SEC_EXIT_NORMAL here if interrupts are enabled */ | ||
40 | ldmfd sp!, {r4-r12, pc} | ||
41 | ENDPROC(bcm_kona_smc_asm) | ||