pmc.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * Copyright (c) 2010 Google, Inc
  3. * Copyright (c) 2014 NVIDIA Corporation
  4. *
  5. * Author:
  6. * Colin Cross <ccross@google.com>
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef __SOC_TEGRA_PMC_H__
  19. #define __SOC_TEGRA_PMC_H__
  20. #include <linux/reboot.h>
  21. #include <soc/tegra/pm.h>
  22. struct clk;
  23. struct reset_control;
  24. #ifdef CONFIG_PM_SLEEP
  25. enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
  26. void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
  27. void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode);
  28. #endif /* CONFIG_PM_SLEEP */
  29. #ifdef CONFIG_SMP
  30. bool tegra_pmc_cpu_is_powered(unsigned int cpuid);
  31. int tegra_pmc_cpu_power_on(unsigned int cpuid);
  32. int tegra_pmc_cpu_remove_clamping(unsigned int cpuid);
  33. #endif /* CONFIG_SMP */
  34. /*
  35. * powergate and I/O rail APIs
  36. */
  37. #define TEGRA_POWERGATE_CPU 0
  38. #define TEGRA_POWERGATE_3D 1
  39. #define TEGRA_POWERGATE_VENC 2
  40. #define TEGRA_POWERGATE_PCIE 3
  41. #define TEGRA_POWERGATE_VDEC 4
  42. #define TEGRA_POWERGATE_L2 5
  43. #define TEGRA_POWERGATE_MPE 6
  44. #define TEGRA_POWERGATE_HEG 7
  45. #define TEGRA_POWERGATE_SATA 8
  46. #define TEGRA_POWERGATE_CPU1 9
  47. #define TEGRA_POWERGATE_CPU2 10
  48. #define TEGRA_POWERGATE_CPU3 11
  49. #define TEGRA_POWERGATE_CELP 12
  50. #define TEGRA_POWERGATE_3D1 13
  51. #define TEGRA_POWERGATE_CPU0 14
  52. #define TEGRA_POWERGATE_C0NC 15
  53. #define TEGRA_POWERGATE_C1NC 16
  54. #define TEGRA_POWERGATE_SOR 17
  55. #define TEGRA_POWERGATE_DIS 18
  56. #define TEGRA_POWERGATE_DISB 19
  57. #define TEGRA_POWERGATE_XUSBA 20
  58. #define TEGRA_POWERGATE_XUSBB 21
  59. #define TEGRA_POWERGATE_XUSBC 22
  60. #define TEGRA_POWERGATE_VIC 23
  61. #define TEGRA_POWERGATE_IRAM 24
  62. #define TEGRA_POWERGATE_NVDEC 25
  63. #define TEGRA_POWERGATE_NVJPG 26
  64. #define TEGRA_POWERGATE_AUD 27
  65. #define TEGRA_POWERGATE_DFD 28
  66. #define TEGRA_POWERGATE_VE2 29
  67. #define TEGRA_POWERGATE_MAX TEGRA_POWERGATE_VE2
  68. #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
  69. #define TEGRA_IO_RAIL_CSIA 0
  70. #define TEGRA_IO_RAIL_CSIB 1
  71. #define TEGRA_IO_RAIL_DSI 2
  72. #define TEGRA_IO_RAIL_MIPI_BIAS 3
  73. #define TEGRA_IO_RAIL_PEX_BIAS 4
  74. #define TEGRA_IO_RAIL_PEX_CLK1 5
  75. #define TEGRA_IO_RAIL_PEX_CLK2 6
  76. #define TEGRA_IO_RAIL_USB0 9
  77. #define TEGRA_IO_RAIL_USB1 10
  78. #define TEGRA_IO_RAIL_USB2 11
  79. #define TEGRA_IO_RAIL_USB_BIAS 12
  80. #define TEGRA_IO_RAIL_NAND 13
  81. #define TEGRA_IO_RAIL_UART 14
  82. #define TEGRA_IO_RAIL_BB 15
  83. #define TEGRA_IO_RAIL_AUDIO 17
  84. #define TEGRA_IO_RAIL_HSIC 19
  85. #define TEGRA_IO_RAIL_COMP 22
  86. #define TEGRA_IO_RAIL_HDMI 28
  87. #define TEGRA_IO_RAIL_PEX_CNTRL 32
  88. #define TEGRA_IO_RAIL_SDMMC1 33
  89. #define TEGRA_IO_RAIL_SDMMC3 34
  90. #define TEGRA_IO_RAIL_SDMMC4 35
  91. #define TEGRA_IO_RAIL_CAM 36
  92. #define TEGRA_IO_RAIL_RES 37
  93. #define TEGRA_IO_RAIL_HV 38
  94. #define TEGRA_IO_RAIL_DSIB 39
  95. #define TEGRA_IO_RAIL_DSIC 40
  96. #define TEGRA_IO_RAIL_DSID 41
  97. #define TEGRA_IO_RAIL_CSIE 44
  98. #define TEGRA_IO_RAIL_LVDS 57
  99. #define TEGRA_IO_RAIL_SYS_DDC 58
  100. #ifdef CONFIG_ARCH_TEGRA
  101. int tegra_powergate_is_powered(unsigned int id);
  102. int tegra_powergate_power_on(unsigned int id);
  103. int tegra_powergate_power_off(unsigned int id);
  104. int tegra_powergate_remove_clamping(unsigned int id);
  105. /* Must be called with clk disabled, and returns with clk enabled */
  106. int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk,
  107. struct reset_control *rst);
  108. int tegra_io_rail_power_on(unsigned int id);
  109. int tegra_io_rail_power_off(unsigned int id);
  110. #else
  111. static inline int tegra_powergate_is_powered(unsigned int id)
  112. {
  113. return -ENOSYS;
  114. }
  115. static inline int tegra_powergate_power_on(unsigned int id)
  116. {
  117. return -ENOSYS;
  118. }
  119. static inline int tegra_powergate_power_off(unsigned int id)
  120. {
  121. return -ENOSYS;
  122. }
  123. static inline int tegra_powergate_remove_clamping(unsigned int id)
  124. {
  125. return -ENOSYS;
  126. }
  127. static inline int tegra_powergate_sequence_power_up(unsigned int id,
  128. struct clk *clk,
  129. struct reset_control *rst)
  130. {
  131. return -ENOSYS;
  132. }
  133. static inline int tegra_io_rail_power_on(unsigned int id)
  134. {
  135. return -ENOSYS;
  136. }
  137. static inline int tegra_io_rail_power_off(unsigned int id)
  138. {
  139. return -ENOSYS;
  140. }
  141. #endif /* CONFIG_ARCH_TEGRA */
  142. #endif /* __SOC_TEGRA_PMC_H__ */