1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * sleep mode for CSR SiRFprimaII
5 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
8 #include <linux/linkage.h>
9 #include <asm/ptrace.h>
10 #include <asm/assembler.h>
14 #define DENALI_CTL_22_OFF 0x58
15 #define DENALI_CTL_112_OFF 0x1c0
19 ENTRY(sirfsoc_finish_suspend)
21 ldr r0, =sirfsoc_memc_base
23 @ r6: pwrc base offset
24 ldr r0, =sirfsoc_pwrc_base
26 @ r7: rtc iobrg controller
27 ldr r0, =sirfsoc_rtciobrg_base
30 @ Read the power control register and set the
32 add r0, r6, #SIRFSOC_PWRC_PDN_CTRL
33 bl __sirfsoc_rtc_iobrg_readl
34 orr r0,r0,#SIRFSOC_PWR_SLEEPFORCE
35 add r1, r6, #SIRFSOC_PWRC_PDN_CTRL
36 bl sirfsoc_rtc_iobrg_pre_writel
39 @ read the MEM ctl register and set the self
42 ldr r2, [r5, #DENALI_CTL_22_OFF]
45 @ Following code has to run from cache since
46 @ the RAM is going to self refresh mode
48 str r2, [r5, #DENALI_CTL_22_OFF]
51 ldr r4, [r5, #DENALI_CTL_112_OFF]
55 @ write SLEEPFORCE through rtc iobridge
58 @ wait rtc io bridge sync