2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
5 * Exynos low-level resume code
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include <linux/linkage.h>
19 #include <asm/asm-offsets.h>
20 #include <asm/hardware/cache-l2x0.h>
23 #define CPU_MASK 0xff0ffff0
24 #define CPU_CORTEX_A9 0x410fc090
30 * sleep magic, to allow the bootloader to check for an valid
31 * image to resume to. Must be the first word before the
32 * exynos_cpu_resume entry.
40 * resume code entry for bootloader to call
43 ENTRY(exynos_cpu_resume)
44 #ifdef CONFIG_CACHE_L2X0
45 mrc p15, 0, r0, c0, c0, 0
48 ldr r1, =CPU_CORTEX_A9
50 bleq l2c310_early_resume
53 ENDPROC(exynos_cpu_resume)
57 ENTRY(exynos_cpu_resume_ns)
58 mrc p15, 0, r0, c0, c0, 0
61 ldr r1, =CPU_CORTEX_A9
65 adr r0, _cp15_save_power
68 adr r0, _cp15_save_diag
71 mov r0, #SMC_CMD_C15RESUME
74 #ifdef CONFIG_CACHE_L2X0
79 /* Check that the address has been initialised. */
80 ldr r1, [r0, #L2X0_R_PHY_BASE]
84 /* Check if controller has been enabled. */
85 ldr r2, [r1, #L2X0_CTRL]
89 ldr r1, [r0, #L2X0_R_TAG_LATENCY]
90 ldr r2, [r0, #L2X0_R_DATA_LATENCY]
91 ldr r3, [r0, #L2X0_R_PREFETCH_CTRL]
92 mov r0, #SMC_CMD_L2X0SETUP1
95 /* Reload saved regs pointer because smc corrupts registers. */
100 ldr r1, [r0, #L2X0_R_PWR_CTRL]
101 ldr r2, [r0, #L2X0_R_AUX_CTRL]
102 mov r0, #SMC_CMD_L2X0SETUP2
105 mov r0, #SMC_CMD_L2X0INVALL
109 mov r0, #SMC_CMD_L2X0CTRL
112 #endif /* CONFIG_CACHE_L2X0 */
115 ENDPROC(exynos_cpu_resume_ns)
119 .long cp15_save_power - .
121 .long cp15_save_diag - .
122 #ifdef CONFIG_CACHE_L2X0
123 1: .long l2x0_saved_regs - .
124 #endif /* CONFIG_CACHE_L2X0 */
127 .globl cp15_save_diag
129 .long 0 @ cp15 diagnostic
130 .globl cp15_save_power
132 .long 0 @ cp15 power control