flexcop-reg.h 3.6 KB

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