ftpmu010.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * (C) Copyright 2009 Faraday Technology
  3. * Po-Yu Chuang <ratbert@faraday-tech.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. /*
  20. * Power Management Unit
  21. */
  22. #ifndef __FTPMU010_H
  23. #define __FTPMU010_H
  24. struct ftpmu010 {
  25. unsigned int IDNMBR0; /* 0x00 */
  26. unsigned int reserved0; /* 0x04 */
  27. unsigned int OSCC; /* 0x08 */
  28. unsigned int PMODE; /* 0x0C */
  29. unsigned int PMCR; /* 0x10 */
  30. unsigned int PED; /* 0x14 */
  31. unsigned int PEDSR; /* 0x18 */
  32. unsigned int reserved1; /* 0x1C */
  33. unsigned int PMSR; /* 0x20 */
  34. unsigned int PGSR; /* 0x24 */
  35. unsigned int MFPSR; /* 0x28 */
  36. unsigned int MISC; /* 0x2C */
  37. unsigned int PDLLCR0; /* 0x30 */
  38. unsigned int PDLLCR1; /* 0x34 */
  39. unsigned int AHBMCLKOFF; /* 0x38 */
  40. unsigned int APBMCLKOFF; /* 0x3C */
  41. unsigned int DCSRCR0; /* 0x40 */
  42. unsigned int DCSRCR1; /* 0x44 */
  43. unsigned int DCSRCR2; /* 0x48 */
  44. unsigned int SDRAMHTC; /* 0x4C */
  45. unsigned int PSPR0; /* 0x50 */
  46. unsigned int PSPR1; /* 0x54 */
  47. unsigned int PSPR2; /* 0x58 */
  48. unsigned int PSPR3; /* 0x5C */
  49. unsigned int PSPR4; /* 0x60 */
  50. unsigned int PSPR5; /* 0x64 */
  51. unsigned int PSPR6; /* 0x68 */
  52. unsigned int PSPR7; /* 0x6C */
  53. unsigned int PSPR8; /* 0x70 */
  54. unsigned int PSPR9; /* 0x74 */
  55. unsigned int PSPR10; /* 0x78 */
  56. unsigned int PSPR11; /* 0x7C */
  57. unsigned int PSPR12; /* 0x80 */
  58. unsigned int PSPR13; /* 0x84 */
  59. unsigned int PSPR14; /* 0x88 */
  60. unsigned int PSPR15; /* 0x8C */
  61. unsigned int AHBDMA_RACCS; /* 0x90 */
  62. unsigned int reserved2; /* 0x94 */
  63. unsigned int reserved3; /* 0x98 */
  64. unsigned int JSS; /* 0x9C */
  65. unsigned int CFC_RACC; /* 0xA0 */
  66. unsigned int SSP1_RACC; /* 0xA4 */
  67. unsigned int UART1TX_RACC; /* 0xA8 */
  68. unsigned int UART1RX_RACC; /* 0xAC */
  69. unsigned int UART2TX_RACC; /* 0xB0 */
  70. unsigned int UART2RX_RACC; /* 0xB4 */
  71. unsigned int SDC_RACC; /* 0xB8 */
  72. unsigned int I2SAC97_RACC; /* 0xBC */
  73. unsigned int IRDATX_RACC; /* 0xC0 */
  74. unsigned int reserved4; /* 0xC4 */
  75. unsigned int USBD_RACC; /* 0xC8 */
  76. unsigned int IRDARX_RACC; /* 0xCC */
  77. unsigned int IRDA_RACC; /* 0xD0 */
  78. unsigned int ED0_RACC; /* 0xD4 */
  79. unsigned int ED1_RACC; /* 0xD8 */
  80. };
  81. /*
  82. * ID Number 0 Register
  83. */
  84. #define FTPMU010_ID_A320A 0x03200000
  85. #define FTPMU010_ID_A320C 0x03200010
  86. #define FTPMU010_ID_A320D 0x03200030
  87. /*
  88. * OSC Control Register
  89. */
  90. #define FTPMU010_OSCC_OSCH_TRI (1 << 11)
  91. #define FTPMU010_OSCC_OSCH_STABLE (1 << 9)
  92. #define FTPMU010_OSCC_OSCH_OFF (1 << 8)
  93. #define FTPMU010_OSCC_OSCL_TRI (1 << 3)
  94. #define FTPMU010_OSCC_OSCL_RTCLSEL (1 << 2)
  95. #define FTPMU010_OSCC_OSCL_STABLE (1 << 1)
  96. #define FTPMU010_OSCC_OSCL_OFF (1 << 0)
  97. /*
  98. * Power Mode Register
  99. */
  100. #define FTPMU010_PMODE_DIVAHBCLK_MASK (0x7 << 4)
  101. #define FTPMU010_PMODE_DIVAHBCLK_2 (0x0 << 4)
  102. #define FTPMU010_PMODE_DIVAHBCLK_3 (0x1 << 4)
  103. #define FTPMU010_PMODE_DIVAHBCLK_4 (0x2 << 4)
  104. #define FTPMU010_PMODE_DIVAHBCLK_6 (0x3 << 4)
  105. #define FTPMU010_PMODE_DIVAHBCLK_8 (0x4 << 4)
  106. #define FTPMU010_PMODE_DIVAHBCLK(pmode) (((pmode) >> 4) & 0x7)
  107. #define FTPMU010_PMODE_FCS (1 << 2)
  108. #define FTPMU010_PMODE_TURBO (1 << 1)
  109. #define FTPMU010_PMODE_SLEEP (1 << 0)
  110. /*
  111. * Power Manager Status Register
  112. */
  113. #define FTPMU010_PMSR_SMR (1 << 10)
  114. #define FTPMU010_PMSR_RDH (1 << 2)
  115. #define FTPMU010_PMSR_PH (1 << 1)
  116. #define FTPMU010_PMSR_CKEHLOW (1 << 0)
  117. /*
  118. * Multi-Function Port Setting Register
  119. */
  120. #define FTPMU010_MFPSR_MODEMPINSEL (1 << 14)
  121. #define FTPMU010_MFPSR_AC97CLKOUTSEL (1 << 13)
  122. #define FTPMU010_MFPSR_AC97PINSEL (1 << 3)
  123. /*
  124. * PLL/DLL Control Register 0
  125. */
  126. #define FTPMU010_PDLLCR0_HCLKOUTDIS(cr0) (((cr0) >> 20) & 0xf)
  127. #define FTPMU010_PDLLCR0_DLLFRAG (1 << 19)
  128. #define FTPMU010_PDLLCR0_DLLSTSEL (1 << 18)
  129. #define FTPMU010_PDLLCR0_DLLSTABLE (1 << 17)
  130. #define FTPMU010_PDLLCR0_DLLDIS (1 << 16)
  131. #define FTPMU010_PDLLCR0_PLL1NS(cr0) (((cr0) >> 3) & 0x1ff)
  132. #define FTPMU010_PDLLCR0_PLL1STSEL (1 << 2)
  133. #define FTPMU010_PDLLCR0_PLL1STABLE (1 << 1)
  134. #define FTPMU010_PDLLCR0_PLL1DIS (1 << 0)
  135. #endif /* __FTPMU010_H */