2 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
3 * Author: Tony Xie <tony.xie@rock-chips.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 #include <linux/linkage.h>
17 #include <asm/assembler.h>
18 #include <asm/memory.h>
22 * this code will be copied from
23 * ddr to sram for system resumeing.
24 * so it is ".data section".
28 ENTRY(rockchip_slp_cpu_resume)
29 setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set svc, irqs off
30 mrc p15, 0, r1, c0, c0, 5
33 /* olny cpu0 can continue to run, the others is halt here */
39 ldr r3, rkpm_bootdata_l2ctlr_f
42 ldr r3, rkpm_bootdata_l2ctlr
43 mcr p15, 1, r3, c9, c0, 2
45 ldr sp, rkpm_bootdata_cpusp
46 ldr r1, rkpm_bootdata_cpu_code
48 ENDPROC(rockchip_slp_cpu_resume)
50 /* Parameters filled in by the kernel */
52 /* Flag for whether to restore L2CTLR on resume */
53 .global rkpm_bootdata_l2ctlr_f
54 rkpm_bootdata_l2ctlr_f:
57 /* Saved L2CTLR to restore on resume */
58 .global rkpm_bootdata_l2ctlr
62 /* CPU resume SP addr */
63 .globl rkpm_bootdata_cpusp
67 /* CPU resume function (physical address) */
68 .globl rkpm_bootdata_cpu_code
69 rkpm_bootdata_cpu_code:
72 ENTRY(rk3288_bootram_sz)
73 .word . - rockchip_slp_cpu_resume