eth_defs.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. #ifndef __eth_defs_h
  2. #define __eth_defs_h
  3. /*
  4. * This file is autogenerated from
  5. * file: ../../inst/eth/rtl/eth_regs.r
  6. * id: eth_regs.r,v 1.11 2005/02/09 10:48:38 kriskn Exp
  7. * last modfied: Mon Apr 11 16:07:03 2005
  8. *
  9. * by /n/asic/design/tools/rdesc/src/rdes2c --outfile eth_defs.h ../../inst/eth/rtl/eth_regs.r
  10. * id: $Id: eth_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
  11. * Any changes here will be lost.
  12. *
  13. * -*- buffer-read-only: t -*-
  14. */
  15. /* Main access macros */
  16. #ifndef REG_RD
  17. #define REG_RD( scope, inst, reg ) \
  18. REG_READ( reg_##scope##_##reg, \
  19. (inst) + REG_RD_ADDR_##scope##_##reg )
  20. #endif
  21. #ifndef REG_WR
  22. #define REG_WR( scope, inst, reg, val ) \
  23. REG_WRITE( reg_##scope##_##reg, \
  24. (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
  25. #endif
  26. #ifndef REG_RD_VECT
  27. #define REG_RD_VECT( scope, inst, reg, index ) \
  28. REG_READ( reg_##scope##_##reg, \
  29. (inst) + REG_RD_ADDR_##scope##_##reg + \
  30. (index) * STRIDE_##scope##_##reg )
  31. #endif
  32. #ifndef REG_WR_VECT
  33. #define REG_WR_VECT( scope, inst, reg, index, val ) \
  34. REG_WRITE( reg_##scope##_##reg, \
  35. (inst) + REG_WR_ADDR_##scope##_##reg + \
  36. (index) * STRIDE_##scope##_##reg, (val) )
  37. #endif
  38. #ifndef REG_RD_INT
  39. #define REG_RD_INT( scope, inst, reg ) \
  40. REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
  41. #endif
  42. #ifndef REG_WR_INT
  43. #define REG_WR_INT( scope, inst, reg, val ) \
  44. REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
  45. #endif
  46. #ifndef REG_RD_INT_VECT
  47. #define REG_RD_INT_VECT( scope, inst, reg, index ) \
  48. REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
  49. (index) * STRIDE_##scope##_##reg )
  50. #endif
  51. #ifndef REG_WR_INT_VECT
  52. #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
  53. REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
  54. (index) * STRIDE_##scope##_##reg, (val) )
  55. #endif
  56. #ifndef REG_TYPE_CONV
  57. #define REG_TYPE_CONV( type, orgtype, val ) \
  58. ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
  59. #endif
  60. #ifndef reg_page_size
  61. #define reg_page_size 8192
  62. #endif
  63. #ifndef REG_ADDR
  64. #define REG_ADDR( scope, inst, reg ) \
  65. ( (inst) + REG_RD_ADDR_##scope##_##reg )
  66. #endif
  67. #ifndef REG_ADDR_VECT
  68. #define REG_ADDR_VECT( scope, inst, reg, index ) \
  69. ( (inst) + REG_RD_ADDR_##scope##_##reg + \
  70. (index) * STRIDE_##scope##_##reg )
  71. #endif
  72. /* C-code for register scope eth */
  73. /* Register rw_ma0_lo, scope eth, type rw */
  74. typedef struct {
  75. unsigned int addr : 32;
  76. } reg_eth_rw_ma0_lo;
  77. #define REG_RD_ADDR_eth_rw_ma0_lo 0
  78. #define REG_WR_ADDR_eth_rw_ma0_lo 0
  79. /* Register rw_ma0_hi, scope eth, type rw */
  80. typedef struct {
  81. unsigned int addr : 16;
  82. unsigned int dummy1 : 16;
  83. } reg_eth_rw_ma0_hi;
  84. #define REG_RD_ADDR_eth_rw_ma0_hi 4
  85. #define REG_WR_ADDR_eth_rw_ma0_hi 4
  86. /* Register rw_ma1_lo, scope eth, type rw */
  87. typedef struct {
  88. unsigned int addr : 32;
  89. } reg_eth_rw_ma1_lo;
  90. #define REG_RD_ADDR_eth_rw_ma1_lo 8
  91. #define REG_WR_ADDR_eth_rw_ma1_lo 8
  92. /* Register rw_ma1_hi, scope eth, type rw */
  93. typedef struct {
  94. unsigned int addr : 16;
  95. unsigned int dummy1 : 16;
  96. } reg_eth_rw_ma1_hi;
  97. #define REG_RD_ADDR_eth_rw_ma1_hi 12
  98. #define REG_WR_ADDR_eth_rw_ma1_hi 12
  99. /* Register rw_ga_lo, scope eth, type rw */
  100. typedef struct {
  101. unsigned int table : 32;
  102. } reg_eth_rw_ga_lo;
  103. #define REG_RD_ADDR_eth_rw_ga_lo 16
  104. #define REG_WR_ADDR_eth_rw_ga_lo 16
  105. /* Register rw_ga_hi, scope eth, type rw */
  106. typedef struct {
  107. unsigned int table : 32;
  108. } reg_eth_rw_ga_hi;
  109. #define REG_RD_ADDR_eth_rw_ga_hi 20
  110. #define REG_WR_ADDR_eth_rw_ga_hi 20
  111. /* Register rw_gen_ctrl, scope eth, type rw */
  112. typedef struct {
  113. unsigned int en : 1;
  114. unsigned int phy : 2;
  115. unsigned int protocol : 1;
  116. unsigned int loopback : 1;
  117. unsigned int flow_ctrl_dis : 1;
  118. unsigned int dummy1 : 26;
  119. } reg_eth_rw_gen_ctrl;
  120. #define REG_RD_ADDR_eth_rw_gen_ctrl 24
  121. #define REG_WR_ADDR_eth_rw_gen_ctrl 24
  122. /* Register rw_rec_ctrl, scope eth, type rw */
  123. typedef struct {
  124. unsigned int ma0 : 1;
  125. unsigned int ma1 : 1;
  126. unsigned int individual : 1;
  127. unsigned int broadcast : 1;
  128. unsigned int undersize : 1;
  129. unsigned int oversize : 1;
  130. unsigned int bad_crc : 1;
  131. unsigned int duplex : 1;
  132. unsigned int max_size : 1;
  133. unsigned int dummy1 : 23;
  134. } reg_eth_rw_rec_ctrl;
  135. #define REG_RD_ADDR_eth_rw_rec_ctrl 28
  136. #define REG_WR_ADDR_eth_rw_rec_ctrl 28
  137. /* Register rw_tr_ctrl, scope eth, type rw */
  138. typedef struct {
  139. unsigned int crc : 1;
  140. unsigned int pad : 1;
  141. unsigned int retry : 1;
  142. unsigned int ignore_col : 1;
  143. unsigned int cancel : 1;
  144. unsigned int hsh_delay : 1;
  145. unsigned int ignore_crs : 1;
  146. unsigned int dummy1 : 25;
  147. } reg_eth_rw_tr_ctrl;
  148. #define REG_RD_ADDR_eth_rw_tr_ctrl 32
  149. #define REG_WR_ADDR_eth_rw_tr_ctrl 32
  150. /* Register rw_clr_err, scope eth, type rw */
  151. typedef struct {
  152. unsigned int clr : 1;
  153. unsigned int dummy1 : 31;
  154. } reg_eth_rw_clr_err;
  155. #define REG_RD_ADDR_eth_rw_clr_err 36
  156. #define REG_WR_ADDR_eth_rw_clr_err 36
  157. /* Register rw_mgm_ctrl, scope eth, type rw */
  158. typedef struct {
  159. unsigned int mdio : 1;
  160. unsigned int mdoe : 1;
  161. unsigned int mdc : 1;
  162. unsigned int phyclk : 1;
  163. unsigned int txdata : 4;
  164. unsigned int txen : 1;
  165. unsigned int dummy1 : 23;
  166. } reg_eth_rw_mgm_ctrl;
  167. #define REG_RD_ADDR_eth_rw_mgm_ctrl 40
  168. #define REG_WR_ADDR_eth_rw_mgm_ctrl 40
  169. /* Register r_stat, scope eth, type r */
  170. typedef struct {
  171. unsigned int mdio : 1;
  172. unsigned int exc_col : 1;
  173. unsigned int urun : 1;
  174. unsigned int phyclk : 1;
  175. unsigned int txdata : 4;
  176. unsigned int txen : 1;
  177. unsigned int col : 1;
  178. unsigned int crs : 1;
  179. unsigned int txclk : 1;
  180. unsigned int rxdata : 4;
  181. unsigned int rxer : 1;
  182. unsigned int rxdv : 1;
  183. unsigned int rxclk : 1;
  184. unsigned int dummy1 : 13;
  185. } reg_eth_r_stat;
  186. #define REG_RD_ADDR_eth_r_stat 44
  187. /* Register rs_rec_cnt, scope eth, type rs */
  188. typedef struct {
  189. unsigned int crc_err : 8;
  190. unsigned int align_err : 8;
  191. unsigned int oversize : 8;
  192. unsigned int congestion : 8;
  193. } reg_eth_rs_rec_cnt;
  194. #define REG_RD_ADDR_eth_rs_rec_cnt 48
  195. /* Register r_rec_cnt, scope eth, type r */
  196. typedef struct {
  197. unsigned int crc_err : 8;
  198. unsigned int align_err : 8;
  199. unsigned int oversize : 8;
  200. unsigned int congestion : 8;
  201. } reg_eth_r_rec_cnt;
  202. #define REG_RD_ADDR_eth_r_rec_cnt 52
  203. /* Register rs_tr_cnt, scope eth, type rs */
  204. typedef struct {
  205. unsigned int single_col : 8;
  206. unsigned int mult_col : 8;
  207. unsigned int late_col : 8;
  208. unsigned int deferred : 8;
  209. } reg_eth_rs_tr_cnt;
  210. #define REG_RD_ADDR_eth_rs_tr_cnt 56
  211. /* Register r_tr_cnt, scope eth, type r */
  212. typedef struct {
  213. unsigned int single_col : 8;
  214. unsigned int mult_col : 8;
  215. unsigned int late_col : 8;
  216. unsigned int deferred : 8;
  217. } reg_eth_r_tr_cnt;
  218. #define REG_RD_ADDR_eth_r_tr_cnt 60
  219. /* Register rs_phy_cnt, scope eth, type rs */
  220. typedef struct {
  221. unsigned int carrier_loss : 8;
  222. unsigned int sqe_err : 8;
  223. unsigned int dummy1 : 16;
  224. } reg_eth_rs_phy_cnt;
  225. #define REG_RD_ADDR_eth_rs_phy_cnt 64
  226. /* Register r_phy_cnt, scope eth, type r */
  227. typedef struct {
  228. unsigned int carrier_loss : 8;
  229. unsigned int sqe_err : 8;
  230. unsigned int dummy1 : 16;
  231. } reg_eth_r_phy_cnt;
  232. #define REG_RD_ADDR_eth_r_phy_cnt 68
  233. /* Register rw_test_ctrl, scope eth, type rw */
  234. typedef struct {
  235. unsigned int snmp_inc : 1;
  236. unsigned int snmp : 1;
  237. unsigned int backoff : 1;
  238. unsigned int dummy1 : 29;
  239. } reg_eth_rw_test_ctrl;
  240. #define REG_RD_ADDR_eth_rw_test_ctrl 72
  241. #define REG_WR_ADDR_eth_rw_test_ctrl 72
  242. /* Register rw_intr_mask, scope eth, type rw */
  243. typedef struct {
  244. unsigned int crc : 1;
  245. unsigned int align : 1;
  246. unsigned int oversize : 1;
  247. unsigned int congestion : 1;
  248. unsigned int single_col : 1;
  249. unsigned int mult_col : 1;
  250. unsigned int late_col : 1;
  251. unsigned int deferred : 1;
  252. unsigned int carrier_loss : 1;
  253. unsigned int sqe_test_err : 1;
  254. unsigned int orun : 1;
  255. unsigned int urun : 1;
  256. unsigned int excessive_col : 1;
  257. unsigned int mdio : 1;
  258. unsigned int dummy1 : 18;
  259. } reg_eth_rw_intr_mask;
  260. #define REG_RD_ADDR_eth_rw_intr_mask 76
  261. #define REG_WR_ADDR_eth_rw_intr_mask 76
  262. /* Register rw_ack_intr, scope eth, type rw */
  263. typedef struct {
  264. unsigned int crc : 1;
  265. unsigned int align : 1;
  266. unsigned int oversize : 1;
  267. unsigned int congestion : 1;
  268. unsigned int single_col : 1;
  269. unsigned int mult_col : 1;
  270. unsigned int late_col : 1;
  271. unsigned int deferred : 1;
  272. unsigned int carrier_loss : 1;
  273. unsigned int sqe_test_err : 1;
  274. unsigned int orun : 1;
  275. unsigned int urun : 1;
  276. unsigned int excessive_col : 1;
  277. unsigned int mdio : 1;
  278. unsigned int dummy1 : 18;
  279. } reg_eth_rw_ack_intr;
  280. #define REG_RD_ADDR_eth_rw_ack_intr 80
  281. #define REG_WR_ADDR_eth_rw_ack_intr 80
  282. /* Register r_intr, scope eth, type r */
  283. typedef struct {
  284. unsigned int crc : 1;
  285. unsigned int align : 1;
  286. unsigned int oversize : 1;
  287. unsigned int congestion : 1;
  288. unsigned int single_col : 1;
  289. unsigned int mult_col : 1;
  290. unsigned int late_col : 1;
  291. unsigned int deferred : 1;
  292. unsigned int carrier_loss : 1;
  293. unsigned int sqe_test_err : 1;
  294. unsigned int orun : 1;
  295. unsigned int urun : 1;
  296. unsigned int excessive_col : 1;
  297. unsigned int mdio : 1;
  298. unsigned int dummy1 : 18;
  299. } reg_eth_r_intr;
  300. #define REG_RD_ADDR_eth_r_intr 84
  301. /* Register r_masked_intr, scope eth, type r */
  302. typedef struct {
  303. unsigned int crc : 1;
  304. unsigned int align : 1;
  305. unsigned int oversize : 1;
  306. unsigned int congestion : 1;
  307. unsigned int single_col : 1;
  308. unsigned int mult_col : 1;
  309. unsigned int late_col : 1;
  310. unsigned int deferred : 1;
  311. unsigned int carrier_loss : 1;
  312. unsigned int sqe_test_err : 1;
  313. unsigned int orun : 1;
  314. unsigned int urun : 1;
  315. unsigned int excessive_col : 1;
  316. unsigned int mdio : 1;
  317. unsigned int dummy1 : 18;
  318. } reg_eth_r_masked_intr;
  319. #define REG_RD_ADDR_eth_r_masked_intr 88
  320. /* Constants */
  321. enum {
  322. regk_eth_discard = 0x00000000,
  323. regk_eth_ether = 0x00000000,
  324. regk_eth_full = 0x00000001,
  325. regk_eth_half = 0x00000000,
  326. regk_eth_hsh = 0x00000001,
  327. regk_eth_mii = 0x00000001,
  328. regk_eth_mii_clk = 0x00000000,
  329. regk_eth_mii_rec = 0x00000002,
  330. regk_eth_no = 0x00000000,
  331. regk_eth_rec = 0x00000001,
  332. regk_eth_rw_ga_hi_default = 0x00000000,
  333. regk_eth_rw_ga_lo_default = 0x00000000,
  334. regk_eth_rw_gen_ctrl_default = 0x00000000,
  335. regk_eth_rw_intr_mask_default = 0x00000000,
  336. regk_eth_rw_ma0_hi_default = 0x00000000,
  337. regk_eth_rw_ma0_lo_default = 0x00000000,
  338. regk_eth_rw_ma1_hi_default = 0x00000000,
  339. regk_eth_rw_ma1_lo_default = 0x00000000,
  340. regk_eth_rw_mgm_ctrl_default = 0x00000000,
  341. regk_eth_rw_test_ctrl_default = 0x00000000,
  342. regk_eth_size1518 = 0x00000000,
  343. regk_eth_size1522 = 0x00000001,
  344. regk_eth_yes = 0x00000001
  345. };
  346. #endif /* __eth_defs_h */