pm.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2016 Freescale Semiconductor, Inc.
  4. * Copyright 2017-2018 NXP
  5. *
  6. * Header file containing the public API for the System Controller (SC)
  7. * Power Management (PM) function. This includes functions for power state
  8. * control, clock control, reset control, and wake-up event control.
  9. *
  10. * PM_SVC (SVC) Power Management Service
  11. *
  12. * Module for the Power Management (PM) service.
  13. */
  14. #ifndef _SC_PM_API_H
  15. #define _SC_PM_API_H
  16. #include <linux/firmware/imx/sci.h>
  17. /*
  18. * This type is used to indicate RPC PM function calls.
  19. */
  20. enum imx_sc_pm_func {
  21. IMX_SC_PM_FUNC_UNKNOWN = 0,
  22. IMX_SC_PM_FUNC_SET_SYS_POWER_MODE = 19,
  23. IMX_SC_PM_FUNC_SET_PARTITION_POWER_MODE = 1,
  24. IMX_SC_PM_FUNC_GET_SYS_POWER_MODE = 2,
  25. IMX_SC_PM_FUNC_SET_RESOURCE_POWER_MODE = 3,
  26. IMX_SC_PM_FUNC_GET_RESOURCE_POWER_MODE = 4,
  27. IMX_SC_PM_FUNC_REQ_LOW_POWER_MODE = 16,
  28. IMX_SC_PM_FUNC_SET_CPU_RESUME_ADDR = 17,
  29. IMX_SC_PM_FUNC_REQ_SYS_IF_POWER_MODE = 18,
  30. IMX_SC_PM_FUNC_SET_CLOCK_RATE = 5,
  31. IMX_SC_PM_FUNC_GET_CLOCK_RATE = 6,
  32. IMX_SC_PM_FUNC_CLOCK_ENABLE = 7,
  33. IMX_SC_PM_FUNC_SET_CLOCK_PARENT = 14,
  34. IMX_SC_PM_FUNC_GET_CLOCK_PARENT = 15,
  35. IMX_SC_PM_FUNC_RESET = 13,
  36. IMX_SC_PM_FUNC_RESET_REASON = 10,
  37. IMX_SC_PM_FUNC_BOOT = 8,
  38. IMX_SC_PM_FUNC_REBOOT = 9,
  39. IMX_SC_PM_FUNC_REBOOT_PARTITION = 12,
  40. IMX_SC_PM_FUNC_CPU_START = 11,
  41. };
  42. /*
  43. * Defines for ALL parameters
  44. */
  45. #define IMX_SC_PM_CLK_ALL UINT8_MAX /* All clocks */
  46. /*
  47. * Defines for SC PM Power Mode
  48. */
  49. #define IMX_SC_PM_PW_MODE_OFF 0 /* Power off */
  50. #define IMX_SC_PM_PW_MODE_STBY 1 /* Power in standby */
  51. #define IMX_SC_PM_PW_MODE_LP 2 /* Power in low-power */
  52. #define IMX_SC_PM_PW_MODE_ON 3 /* Power on */
  53. /*
  54. * Defines for SC PM CLK
  55. */
  56. #define IMX_SC_PM_CLK_SLV_BUS 0 /* Slave bus clock */
  57. #define IMX_SC_PM_CLK_MST_BUS 1 /* Master bus clock */
  58. #define IMX_SC_PM_CLK_PER 2 /* Peripheral clock */
  59. #define IMX_SC_PM_CLK_PHY 3 /* Phy clock */
  60. #define IMX_SC_PM_CLK_MISC 4 /* Misc clock */
  61. #define IMX_SC_PM_CLK_MISC0 0 /* Misc 0 clock */
  62. #define IMX_SC_PM_CLK_MISC1 1 /* Misc 1 clock */
  63. #define IMX_SC_PM_CLK_MISC2 2 /* Misc 2 clock */
  64. #define IMX_SC_PM_CLK_MISC3 3 /* Misc 3 clock */
  65. #define IMX_SC_PM_CLK_MISC4 4 /* Misc 4 clock */
  66. #define IMX_SC_PM_CLK_CPU 2 /* CPU clock */
  67. #define IMX_SC_PM_CLK_PLL 4 /* PLL */
  68. #define IMX_SC_PM_CLK_BYPASS 4 /* Bypass clock */
  69. /*
  70. * Defines for SC PM CLK Parent
  71. */
  72. #define IMX_SC_PM_PARENT_XTAL 0 /* Parent is XTAL. */
  73. #define IMX_SC_PM_PARENT_PLL0 1 /* Parent is PLL0 */
  74. #define IMX_SC_PM_PARENT_PLL1 2 /* Parent is PLL1 or PLL0/2 */
  75. #define IMX_SC_PM_PARENT_PLL2 3 /* Parent in PLL2 or PLL0/4 */
  76. #define IMX_SC_PM_PARENT_BYPS 4 /* Parent is a bypass clock. */
  77. #endif /* _SC_PM_API_H */