blob: 108a45f4bb62077fc718bb9e2f473ddfd5b9533b [file] [log] [blame]
Tomasz Figad710aa32014-03-18 07:28:27 +09001/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Exynos low-level resume code
6 *
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.
11 *
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.
16 */
17
18#include <linux/linkage.h>
Tomasz Figad710aa32014-03-18 07:28:27 +090019
20#define CPU_MASK 0xff0ffff0
21#define CPU_CORTEX_A9 0x410fc090
22
23 /*
24 * The following code is located into the .data section. This is to
25 * allow l2x0_regs_phys to be accessed with a relative load while we
26 * can't rely on any MMU translation. We could have put l2x0_regs_phys
27 * in the .text section as well, but some setups might insist on it to
28 * be truly read-only. (Reference from: arch/arm/kernel/sleep.S)
29 */
30 .data
31 .align
32
33 /*
34 * sleep magic, to allow the bootloader to check for an valid
35 * image to resume to. Must be the first word before the
36 * exynos_cpu_resume entry.
37 */
38
39 .word 0x2bedf00d
40
41 /*
42 * exynos_cpu_resume
43 *
44 * resume code entry for bootloader to call
45 */
46
47ENTRY(exynos_cpu_resume)
48#ifdef CONFIG_CACHE_L2X0
49 mrc p15, 0, r0, c0, c0, 0
50 ldr r1, =CPU_MASK
51 and r0, r0, r1
52 ldr r1, =CPU_CORTEX_A9
53 cmp r0, r1
Russell King25a9ef62014-04-05 11:45:34 +010054 bleq l2c310_early_resume
Tomasz Figad710aa32014-03-18 07:28:27 +090055#endif
56 b cpu_resume
57ENDPROC(exynos_cpu_resume)