regs-apbh.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. /*
  2. * Freescale i.MX28 APBH Register Definitions
  3. *
  4. * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
  5. * on behalf of DENX Software Engineering GmbH
  6. *
  7. * Based on code from LTIB:
  8. * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (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, MA 02111-1307 USA
  23. *
  24. */
  25. #ifndef __REGS_APBH_H__
  26. #define __REGS_APBH_H__
  27. #include <asm/arch/regs-common.h>
  28. #ifndef __ASSEMBLY__
  29. struct mx28_apbh_regs {
  30. mx28_reg_32(hw_apbh_ctrl0)
  31. mx28_reg_32(hw_apbh_ctrl1)
  32. mx28_reg_32(hw_apbh_ctrl2)
  33. mx28_reg_32(hw_apbh_channel_ctrl)
  34. mx28_reg_32(hw_apbh_devsel)
  35. mx28_reg_32(hw_apbh_dma_burst_size)
  36. mx28_reg_32(hw_apbh_debug)
  37. uint32_t reserved[36];
  38. union {
  39. struct {
  40. mx28_reg_32(hw_apbh_ch_curcmdar)
  41. mx28_reg_32(hw_apbh_ch_nxtcmdar)
  42. mx28_reg_32(hw_apbh_ch_cmd)
  43. mx28_reg_32(hw_apbh_ch_bar)
  44. mx28_reg_32(hw_apbh_ch_sema)
  45. mx28_reg_32(hw_apbh_ch_debug1)
  46. mx28_reg_32(hw_apbh_ch_debug2)
  47. } ch[16];
  48. struct {
  49. mx28_reg_32(hw_apbh_ch0_curcmdar)
  50. mx28_reg_32(hw_apbh_ch0_nxtcmdar)
  51. mx28_reg_32(hw_apbh_ch0_cmd)
  52. mx28_reg_32(hw_apbh_ch0_bar)
  53. mx28_reg_32(hw_apbh_ch0_sema)
  54. mx28_reg_32(hw_apbh_ch0_debug1)
  55. mx28_reg_32(hw_apbh_ch0_debug2)
  56. mx28_reg_32(hw_apbh_ch1_curcmdar)
  57. mx28_reg_32(hw_apbh_ch1_nxtcmdar)
  58. mx28_reg_32(hw_apbh_ch1_cmd)
  59. mx28_reg_32(hw_apbh_ch1_bar)
  60. mx28_reg_32(hw_apbh_ch1_sema)
  61. mx28_reg_32(hw_apbh_ch1_debug1)
  62. mx28_reg_32(hw_apbh_ch1_debug2)
  63. mx28_reg_32(hw_apbh_ch2_curcmdar)
  64. mx28_reg_32(hw_apbh_ch2_nxtcmdar)
  65. mx28_reg_32(hw_apbh_ch2_cmd)
  66. mx28_reg_32(hw_apbh_ch2_bar)
  67. mx28_reg_32(hw_apbh_ch2_sema)
  68. mx28_reg_32(hw_apbh_ch2_debug1)
  69. mx28_reg_32(hw_apbh_ch2_debug2)
  70. mx28_reg_32(hw_apbh_ch3_curcmdar)
  71. mx28_reg_32(hw_apbh_ch3_nxtcmdar)
  72. mx28_reg_32(hw_apbh_ch3_cmd)
  73. mx28_reg_32(hw_apbh_ch3_bar)
  74. mx28_reg_32(hw_apbh_ch3_sema)
  75. mx28_reg_32(hw_apbh_ch3_debug1)
  76. mx28_reg_32(hw_apbh_ch3_debug2)
  77. mx28_reg_32(hw_apbh_ch4_curcmdar)
  78. mx28_reg_32(hw_apbh_ch4_nxtcmdar)
  79. mx28_reg_32(hw_apbh_ch4_cmd)
  80. mx28_reg_32(hw_apbh_ch4_bar)
  81. mx28_reg_32(hw_apbh_ch4_sema)
  82. mx28_reg_32(hw_apbh_ch4_debug1)
  83. mx28_reg_32(hw_apbh_ch4_debug2)
  84. mx28_reg_32(hw_apbh_ch5_curcmdar)
  85. mx28_reg_32(hw_apbh_ch5_nxtcmdar)
  86. mx28_reg_32(hw_apbh_ch5_cmd)
  87. mx28_reg_32(hw_apbh_ch5_bar)
  88. mx28_reg_32(hw_apbh_ch5_sema)
  89. mx28_reg_32(hw_apbh_ch5_debug1)
  90. mx28_reg_32(hw_apbh_ch5_debug2)
  91. mx28_reg_32(hw_apbh_ch6_curcmdar)
  92. mx28_reg_32(hw_apbh_ch6_nxtcmdar)
  93. mx28_reg_32(hw_apbh_ch6_cmd)
  94. mx28_reg_32(hw_apbh_ch6_bar)
  95. mx28_reg_32(hw_apbh_ch6_sema)
  96. mx28_reg_32(hw_apbh_ch6_debug1)
  97. mx28_reg_32(hw_apbh_ch6_debug2)
  98. mx28_reg_32(hw_apbh_ch7_curcmdar)
  99. mx28_reg_32(hw_apbh_ch7_nxtcmdar)
  100. mx28_reg_32(hw_apbh_ch7_cmd)
  101. mx28_reg_32(hw_apbh_ch7_bar)
  102. mx28_reg_32(hw_apbh_ch7_sema)
  103. mx28_reg_32(hw_apbh_ch7_debug1)
  104. mx28_reg_32(hw_apbh_ch7_debug2)
  105. mx28_reg_32(hw_apbh_ch8_curcmdar)
  106. mx28_reg_32(hw_apbh_ch8_nxtcmdar)
  107. mx28_reg_32(hw_apbh_ch8_cmd)
  108. mx28_reg_32(hw_apbh_ch8_bar)
  109. mx28_reg_32(hw_apbh_ch8_sema)
  110. mx28_reg_32(hw_apbh_ch8_debug1)
  111. mx28_reg_32(hw_apbh_ch8_debug2)
  112. mx28_reg_32(hw_apbh_ch9_curcmdar)
  113. mx28_reg_32(hw_apbh_ch9_nxtcmdar)
  114. mx28_reg_32(hw_apbh_ch9_cmd)
  115. mx28_reg_32(hw_apbh_ch9_bar)
  116. mx28_reg_32(hw_apbh_ch9_sema)
  117. mx28_reg_32(hw_apbh_ch9_debug1)
  118. mx28_reg_32(hw_apbh_ch9_debug2)
  119. mx28_reg_32(hw_apbh_ch10_curcmdar)
  120. mx28_reg_32(hw_apbh_ch10_nxtcmdar)
  121. mx28_reg_32(hw_apbh_ch10_cmd)
  122. mx28_reg_32(hw_apbh_ch10_bar)
  123. mx28_reg_32(hw_apbh_ch10_sema)
  124. mx28_reg_32(hw_apbh_ch10_debug1)
  125. mx28_reg_32(hw_apbh_ch10_debug2)
  126. mx28_reg_32(hw_apbh_ch11_curcmdar)
  127. mx28_reg_32(hw_apbh_ch11_nxtcmdar)
  128. mx28_reg_32(hw_apbh_ch11_cmd)
  129. mx28_reg_32(hw_apbh_ch11_bar)
  130. mx28_reg_32(hw_apbh_ch11_sema)
  131. mx28_reg_32(hw_apbh_ch11_debug1)
  132. mx28_reg_32(hw_apbh_ch11_debug2)
  133. mx28_reg_32(hw_apbh_ch12_curcmdar)
  134. mx28_reg_32(hw_apbh_ch12_nxtcmdar)
  135. mx28_reg_32(hw_apbh_ch12_cmd)
  136. mx28_reg_32(hw_apbh_ch12_bar)
  137. mx28_reg_32(hw_apbh_ch12_sema)
  138. mx28_reg_32(hw_apbh_ch12_debug1)
  139. mx28_reg_32(hw_apbh_ch12_debug2)
  140. mx28_reg_32(hw_apbh_ch13_curcmdar)
  141. mx28_reg_32(hw_apbh_ch13_nxtcmdar)
  142. mx28_reg_32(hw_apbh_ch13_cmd)
  143. mx28_reg_32(hw_apbh_ch13_bar)
  144. mx28_reg_32(hw_apbh_ch13_sema)
  145. mx28_reg_32(hw_apbh_ch13_debug1)
  146. mx28_reg_32(hw_apbh_ch13_debug2)
  147. mx28_reg_32(hw_apbh_ch14_curcmdar)
  148. mx28_reg_32(hw_apbh_ch14_nxtcmdar)
  149. mx28_reg_32(hw_apbh_ch14_cmd)
  150. mx28_reg_32(hw_apbh_ch14_bar)
  151. mx28_reg_32(hw_apbh_ch14_sema)
  152. mx28_reg_32(hw_apbh_ch14_debug1)
  153. mx28_reg_32(hw_apbh_ch14_debug2)
  154. mx28_reg_32(hw_apbh_ch15_curcmdar)
  155. mx28_reg_32(hw_apbh_ch15_nxtcmdar)
  156. mx28_reg_32(hw_apbh_ch15_cmd)
  157. mx28_reg_32(hw_apbh_ch15_bar)
  158. mx28_reg_32(hw_apbh_ch15_sema)
  159. mx28_reg_32(hw_apbh_ch15_debug1)
  160. mx28_reg_32(hw_apbh_ch15_debug2)
  161. };
  162. };
  163. mx28_reg_32(hw_apbh_version)
  164. };
  165. #endif
  166. #define APBH_CTRL0_SFTRST (1 << 31)
  167. #define APBH_CTRL0_CLKGATE (1 << 30)
  168. #define APBH_CTRL0_AHB_BURST8_EN (1 << 29)
  169. #define APBH_CTRL0_APB_BURST_EN (1 << 28)
  170. #define APBH_CTRL0_RSVD0_MASK (0xfff << 16)
  171. #define APBH_CTRL0_RSVD0_OFFSET 16
  172. #define APBH_CTRL0_CLKGATE_CHANNEL_MASK 0xffff
  173. #define APBH_CTRL0_CLKGATE_CHANNEL_OFFSET 0
  174. #define APBH_CTRL0_CLKGATE_CHANNEL_SSP0 0x0001
  175. #define APBH_CTRL0_CLKGATE_CHANNEL_SSP1 0x0002
  176. #define APBH_CTRL0_CLKGATE_CHANNEL_SSP2 0x0004
  177. #define APBH_CTRL0_CLKGATE_CHANNEL_SSP3 0x0008
  178. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND0 0x0010
  179. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND1 0x0020
  180. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND2 0x0040
  181. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND3 0x0080
  182. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND4 0x0100
  183. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND5 0x0200
  184. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND6 0x0400
  185. #define APBH_CTRL0_CLKGATE_CHANNEL_NAND7 0x0800
  186. #define APBH_CTRL0_CLKGATE_CHANNEL_HSADC 0x1000
  187. #define APBH_CTRL0_CLKGATE_CHANNEL_LCDIF 0x2000
  188. #define APBH_CTRL1_CH15_CMDCMPLT_IRQ_EN (1 << 31)
  189. #define APBH_CTRL1_CH14_CMDCMPLT_IRQ_EN (1 << 30)
  190. #define APBH_CTRL1_CH13_CMDCMPLT_IRQ_EN (1 << 29)
  191. #define APBH_CTRL1_CH12_CMDCMPLT_IRQ_EN (1 << 28)
  192. #define APBH_CTRL1_CH11_CMDCMPLT_IRQ_EN (1 << 27)
  193. #define APBH_CTRL1_CH10_CMDCMPLT_IRQ_EN (1 << 26)
  194. #define APBH_CTRL1_CH9_CMDCMPLT_IRQ_EN (1 << 25)
  195. #define APBH_CTRL1_CH8_CMDCMPLT_IRQ_EN (1 << 24)
  196. #define APBH_CTRL1_CH7_CMDCMPLT_IRQ_EN (1 << 23)
  197. #define APBH_CTRL1_CH6_CMDCMPLT_IRQ_EN (1 << 22)
  198. #define APBH_CTRL1_CH5_CMDCMPLT_IRQ_EN (1 << 21)
  199. #define APBH_CTRL1_CH4_CMDCMPLT_IRQ_EN (1 << 20)
  200. #define APBH_CTRL1_CH3_CMDCMPLT_IRQ_EN (1 << 19)
  201. #define APBH_CTRL1_CH2_CMDCMPLT_IRQ_EN (1 << 18)
  202. #define APBH_CTRL1_CH1_CMDCMPLT_IRQ_EN (1 << 17)
  203. #define APBH_CTRL1_CH0_CMDCMPLT_IRQ_EN (1 << 16)
  204. #define APBH_CTRL1_CH_CMDCMPLT_IRQ_EN_OFFSET 16
  205. #define APBH_CTRL1_CH_CMDCMPLT_IRQ_EN_MASK (0xffff << 16)
  206. #define APBH_CTRL1_CH15_CMDCMPLT_IRQ (1 << 15)
  207. #define APBH_CTRL1_CH14_CMDCMPLT_IRQ (1 << 14)
  208. #define APBH_CTRL1_CH13_CMDCMPLT_IRQ (1 << 13)
  209. #define APBH_CTRL1_CH12_CMDCMPLT_IRQ (1 << 12)
  210. #define APBH_CTRL1_CH11_CMDCMPLT_IRQ (1 << 11)
  211. #define APBH_CTRL1_CH10_CMDCMPLT_IRQ (1 << 10)
  212. #define APBH_CTRL1_CH9_CMDCMPLT_IRQ (1 << 9)
  213. #define APBH_CTRL1_CH8_CMDCMPLT_IRQ (1 << 8)
  214. #define APBH_CTRL1_CH7_CMDCMPLT_IRQ (1 << 7)
  215. #define APBH_CTRL1_CH6_CMDCMPLT_IRQ (1 << 6)
  216. #define APBH_CTRL1_CH5_CMDCMPLT_IRQ (1 << 5)
  217. #define APBH_CTRL1_CH4_CMDCMPLT_IRQ (1 << 4)
  218. #define APBH_CTRL1_CH3_CMDCMPLT_IRQ (1 << 3)
  219. #define APBH_CTRL1_CH2_CMDCMPLT_IRQ (1 << 2)
  220. #define APBH_CTRL1_CH1_CMDCMPLT_IRQ (1 << 1)
  221. #define APBH_CTRL1_CH0_CMDCMPLT_IRQ (1 << 0)
  222. #define APBH_CTRL2_CH15_ERROR_STATUS (1 << 31)
  223. #define APBH_CTRL2_CH14_ERROR_STATUS (1 << 30)
  224. #define APBH_CTRL2_CH13_ERROR_STATUS (1 << 29)
  225. #define APBH_CTRL2_CH12_ERROR_STATUS (1 << 28)
  226. #define APBH_CTRL2_CH11_ERROR_STATUS (1 << 27)
  227. #define APBH_CTRL2_CH10_ERROR_STATUS (1 << 26)
  228. #define APBH_CTRL2_CH9_ERROR_STATUS (1 << 25)
  229. #define APBH_CTRL2_CH8_ERROR_STATUS (1 << 24)
  230. #define APBH_CTRL2_CH7_ERROR_STATUS (1 << 23)
  231. #define APBH_CTRL2_CH6_ERROR_STATUS (1 << 22)
  232. #define APBH_CTRL2_CH5_ERROR_STATUS (1 << 21)
  233. #define APBH_CTRL2_CH4_ERROR_STATUS (1 << 20)
  234. #define APBH_CTRL2_CH3_ERROR_STATUS (1 << 19)
  235. #define APBH_CTRL2_CH2_ERROR_STATUS (1 << 18)
  236. #define APBH_CTRL2_CH1_ERROR_STATUS (1 << 17)
  237. #define APBH_CTRL2_CH0_ERROR_STATUS (1 << 16)
  238. #define APBH_CTRL2_CH15_ERROR_IRQ (1 << 15)
  239. #define APBH_CTRL2_CH14_ERROR_IRQ (1 << 14)
  240. #define APBH_CTRL2_CH13_ERROR_IRQ (1 << 13)
  241. #define APBH_CTRL2_CH12_ERROR_IRQ (1 << 12)
  242. #define APBH_CTRL2_CH11_ERROR_IRQ (1 << 11)
  243. #define APBH_CTRL2_CH10_ERROR_IRQ (1 << 10)
  244. #define APBH_CTRL2_CH9_ERROR_IRQ (1 << 9)
  245. #define APBH_CTRL2_CH8_ERROR_IRQ (1 << 8)
  246. #define APBH_CTRL2_CH7_ERROR_IRQ (1 << 7)
  247. #define APBH_CTRL2_CH6_ERROR_IRQ (1 << 6)
  248. #define APBH_CTRL2_CH5_ERROR_IRQ (1 << 5)
  249. #define APBH_CTRL2_CH4_ERROR_IRQ (1 << 4)
  250. #define APBH_CTRL2_CH3_ERROR_IRQ (1 << 3)
  251. #define APBH_CTRL2_CH2_ERROR_IRQ (1 << 2)
  252. #define APBH_CTRL2_CH1_ERROR_IRQ (1 << 1)
  253. #define APBH_CTRL2_CH0_ERROR_IRQ (1 << 0)
  254. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_MASK (0xffff << 16)
  255. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_OFFSET 16
  256. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_SSP0 (0x0001 << 16)
  257. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_SSP1 (0x0002 << 16)
  258. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_SSP2 (0x0004 << 16)
  259. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_SSP3 (0x0008 << 16)
  260. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND0 (0x0010 << 16)
  261. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND1 (0x0020 << 16)
  262. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND2 (0x0040 << 16)
  263. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND3 (0x0080 << 16)
  264. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND4 (0x0100 << 16)
  265. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND5 (0x0200 << 16)
  266. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND6 (0x0400 << 16)
  267. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_NAND7 (0x0800 << 16)
  268. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_HSADC (0x1000 << 16)
  269. #define APBH_CHANNEL_CTRL_RESET_CHANNEL_LCDIF (0x2000 << 16)
  270. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_MASK 0xffff
  271. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_OFFSET 0
  272. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_SSP0 0x0001
  273. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_SSP1 0x0002
  274. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_SSP2 0x0004
  275. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_SSP3 0x0008
  276. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND0 0x0010
  277. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND1 0x0020
  278. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND2 0x0040
  279. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND3 0x0080
  280. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND4 0x0100
  281. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND5 0x0200
  282. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND6 0x0400
  283. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_NAND7 0x0800
  284. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_HSADC 0x1000
  285. #define APBH_CHANNEL_CTRL_FREEZE_CHANNEL_LCDIF 0x2000
  286. #define APBH_DEVSEL_CH15_MASK (0x3 << 30)
  287. #define APBH_DEVSEL_CH15_OFFSET 30
  288. #define APBH_DEVSEL_CH14_MASK (0x3 << 28)
  289. #define APBH_DEVSEL_CH14_OFFSET 28
  290. #define APBH_DEVSEL_CH13_MASK (0x3 << 26)
  291. #define APBH_DEVSEL_CH13_OFFSET 26
  292. #define APBH_DEVSEL_CH12_MASK (0x3 << 24)
  293. #define APBH_DEVSEL_CH12_OFFSET 24
  294. #define APBH_DEVSEL_CH11_MASK (0x3 << 22)
  295. #define APBH_DEVSEL_CH11_OFFSET 22
  296. #define APBH_DEVSEL_CH10_MASK (0x3 << 20)
  297. #define APBH_DEVSEL_CH10_OFFSET 20
  298. #define APBH_DEVSEL_CH9_MASK (0x3 << 18)
  299. #define APBH_DEVSEL_CH9_OFFSET 18
  300. #define APBH_DEVSEL_CH8_MASK (0x3 << 16)
  301. #define APBH_DEVSEL_CH8_OFFSET 16
  302. #define APBH_DEVSEL_CH7_MASK (0x3 << 14)
  303. #define APBH_DEVSEL_CH7_OFFSET 14
  304. #define APBH_DEVSEL_CH6_MASK (0x3 << 12)
  305. #define APBH_DEVSEL_CH6_OFFSET 12
  306. #define APBH_DEVSEL_CH5_MASK (0x3 << 10)
  307. #define APBH_DEVSEL_CH5_OFFSET 10
  308. #define APBH_DEVSEL_CH4_MASK (0x3 << 8)
  309. #define APBH_DEVSEL_CH4_OFFSET 8
  310. #define APBH_DEVSEL_CH3_MASK (0x3 << 6)
  311. #define APBH_DEVSEL_CH3_OFFSET 6
  312. #define APBH_DEVSEL_CH2_MASK (0x3 << 4)
  313. #define APBH_DEVSEL_CH2_OFFSET 4
  314. #define APBH_DEVSEL_CH1_MASK (0x3 << 2)
  315. #define APBH_DEVSEL_CH1_OFFSET 2
  316. #define APBH_DEVSEL_CH0_MASK (0x3 << 0)
  317. #define APBH_DEVSEL_CH0_OFFSET 0
  318. #define APBH_DMA_BURST_SIZE_CH15_MASK (0x3 << 30)
  319. #define APBH_DMA_BURST_SIZE_CH15_OFFSET 30
  320. #define APBH_DMA_BURST_SIZE_CH14_MASK (0x3 << 28)
  321. #define APBH_DMA_BURST_SIZE_CH14_OFFSET 28
  322. #define APBH_DMA_BURST_SIZE_CH13_MASK (0x3 << 26)
  323. #define APBH_DMA_BURST_SIZE_CH13_OFFSET 26
  324. #define APBH_DMA_BURST_SIZE_CH12_MASK (0x3 << 24)
  325. #define APBH_DMA_BURST_SIZE_CH12_OFFSET 24
  326. #define APBH_DMA_BURST_SIZE_CH11_MASK (0x3 << 22)
  327. #define APBH_DMA_BURST_SIZE_CH11_OFFSET 22
  328. #define APBH_DMA_BURST_SIZE_CH10_MASK (0x3 << 20)
  329. #define APBH_DMA_BURST_SIZE_CH10_OFFSET 20
  330. #define APBH_DMA_BURST_SIZE_CH9_MASK (0x3 << 18)
  331. #define APBH_DMA_BURST_SIZE_CH9_OFFSET 18
  332. #define APBH_DMA_BURST_SIZE_CH8_MASK (0x3 << 16)
  333. #define APBH_DMA_BURST_SIZE_CH8_OFFSET 16
  334. #define APBH_DMA_BURST_SIZE_CH8_BURST0 (0x0 << 16)
  335. #define APBH_DMA_BURST_SIZE_CH8_BURST4 (0x1 << 16)
  336. #define APBH_DMA_BURST_SIZE_CH8_BURST8 (0x2 << 16)
  337. #define APBH_DMA_BURST_SIZE_CH7_MASK (0x3 << 14)
  338. #define APBH_DMA_BURST_SIZE_CH7_OFFSET 14
  339. #define APBH_DMA_BURST_SIZE_CH6_MASK (0x3 << 12)
  340. #define APBH_DMA_BURST_SIZE_CH6_OFFSET 12
  341. #define APBH_DMA_BURST_SIZE_CH5_MASK (0x3 << 10)
  342. #define APBH_DMA_BURST_SIZE_CH5_OFFSET 10
  343. #define APBH_DMA_BURST_SIZE_CH4_MASK (0x3 << 8)
  344. #define APBH_DMA_BURST_SIZE_CH4_OFFSET 8
  345. #define APBH_DMA_BURST_SIZE_CH3_MASK (0x3 << 6)
  346. #define APBH_DMA_BURST_SIZE_CH3_OFFSET 6
  347. #define APBH_DMA_BURST_SIZE_CH3_BURST0 (0x0 << 6)
  348. #define APBH_DMA_BURST_SIZE_CH3_BURST4 (0x1 << 6)
  349. #define APBH_DMA_BURST_SIZE_CH3_BURST8 (0x2 << 6)
  350. #define APBH_DMA_BURST_SIZE_CH2_MASK (0x3 << 4)
  351. #define APBH_DMA_BURST_SIZE_CH2_OFFSET 4
  352. #define APBH_DMA_BURST_SIZE_CH2_BURST0 (0x0 << 4)
  353. #define APBH_DMA_BURST_SIZE_CH2_BURST4 (0x1 << 4)
  354. #define APBH_DMA_BURST_SIZE_CH2_BURST8 (0x2 << 4)
  355. #define APBH_DMA_BURST_SIZE_CH1_MASK (0x3 << 2)
  356. #define APBH_DMA_BURST_SIZE_CH1_OFFSET 2
  357. #define APBH_DMA_BURST_SIZE_CH1_BURST0 (0x0 << 2)
  358. #define APBH_DMA_BURST_SIZE_CH1_BURST4 (0x1 << 2)
  359. #define APBH_DMA_BURST_SIZE_CH1_BURST8 (0x2 << 2)
  360. #define APBH_DMA_BURST_SIZE_CH0_MASK 0x3
  361. #define APBH_DMA_BURST_SIZE_CH0_OFFSET 0
  362. #define APBH_DMA_BURST_SIZE_CH0_BURST0 0x0
  363. #define APBH_DMA_BURST_SIZE_CH0_BURST4 0x1
  364. #define APBH_DMA_BURST_SIZE_CH0_BURST8 0x2
  365. #define APBH_DEBUG_GPMI_ONE_FIFO (1 << 0)
  366. #define APBH_CHn_CURCMDAR_CMD_ADDR_MASK 0xffffffff
  367. #define APBH_CHn_CURCMDAR_CMD_ADDR_OFFSET 0
  368. #define APBH_CHn_NXTCMDAR_CMD_ADDR_MASK 0xffffffff
  369. #define APBH_CHn_NXTCMDAR_CMD_ADDR_OFFSET 0
  370. #define APBH_CHn_CMD_XFER_COUNT_MASK (0xffff << 16)
  371. #define APBH_CHn_CMD_XFER_COUNT_OFFSET 16
  372. #define APBH_CHn_CMD_CMDWORDS_MASK (0xf << 12)
  373. #define APBH_CHn_CMD_CMDWORDS_OFFSET 12
  374. #define APBH_CHn_CMD_HALTONTERMINATE (1 << 8)
  375. #define APBH_CHn_CMD_WAIT4ENDCMD (1 << 7)
  376. #define APBH_CHn_CMD_SEMAPHORE (1 << 6)
  377. #define APBH_CHn_CMD_NANDWAIT4READY (1 << 5)
  378. #define APBH_CHn_CMD_NANDLOCK (1 << 4)
  379. #define APBH_CHn_CMD_IRQONCMPLT (1 << 3)
  380. #define APBH_CHn_CMD_CHAIN (1 << 2)
  381. #define APBH_CHn_CMD_COMMAND_MASK 0x3
  382. #define APBH_CHn_CMD_COMMAND_OFFSET 0
  383. #define APBH_CHn_CMD_COMMAND_NO_DMA_XFER 0x0
  384. #define APBH_CHn_CMD_COMMAND_DMA_WRITE 0x1
  385. #define APBH_CHn_CMD_COMMAND_DMA_READ 0x2
  386. #define APBH_CHn_CMD_COMMAND_DMA_SENSE 0x3
  387. #define APBH_CHn_BAR_ADDRESS_MASK 0xffffffff
  388. #define APBH_CHn_BAR_ADDRESS_OFFSET 0
  389. #define APBH_CHn_SEMA_RSVD2_MASK (0xff << 24)
  390. #define APBH_CHn_SEMA_RSVD2_OFFSET 24
  391. #define APBH_CHn_SEMA_PHORE_MASK (0xff << 16)
  392. #define APBH_CHn_SEMA_PHORE_OFFSET 16
  393. #define APBH_CHn_SEMA_RSVD1_MASK (0xff << 8)
  394. #define APBH_CHn_SEMA_RSVD1_OFFSET 8
  395. #define APBH_CHn_SEMA_INCREMENT_SEMA_MASK (0xff << 0)
  396. #define APBH_CHn_SEMA_INCREMENT_SEMA_OFFSET 0
  397. #define APBH_CHn_DEBUG1_REQ (1 << 31)
  398. #define APBH_CHn_DEBUG1_BURST (1 << 30)
  399. #define APBH_CHn_DEBUG1_KICK (1 << 29)
  400. #define APBH_CHn_DEBUG1_END (1 << 28)
  401. #define APBH_CHn_DEBUG1_SENSE (1 << 27)
  402. #define APBH_CHn_DEBUG1_READY (1 << 26)
  403. #define APBH_CHn_DEBUG1_LOCK (1 << 25)
  404. #define APBH_CHn_DEBUG1_NEXTCMDADDRVALID (1 << 24)
  405. #define APBH_CHn_DEBUG1_RD_FIFO_EMPTY (1 << 23)
  406. #define APBH_CHn_DEBUG1_RD_FIFO_FULL (1 << 22)
  407. #define APBH_CHn_DEBUG1_WR_FIFO_EMPTY (1 << 21)
  408. #define APBH_CHn_DEBUG1_WR_FIFO_FULL (1 << 20)
  409. #define APBH_CHn_DEBUG1_RSVD1_MASK (0x7fff << 5)
  410. #define APBH_CHn_DEBUG1_RSVD1_OFFSET 5
  411. #define APBH_CHn_DEBUG1_STATEMACHINE_MASK 0x1f
  412. #define APBH_CHn_DEBUG1_STATEMACHINE_OFFSET 0
  413. #define APBH_CHn_DEBUG1_STATEMACHINE_IDLE 0x00
  414. #define APBH_CHn_DEBUG1_STATEMACHINE_REQ_CMD1 0x01
  415. #define APBH_CHn_DEBUG1_STATEMACHINE_REQ_CMD3 0x02
  416. #define APBH_CHn_DEBUG1_STATEMACHINE_REQ_CMD2 0x03
  417. #define APBH_CHn_DEBUG1_STATEMACHINE_XFER_DECODE 0x04
  418. #define APBH_CHn_DEBUG1_STATEMACHINE_REQ_WAIT 0x05
  419. #define APBH_CHn_DEBUG1_STATEMACHINE_REQ_CMD4 0x06
  420. #define APBH_CHn_DEBUG1_STATEMACHINE_PIO_REQ 0x07
  421. #define APBH_CHn_DEBUG1_STATEMACHINE_READ_FLUSH 0x08
  422. #define APBH_CHn_DEBUG1_STATEMACHINE_READ_WAIT 0x09
  423. #define APBH_CHn_DEBUG1_STATEMACHINE_WRITE 0x0c
  424. #define APBH_CHn_DEBUG1_STATEMACHINE_READ_REQ 0x0d
  425. #define APBH_CHn_DEBUG1_STATEMACHINE_CHECK_CHAIN 0x0e
  426. #define APBH_CHn_DEBUG1_STATEMACHINE_XFER_COMPLETE 0x0f
  427. #define APBH_CHn_DEBUG1_STATEMACHINE_TERMINATE 0x14
  428. #define APBH_CHn_DEBUG1_STATEMACHINE_WAIT_END 0x15
  429. #define APBH_CHn_DEBUG1_STATEMACHINE_WRITE_WAIT 0x1c
  430. #define APBH_CHn_DEBUG1_STATEMACHINE_HALT_AFTER_TERM 0x1d
  431. #define APBH_CHn_DEBUG1_STATEMACHINE_CHECK_WAIT 0x1e
  432. #define APBH_CHn_DEBUG1_STATEMACHINE_WAIT_READY 0x1f
  433. #define APBH_CHn_DEBUG2_APB_BYTES_MASK (0xffff << 16)
  434. #define APBH_CHn_DEBUG2_APB_BYTES_OFFSET 16
  435. #define APBH_CHn_DEBUG2_AHB_BYTES_MASK 0xffff
  436. #define APBH_CHn_DEBUG2_AHB_BYTES_OFFSET 0
  437. #define APBH_VERSION_MAJOR_MASK (0xff << 24)
  438. #define APBH_VERSION_MAJOR_OFFSET 24
  439. #define APBH_VERSION_MINOR_MASK (0xff << 16)
  440. #define APBH_VERSION_MINOR_OFFSET 16
  441. #define APBH_VERSION_STEP_MASK 0xffff
  442. #define APBH_VERSION_STEP_OFFSET 0
  443. #endif /* __REGS_APBH_H__ */