pio_defs.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. #ifndef __pio_defs_h
  2. #define __pio_defs_h
  3. /*
  4. * This file is autogenerated from
  5. * file: pio.r
  6. *
  7. * by ../../../tools/rdesc/bin/rdes2c -outfile pio_defs.h pio.r
  8. * Any changes here will be lost.
  9. *
  10. * -*- buffer-read-only: t -*-
  11. */
  12. /* Main access macros */
  13. #ifndef REG_RD
  14. #define REG_RD( scope, inst, reg ) \
  15. REG_READ( reg_##scope##_##reg, \
  16. (inst) + REG_RD_ADDR_##scope##_##reg )
  17. #endif
  18. #ifndef REG_WR
  19. #define REG_WR( scope, inst, reg, val ) \
  20. REG_WRITE( reg_##scope##_##reg, \
  21. (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
  22. #endif
  23. #ifndef REG_RD_VECT
  24. #define REG_RD_VECT( scope, inst, reg, index ) \
  25. REG_READ( reg_##scope##_##reg, \
  26. (inst) + REG_RD_ADDR_##scope##_##reg + \
  27. (index) * STRIDE_##scope##_##reg )
  28. #endif
  29. #ifndef REG_WR_VECT
  30. #define REG_WR_VECT( scope, inst, reg, index, val ) \
  31. REG_WRITE( reg_##scope##_##reg, \
  32. (inst) + REG_WR_ADDR_##scope##_##reg + \
  33. (index) * STRIDE_##scope##_##reg, (val) )
  34. #endif
  35. #ifndef REG_RD_INT
  36. #define REG_RD_INT( scope, inst, reg ) \
  37. REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
  38. #endif
  39. #ifndef REG_WR_INT
  40. #define REG_WR_INT( scope, inst, reg, val ) \
  41. REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
  42. #endif
  43. #ifndef REG_RD_INT_VECT
  44. #define REG_RD_INT_VECT( scope, inst, reg, index ) \
  45. REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
  46. (index) * STRIDE_##scope##_##reg )
  47. #endif
  48. #ifndef REG_WR_INT_VECT
  49. #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
  50. REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
  51. (index) * STRIDE_##scope##_##reg, (val) )
  52. #endif
  53. #ifndef REG_TYPE_CONV
  54. #define REG_TYPE_CONV( type, orgtype, val ) \
  55. ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
  56. #endif
  57. #ifndef reg_page_size
  58. #define reg_page_size 8192
  59. #endif
  60. #ifndef REG_ADDR
  61. #define REG_ADDR( scope, inst, reg ) \
  62. ( (inst) + REG_RD_ADDR_##scope##_##reg )
  63. #endif
  64. #ifndef REG_ADDR_VECT
  65. #define REG_ADDR_VECT( scope, inst, reg, index ) \
  66. ( (inst) + REG_RD_ADDR_##scope##_##reg + \
  67. (index) * STRIDE_##scope##_##reg )
  68. #endif
  69. /* C-code for register scope pio */
  70. /* Register rw_data, scope pio, type rw */
  71. typedef unsigned int reg_pio_rw_data;
  72. #define REG_RD_ADDR_pio_rw_data 64
  73. #define REG_WR_ADDR_pio_rw_data 64
  74. /* Register rw_io_access0, scope pio, type rw */
  75. typedef struct {
  76. unsigned int data : 8;
  77. unsigned int dummy1 : 24;
  78. } reg_pio_rw_io_access0;
  79. #define REG_RD_ADDR_pio_rw_io_access0 0
  80. #define REG_WR_ADDR_pio_rw_io_access0 0
  81. /* Register rw_io_access1, scope pio, type rw */
  82. typedef struct {
  83. unsigned int data : 8;
  84. unsigned int dummy1 : 24;
  85. } reg_pio_rw_io_access1;
  86. #define REG_RD_ADDR_pio_rw_io_access1 4
  87. #define REG_WR_ADDR_pio_rw_io_access1 4
  88. /* Register rw_io_access2, scope pio, type rw */
  89. typedef struct {
  90. unsigned int data : 8;
  91. unsigned int dummy1 : 24;
  92. } reg_pio_rw_io_access2;
  93. #define REG_RD_ADDR_pio_rw_io_access2 8
  94. #define REG_WR_ADDR_pio_rw_io_access2 8
  95. /* Register rw_io_access3, scope pio, type rw */
  96. typedef struct {
  97. unsigned int data : 8;
  98. unsigned int dummy1 : 24;
  99. } reg_pio_rw_io_access3;
  100. #define REG_RD_ADDR_pio_rw_io_access3 12
  101. #define REG_WR_ADDR_pio_rw_io_access3 12
  102. /* Register rw_io_access4, scope pio, type rw */
  103. typedef struct {
  104. unsigned int data : 8;
  105. unsigned int dummy1 : 24;
  106. } reg_pio_rw_io_access4;
  107. #define REG_RD_ADDR_pio_rw_io_access4 16
  108. #define REG_WR_ADDR_pio_rw_io_access4 16
  109. /* Register rw_io_access5, scope pio, type rw */
  110. typedef struct {
  111. unsigned int data : 8;
  112. unsigned int dummy1 : 24;
  113. } reg_pio_rw_io_access5;
  114. #define REG_RD_ADDR_pio_rw_io_access5 20
  115. #define REG_WR_ADDR_pio_rw_io_access5 20
  116. /* Register rw_io_access6, scope pio, type rw */
  117. typedef struct {
  118. unsigned int data : 8;
  119. unsigned int dummy1 : 24;
  120. } reg_pio_rw_io_access6;
  121. #define REG_RD_ADDR_pio_rw_io_access6 24
  122. #define REG_WR_ADDR_pio_rw_io_access6 24
  123. /* Register rw_io_access7, scope pio, type rw */
  124. typedef struct {
  125. unsigned int data : 8;
  126. unsigned int dummy1 : 24;
  127. } reg_pio_rw_io_access7;
  128. #define REG_RD_ADDR_pio_rw_io_access7 28
  129. #define REG_WR_ADDR_pio_rw_io_access7 28
  130. /* Register rw_io_access8, scope pio, type rw */
  131. typedef struct {
  132. unsigned int data : 8;
  133. unsigned int dummy1 : 24;
  134. } reg_pio_rw_io_access8;
  135. #define REG_RD_ADDR_pio_rw_io_access8 32
  136. #define REG_WR_ADDR_pio_rw_io_access8 32
  137. /* Register rw_io_access9, scope pio, type rw */
  138. typedef struct {
  139. unsigned int data : 8;
  140. unsigned int dummy1 : 24;
  141. } reg_pio_rw_io_access9;
  142. #define REG_RD_ADDR_pio_rw_io_access9 36
  143. #define REG_WR_ADDR_pio_rw_io_access9 36
  144. /* Register rw_io_access10, scope pio, type rw */
  145. typedef struct {
  146. unsigned int data : 8;
  147. unsigned int dummy1 : 24;
  148. } reg_pio_rw_io_access10;
  149. #define REG_RD_ADDR_pio_rw_io_access10 40
  150. #define REG_WR_ADDR_pio_rw_io_access10 40
  151. /* Register rw_io_access11, scope pio, type rw */
  152. typedef struct {
  153. unsigned int data : 8;
  154. unsigned int dummy1 : 24;
  155. } reg_pio_rw_io_access11;
  156. #define REG_RD_ADDR_pio_rw_io_access11 44
  157. #define REG_WR_ADDR_pio_rw_io_access11 44
  158. /* Register rw_io_access12, scope pio, type rw */
  159. typedef struct {
  160. unsigned int data : 8;
  161. unsigned int dummy1 : 24;
  162. } reg_pio_rw_io_access12;
  163. #define REG_RD_ADDR_pio_rw_io_access12 48
  164. #define REG_WR_ADDR_pio_rw_io_access12 48
  165. /* Register rw_io_access13, scope pio, type rw */
  166. typedef struct {
  167. unsigned int data : 8;
  168. unsigned int dummy1 : 24;
  169. } reg_pio_rw_io_access13;
  170. #define REG_RD_ADDR_pio_rw_io_access13 52
  171. #define REG_WR_ADDR_pio_rw_io_access13 52
  172. /* Register rw_io_access14, scope pio, type rw */
  173. typedef struct {
  174. unsigned int data : 8;
  175. unsigned int dummy1 : 24;
  176. } reg_pio_rw_io_access14;
  177. #define REG_RD_ADDR_pio_rw_io_access14 56
  178. #define REG_WR_ADDR_pio_rw_io_access14 56
  179. /* Register rw_io_access15, scope pio, type rw */
  180. typedef struct {
  181. unsigned int data : 8;
  182. unsigned int dummy1 : 24;
  183. } reg_pio_rw_io_access15;
  184. #define REG_RD_ADDR_pio_rw_io_access15 60
  185. #define REG_WR_ADDR_pio_rw_io_access15 60
  186. /* Register rw_ce0_cfg, scope pio, type rw */
  187. typedef struct {
  188. unsigned int lw : 6;
  189. unsigned int ew : 3;
  190. unsigned int zw : 3;
  191. unsigned int aw : 2;
  192. unsigned int mode : 2;
  193. unsigned int dummy1 : 16;
  194. } reg_pio_rw_ce0_cfg;
  195. #define REG_RD_ADDR_pio_rw_ce0_cfg 68
  196. #define REG_WR_ADDR_pio_rw_ce0_cfg 68
  197. /* Register rw_ce1_cfg, scope pio, type rw */
  198. typedef struct {
  199. unsigned int lw : 6;
  200. unsigned int ew : 3;
  201. unsigned int zw : 3;
  202. unsigned int aw : 2;
  203. unsigned int mode : 2;
  204. unsigned int dummy1 : 16;
  205. } reg_pio_rw_ce1_cfg;
  206. #define REG_RD_ADDR_pio_rw_ce1_cfg 72
  207. #define REG_WR_ADDR_pio_rw_ce1_cfg 72
  208. /* Register rw_ce2_cfg, scope pio, type rw */
  209. typedef struct {
  210. unsigned int lw : 6;
  211. unsigned int ew : 3;
  212. unsigned int zw : 3;
  213. unsigned int aw : 2;
  214. unsigned int mode : 2;
  215. unsigned int dummy1 : 16;
  216. } reg_pio_rw_ce2_cfg;
  217. #define REG_RD_ADDR_pio_rw_ce2_cfg 76
  218. #define REG_WR_ADDR_pio_rw_ce2_cfg 76
  219. /* Register rw_dout, scope pio, type rw */
  220. typedef struct {
  221. unsigned int data : 8;
  222. unsigned int rd_n : 1;
  223. unsigned int wr_n : 1;
  224. unsigned int a0 : 1;
  225. unsigned int a1 : 1;
  226. unsigned int ce0_n : 1;
  227. unsigned int ce1_n : 1;
  228. unsigned int ce2_n : 1;
  229. unsigned int rdy : 1;
  230. unsigned int dummy1 : 16;
  231. } reg_pio_rw_dout;
  232. #define REG_RD_ADDR_pio_rw_dout 80
  233. #define REG_WR_ADDR_pio_rw_dout 80
  234. /* Register rw_oe, scope pio, type rw */
  235. typedef struct {
  236. unsigned int data : 8;
  237. unsigned int rd_n : 1;
  238. unsigned int wr_n : 1;
  239. unsigned int a0 : 1;
  240. unsigned int a1 : 1;
  241. unsigned int ce0_n : 1;
  242. unsigned int ce1_n : 1;
  243. unsigned int ce2_n : 1;
  244. unsigned int rdy : 1;
  245. unsigned int dummy1 : 16;
  246. } reg_pio_rw_oe;
  247. #define REG_RD_ADDR_pio_rw_oe 84
  248. #define REG_WR_ADDR_pio_rw_oe 84
  249. /* Register rw_man_ctrl, scope pio, type rw */
  250. typedef struct {
  251. unsigned int data : 8;
  252. unsigned int rd_n : 1;
  253. unsigned int wr_n : 1;
  254. unsigned int a0 : 1;
  255. unsigned int a1 : 1;
  256. unsigned int ce0_n : 1;
  257. unsigned int ce1_n : 1;
  258. unsigned int ce2_n : 1;
  259. unsigned int rdy : 1;
  260. unsigned int dummy1 : 16;
  261. } reg_pio_rw_man_ctrl;
  262. #define REG_RD_ADDR_pio_rw_man_ctrl 88
  263. #define REG_WR_ADDR_pio_rw_man_ctrl 88
  264. /* Register r_din, scope pio, type r */
  265. typedef struct {
  266. unsigned int data : 8;
  267. unsigned int rd_n : 1;
  268. unsigned int wr_n : 1;
  269. unsigned int a0 : 1;
  270. unsigned int a1 : 1;
  271. unsigned int ce0_n : 1;
  272. unsigned int ce1_n : 1;
  273. unsigned int ce2_n : 1;
  274. unsigned int rdy : 1;
  275. unsigned int dummy1 : 16;
  276. } reg_pio_r_din;
  277. #define REG_RD_ADDR_pio_r_din 92
  278. /* Register r_stat, scope pio, type r */
  279. typedef struct {
  280. unsigned int busy : 1;
  281. unsigned int dummy1 : 31;
  282. } reg_pio_r_stat;
  283. #define REG_RD_ADDR_pio_r_stat 96
  284. /* Register rw_intr_mask, scope pio, type rw */
  285. typedef struct {
  286. unsigned int rdy : 1;
  287. unsigned int dummy1 : 31;
  288. } reg_pio_rw_intr_mask;
  289. #define REG_RD_ADDR_pio_rw_intr_mask 100
  290. #define REG_WR_ADDR_pio_rw_intr_mask 100
  291. /* Register rw_ack_intr, scope pio, type rw */
  292. typedef struct {
  293. unsigned int rdy : 1;
  294. unsigned int dummy1 : 31;
  295. } reg_pio_rw_ack_intr;
  296. #define REG_RD_ADDR_pio_rw_ack_intr 104
  297. #define REG_WR_ADDR_pio_rw_ack_intr 104
  298. /* Register r_intr, scope pio, type r */
  299. typedef struct {
  300. unsigned int rdy : 1;
  301. unsigned int dummy1 : 31;
  302. } reg_pio_r_intr;
  303. #define REG_RD_ADDR_pio_r_intr 108
  304. /* Register r_masked_intr, scope pio, type r */
  305. typedef struct {
  306. unsigned int rdy : 1;
  307. unsigned int dummy1 : 31;
  308. } reg_pio_r_masked_intr;
  309. #define REG_RD_ADDR_pio_r_masked_intr 112
  310. /* Constants */
  311. enum {
  312. regk_pio_a2 = 0x00000003,
  313. regk_pio_no = 0x00000000,
  314. regk_pio_normal = 0x00000000,
  315. regk_pio_rd = 0x00000001,
  316. regk_pio_rw_ce0_cfg_default = 0x00000000,
  317. regk_pio_rw_ce1_cfg_default = 0x00000000,
  318. regk_pio_rw_ce2_cfg_default = 0x00000000,
  319. regk_pio_rw_intr_mask_default = 0x00000000,
  320. regk_pio_rw_man_ctrl_default = 0x00000000,
  321. regk_pio_rw_oe_default = 0x00000000,
  322. regk_pio_wr = 0x00000002,
  323. regk_pio_wr_ce2 = 0x00000003,
  324. regk_pio_yes = 0x00000001,
  325. regk_pio_yes_all = 0x000000ff
  326. };
  327. #endif /* __pio_defs_h */