flexcop-reg.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
  3. * flexcop-reg.h - register abstraction for FlexCopII, FlexCopIIb and FlexCopIII
  4. * see flexcop.c for copyright information
  5. */
  6. #ifndef __FLEXCOP_REG_H__
  7. #define __FLEXCOP_REG_H__
  8. typedef enum {
  9. FLEXCOP_UNK = 0,
  10. FLEXCOP_II,
  11. FLEXCOP_IIB,
  12. FLEXCOP_III,
  13. } flexcop_revision_t;
  14. typedef enum {
  15. FC_UNK = 0,
  16. FC_CABLE,
  17. FC_AIR_DVBT,
  18. FC_AIR_ATSC1,
  19. FC_AIR_ATSC2,
  20. FC_AIR_ATSC3,
  21. FC_SKY_REV23,
  22. FC_SKY_REV26,
  23. FC_SKY_REV27,
  24. FC_SKY_REV28,
  25. } flexcop_device_type_t;
  26. typedef enum {
  27. FC_USB = 0,
  28. FC_PCI,
  29. } flexcop_bus_t;
  30. /* FlexCop IBI Registers */
  31. #if defined(__LITTLE_ENDIAN)
  32. #include "flexcop_ibi_value_le.h"
  33. #else
  34. #if defined(__BIG_ENDIAN)
  35. #include "flexcop_ibi_value_be.h"
  36. #else
  37. #error no endian defined
  38. #endif
  39. #endif
  40. #define fc_data_Tag_ID_DVB 0x3e
  41. #define fc_data_Tag_ID_ATSC 0x3f
  42. #define fc_data_Tag_ID_IDSB 0x8b
  43. #define fc_key_code_default 0x1
  44. #define fc_key_code_even 0x2
  45. #define fc_key_code_odd 0x3
  46. extern flexcop_ibi_value ibi_zero;
  47. typedef enum {
  48. FC_I2C_PORT_DEMOD = 1,
  49. FC_I2C_PORT_EEPROM = 2,
  50. FC_I2C_PORT_TUNER = 3,
  51. } flexcop_i2c_port_t;
  52. typedef enum {
  53. FC_WRITE = 0,
  54. FC_READ = 1,
  55. } flexcop_access_op_t;
  56. typedef enum {
  57. FC_SRAM_DEST_NET = 1,
  58. FC_SRAM_DEST_CAI = 2,
  59. FC_SRAM_DEST_CAO = 4,
  60. FC_SRAM_DEST_MEDIA = 8
  61. } flexcop_sram_dest_t;
  62. typedef enum {
  63. FC_SRAM_DEST_TARGET_WAN_USB = 0,
  64. FC_SRAM_DEST_TARGET_DMA1 = 1,
  65. FC_SRAM_DEST_TARGET_DMA2 = 2,
  66. FC_SRAM_DEST_TARGET_FC3_CA = 3
  67. } flexcop_sram_dest_target_t;
  68. typedef enum {
  69. FC_SRAM_2_32KB = 0, /* 64KB */
  70. FC_SRAM_1_32KB = 1, /* 32KB - default fow FCII */
  71. FC_SRAM_1_128KB = 2, /* 128KB */
  72. FC_SRAM_1_48KB = 3, /* 48KB - default for FCIII */
  73. } flexcop_sram_type_t;
  74. typedef enum {
  75. FC_WAN_SPEED_4MBITS = 0,
  76. FC_WAN_SPEED_8MBITS = 1,
  77. FC_WAN_SPEED_12MBITS = 2,
  78. FC_WAN_SPEED_16MBITS = 3,
  79. } flexcop_wan_speed_t;
  80. typedef enum {
  81. FC_DMA_1 = 1,
  82. FC_DMA_2 = 2,
  83. } flexcop_dma_index_t;
  84. typedef enum {
  85. FC_DMA_SUBADDR_0 = 1,
  86. FC_DMA_SUBADDR_1 = 2,
  87. } flexcop_dma_addr_index_t;
  88. /* names of the particular registers */
  89. typedef enum {
  90. dma1_000 = 0x000,
  91. dma1_004 = 0x004,
  92. dma1_008 = 0x008,
  93. dma1_00c = 0x00c,
  94. dma2_010 = 0x010,
  95. dma2_014 = 0x014,
  96. dma2_018 = 0x018,
  97. dma2_01c = 0x01c,
  98. tw_sm_c_100 = 0x100,
  99. tw_sm_c_104 = 0x104,
  100. tw_sm_c_108 = 0x108,
  101. tw_sm_c_10c = 0x10c,
  102. tw_sm_c_110 = 0x110,
  103. lnb_switch_freq_200 = 0x200,
  104. misc_204 = 0x204,
  105. ctrl_208 = 0x208,
  106. irq_20c = 0x20c,
  107. sw_reset_210 = 0x210,
  108. misc_214 = 0x214,
  109. mbox_v8_to_host_218 = 0x218,
  110. mbox_host_to_v8_21c = 0x21c,
  111. pid_filter_300 = 0x300,
  112. pid_filter_304 = 0x304,
  113. pid_filter_308 = 0x308,
  114. pid_filter_30c = 0x30c,
  115. index_reg_310 = 0x310,
  116. pid_n_reg_314 = 0x314,
  117. mac_low_reg_318 = 0x318,
  118. mac_high_reg_31c = 0x31c,
  119. data_tag_400 = 0x400,
  120. card_id_408 = 0x408,
  121. card_id_40c = 0x40c,
  122. mac_address_418 = 0x418,
  123. mac_address_41c = 0x41c,
  124. ci_600 = 0x600,
  125. pi_604 = 0x604,
  126. pi_608 = 0x608,
  127. dvb_reg_60c = 0x60c,
  128. sram_ctrl_reg_700 = 0x700,
  129. net_buf_reg_704 = 0x704,
  130. cai_buf_reg_708 = 0x708,
  131. cao_buf_reg_70c = 0x70c,
  132. media_buf_reg_710 = 0x710,
  133. sram_dest_reg_714 = 0x714,
  134. net_buf_reg_718 = 0x718,
  135. wan_ctrl_reg_71c = 0x71c,
  136. } flexcop_ibi_register;
  137. #define flexcop_set_ibi_value(reg,attr,val) { \
  138. flexcop_ibi_value v = fc->read_ibi_reg(fc,reg); \
  139. v.reg.attr = val; \
  140. fc->write_ibi_reg(fc,reg,v); \
  141. }
  142. #endif