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