config_defs.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #ifndef __config_defs_h
  2. #define __config_defs_h
  3. /*
  4. * This file is autogenerated from
  5. * file: ../../rtl/config_regs.r
  6. * id: config_regs.r,v 1.23 2004/03/04 11:34:42 mikaeln Exp
  7. * last modfied: Thu Mar 4 12:34:39 2004
  8. *
  9. * by /n/asic/design/tools/rdesc/src/rdes2c --outfile config_defs.h ../../rtl/config_regs.r
  10. * id: $Id: config_defs.h,v 1.1 2007/02/13 11:55:30 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 config */
  73. /* Register r_bootsel, scope config, type r */
  74. typedef struct {
  75. unsigned int boot_mode : 3;
  76. unsigned int full_duplex : 1;
  77. unsigned int user : 1;
  78. unsigned int pll : 1;
  79. unsigned int flash_bw : 1;
  80. unsigned int dummy1 : 25;
  81. } reg_config_r_bootsel;
  82. #define REG_RD_ADDR_config_r_bootsel 0
  83. /* Register rw_clk_ctrl, scope config, type rw */
  84. typedef struct {
  85. unsigned int pll : 1;
  86. unsigned int cpu : 1;
  87. unsigned int iop : 1;
  88. unsigned int dma01_eth0 : 1;
  89. unsigned int dma23 : 1;
  90. unsigned int dma45 : 1;
  91. unsigned int dma67 : 1;
  92. unsigned int dma89_strcop : 1;
  93. unsigned int bif : 1;
  94. unsigned int fix_io : 1;
  95. unsigned int dummy1 : 22;
  96. } reg_config_rw_clk_ctrl;
  97. #define REG_RD_ADDR_config_rw_clk_ctrl 4
  98. #define REG_WR_ADDR_config_rw_clk_ctrl 4
  99. /* Register rw_pad_ctrl, scope config, type rw */
  100. typedef struct {
  101. unsigned int usb_susp : 1;
  102. unsigned int phyrst_n : 1;
  103. unsigned int dummy1 : 30;
  104. } reg_config_rw_pad_ctrl;
  105. #define REG_RD_ADDR_config_rw_pad_ctrl 8
  106. #define REG_WR_ADDR_config_rw_pad_ctrl 8
  107. /* Constants */
  108. enum {
  109. regk_config_bw16 = 0x00000000,
  110. regk_config_bw32 = 0x00000001,
  111. regk_config_master = 0x00000005,
  112. regk_config_nand = 0x00000003,
  113. regk_config_net_rx = 0x00000001,
  114. regk_config_net_tx_rx = 0x00000002,
  115. regk_config_no = 0x00000000,
  116. regk_config_none = 0x00000007,
  117. regk_config_nor = 0x00000000,
  118. regk_config_rw_clk_ctrl_default = 0x00000002,
  119. regk_config_rw_pad_ctrl_default = 0x00000000,
  120. regk_config_ser = 0x00000004,
  121. regk_config_slave = 0x00000006,
  122. regk_config_yes = 0x00000001
  123. };
  124. #endif /* __config_defs_h */