Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Freescale Semiconductor, Inc. |
| 3 | * Copyright 2011 Linaro Ltd. |
| 4 | * |
| 5 | * The code contained herein is licensed under the GNU General Public |
| 6 | * License. You may obtain a copy of the GNU General Public License |
| 7 | * Version 2 or later at the following locations: |
| 8 | * |
| 9 | * http://www.opensource.org/licenses/gpl-license.html |
| 10 | * http://www.gnu.org/copyleft/gpl.html |
| 11 | */ |
| 12 | |
| 13 | #include <linux/linkage.h> |
| 14 | #include <linux/init.h> |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 15 | #include <asm/asm-offsets.h> |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 16 | #include <asm/hardware/cache-l2x0.h> |
| 17 | |
| 18 | .section ".text.head", "ax" |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 19 | |
Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame] | 20 | #ifdef CONFIG_SMP |
| 21 | ENTRY(v7_secondary_startup) |
| 22 | bl v7_invalidate_l1 |
| 23 | b secondary_startup |
| 24 | ENDPROC(v7_secondary_startup) |
| 25 | #endif |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 26 | |
Arnd Bergmann | cb48389 | 2013-04-30 17:57:00 +0200 | [diff] [blame^] | 27 | #ifdef CONFIG_ARM_CPU_SUSPEND |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 28 | /* |
| 29 | * The following code is located into the .data section. This is to |
| 30 | * allow phys_l2x0_saved_regs to be accessed with a relative load |
| 31 | * as we are running on physical address here. |
| 32 | */ |
| 33 | .data |
| 34 | .align |
| 35 | |
Eric Miao | 733d172 | 2011-12-22 11:55:01 +0800 | [diff] [blame] | 36 | #ifdef CONFIG_CACHE_L2X0 |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 37 | .macro pl310_resume |
| 38 | ldr r2, phys_l2x0_saved_regs |
| 39 | ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0 |
| 40 | ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value |
| 41 | str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl |
| 42 | mov r1, #0x1 |
| 43 | str r1, [r0, #L2X0_CTRL] @ re-enable L2 |
| 44 | .endm |
| 45 | |
Eric Miao | 733d172 | 2011-12-22 11:55:01 +0800 | [diff] [blame] | 46 | .globl phys_l2x0_saved_regs |
| 47 | phys_l2x0_saved_regs: |
| 48 | .long 0 |
| 49 | #else |
| 50 | .macro pl310_resume |
| 51 | .endm |
| 52 | #endif |
| 53 | |
Shawn Guo | a1f1c7e | 2011-09-06 15:08:40 +0800 | [diff] [blame] | 54 | ENTRY(v7_cpu_resume) |
| 55 | bl v7_invalidate_l1 |
| 56 | pl310_resume |
| 57 | b cpu_resume |
| 58 | ENDPROC(v7_cpu_resume) |
Eric Miao | 46ec1b2 | 2011-12-21 22:38:23 +0800 | [diff] [blame] | 59 | #endif |