pm.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
  3. * Author: Tony Xie <tony.xie@rock-chips.com>
  4. *
  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.
  8. *
  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
  12. * more details.
  13. */
  14. #ifndef __MACH_ROCKCHIP_PM_H
  15. #define __MACH_ROCKCHIP_PM_H
  16. extern unsigned long rkpm_bootdata_cpusp;
  17. extern unsigned long rkpm_bootdata_cpu_code;
  18. extern unsigned long rkpm_bootdata_l2ctlr_f;
  19. extern unsigned long rkpm_bootdata_l2ctlr;
  20. extern unsigned long rkpm_bootdata_ddr_code;
  21. extern unsigned long rkpm_bootdata_ddr_data;
  22. extern unsigned long rk3288_bootram_sz;
  23. void rockchip_slp_cpu_resume(void);
  24. #ifdef CONFIG_PM_SLEEP
  25. void __init rockchip_suspend_init(void);
  26. #else
  27. static inline void rockchip_suspend_init(void)
  28. {
  29. }
  30. #endif
  31. /****** following is rk3288 defined **********/
  32. #define RK3288_PMU_WAKEUP_CFG0 0x00
  33. #define RK3288_PMU_WAKEUP_CFG1 0x04
  34. #define RK3288_PMU_PWRMODE_CON 0x18
  35. #define RK3288_PMU_OSC_CNT 0x20
  36. #define RK3288_PMU_PLL_CNT 0x24
  37. #define RK3288_PMU_STABL_CNT 0x28
  38. #define RK3288_PMU_DDR0IO_PWRON_CNT 0x2c
  39. #define RK3288_PMU_DDR1IO_PWRON_CNT 0x30
  40. #define RK3288_PMU_CORE_PWRDWN_CNT 0x34
  41. #define RK3288_PMU_CORE_PWRUP_CNT 0x38
  42. #define RK3288_PMU_GPU_PWRDWN_CNT 0x3c
  43. #define RK3288_PMU_GPU_PWRUP_CNT 0x40
  44. #define RK3288_PMU_WAKEUP_RST_CLR_CNT 0x44
  45. #define RK3288_PMU_PWRMODE_CON1 0x90
  46. #define RK3288_SGRF_SOC_CON0 (0x0000)
  47. #define RK3288_SGRF_FAST_BOOT_ADDR (0x0120)
  48. #define SGRF_PCLK_WDT_GATE BIT(6)
  49. #define SGRF_PCLK_WDT_GATE_WRITE BIT(22)
  50. #define SGRF_FAST_BOOT_EN BIT(8)
  51. #define SGRF_FAST_BOOT_EN_WRITE BIT(24)
  52. #define RK3288_SGRF_CPU_CON0 (0x40)
  53. #define SGRF_DAPDEVICEEN BIT(0)
  54. #define SGRF_DAPDEVICEEN_WRITE BIT(16)
  55. /* PMU_WAKEUP_CFG1 bits */
  56. #define PMU_ARMINT_WAKEUP_EN BIT(0)
  57. #define PMU_GPIOINT_WAKEUP_EN BIT(3)
  58. enum rk3288_pwr_mode_con {
  59. PMU_PWR_MODE_EN = 0,
  60. PMU_CLK_CORE_SRC_GATE_EN,
  61. PMU_GLOBAL_INT_DISABLE,
  62. PMU_L2FLUSH_EN,
  63. PMU_BUS_PD_EN,
  64. PMU_A12_0_PD_EN,
  65. PMU_SCU_EN,
  66. PMU_PLL_PD_EN,
  67. PMU_CHIP_PD_EN, /* POWER OFF PIN ENABLE */
  68. PMU_PWROFF_COMB,
  69. PMU_ALIVE_USE_LF,
  70. PMU_PMU_USE_LF,
  71. PMU_OSC_24M_DIS,
  72. PMU_INPUT_CLAMP_EN,
  73. PMU_WAKEUP_RESET_EN,
  74. PMU_SREF0_ENTER_EN,
  75. PMU_SREF1_ENTER_EN,
  76. PMU_DDR0IO_RET_EN,
  77. PMU_DDR1IO_RET_EN,
  78. PMU_DDR0_GATING_EN,
  79. PMU_DDR1_GATING_EN,
  80. PMU_DDR0IO_RET_DE_REQ,
  81. PMU_DDR1IO_RET_DE_REQ
  82. };
  83. enum rk3288_pwr_mode_con1 {
  84. PMU_CLR_BUS = 0,
  85. PMU_CLR_CORE,
  86. PMU_CLR_CPUP,
  87. PMU_CLR_ALIVE,
  88. PMU_CLR_DMA,
  89. PMU_CLR_PERI,
  90. PMU_CLR_GPU,
  91. PMU_CLR_VIDEO,
  92. PMU_CLR_HEVC,
  93. PMU_CLR_VIO,
  94. };
  95. #endif /* __MACH_ROCKCHIP_PM_H */