clkgen_defs.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #ifndef __clkgen_defs_h
  2. #define __clkgen_defs_h
  3. /*
  4. * This file is autogenerated from
  5. * file: clkgen.r
  6. *
  7. * by ../../../tools/rdesc/bin/rdes2c -outfile clkgen_defs.h clkgen.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 clkgen */
  70. /* Register r_bootsel, scope clkgen, type r */
  71. typedef struct {
  72. unsigned int boot_mode : 5;
  73. unsigned int intern_main_clk : 1;
  74. unsigned int extern_usb2_clk : 1;
  75. unsigned int dummy1 : 25;
  76. } reg_clkgen_r_bootsel;
  77. #define REG_RD_ADDR_clkgen_r_bootsel 0
  78. /* Register rw_clk_ctrl, scope clkgen, type rw */
  79. typedef struct {
  80. unsigned int pll : 1;
  81. unsigned int cpu : 1;
  82. unsigned int iop_usb : 1;
  83. unsigned int vin : 1;
  84. unsigned int sclr : 1;
  85. unsigned int h264 : 1;
  86. unsigned int ddr2 : 1;
  87. unsigned int vout_hist : 1;
  88. unsigned int eth : 1;
  89. unsigned int ccd_tg_200 : 1;
  90. unsigned int dma0_1_eth : 1;
  91. unsigned int ccd_tg_100 : 1;
  92. unsigned int jpeg : 1;
  93. unsigned int sser_ser_dma6_7 : 1;
  94. unsigned int strdma0_2_video : 1;
  95. unsigned int dma2_3_strcop : 1;
  96. unsigned int dma4_5_iop : 1;
  97. unsigned int dma9_11 : 1;
  98. unsigned int memarb_bar_ddr : 1;
  99. unsigned int sclr_h264 : 1;
  100. unsigned int dummy1 : 12;
  101. } reg_clkgen_rw_clk_ctrl;
  102. #define REG_RD_ADDR_clkgen_rw_clk_ctrl 4
  103. #define REG_WR_ADDR_clkgen_rw_clk_ctrl 4
  104. /* Constants */
  105. enum {
  106. regk_clkgen_eth1000_rx = 0x0000000c,
  107. regk_clkgen_eth1000_tx = 0x0000000e,
  108. regk_clkgen_eth100_rx = 0x0000001d,
  109. regk_clkgen_eth100_rx_half = 0x0000001c,
  110. regk_clkgen_eth100_tx = 0x0000001f,
  111. regk_clkgen_eth100_tx_half = 0x0000001e,
  112. regk_clkgen_nand_3_2 = 0x00000000,
  113. regk_clkgen_nand_3_2_0x30 = 0x00000002,
  114. regk_clkgen_nand_3_2_0x30_pll = 0x00000012,
  115. regk_clkgen_nand_3_2_pll = 0x00000010,
  116. regk_clkgen_nand_3_3 = 0x00000001,
  117. regk_clkgen_nand_3_3_0x30 = 0x00000003,
  118. regk_clkgen_nand_3_3_0x30_pll = 0x00000013,
  119. regk_clkgen_nand_3_3_pll = 0x00000011,
  120. regk_clkgen_nand_4_2 = 0x00000004,
  121. regk_clkgen_nand_4_2_0x30 = 0x00000006,
  122. regk_clkgen_nand_4_2_0x30_pll = 0x00000016,
  123. regk_clkgen_nand_4_2_pll = 0x00000014,
  124. regk_clkgen_nand_4_3 = 0x00000005,
  125. regk_clkgen_nand_4_3_0x30 = 0x00000007,
  126. regk_clkgen_nand_4_3_0x30_pll = 0x00000017,
  127. regk_clkgen_nand_4_3_pll = 0x00000015,
  128. regk_clkgen_nand_5_2 = 0x00000008,
  129. regk_clkgen_nand_5_2_0x30 = 0x0000000a,
  130. regk_clkgen_nand_5_2_0x30_pll = 0x0000001a,
  131. regk_clkgen_nand_5_2_pll = 0x00000018,
  132. regk_clkgen_nand_5_3 = 0x00000009,
  133. regk_clkgen_nand_5_3_0x30 = 0x0000000b,
  134. regk_clkgen_nand_5_3_0x30_pll = 0x0000001b,
  135. regk_clkgen_nand_5_3_pll = 0x00000019,
  136. regk_clkgen_no = 0x00000000,
  137. regk_clkgen_rw_clk_ctrl_default = 0x00000002,
  138. regk_clkgen_ser = 0x0000000d,
  139. regk_clkgen_ser_pll = 0x0000000f,
  140. regk_clkgen_yes = 0x00000001
  141. };
  142. #endif /* __clkgen_defs_h */