fsl_pm.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Support Power Management
  3. *
  4. * Copyright 2014-2015 Freescale Semiconductor Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #ifndef __PPC_FSL_PM_H
  12. #define __PPC_FSL_PM_H
  13. #define E500_PM_PH10 1
  14. #define E500_PM_PH15 2
  15. #define E500_PM_PH20 3
  16. #define E500_PM_PH30 4
  17. #define E500_PM_DOZE E500_PM_PH10
  18. #define E500_PM_NAP E500_PM_PH15
  19. #define PLAT_PM_SLEEP 20
  20. #define PLAT_PM_LPM20 30
  21. #define FSL_PM_SLEEP (1 << 0)
  22. #define FSL_PM_DEEP_SLEEP (1 << 1)
  23. struct fsl_pm_ops {
  24. /* mask pending interrupts to the RCPM from MPIC */
  25. void (*irq_mask)(int cpu);
  26. /* unmask pending interrupts to the RCPM from MPIC */
  27. void (*irq_unmask)(int cpu);
  28. void (*cpu_enter_state)(int cpu, int state);
  29. void (*cpu_exit_state)(int cpu, int state);
  30. void (*cpu_up_prepare)(int cpu);
  31. void (*cpu_die)(int cpu);
  32. int (*plat_enter_sleep)(void);
  33. void (*freeze_time_base)(bool freeze);
  34. /* keep the power of IP blocks during sleep/deep sleep */
  35. void (*set_ip_power)(bool enable, u32 mask);
  36. /* get platform supported power management modes */
  37. unsigned int (*get_pm_modes)(void);
  38. };
  39. extern const struct fsl_pm_ops *qoriq_pm_ops;
  40. int __init fsl_rcpm_init(void);
  41. #endif /* __PPC_FSL_PM_H */