pinmux_defs.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. #ifndef __pinmux_defs_h
  2. #define __pinmux_defs_h
  3. /*
  4. * This file is autogenerated from
  5. * file: pinmux.r
  6. *
  7. * by ../../../tools/rdesc/bin/rdes2c -outfile pinmux_defs.h pinmux.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 pinmux */
  70. /* Register rw_hwprot, scope pinmux, type rw */
  71. typedef struct {
  72. unsigned int eth : 1;
  73. unsigned int eth_mdio : 1;
  74. unsigned int geth : 1;
  75. unsigned int tg : 1;
  76. unsigned int tg_clk : 1;
  77. unsigned int vout : 1;
  78. unsigned int vout_sync : 1;
  79. unsigned int ser1 : 1;
  80. unsigned int ser2 : 1;
  81. unsigned int ser3 : 1;
  82. unsigned int ser4 : 1;
  83. unsigned int sser : 1;
  84. unsigned int pwm0 : 1;
  85. unsigned int pwm1 : 1;
  86. unsigned int pwm2 : 1;
  87. unsigned int timer0 : 1;
  88. unsigned int timer1 : 1;
  89. unsigned int pio : 1;
  90. unsigned int i2c0 : 1;
  91. unsigned int i2c1 : 1;
  92. unsigned int i2c1_sda1 : 1;
  93. unsigned int i2c1_sda2 : 1;
  94. unsigned int i2c1_sda3 : 1;
  95. unsigned int i2c1_sen : 1;
  96. unsigned int dummy1 : 8;
  97. } reg_pinmux_rw_hwprot;
  98. #define REG_RD_ADDR_pinmux_rw_hwprot 0
  99. #define REG_WR_ADDR_pinmux_rw_hwprot 0
  100. /* Register rw_gio_pa, scope pinmux, type rw */
  101. typedef struct {
  102. unsigned int pa0 : 1;
  103. unsigned int pa1 : 1;
  104. unsigned int pa2 : 1;
  105. unsigned int pa3 : 1;
  106. unsigned int pa4 : 1;
  107. unsigned int pa5 : 1;
  108. unsigned int pa6 : 1;
  109. unsigned int pa7 : 1;
  110. unsigned int pa8 : 1;
  111. unsigned int pa9 : 1;
  112. unsigned int pa10 : 1;
  113. unsigned int pa11 : 1;
  114. unsigned int pa12 : 1;
  115. unsigned int pa13 : 1;
  116. unsigned int pa14 : 1;
  117. unsigned int pa15 : 1;
  118. unsigned int pa16 : 1;
  119. unsigned int pa17 : 1;
  120. unsigned int pa18 : 1;
  121. unsigned int pa19 : 1;
  122. unsigned int pa20 : 1;
  123. unsigned int pa21 : 1;
  124. unsigned int pa22 : 1;
  125. unsigned int pa23 : 1;
  126. unsigned int pa24 : 1;
  127. unsigned int pa25 : 1;
  128. unsigned int pa26 : 1;
  129. unsigned int pa27 : 1;
  130. unsigned int pa28 : 1;
  131. unsigned int pa29 : 1;
  132. unsigned int pa30 : 1;
  133. unsigned int pa31 : 1;
  134. } reg_pinmux_rw_gio_pa;
  135. #define REG_RD_ADDR_pinmux_rw_gio_pa 4
  136. #define REG_WR_ADDR_pinmux_rw_gio_pa 4
  137. /* Register rw_gio_pb, scope pinmux, type rw */
  138. typedef struct {
  139. unsigned int pb0 : 1;
  140. unsigned int pb1 : 1;
  141. unsigned int pb2 : 1;
  142. unsigned int pb3 : 1;
  143. unsigned int pb4 : 1;
  144. unsigned int pb5 : 1;
  145. unsigned int pb6 : 1;
  146. unsigned int pb7 : 1;
  147. unsigned int pb8 : 1;
  148. unsigned int pb9 : 1;
  149. unsigned int pb10 : 1;
  150. unsigned int pb11 : 1;
  151. unsigned int pb12 : 1;
  152. unsigned int pb13 : 1;
  153. unsigned int pb14 : 1;
  154. unsigned int pb15 : 1;
  155. unsigned int pb16 : 1;
  156. unsigned int pb17 : 1;
  157. unsigned int pb18 : 1;
  158. unsigned int pb19 : 1;
  159. unsigned int pb20 : 1;
  160. unsigned int pb21 : 1;
  161. unsigned int pb22 : 1;
  162. unsigned int pb23 : 1;
  163. unsigned int pb24 : 1;
  164. unsigned int pb25 : 1;
  165. unsigned int pb26 : 1;
  166. unsigned int pb27 : 1;
  167. unsigned int pb28 : 1;
  168. unsigned int pb29 : 1;
  169. unsigned int pb30 : 1;
  170. unsigned int pb31 : 1;
  171. } reg_pinmux_rw_gio_pb;
  172. #define REG_RD_ADDR_pinmux_rw_gio_pb 8
  173. #define REG_WR_ADDR_pinmux_rw_gio_pb 8
  174. /* Register rw_gio_pc, scope pinmux, type rw */
  175. typedef struct {
  176. unsigned int pc0 : 1;
  177. unsigned int pc1 : 1;
  178. unsigned int pc2 : 1;
  179. unsigned int pc3 : 1;
  180. unsigned int pc4 : 1;
  181. unsigned int pc5 : 1;
  182. unsigned int pc6 : 1;
  183. unsigned int pc7 : 1;
  184. unsigned int pc8 : 1;
  185. unsigned int pc9 : 1;
  186. unsigned int pc10 : 1;
  187. unsigned int pc11 : 1;
  188. unsigned int pc12 : 1;
  189. unsigned int pc13 : 1;
  190. unsigned int pc14 : 1;
  191. unsigned int pc15 : 1;
  192. unsigned int dummy1 : 16;
  193. } reg_pinmux_rw_gio_pc;
  194. #define REG_RD_ADDR_pinmux_rw_gio_pc 12
  195. #define REG_WR_ADDR_pinmux_rw_gio_pc 12
  196. /* Register rw_iop_pa, scope pinmux, type rw */
  197. typedef struct {
  198. unsigned int pa0 : 1;
  199. unsigned int pa1 : 1;
  200. unsigned int pa2 : 1;
  201. unsigned int pa3 : 1;
  202. unsigned int pa4 : 1;
  203. unsigned int pa5 : 1;
  204. unsigned int pa6 : 1;
  205. unsigned int pa7 : 1;
  206. unsigned int pa8 : 1;
  207. unsigned int pa9 : 1;
  208. unsigned int pa10 : 1;
  209. unsigned int pa11 : 1;
  210. unsigned int pa12 : 1;
  211. unsigned int pa13 : 1;
  212. unsigned int pa14 : 1;
  213. unsigned int pa15 : 1;
  214. unsigned int pa16 : 1;
  215. unsigned int pa17 : 1;
  216. unsigned int pa18 : 1;
  217. unsigned int pa19 : 1;
  218. unsigned int pa20 : 1;
  219. unsigned int pa21 : 1;
  220. unsigned int pa22 : 1;
  221. unsigned int pa23 : 1;
  222. unsigned int pa24 : 1;
  223. unsigned int pa25 : 1;
  224. unsigned int pa26 : 1;
  225. unsigned int pa27 : 1;
  226. unsigned int pa28 : 1;
  227. unsigned int pa29 : 1;
  228. unsigned int pa30 : 1;
  229. unsigned int pa31 : 1;
  230. } reg_pinmux_rw_iop_pa;
  231. #define REG_RD_ADDR_pinmux_rw_iop_pa 16
  232. #define REG_WR_ADDR_pinmux_rw_iop_pa 16
  233. /* Register rw_iop_pb, scope pinmux, type rw */
  234. typedef struct {
  235. unsigned int pb0 : 1;
  236. unsigned int pb1 : 1;
  237. unsigned int pb2 : 1;
  238. unsigned int pb3 : 1;
  239. unsigned int pb4 : 1;
  240. unsigned int pb5 : 1;
  241. unsigned int pb6 : 1;
  242. unsigned int pb7 : 1;
  243. unsigned int dummy1 : 24;
  244. } reg_pinmux_rw_iop_pb;
  245. #define REG_RD_ADDR_pinmux_rw_iop_pb 20
  246. #define REG_WR_ADDR_pinmux_rw_iop_pb 20
  247. /* Register rw_iop_pio, scope pinmux, type rw */
  248. typedef struct {
  249. unsigned int d0 : 1;
  250. unsigned int d1 : 1;
  251. unsigned int d2 : 1;
  252. unsigned int d3 : 1;
  253. unsigned int d4 : 1;
  254. unsigned int d5 : 1;
  255. unsigned int d6 : 1;
  256. unsigned int d7 : 1;
  257. unsigned int rd_n : 1;
  258. unsigned int wr_n : 1;
  259. unsigned int a0 : 1;
  260. unsigned int a1 : 1;
  261. unsigned int ce0_n : 1;
  262. unsigned int ce1_n : 1;
  263. unsigned int ce2_n : 1;
  264. unsigned int rdy : 1;
  265. unsigned int dummy1 : 16;
  266. } reg_pinmux_rw_iop_pio;
  267. #define REG_RD_ADDR_pinmux_rw_iop_pio 24
  268. #define REG_WR_ADDR_pinmux_rw_iop_pio 24
  269. /* Register rw_iop_usb, scope pinmux, type rw */
  270. typedef struct {
  271. unsigned int usb0 : 1;
  272. unsigned int dummy1 : 31;
  273. } reg_pinmux_rw_iop_usb;
  274. #define REG_RD_ADDR_pinmux_rw_iop_usb 28
  275. #define REG_WR_ADDR_pinmux_rw_iop_usb 28
  276. /* Constants */
  277. enum {
  278. regk_pinmux_no = 0x00000000,
  279. regk_pinmux_rw_gio_pa_default = 0x00000000,
  280. regk_pinmux_rw_gio_pb_default = 0x00000000,
  281. regk_pinmux_rw_gio_pc_default = 0x00000000,
  282. regk_pinmux_rw_hwprot_default = 0x00000000,
  283. regk_pinmux_rw_iop_pa_default = 0x00000000,
  284. regk_pinmux_rw_iop_pb_default = 0x00000000,
  285. regk_pinmux_rw_iop_pio_default = 0x00000000,
  286. regk_pinmux_rw_iop_usb_default = 0x00000001,
  287. regk_pinmux_yes = 0x00000001
  288. };
  289. #endif /* __pinmux_defs_h */