blackfin.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. /*
  2. * File: include/asm-blackfin/mach-bf537/blackfin.h
  3. * Based on:
  4. * Author:
  5. *
  6. * Created:
  7. * Description:
  8. *
  9. * Rev:
  10. *
  11. * Modified:
  12. *
  13. *
  14. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License as published by
  18. * the Free Software Foundation; either version 2, or (at your option)
  19. * any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; see the file COPYING.
  28. * If not, write to the Free Software Foundation,
  29. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  30. */
  31. #ifndef _MACH_BLACKFIN_H_
  32. #define _MACH_BLACKFIN_H_
  33. #define BF537_FAMILY
  34. #include "bf537.h"
  35. #include "mem_map.h"
  36. #include "defBF534.h"
  37. #include "anomaly.h"
  38. #if defined(CONFIG_BF537) || defined(CONFIG_BF536)
  39. #include "defBF537.h"
  40. #endif
  41. #if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
  42. #include "cdefBF534.h"
  43. /* UART 0*/
  44. #define bfin_read_UART_THR() bfin_read_UART0_THR()
  45. #define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
  46. #define bfin_read_UART_RBR() bfin_read_UART0_RBR()
  47. #define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
  48. #define bfin_read_UART_DLL() bfin_read_UART0_DLL()
  49. #define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
  50. #define bfin_read_UART_IER() bfin_read_UART0_IER()
  51. #define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
  52. #define bfin_read_UART_DLH() bfin_read_UART0_DLH()
  53. #define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
  54. #define bfin_read_UART_IIR() bfin_read_UART0_IIR()
  55. #define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
  56. #define bfin_read_UART_LCR() bfin_read_UART0_LCR()
  57. #define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
  58. #define bfin_read_UART_MCR() bfin_read_UART0_MCR()
  59. #define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
  60. #define bfin_read_UART_LSR() bfin_read_UART0_LSR()
  61. #define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
  62. #define bfin_read_UART_SCR() bfin_read_UART0_SCR()
  63. #define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
  64. #define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
  65. #define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
  66. #if defined(CONFIG_BF537) || defined(CONFIG_BF536)
  67. #include "cdefBF537.h"
  68. #endif
  69. #endif
  70. /* MAP used DEFINES from BF533 to BF537 - so we don't need to change them in the driver, kernel, etc. */
  71. /* UART_IIR Register */
  72. #define STATUS(x) ((x << 1) & 0x06)
  73. #define STATUS_P1 0x02
  74. #define STATUS_P0 0x01
  75. /* UART 0*/
  76. /* DMA Channnel */
  77. #define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
  78. #define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
  79. #define CH_UART_RX CH_UART0_RX
  80. #define bfin_read_CH_UART_TX() bfin_read_CH_UART0_TX()
  81. #define bfin_write_CH_UART_TX(val) bfin_write_CH_UART0_TX(val)
  82. #define CH_UART_TX CH_UART0_TX
  83. /* System Interrupt Controller */
  84. #define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART0_RX()
  85. #define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART0_RX(val)
  86. #define IRQ_UART_RX IRQ_UART0_RX
  87. #define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART0_TX()
  88. #define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART0_TX(val)
  89. #define IRQ_UART_TX IRQ_UART0_TX
  90. #define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART0_ERROR()
  91. #define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART0_ERROR(val)
  92. #define IRQ_UART_ERROR IRQ_UART0_ERROR
  93. /* MMR Registers*/
  94. #define bfin_read_UART_THR() bfin_read_UART0_THR()
  95. #define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
  96. #define UART_THR UART0_THR
  97. #define bfin_read_UART_RBR() bfin_read_UART0_RBR()
  98. #define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
  99. #define UART_RBR UART0_RBR
  100. #define bfin_read_UART_DLL() bfin_read_UART0_DLL()
  101. #define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
  102. #define UART_DLL UART0_DLL
  103. #define bfin_read_UART_IER() bfin_read_UART0_IER()
  104. #define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
  105. #define UART_IER UART0_IER
  106. #define bfin_read_UART_DLH() bfin_read_UART0_DLH()
  107. #define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
  108. #define UART_DLH UART0_DLH
  109. #define bfin_read_UART_IIR() bfin_read_UART0_IIR()
  110. #define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
  111. #define UART_IIR UART0_IIR
  112. #define bfin_read_UART_LCR() bfin_read_UART0_LCR()
  113. #define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
  114. #define UART_LCR UART0_LCR
  115. #define bfin_read_UART_MCR() bfin_read_UART0_MCR()
  116. #define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
  117. #define UART_MCR UART0_MCR
  118. #define bfin_read_UART_LSR() bfin_read_UART0_LSR()
  119. #define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
  120. #define UART_LSR UART0_LSR
  121. #define bfin_read_UART_SCR() bfin_read_UART0_SCR()
  122. #define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
  123. #define UART_SCR UART0_SCR
  124. #define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
  125. #define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
  126. #define UART_GCTL UART0_GCTL
  127. /* DPMC*/
  128. #define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
  129. #define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
  130. #define STOPCK_OFF STOPCK
  131. /* FIO USE PORT F*/
  132. #ifdef CONFIG_BF537_PORT_F
  133. #define bfin_read_PORT_FER() bfin_read_PORTF_FER()
  134. #define bfin_write_PORT_FER(val) bfin_write_PORTF_FER(val)
  135. #define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
  136. #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
  137. #define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
  138. #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
  139. #define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
  140. #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
  141. #define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
  142. #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
  143. #define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
  144. #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
  145. #define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
  146. #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
  147. #define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
  148. #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
  149. #define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
  150. #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
  151. #define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
  152. #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
  153. #define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
  154. #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
  155. #define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
  156. #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
  157. #define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
  158. #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
  159. #define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
  160. #define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
  161. #define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
  162. #define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
  163. #define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
  164. #define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
  165. #define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
  166. #define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
  167. #define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
  168. #define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
  169. #define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
  170. #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
  171. #define FIO_FLAG_D PORTFIO
  172. #define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
  173. #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
  174. #define FIO_FLAG_C PORTFIO_CLEAR
  175. #define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
  176. #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
  177. #define FIO_FLAG_S PORTFIO_SET
  178. #define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
  179. #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
  180. #define FIO_FLAG_T PORTFIO_TOGGLE
  181. #define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
  182. #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
  183. #define FIO_MASKA_D PORTFIO_MASKA
  184. #define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
  185. #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
  186. #define FIO_MASKA_C PORTFIO_MASKA_CLEAR
  187. #define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
  188. #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
  189. #define FIO_MASKA_S PORTFIO_MASKA_SET
  190. #define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
  191. #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
  192. #define FIO_MASKA_T PORTFIO_MASKA_TOGGLE
  193. #define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
  194. #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
  195. #define FIO_MASKB_D PORTFIO_MASKB
  196. #define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
  197. #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
  198. #define FIO_MASKB_C PORTFIO_MASKB_CLEAR
  199. #define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
  200. #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
  201. #define FIO_MASKB_S PORTFIO_MASKB_SET
  202. #define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
  203. #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
  204. #define FIO_MASKB_T PORTFIO_MASKB_TOGGLE
  205. #define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
  206. #define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
  207. #define FIO_DIR PORTFIO_DIR
  208. #define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
  209. #define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
  210. #define FIO_POLAR PORTFIO_POLAR
  211. #define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
  212. #define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
  213. #define FIO_EDGE PORTFIO_EDGE
  214. #define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
  215. #define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
  216. #define FIO_BOTH PORTFIO_BOTH
  217. #define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
  218. #define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
  219. #define FIO_INEN PORTFIO_INEN
  220. #endif
  221. /* FIO USE PORT G*/
  222. #ifdef CONFIG_BF537_PORT_G
  223. #define bfin_read_PORT_FER() bfin_read_PORTG_FER()
  224. #define bfin_write_PORT_FER(val) bfin_write_PORTG_FER(val)
  225. #define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
  226. #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
  227. #define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
  228. #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
  229. #define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
  230. #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
  231. #define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
  232. #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
  233. #define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
  234. #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
  235. #define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
  236. #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
  237. #define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
  238. #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
  239. #define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
  240. #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
  241. #define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
  242. #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
  243. #define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
  244. #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
  245. #define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
  246. #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
  247. #define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
  248. #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
  249. #define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
  250. #define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
  251. #define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
  252. #define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
  253. #define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
  254. #define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
  255. #define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
  256. #define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
  257. #define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
  258. #define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
  259. #define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
  260. #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
  261. #define FIO_FLAG_D PORTGIO
  262. #define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
  263. #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
  264. #define FIO_FLAG_C PORTGIO_CLEAR
  265. #define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
  266. #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
  267. #define FIO_FLAG_S PORTGIO_SET
  268. #define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
  269. #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
  270. #define FIO_FLAG_T PORTGIO_TOGGLE
  271. #define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
  272. #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
  273. #define FIO_MASKA_D PORTGIO_MASKA
  274. #define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
  275. #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
  276. #define FIO_MASKA_C PORTGIO_MASKA_CLEAR
  277. #define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
  278. #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
  279. #define FIO_MASKA_S PORTGIO_MASKA_SET
  280. #define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
  281. #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
  282. #define FIO_MASKA_T PORTGIO_MASKA_TOGGLE
  283. #define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
  284. #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
  285. #define FIO_MASKB_D PORTGIO_MASKB
  286. #define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
  287. #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
  288. #define FIO_MASKB_C PORTGIO_MASKB_CLEAR
  289. #define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
  290. #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
  291. #define FIO_MASKB_S PORTGIO_MASKB_SET
  292. #define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
  293. #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
  294. #define FIO_MASKB_T PORTGIO_MASKB_TOGGLE
  295. #define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
  296. #define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
  297. #define FIO_DIR PORTGIO_DIR
  298. #define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
  299. #define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
  300. #define FIO_POLAR PORTGIO_POLAR
  301. #define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
  302. #define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
  303. #define FIO_EDGE PORTGIO_EDGE
  304. #define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
  305. #define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
  306. #define FIO_BOTH PORTGIO_BOTH
  307. #define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
  308. #define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
  309. #define FIO_INEN PORTGIO_INEN
  310. #endif
  311. /* FIO USE PORT H*/
  312. #ifdef CONFIG_BF537_PORT_H
  313. #define bfin_read_PORT_FER() bfin_read_PORTH_FER()
  314. #define bfin_write_PORT_FER(val) bfin_write_PORTH_FER(val)
  315. #define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
  316. #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
  317. #define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
  318. #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
  319. #define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
  320. #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
  321. #define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
  322. #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
  323. #define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
  324. #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
  325. #define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
  326. #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
  327. #define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
  328. #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
  329. #define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
  330. #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
  331. #define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
  332. #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
  333. #define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
  334. #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
  335. #define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
  336. #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
  337. #define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
  338. #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
  339. #define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
  340. #define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
  341. #define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
  342. #define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
  343. #define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
  344. #define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
  345. #define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
  346. #define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
  347. #define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
  348. #define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
  349. #define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
  350. #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
  351. #define FIO_FLAG_D PORTHIO
  352. #define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
  353. #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
  354. #define FIO_FLAG_C PORTHIO_CLEAR
  355. #define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
  356. #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
  357. #define FIO_FLAG_S PORTHIO_SET
  358. #define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
  359. #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
  360. #define FIO_FLAG_T PORTHIO_TOGGLE
  361. #define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
  362. #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
  363. #define FIO_MASKA_D PORTHIO_MASKA
  364. #define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
  365. #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
  366. #define FIO_MASKA_C PORTHIO_MASKA_CLEAR
  367. #define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
  368. #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
  369. #define FIO_MASKA_S PORTHIO_MASKA_SET
  370. #define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
  371. #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
  372. #define FIO_MASKA_T PORTHIO_MASKA_TOGGLE
  373. #define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
  374. #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
  375. #define FIO_MASKB_D PORTHIO_MASKB
  376. #define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
  377. #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
  378. #define FIO_MASKB_C PORTHIO_MASKB_CLEAR
  379. #define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
  380. #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
  381. #define FIO_MASKB_S PORTHIO_MASKB_SET
  382. #define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
  383. #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
  384. #define FIO_MASKB_T PORTHIO_MASKB_TOGGLE
  385. #define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
  386. #define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
  387. #define FIO_DIR PORTHIO_DIR
  388. #define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
  389. #define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
  390. #define FIO_POLAR PORTHIO_POLAR
  391. #define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
  392. #define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
  393. #define FIO_EDGE PORTHIO_EDGE
  394. #define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
  395. #define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
  396. #define FIO_BOTH PORTHIO_BOTH
  397. #define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
  398. #define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
  399. #define FIO_INEN PORTHIO_INEN
  400. #endif
  401. /* PLL_DIV Masks */
  402. #define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
  403. #define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
  404. #define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
  405. #define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
  406. #endif