pm-mmp2.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * MMP2 Power Management Routines
  4. *
  5. * (C) Copyright 2010 Marvell International Ltd.
  6. * All Rights Reserved
  7. */
  8. #ifndef __MMP2_PM_H__
  9. #define __MMP2_PM_H__
  10. #include "addr-map.h"
  11. #define APMU_PJ_IDLE_CFG APMU_REG(0x018)
  12. #define APMU_PJ_IDLE_CFG_PJ_IDLE (1 << 1)
  13. #define APMU_PJ_IDLE_CFG_PJ_PWRDWN (1 << 5)
  14. #define APMU_PJ_IDLE_CFG_PWR_SW(x) ((x) << 16)
  15. #define APMU_PJ_IDLE_CFG_L2_PWR_SW (1 << 19)
  16. #define APMU_PJ_IDLE_CFG_ISO_MODE_CNTRL_MASK (3 << 28)
  17. #define APMU_SRAM_PWR_DWN APMU_REG(0x08c)
  18. #define MPMU_SCCR MPMU_REG(0x038)
  19. #define MPMU_PCR_PJ MPMU_REG(0x1000)
  20. #define MPMU_PCR_PJ_AXISD (1 << 31)
  21. #define MPMU_PCR_PJ_SLPEN (1 << 29)
  22. #define MPMU_PCR_PJ_SPSD (1 << 28)
  23. #define MPMU_PCR_PJ_DDRCORSD (1 << 27)
  24. #define MPMU_PCR_PJ_APBSD (1 << 26)
  25. #define MPMU_PCR_PJ_INTCLR (1 << 24)
  26. #define MPMU_PCR_PJ_SLPWP0 (1 << 23)
  27. #define MPMU_PCR_PJ_SLPWP1 (1 << 22)
  28. #define MPMU_PCR_PJ_SLPWP2 (1 << 21)
  29. #define MPMU_PCR_PJ_SLPWP3 (1 << 20)
  30. #define MPMU_PCR_PJ_VCTCXOSD (1 << 19)
  31. #define MPMU_PCR_PJ_SLPWP4 (1 << 18)
  32. #define MPMU_PCR_PJ_SLPWP5 (1 << 17)
  33. #define MPMU_PCR_PJ_SLPWP6 (1 << 16)
  34. #define MPMU_PCR_PJ_SLPWP7 (1 << 15)
  35. #define MPMU_PLL2_CTRL1 MPMU_REG(0x0414)
  36. #define MPMU_CGR_PJ MPMU_REG(0x1024)
  37. #define MPMU_WUCRM_PJ MPMU_REG(0x104c)
  38. #define MPMU_WUCRM_PJ_WAKEUP(x) (1 << (x))
  39. #define MPMU_WUCRM_PJ_RTC_ALARM (1 << 17)
  40. enum {
  41. POWER_MODE_ACTIVE = 0,
  42. POWER_MODE_CORE_INTIDLE,
  43. POWER_MODE_CORE_EXTIDLE,
  44. POWER_MODE_APPS_IDLE,
  45. POWER_MODE_APPS_SLEEP,
  46. POWER_MODE_CHIP_SLEEP,
  47. POWER_MODE_SYS_SLEEP,
  48. };
  49. extern void mmp2_pm_enter_lowpower_mode(int state);
  50. extern int mmp2_set_wake(struct irq_data *d, unsigned int on);
  51. #endif