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