pxa2xx-regs.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
  3. *
  4. * Taken from pxa-regs.h by Russell King
  5. *
  6. * Author: Nicolas Pitre
  7. * Copyright: MontaVista Software Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef __PXA2XX_REGS_H
  14. #define __PXA2XX_REGS_H
  15. #include <mach/hardware.h>
  16. /*
  17. * Power Manager
  18. */
  19. #define PMCR __REG(0x40F00000) /* Power Manager Control Register */
  20. #define PSSR __REG(0x40F00004) /* Power Manager Sleep Status Register */
  21. #define PSPR __REG(0x40F00008) /* Power Manager Scratch Pad Register */
  22. #define PWER __REG(0x40F0000C) /* Power Manager Wake-up Enable Register */
  23. #define PRER __REG(0x40F00010) /* Power Manager GPIO Rising-Edge Detect Enable Register */
  24. #define PFER __REG(0x40F00014) /* Power Manager GPIO Falling-Edge Detect Enable Register */
  25. #define PEDR __REG(0x40F00018) /* Power Manager GPIO Edge Detect Status Register */
  26. #define PCFR __REG(0x40F0001C) /* Power Manager General Configuration Register */
  27. #define PGSR0 __REG(0x40F00020) /* Power Manager GPIO Sleep State Register for GP[31-0] */
  28. #define PGSR1 __REG(0x40F00024) /* Power Manager GPIO Sleep State Register for GP[63-32] */
  29. #define PGSR2 __REG(0x40F00028) /* Power Manager GPIO Sleep State Register for GP[84-64] */
  30. #define PGSR3 __REG(0x40F0002C) /* Power Manager GPIO Sleep State Register for GP[118-96] */
  31. #define RCSR __REG(0x40F00030) /* Reset Controller Status Register */
  32. #define PSLR __REG(0x40F00034) /* Power Manager Sleep Config Register */
  33. #define PSTR __REG(0x40F00038) /* Power Manager Standby Config Register */
  34. #define PSNR __REG(0x40F0003C) /* Power Manager Sense Config Register */
  35. #define PVCR __REG(0x40F00040) /* Power Manager VoltageControl Register */
  36. #define PKWR __REG(0x40F00050) /* Power Manager KB Wake-up Enable Reg */
  37. #define PKSR __REG(0x40F00054) /* Power Manager KB Level-Detect Register */
  38. #define PCMD(x) __REG2(0x40F00080, (x)<<2)
  39. #define PCMD0 __REG(0x40F00080 + 0 * 4)
  40. #define PCMD1 __REG(0x40F00080 + 1 * 4)
  41. #define PCMD2 __REG(0x40F00080 + 2 * 4)
  42. #define PCMD3 __REG(0x40F00080 + 3 * 4)
  43. #define PCMD4 __REG(0x40F00080 + 4 * 4)
  44. #define PCMD5 __REG(0x40F00080 + 5 * 4)
  45. #define PCMD6 __REG(0x40F00080 + 6 * 4)
  46. #define PCMD7 __REG(0x40F00080 + 7 * 4)
  47. #define PCMD8 __REG(0x40F00080 + 8 * 4)
  48. #define PCMD9 __REG(0x40F00080 + 9 * 4)
  49. #define PCMD10 __REG(0x40F00080 + 10 * 4)
  50. #define PCMD11 __REG(0x40F00080 + 11 * 4)
  51. #define PCMD12 __REG(0x40F00080 + 12 * 4)
  52. #define PCMD13 __REG(0x40F00080 + 13 * 4)
  53. #define PCMD14 __REG(0x40F00080 + 14 * 4)
  54. #define PCMD15 __REG(0x40F00080 + 15 * 4)
  55. #define PCMD16 __REG(0x40F00080 + 16 * 4)
  56. #define PCMD17 __REG(0x40F00080 + 17 * 4)
  57. #define PCMD18 __REG(0x40F00080 + 18 * 4)
  58. #define PCMD19 __REG(0x40F00080 + 19 * 4)
  59. #define PCMD20 __REG(0x40F00080 + 20 * 4)
  60. #define PCMD21 __REG(0x40F00080 + 21 * 4)
  61. #define PCMD22 __REG(0x40F00080 + 22 * 4)
  62. #define PCMD23 __REG(0x40F00080 + 23 * 4)
  63. #define PCMD24 __REG(0x40F00080 + 24 * 4)
  64. #define PCMD25 __REG(0x40F00080 + 25 * 4)
  65. #define PCMD26 __REG(0x40F00080 + 26 * 4)
  66. #define PCMD27 __REG(0x40F00080 + 27 * 4)
  67. #define PCMD28 __REG(0x40F00080 + 28 * 4)
  68. #define PCMD29 __REG(0x40F00080 + 29 * 4)
  69. #define PCMD30 __REG(0x40F00080 + 30 * 4)
  70. #define PCMD31 __REG(0x40F00080 + 31 * 4)
  71. #define PCMD_MBC (1<<12)
  72. #define PCMD_DCE (1<<11)
  73. #define PCMD_LC (1<<10)
  74. /* FIXME: PCMD_SQC need be checked. */
  75. #define PCMD_SQC (3<<8) /* currently only bit 8 is changeable,
  76. bit 9 should be 0 all day. */
  77. #define PVCR_VCSA (0x1<<14)
  78. #define PVCR_CommandDelay (0xf80)
  79. #define PCFR_PI2C_EN (0x1 << 6)
  80. #define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */
  81. #define PSSR_RDH (1 << 5) /* Read Disable Hold */
  82. #define PSSR_PH (1 << 4) /* Peripheral Control Hold */
  83. #define PSSR_STS (1 << 3) /* Standby Mode Status */
  84. #define PSSR_VFS (1 << 2) /* VDD Fault Status */
  85. #define PSSR_BFS (1 << 1) /* Battery Fault Status */
  86. #define PSSR_SSS (1 << 0) /* Software Sleep Status */
  87. #define PSLR_SL_ROD (1 << 20) /* Sleep-Mode/Depp-Sleep Mode nRESET_OUT Disable */
  88. #define PCFR_RO (1 << 15) /* RDH Override */
  89. #define PCFR_PO (1 << 14) /* PH Override */
  90. #define PCFR_GPROD (1 << 12) /* GPIO nRESET_OUT Disable */
  91. #define PCFR_L1_EN (1 << 11) /* Sleep Mode L1 converter Enable */
  92. #define PCFR_FVC (1 << 10) /* Frequency/Voltage Change */
  93. #define PCFR_DC_EN (1 << 7) /* Sleep/deep-sleep DC-DC Converter Enable */
  94. #define PCFR_PI2CEN (1 << 6) /* Enable PI2C controller */
  95. #define PCFR_GPR_EN (1 << 4) /* nRESET_GPIO Pin Enable */
  96. #define PCFR_DS (1 << 3) /* Deep Sleep Mode */
  97. #define PCFR_FS (1 << 2) /* Float Static Chip Selects */
  98. #define PCFR_FP (1 << 1) /* Float PCMCIA controls */
  99. #define PCFR_OPDE (1 << 0) /* 3.6864 MHz oscillator power-down enable */
  100. #define RCSR_GPR (1 << 3) /* GPIO Reset */
  101. #define RCSR_SMR (1 << 2) /* Sleep Mode */
  102. #define RCSR_WDR (1 << 1) /* Watchdog Reset */
  103. #define RCSR_HWR (1 << 0) /* Hardware Reset */
  104. #define PWER_GPIO(Nb) (1 << Nb) /* GPIO [0..15] wake-up enable */
  105. #define PWER_GPIO0 PWER_GPIO (0) /* GPIO [0] wake-up enable */
  106. #define PWER_GPIO1 PWER_GPIO (1) /* GPIO [1] wake-up enable */
  107. #define PWER_GPIO2 PWER_GPIO (2) /* GPIO [2] wake-up enable */
  108. #define PWER_GPIO3 PWER_GPIO (3) /* GPIO [3] wake-up enable */
  109. #define PWER_GPIO4 PWER_GPIO (4) /* GPIO [4] wake-up enable */
  110. #define PWER_GPIO5 PWER_GPIO (5) /* GPIO [5] wake-up enable */
  111. #define PWER_GPIO6 PWER_GPIO (6) /* GPIO [6] wake-up enable */
  112. #define PWER_GPIO7 PWER_GPIO (7) /* GPIO [7] wake-up enable */
  113. #define PWER_GPIO8 PWER_GPIO (8) /* GPIO [8] wake-up enable */
  114. #define PWER_GPIO9 PWER_GPIO (9) /* GPIO [9] wake-up enable */
  115. #define PWER_GPIO10 PWER_GPIO (10) /* GPIO [10] wake-up enable */
  116. #define PWER_GPIO11 PWER_GPIO (11) /* GPIO [11] wake-up enable */
  117. #define PWER_GPIO12 PWER_GPIO (12) /* GPIO [12] wake-up enable */
  118. #define PWER_GPIO13 PWER_GPIO (13) /* GPIO [13] wake-up enable */
  119. #define PWER_GPIO14 PWER_GPIO (14) /* GPIO [14] wake-up enable */
  120. #define PWER_GPIO15 PWER_GPIO (15) /* GPIO [15] wake-up enable */
  121. #define PWER_RTC 0x80000000 /* RTC alarm wake-up enable */
  122. /*
  123. * PXA2xx specific Core clock definitions
  124. */
  125. #define CCCR io_p2v(0x41300000) /* Core Clock Configuration Register */
  126. #define CCSR io_p2v(0x4130000C) /* Core Clock Status Register */
  127. #define CKEN io_p2v(0x41300004) /* Clock Enable Register */
  128. #define OSCC io_p2v(0x41300008) /* Oscillator Configuration Register */
  129. #define CCCR_N_MASK 0x0380 /* Run Mode Frequency to Turbo Mode Frequency Multiplier */
  130. #define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */
  131. #define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */
  132. #define CCCR_CPDIS_BIT (31)
  133. #define CCCR_PPDIS_BIT (30)
  134. #define CCCR_LCD_26_BIT (27)
  135. #define CCCR_A_BIT (25)
  136. #define CCSR_N2_MASK CCCR_N_MASK
  137. #define CCSR_M_MASK CCCR_M_MASK
  138. #define CCSR_L_MASK CCCR_L_MASK
  139. #define CCSR_N2_SHIFT 7
  140. #define CKEN_AC97CONF (31) /* AC97 Controller Configuration */
  141. #define CKEN_CAMERA (24) /* Camera Interface Clock Enable */
  142. #define CKEN_SSP1 (23) /* SSP1 Unit Clock Enable */
  143. #define CKEN_MEMC (22) /* Memory Controller Clock Enable */
  144. #define CKEN_MEMSTK (21) /* Memory Stick Host Controller */
  145. #define CKEN_IM (20) /* Internal Memory Clock Enable */
  146. #define CKEN_KEYPAD (19) /* Keypad Interface Clock Enable */
  147. #define CKEN_USIM (18) /* USIM Unit Clock Enable */
  148. #define CKEN_MSL (17) /* MSL Unit Clock Enable */
  149. #define CKEN_LCD (16) /* LCD Unit Clock Enable */
  150. #define CKEN_PWRI2C (15) /* PWR I2C Unit Clock Enable */
  151. #define CKEN_I2C (14) /* I2C Unit Clock Enable */
  152. #define CKEN_FICP (13) /* FICP Unit Clock Enable */
  153. #define CKEN_MMC (12) /* MMC Unit Clock Enable */
  154. #define CKEN_USB (11) /* USB Unit Clock Enable */
  155. #define CKEN_ASSP (10) /* ASSP (SSP3) Clock Enable */
  156. #define CKEN_USBHOST (10) /* USB Host Unit Clock Enable */
  157. #define CKEN_OSTIMER (9) /* OS Timer Unit Clock Enable */
  158. #define CKEN_NSSP (9) /* NSSP (SSP2) Clock Enable */
  159. #define CKEN_I2S (8) /* I2S Unit Clock Enable */
  160. #define CKEN_BTUART (7) /* BTUART Unit Clock Enable */
  161. #define CKEN_FFUART (6) /* FFUART Unit Clock Enable */
  162. #define CKEN_STUART (5) /* STUART Unit Clock Enable */
  163. #define CKEN_HWUART (4) /* HWUART Unit Clock Enable */
  164. #define CKEN_SSP3 (4) /* SSP3 Unit Clock Enable */
  165. #define CKEN_SSP (3) /* SSP Unit Clock Enable */
  166. #define CKEN_SSP2 (3) /* SSP2 Unit Clock Enable */
  167. #define CKEN_AC97 (2) /* AC97 Unit Clock Enable */
  168. #define CKEN_PWM1 (1) /* PWM1 Clock Enable */
  169. #define CKEN_PWM0 (0) /* PWM0 Clock Enable */
  170. #define OSCC_OON (1 << 1) /* 32.768kHz OON (write-once only bit) */
  171. #define OSCC_OOK (1 << 0) /* 32.768kHz OOK (read-only bit) */
  172. /* PWRMODE register M field values */
  173. #define PWRMODE_IDLE 0x1
  174. #define PWRMODE_STANDBY 0x2
  175. #define PWRMODE_SLEEP 0x3
  176. #define PWRMODE_DEEPSLEEP 0x7
  177. #endif