source: tools/multituner.p207/frontends/avl2108/avl2108_reg.h @ 8433

Last change on this file since 8433 was 8433, checked in by obi, 13 years ago

[tools] add multituner.p207

File size: 7.7 KB
Line 
1/*
2    Availink avl2108 - DVBS/S2 Satellite demod driver with Sharp BS2S7HZ6360 tuner
3
4    Copyright (C) 2009 Duolabs Spa
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _AVL2108_REG_H
22#define _AVL2108_REG_H
23
24/* Generic ops like reset and PLL */
25#define REG_CORE_RESET_B                                        0x600000
26#define REG_RESET                                                       0x6C0000
27#define PLL_R1                                                          0x6C0080
28#define PLL_R2                                                          0x6C00C0
29#define PLL_R3                                                          0x6C0100
30#define PLL_R4                                                          0x6C0140
31#define PLL_R5                                                          0x6C0180
32#define PLL_SOFTVALUE_EN                                        0x6C0200
33
34#define REG_ROM_VER                                                     0x00100000      /**< Chip version */
35#define REG_PATCH_VER                                           0x000004A8      /**< Patch version */
36#define REG_ERROR_MSG                                           0x0000042C
37#define REG_RX_CMD                                                      0x00000400
38#define REG_CORE_RDY_WORD                                       0x00000434
39
40/* Generic ops */
41#define DEMOD_OP_NOOP                                   0x00
42#define DEMOD_OP_LD_DEFAULT                             0x01
43#define DEMOD_OP_INIT_GO                                0x02
44#define DEMOD_OP_RESET_BERPER                           0x03
45#define DEMOD_OP_HALT                                   0x04
46#define DEMOD_OP_SLEEP                                  0x05
47#define DEMOD_OP_WAKE                                   0x06
48#define DEMOD_OP_ND_SCAN                                0x08
49#define DEMOD_OP_STDOUT_MODE                            0x09
50#define DEMOD_OP_TUNER_LOCK                             0x0b
51#define DEMOD_OP_TUNER_LOCK_ST                          0x0c
52#define DEMOD_OP_HELLO                                          0xFF
53
54#define CI_FLAG_IQ_BIT                          0x00
55#define CI_FLAG_IQ_BIT_MASK                     0x01
56#define CI_FLAG_IQ_NO_SWAPPED                   0x00
57
58#define CI_FLAG_DVBS2_BIT                       0x02
59#define CI_FLAG_DVBS2_BIT_MASK                  0x1C
60#define CI_FLAG_DVBS2_UNDEF                     0x04
61
62#define CI_FLAG_IQ_AUTO_BIT                                     0x05
63#define CI_FLAG_IQ_AUTO_BIT_MASK                        0x20
64#define CI_FLAG_IQ_AUTO_BIT_AUTO                        0x01
65
66#define CI_FLAG_LOCK_MODE_BIT                           0x06
67#define CI_FLAG_LOCK_MODE_BIT_MASK                      0x40
68
69#define TUNER_LOCKED                                            0x1
70
71#define TUNER_LPF                                                       340     /*< Tuner's LPF in 100KHz */
72
73#define FUNC_MODE_DEMOD                                         0x0
74#define FUNC_MODE_BLIND                                         0x1
75
76#define LOCK_MODE_FIXED                                         0x0
77#define LOCK_MODE_ADAPTIVE                                      0x1
78
79/* RF AGC Polarisation */
80#define AGC_POL_NORMAL                                          0x0
81#define AGC_POL_INVERT                                          0x1
82
83/* Tuner registers */
84#define REG_TUNER_FREQ_100KHZ                           0x000005D0      /**< Tuner frequency in 100KHz */
85#define REG_TUNER_LPF_100KHZ                            0x000005D2      /**< Tuner Low Pass Filter */
86#define REG_TUNER_SLAVE_ADDR                            0x000005D4      /**< Tuner slave address */
87#define REG_TUNER_MAX_LPF_100KHZ                        0x000005D6      /**< Tuner Low Pass Filter maximum */
88#define REG_TUNER_LPF_MARGIN_100KHZ                     0x000005D8      /**< Tuner Low Pass Filter margin */
89#define REG_TUNER_USE_INTERNAL_CTRL                     0x000005DA      /**< Tuner control mode select */
90
91#define TUNER_SLAVE_ADDR                                        0xC0
92
93/* i2c repeater registers for tuner */
94#define REG_I2C_SPEED_KHZ                                       0x000005CC
95#define REG_I2C_CMD                                                     0x00000404
96#define REG_I2C_RSP                                                     0x00000418
97#define REG_TUNER_STATUS                                        0x000007B2
98
99#define TUNER_I2C_CLK                                           200             /**< Tuner's clock speed in KHz dedicated to the I2C bus */
100
101#define I2C_CMD_LEN                                             0x14
102#define I2C_RSP_LEN                                             0x14
103#define I2C_NOOP                                                        0x00
104#define I2C_INIT                                                        0x01
105#define I2C_WRITE                                                       0x02
106#define I2C_READ                                                        0x03
107
108/* Blind-scan registers */
109#define REG_BLIND_SCAN_RETRIES                          0x000005F8      /**< Blind scan retries */
110#define REG_BLIND_SCAN_SRATE_TO_HZ                      0x00002472
111#define REG_BLIND_SCAN_CARIER_FREQ_TO_KHZ       0x00002484
112#define REG_BLIND_SCAN_CARRIER_DB                       0x00002486
113
114/* Receiver registers */
115#define REG_RF_AGC_POL                                          0x0000043c
116#define REG_SPEC_INV                                            0x00000470
117#define REG_MPEG_ERR_SIGNAL_POL                         0x00000458      /**< MPEG error signal polarity */
118#define REG_MPEG_SERIAL_OUT_SEL                         0x00000460      /**< MPEG serial output pin select */
119#define REG_MPEG_SERIAL_BIT_SEQ                         0x00000468      /**< MPEG serial bit sequence */
120#define REG_MPEG_POS_EDGE                                       0x000004DC      /**< MPEG clock edge select */
121#define REG_MPEG_SERIAL                                         0x000004DE      /**< MPEG output mode */
122#define REG_MPEG_MODE                                           0x0000045C      /**< MPEG output mode select */
123#define REG_MPEG_SERIAL_CLK_N                           0x000004E0      /**< MPEG serial clock N */
124#define REG_MPEG_SERIAL_CLK_D                           0x000004E2      /**< MPEG serial clock D */
125#define REG_MPEG_OUTPUT                                         0x006C0024      /**< MPEG output enable */
126#define REG_ERR_MODE_CTRL                                       0x000004F8      /**< Error mode control */
127#define REG_SNR_DB                                                      0x00000680
128#define REG_SNR_LINEAR                                          0x00000690
129#define REG_DMD_CLK_MHZ                                         0x00000580
130#define REG_FEC_CLK_MHZ                                         0x00000582
131#define REG_MPEG_CLK_MHZ                                        0x00000584
132#define REG_SRATE_HZ                                            0x00000490
133#define REG_FORMAT                                                      0x0000044C
134#define REG_ALPHA                                                       0x00000440
135#define REG_ALPHA_SETTING                                       0x0000046C
136#define REG_DECODE_MODE                                         0x0000248A
137#define REG_IQ_SWAP_MODE                                        0x00002488
138#define REG_CARRIER_FREQ_HALF_RANGE_MHZ         0x0000058A
139#define REG_FEC_LOCK                                            0x00000790
140#define REG_BER                                                         0x000007F8
141#define REG_AAGC_REF                                            0x000004CA
142#define REG_AAGC                                                        0x0040004C
143#define REG_DVBS_BER_ADDR                                       0x00002480
144#define REG_LOCK_MODE                                           0x00002478
145#define REG_FUNCTIONAL_MODE                                     0x00002476
146#define REG_MPEG_PERSISTENT_CLK_MODE            0x0000246E /**< MPEG persistent clk mode */
147
148/* Diseqc registers */
149#define REG_DISEQC_TX_CTRL                                      0x00700000
150#define REG_DISEQC_TONE_FRAC_N                          0x00700004
151#define REG_DISEQC_TONE_FRAC_D                          0x00700008
152#define REG_DISEQC_TX_ST                                        0x0070000C
153#define REG_DISEQC_RX_MSG_TMR                           0x00700014
154#define REG_DISEQC_RX_CTRL                                      0x0070001C
155#define REG_DISEQC_SRST                                         0x00700020
156#define REG_DISEQC_SAMP_FRAC_N                          0x00700028
157#define REG_DISEQC_SAMP_FRAC_D                          0x0070002C
158#define REG_DISEQC_TX_FIFO_MAP                          0x00700080
159
160/* Diseqc data */
161#define DISEQC_TONE_FREQ                                        22              /*< In KHz */
162
163#define DISEQC_TX_GAP_15                        0x0000  /*< 15ms gap: When transmitting, there is gap between TONE0 and TONE1 */
164#define DISEQC_TX_GAP_20                        0x0001  /*< 20ms gap */
165#define DISEQC_TX_GAP_25                        0x0002  /*< 25ms gap */
166#define DISEQC_TX_GAP_30                        0x0003  /*< 30ms gap */
167
168#define DISEQC_TX_MODE_MOD                      0x0000  /*< Modulation mode */
169#define DISEQC_TX_MODE_TONE0                    0x0010  /*< Send tone 0 */
170#define DISEQC_TX_MODE_TONE1                    0x0020  /*< Send tone 1 */
171#define DISEQC_TX_MODE_CONT                     0x0030  /*< Continuous send pulses */
172
173#define DISEQC_WAVEFORM_NORMAL                  0x0000  /*< Normal wave mode */
174#define DISEQC_WAVEFORM_ENVELOPE                0x0100  /*< Wave is sent using envelopes */
175
176#define DISEQC_RX_150                           0x0000  /*< Wait 150 ms before closing the input FIFO */
177#define DISEQC_RX_170                           0x1000  /*< Wait 170 ms */
178#define DISEQC_RX_190                           0x2000  /*< Wait 190 ms */
179#define DISEQC_RX_210                           0x3000  /*< Wait 210 ms */
180
181/* Diseqc status */
182#define DISEQC_STATUS_UNINIT                            0x00
183#define DISEQC_STATUS_INIT                                      0x01
184#define DISEQC_STATUS_CONTINUOUS                        0x02
185#define DISEQC_STATUS_TONE                                      0x03
186#define DISEQC_STATUS_MOD                                       0x04
187
188/* MPEG data */
189#define MPEG_FORMAT_TS                                  0x0    /*< Transport stream */
190#define MPEG_FORMAT_TS_PAR                              0x1    /*< Transport stream + Parity */
191
192#define MPEG_MODE_PARALLEL                              0x0    /*< Output parallel data */
193#define MPEG_MODE_SERIAL                                0x1    /*< Output serial data */
194
195#define MPEG_CLK_MODE_FALLING                           0x0    /*< MPEG data sampled on clock's falling edge */
196#define MPEG_CLK_MODE_RISING                            0x1    /*< MPEG data sampled on clock's rising edge */
197
198#endif /* _AVL2108_REG_H */
Note: See TracBrowser for help on using the repository browser.