1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
4 * Author: Tony Xie <tony.xie@rock-chips.com>
7 #ifndef __MACH_ROCKCHIP_PM_H
8 #define __MACH_ROCKCHIP_PM_H
10 extern unsigned long rkpm_bootdata_cpusp
;
11 extern unsigned long rkpm_bootdata_cpu_code
;
12 extern unsigned long rkpm_bootdata_l2ctlr_f
;
13 extern unsigned long rkpm_bootdata_l2ctlr
;
14 extern unsigned long rkpm_bootdata_ddr_code
;
15 extern unsigned long rkpm_bootdata_ddr_data
;
16 extern unsigned long rk3288_bootram_sz
;
18 void rockchip_slp_cpu_resume(void);
19 #ifdef CONFIG_PM_SLEEP
20 void __init
rockchip_suspend_init(void);
22 static inline void rockchip_suspend_init(void)
27 /****** following is rk3288 defined **********/
28 #define RK3288_PMU_WAKEUP_CFG0 0x00
29 #define RK3288_PMU_WAKEUP_CFG1 0x04
30 #define RK3288_PMU_PWRMODE_CON 0x18
31 #define RK3288_PMU_OSC_CNT 0x20
32 #define RK3288_PMU_PLL_CNT 0x24
33 #define RK3288_PMU_STABL_CNT 0x28
34 #define RK3288_PMU_DDR0IO_PWRON_CNT 0x2c
35 #define RK3288_PMU_DDR1IO_PWRON_CNT 0x30
36 #define RK3288_PMU_CORE_PWRDWN_CNT 0x34
37 #define RK3288_PMU_CORE_PWRUP_CNT 0x38
38 #define RK3288_PMU_GPU_PWRDWN_CNT 0x3c
39 #define RK3288_PMU_GPU_PWRUP_CNT 0x40
40 #define RK3288_PMU_WAKEUP_RST_CLR_CNT 0x44
41 #define RK3288_PMU_PWRMODE_CON1 0x90
43 #define RK3288_SGRF_SOC_CON0 (0x0000)
44 #define RK3288_SGRF_FAST_BOOT_ADDR (0x0120)
45 #define SGRF_PCLK_WDT_GATE BIT(6)
46 #define SGRF_PCLK_WDT_GATE_WRITE BIT(22)
47 #define SGRF_FAST_BOOT_EN BIT(8)
48 #define SGRF_FAST_BOOT_EN_WRITE BIT(24)
50 #define RK3288_SGRF_CPU_CON0 (0x40)
51 #define SGRF_DAPDEVICEEN BIT(0)
52 #define SGRF_DAPDEVICEEN_WRITE BIT(16)
54 /* PMU_WAKEUP_CFG1 bits */
55 #define PMU_ARMINT_WAKEUP_EN BIT(0)
56 #define PMU_GPIOINT_WAKEUP_EN BIT(3)
58 enum rk3288_pwr_mode_con
{
60 PMU_CLK_CORE_SRC_GATE_EN
,
61 PMU_GLOBAL_INT_DISABLE
,
67 PMU_CHIP_PD_EN
, /* POWER OFF PIN ENABLE */
80 PMU_DDR0IO_RET_DE_REQ
,
84 enum rk3288_pwr_mode_con1
{
97 #endif /* __MACH_ROCKCHIP_PM_H */