cpu.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /*
  2. * (C) Copyright 2006-2010
  3. * Texas Instruments, <www.ti.com>
  4. *
  5. * Aneesh V <aneesh@ti.com>
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. *
  25. */
  26. #ifndef _CPU_H
  27. #define _CPU_H
  28. #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
  29. #include <asm/types.h>
  30. #endif /* !(__KERNEL_STRICT_NAMES || __ASSEMBLY__) */
  31. #ifndef __KERNEL_STRICT_NAMES
  32. #ifndef __ASSEMBLY__
  33. struct gpmc_cs {
  34. u32 config1; /* 0x00 */
  35. u32 config2; /* 0x04 */
  36. u32 config3; /* 0x08 */
  37. u32 config4; /* 0x0C */
  38. u32 config5; /* 0x10 */
  39. u32 config6; /* 0x14 */
  40. u32 config7; /* 0x18 */
  41. u32 nand_cmd; /* 0x1C */
  42. u32 nand_adr; /* 0x20 */
  43. u32 nand_dat; /* 0x24 */
  44. u8 res[8]; /* blow up to 0x30 byte */
  45. };
  46. struct gpmc {
  47. u8 res1[0x10];
  48. u32 sysconfig; /* 0x10 */
  49. u8 res2[0x4];
  50. u32 irqstatus; /* 0x18 */
  51. u32 irqenable; /* 0x1C */
  52. u8 res3[0x20];
  53. u32 timeout_control; /* 0x40 */
  54. u8 res4[0xC];
  55. u32 config; /* 0x50 */
  56. u32 status; /* 0x54 */
  57. u8 res5[0x8]; /* 0x58 */
  58. struct gpmc_cs cs[8]; /* 0x60, 0x90, .. */
  59. u8 res6[0x14]; /* 0x1E0 */
  60. u32 ecc_config; /* 0x1F4 */
  61. u32 ecc_control; /* 0x1F8 */
  62. u32 ecc_size_config; /* 0x1FC */
  63. u32 ecc1_result; /* 0x200 */
  64. u32 ecc2_result; /* 0x204 */
  65. u32 ecc3_result; /* 0x208 */
  66. u32 ecc4_result; /* 0x20C */
  67. u32 ecc5_result; /* 0x210 */
  68. u32 ecc6_result; /* 0x214 */
  69. u32 ecc7_result; /* 0x218 */
  70. u32 ecc8_result; /* 0x21C */
  71. u32 ecc9_result; /* 0x220 */
  72. };
  73. /* Used for board specific gpmc initialization */
  74. extern struct gpmc *gpmc_cfg;
  75. struct gptimer {
  76. u32 tidr; /* 0x00 r */
  77. u8 res1[0xc];
  78. u32 tiocp_cfg; /* 0x10 rw */
  79. u8 res2[0x10];
  80. u32 tisr_raw; /* 0x24 r */
  81. u32 tisr; /* 0x28 rw */
  82. u32 tier; /* 0x2c rw */
  83. u32 ticr; /* 0x30 rw */
  84. u32 twer; /* 0x34 rw */
  85. u32 tclr; /* 0x38 rw */
  86. u32 tcrr; /* 0x3c rw */
  87. u32 tldr; /* 0x40 rw */
  88. u32 ttgr; /* 0x44 rw */
  89. u32 twpc; /* 0x48 r */
  90. u32 tmar; /* 0x4c rw */
  91. u32 tcar1; /* 0x50 r */
  92. u32 tcicr; /* 0x54 rw */
  93. u32 tcar2; /* 0x58 r */
  94. };
  95. #endif /* __ASSEMBLY__ */
  96. #endif /* __KERNEL_STRICT_NAMES */
  97. /* enable sys_clk NO-prescale /1 */
  98. #define GPT_EN ((0x0 << 2) | (0x1 << 1) | (0x1 << 0))
  99. /* Watchdog */
  100. #ifndef __KERNEL_STRICT_NAMES
  101. #ifndef __ASSEMBLY__
  102. struct watchdog {
  103. u8 res1[0x34];
  104. u32 wwps; /* 0x34 r */
  105. u8 res2[0x10];
  106. u32 wspr; /* 0x48 rw */
  107. };
  108. #endif /* __ASSEMBLY__ */
  109. #endif /* __KERNEL_STRICT_NAMES */
  110. #define WD_UNLOCK1 0xAAAA
  111. #define WD_UNLOCK2 0x5555
  112. #define SYSCLKDIV_1 (0x1 << 6)
  113. #define SYSCLKDIV_2 (0x1 << 7)
  114. #define CLKSEL_GPT1 (0x1 << 0)
  115. #define EN_GPT1 (0x1 << 0)
  116. #define EN_32KSYNC (0x1 << 2)
  117. #define ST_WDT2 (0x1 << 5)
  118. #define RESETDONE (0x1 << 0)
  119. #define TCLR_ST (0x1 << 0)
  120. #define TCLR_AR (0x1 << 1)
  121. #define TCLR_PRE (0x1 << 5)
  122. /* GPMC BASE */
  123. #define GPMC_BASE (OMAP54XX_GPMC_BASE)
  124. /* I2C base */
  125. #define I2C_BASE1 (OMAP54XX_L4_PER_BASE + 0x70000)
  126. #define I2C_BASE2 (OMAP54XX_L4_PER_BASE + 0x72000)
  127. #define I2C_BASE3 (OMAP54XX_L4_PER_BASE + 0x60000)
  128. /* MUSB base */
  129. #define MUSB_BASE (OMAP54XX_L4_CORE_BASE + 0xAB000)
  130. /* OMAP4 GPIO registers */
  131. #define OMAP_GPIO_REVISION 0x0000
  132. #define OMAP_GPIO_SYSCONFIG 0x0010
  133. #define OMAP_GPIO_SYSSTATUS 0x0114
  134. #define OMAP_GPIO_IRQSTATUS1 0x0118
  135. #define OMAP_GPIO_IRQSTATUS2 0x0128
  136. #define OMAP_GPIO_IRQENABLE2 0x012c
  137. #define OMAP_GPIO_IRQENABLE1 0x011c
  138. #define OMAP_GPIO_WAKE_EN 0x0120
  139. #define OMAP_GPIO_CTRL 0x0130
  140. #define OMAP_GPIO_OE 0x0134
  141. #define OMAP_GPIO_DATAIN 0x0138
  142. #define OMAP_GPIO_DATAOUT 0x013c
  143. #define OMAP_GPIO_LEVELDETECT0 0x0140
  144. #define OMAP_GPIO_LEVELDETECT1 0x0144
  145. #define OMAP_GPIO_RISINGDETECT 0x0148
  146. #define OMAP_GPIO_FALLINGDETECT 0x014c
  147. #define OMAP_GPIO_DEBOUNCE_EN 0x0150
  148. #define OMAP_GPIO_DEBOUNCE_VAL 0x0154
  149. #define OMAP_GPIO_CLEARIRQENABLE1 0x0160
  150. #define OMAP_GPIO_SETIRQENABLE1 0x0164
  151. #define OMAP_GPIO_CLEARWKUENA 0x0180
  152. #define OMAP_GPIO_SETWKUENA 0x0184
  153. #define OMAP_GPIO_CLEARDATAOUT 0x0190
  154. #define OMAP_GPIO_SETDATAOUT 0x0194
  155. /*
  156. * PRCM
  157. */
  158. /* PRM */
  159. #define PRM_BASE 0x4AE06000
  160. #define PRM_DEVICE_BASE (PRM_BASE + 0x1B00)
  161. #define PRM_RSTCTRL PRM_DEVICE_BASE
  162. #define PRM_RSTCTRL_RESET 0x01
  163. #define PRM_RSTST (PRM_DEVICE_BASE + 0x4)
  164. #define PRM_RSTST_WARM_RESET_MASK 0x7FEA
  165. #endif /* _CPU_H */