bf527.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. * Copyright 2007-2009 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later.
  5. */
  6. #ifndef __MACH_BF527_H__
  7. #define __MACH_BF527_H__
  8. #define OFFSET_(x) ((x) & 0x0000FFFF)
  9. /*some misc defines*/
  10. #define IMASK_IVG15 0x8000
  11. #define IMASK_IVG14 0x4000
  12. #define IMASK_IVG13 0x2000
  13. #define IMASK_IVG12 0x1000
  14. #define IMASK_IVG11 0x0800
  15. #define IMASK_IVG10 0x0400
  16. #define IMASK_IVG9 0x0200
  17. #define IMASK_IVG8 0x0100
  18. #define IMASK_IVG7 0x0080
  19. #define IMASK_IVGTMR 0x0040
  20. #define IMASK_IVGHW 0x0020
  21. /***************************/
  22. #define BFIN_DSUBBANKS 4
  23. #define BFIN_DWAYS 2
  24. #define BFIN_DLINES 64
  25. #define BFIN_ISUBBANKS 4
  26. #define BFIN_IWAYS 4
  27. #define BFIN_ILINES 32
  28. #define WAY0_L 0x1
  29. #define WAY1_L 0x2
  30. #define WAY01_L 0x3
  31. #define WAY2_L 0x4
  32. #define WAY02_L 0x5
  33. #define WAY12_L 0x6
  34. #define WAY012_L 0x7
  35. #define WAY3_L 0x8
  36. #define WAY03_L 0x9
  37. #define WAY13_L 0xA
  38. #define WAY013_L 0xB
  39. #define WAY32_L 0xC
  40. #define WAY320_L 0xD
  41. #define WAY321_L 0xE
  42. #define WAYALL_L 0xF
  43. #define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
  44. /********************************* EBIU Settings ************************************/
  45. #define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
  46. #define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
  47. #ifdef CONFIG_C_AMBEN_ALL
  48. #define V_AMBEN AMBEN_ALL
  49. #endif
  50. #ifdef CONFIG_C_AMBEN
  51. #define V_AMBEN 0x0
  52. #endif
  53. #ifdef CONFIG_C_AMBEN_B0
  54. #define V_AMBEN AMBEN_B0
  55. #endif
  56. #ifdef CONFIG_C_AMBEN_B0_B1
  57. #define V_AMBEN AMBEN_B0_B1
  58. #endif
  59. #ifdef CONFIG_C_AMBEN_B0_B1_B2
  60. #define V_AMBEN AMBEN_B0_B1_B2
  61. #endif
  62. #ifdef CONFIG_C_AMCKEN
  63. #define V_AMCKEN AMCKEN
  64. #else
  65. #define V_AMCKEN 0x0
  66. #endif
  67. #ifdef CONFIG_C_CDPRIO
  68. #define V_CDPRIO 0x100
  69. #else
  70. #define V_CDPRIO 0x0
  71. #endif
  72. #define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
  73. /**************************** Hysteresis Settings ****************************/
  74. #ifdef CONFIG_BFIN_HYSTERESIS_CONTROL
  75. #ifdef CONFIG_GPIO_HYST_PORTF_0_7
  76. #define HYST_PORTF_0_7 (1 << 0)
  77. #else
  78. #define HYST_PORTF_0_7 (0 << 0)
  79. #endif
  80. #ifdef CONFIG_GPIO_HYST_PORTF_8_9
  81. #define HYST_PORTF_8_9 (1 << 2)
  82. #else
  83. #define HYST_PORTF_8_9 (0 << 2)
  84. #endif
  85. #ifdef CONFIG_GPIO_HYST_PORTF_10
  86. #define HYST_PORTF_10 (1 << 4)
  87. #else
  88. #define HYST_PORTF_10 (0 << 4)
  89. #endif
  90. #ifdef CONFIG_GPIO_HYST_PORTF_11
  91. #define HYST_PORTF_11 (1 << 6)
  92. #else
  93. #define HYST_PORTF_11 (0 << 6)
  94. #endif
  95. #ifdef CONFIG_GPIO_HYST_PORTF_12_13
  96. #define HYST_PORTF_12_13 (1 << 8)
  97. #else
  98. #define HYST_PORTF_12_13 (0 << 8)
  99. #endif
  100. #ifdef CONFIG_GPIO_HYST_PORTF_14_15
  101. #define HYST_PORTF_14_15 (1 << 10)
  102. #else
  103. #define HYST_PORTF_14_15 (0 << 10)
  104. #endif
  105. #define HYST_PORTF_0_15 (HYST_PORTF_0_7 | HYST_PORTF_8_9 | HYST_PORTF_10 | \
  106. HYST_PORTF_11 | HYST_PORTF_12_13 | HYST_PORTF_14_15)
  107. #ifdef CONFIG_GPIO_HYST_PORTG_0
  108. #define HYST_PORTG_0 (1 << 0)
  109. #else
  110. #define HYST_PORTG_0 (0 << 0)
  111. #endif
  112. #ifdef CONFIG_GPIO_HYST_PORTG_1_4
  113. #define HYST_PORTG_1_4 (1 << 2)
  114. #else
  115. #define HYST_PORTG_1_4 (0 << 2)
  116. #endif
  117. #ifdef CONFIG_GPIO_HYST_PORTG_5_6
  118. #define HYST_PORTG_5_6 (1 << 4)
  119. #else
  120. #define HYST_PORTG_5_6 (0 << 4)
  121. #endif
  122. #ifdef CONFIG_GPIO_HYST_PORTG_7_8
  123. #define HYST_PORTG_7_8 (1 << 6)
  124. #else
  125. #define HYST_PORTG_7_8 (0 << 6)
  126. #endif
  127. #ifdef CONFIG_GPIO_HYST_PORTG_9
  128. #define HYST_PORTG_9 (1 << 8)
  129. #else
  130. #define HYST_PORTG_9 (0 << 8)
  131. #endif
  132. #ifdef CONFIG_GPIO_HYST_PORTG_10
  133. #define HYST_PORTG_10 (1 << 10)
  134. #else
  135. #define HYST_PORTG_10 (0 << 10)
  136. #endif
  137. #ifdef CONFIG_GPIO_HYST_PORTG_11_13
  138. #define HYST_PORTG_11_13 (1 << 12)
  139. #else
  140. #define HYST_PORTG_11_13 (0 << 12)
  141. #endif
  142. #ifdef CONFIG_GPIO_HYST_PORTG_14_15
  143. #define HYST_PORTG_14_15 (1 << 14)
  144. #else
  145. #define HYST_PORTG_14_15 (0 << 14)
  146. #endif
  147. #define HYST_PORTG_0_15 (HYST_PORTG_0 | HYST_PORTG_1_4 | HYST_PORTG_5_6 | \
  148. HYST_PORTG_7_8 | HYST_PORTG_9 | HYST_PORTG_10 | \
  149. HYST_PORTG_11_13 | HYST_PORTG_14_15)
  150. #ifdef CONFIG_GPIO_HYST_PORTH_0_7
  151. #define HYST_PORTH_0_7 (1 << 0)
  152. #else
  153. #define HYST_PORTH_0_7 (0 << 0)
  154. #endif
  155. #ifdef CONFIG_GPIO_HYST_PORTH_8
  156. #define HYST_PORTH_8 (1 << 2)
  157. #else
  158. #define HYST_PORTH_8 (0 << 2)
  159. #endif
  160. #ifdef CONFIG_GPIO_HYST_PORTH_9_15
  161. #define HYST_PORTH_9_15 (1 << 4)
  162. #else
  163. #define HYST_PORTH_9_15 (0 << 4)
  164. #endif
  165. #define HYST_PORTH_0_15 (HYST_PORTH_0_7 | HYST_PORTH_8 | HYST_PORTH_9_15)
  166. #ifdef CONFIG_NONEGPIO_HYST_TMR0_FS1_PPICLK
  167. #define HYST_TMR0_FS1_PPICLK (1 << 0)
  168. #else
  169. #define HYST_TMR0_FS1_PPICLK (0 << 0)
  170. #endif
  171. #ifdef CONFIG_NONEGPIO_HYST_NMI_RST_BMODE
  172. #define HYST_NMI_RST_BMODE (1 << 2)
  173. #else
  174. #define HYST_NMI_RST_BMODE (0 << 2)
  175. #endif
  176. #ifdef CONFIG_NONEGPIO_HYST_JTAG
  177. #define HYST_JTAG (1 << 4)
  178. #else
  179. #define HYST_JTAG (0 << 4)
  180. #endif
  181. #define HYST_NONEGPIO (HYST_TMR0_FS1_PPICLK | HYST_NMI_RST_BMODE | HYST_JTAG)
  182. #define HYST_NONEGPIO_MASK (0x3F)
  183. #endif /* CONFIG_BFIN_HYSTERESIS_CONTROL */
  184. #ifdef CONFIG_BF527
  185. #define CPU "BF527"
  186. #define CPUID 0x27e0
  187. #endif
  188. #ifdef CONFIG_BF526
  189. #define CPU "BF526"
  190. #define CPUID 0x27e4
  191. #endif
  192. #ifdef CONFIG_BF525
  193. #define CPU "BF525"
  194. #define CPUID 0x27e0
  195. #endif
  196. #ifdef CONFIG_BF524
  197. #define CPU "BF524"
  198. #define CPUID 0x27e4
  199. #endif
  200. #ifdef CONFIG_BF523
  201. #define CPU "BF523"
  202. #define CPUID 0x27e0
  203. #endif
  204. #ifdef CONFIG_BF522
  205. #define CPU "BF522"
  206. #define CPUID 0x27e4
  207. #endif
  208. #ifndef CPU
  209. #error "Unknown CPU type - This kernel doesn't seem to be configured properly"
  210. #endif
  211. #endif /* __MACH_BF527_H__ */