source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/xpt/7552/bxpt_mpod.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 13.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bxpt_mpod.h $
11 * $brcm_Revision: Hydra_Software_Devel/3 $
12 * $brcm_Date: 12/12/11 2:03p $
13 *
14 * Porting interface code for the MultiPod section of the
15 * data transport core.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_mpod.h $
20 *
21 * Hydra_Software_Devel/3   12/12/11 2:03p gmullen
22 * SW7425-1940: Force output clock rate to 27 MHz when in M-Card mode
23 *
24 * Hydra_Software_Devel/2   8/22/11 5:45p gmullen
25 * SW7231-319: Merged to Hydra branch
26 *
27 * Hydra_Software_Devel/SW7231-319/2   8/18/11 11:26a gmullen
28 * SW7231-319: Fixed compilation error
29 *
30 * Hydra_Software_Devel/SW7231-319/1   8/16/11 2:15p gmullen
31 * SW7231-319: Initial support for B0
32 *
33 * Hydra_Software_Devel/1   10/25/10 2:09p gmullen
34 * SW7425-15: Moved srcs to base2 folder
35 *
36 * Hydra_Software_Devel/1   10/8/10 2:57p gmullen
37 * SW7425-15: Added header files
38 *
39 * Hydra_Software_Devel/18   9/7/10 3:28p gmullen
40 * SW7420-1044: Merged to Hydra_Software_Devel
41 *
42 * Hydra_Software_Devel/SW7420-1044/1   9/7/10 3:20p gmullen
43 * SW7420-1044: Added BXPT_Mpod_RouteToMpodPidFiltered()
44 *
45 * Hydra_Software_Devel/17   6/17/09 6:46p gmullen
46 * PR56110: Added support.xpt/7550/uif_image/a0
47 *
48 * Hydra_Software_Devel/16   4/7/09 5:25p piyushg
49 * PR52986: Add support for 7635
50 * Added directory element "7635".
51 *
52 * Hydra_Software_Devel/15   1/27/09 1:09p gmullen
53 * PR51625: Added 7336 support
54 *
55 * Hydra_Software_Devel/14   11/26/08 4:14p gmullen
56 * PR47755: Added support for 7420.
57 *
58 * Hydra_Software_Devel/13   9/12/08 2:21p gmullen
59 * PR46659: Added 3556/3548 B0 support
60 *
61 * Hydra_Software_Devel/12   7/7/08 11:32a gmullen
62 * PR44486: Added support to control Pod2Chip MCLK select.
63 *
64 * Hydra_Software_Devel/11   5/21/08 6:20p gmullen
65 * PR42923: Added support for S-Card mode. Updated comments for PbBand.
66 *
67 * Hydra_Software_Devel/10   5/21/08 3:38p jrubio
68 * PR42353: add 7325/7335 support to mpod
69 *
70 * Hydra_Software_Devel/9   4/10/08 5:33p gmullen
71 * PR41241: Added support for cardbus.
72 *
73 * Hydra_Software_Devel/8   3/26/08 11:24a gmullen
74 * PR38954: Added 3548 support to XPT PI.
75 *
76 * Hydra_Software_Devel/7   2/14/07 1:10p gmullen
77 * PR27642: Added support for 7405.
78 *
79 * Hydra_Software_Devel/6   2/6/07 7:05p gmullen
80 * PR26217: Added B0 support.
81 *
82 * Hydra_Software_Devel/5   1/18/07 4:55p katrep
83 * PR27188: Enabled Parallel MPOD support for 7403
84 *
85 * Hydra_Software_Devel/4   11/2/06 8:40a gmullen
86 * PR23189: Added 3563 support.
87 *
88 * Hydra_Software_Devel/3   4/12/06 10:15a gmullen
89 * PR20631: Added parallel IO support
90 *
91 * Hydra_Software_Devel/2   3/31/06 4:12p gmullen
92 * PR 15309: To use MPOD, parser band must be in all-pass mode.
93 *
94 * Hydra_Software_Devel/1   5/13/05 1:27p gmullen
95 * PR15309: First draft of XPT PI.
96 *
97 ***************************************************************************/
98
99/*= Module Overview *********************************************************
100Overview
101
102To follow later
103
104Sample Code
105
106To follow later
107***************************************************************************/
108
109#ifndef BXPT_MPOD_H__
110#define BXPT_MPOD_H__
111
112#include "bxpt.h"
113
114#ifdef __cplusplus
115extern "C" {
116#endif
117
118/***************************************************************************
119Summary:
120Enumeration of all the output clock rates.
121****************************************************************************/
122typedef enum BXPT_Mpod_OutputClockRate
123{
124    BXPT_Mpod_OutputClockRate_e81,              /* 81 MHz */
125    BXPT_Mpod_OutputClockRate_e54,              /* 54 MHz */
126    BXPT_Mpod_OutputClockRate_e40_50,           /* 40.5 MHz */
127    BXPT_Mpod_OutputClockRate_e20_25,           /* 20.25 MHz */
128    BXPT_Mpod_OutputClockRate_e27,              /* 27 MHz */
129    BXPT_Mpod_OutputClockRate_ePll,              /* PLL clock */
130    BXPT_Mpod_OutputClockRate_e108,              /* 108 MHz clock */
131
132    BXPT_Mpod_OutputClockRate_eIb0 = 0x8,        /* Input band 0 clock */
133    BXPT_Mpod_OutputClockRate_eIb1,              /* Input band 1 clock */
134    BXPT_Mpod_OutputClockRate_eIb2,              /* Input band 2 clock */
135    BXPT_Mpod_OutputClockRate_eIb3,              /* Input band 3 clock */
136    BXPT_Mpod_OutputClockRate_eIb4,              /* Input band 4 clock */
137    BXPT_Mpod_OutputClockRate_eIb5,              /* Input band 5 clock */
138    BXPT_Mpod_OutputClockRate_eIb6,              /* Input band 6 clock */
139    BXPT_Mpod_OutputClockRate_eIb7,              /* Input band 7 clock */
140    BXPT_Mpod_OutputClockRate_eIb8,              /* Input band 8 clock */
141
142    BXPT_Mpod_OutputClockRate_eMax              /* End of the enum list */
143}
144BXPT_Mpod_OutputClockRate;
145
146/***************************************************************************
147Summary
148Output clock rate divider.
149****************************************************************************/
150typedef enum BXPT_Mpod_OutputClockDivider
151{
152    BXPT_Mpod_OutputClockDivider_eNone,  /* No divider */
153    BXPT_Mpod_OutputClockDivider_e12,    /* Divide clock by 12 */
154    BXPT_Mpod_OutputClockDivider_e9,     /* Divide clock by 9 */
155    BXPT_Mpod_OutputClockDivider_e8,     /* Divide clock by 8 */
156    BXPT_Mpod_OutputClockDivider_e4,     /* Divide clock by 4 */
157    BXPT_Mpod_OutputClockDivider_eMax
158}
159BXPT_Mpod_OutputClockDivider;
160
161/***************************************************************************
162Summary:
163Configuration settings to used during BXPT_Mpod_Init().
164****************************************************************************/
165typedef struct BXPT_Mpod_Config
166{   
167    /* Ouput Interface Formatter Control */
168    unsigned char ByteSync;
169    unsigned char ClkNrun;
170    unsigned char InvertClk;
171    unsigned char NshiftClk;
172    unsigned char OutputInvertSync;
173
174    /* Input Interface Formatter Control */
175    unsigned char InputInvertSync;
176
177    /* S-Mode is enabled when true, M-Mode when false */
178    bool SmodeEn;   
179
180    /*
181    ** Value inserted into the Host_reserved field of the 12-byte
182    ** pre-header when HostRsvdEn is true.
183    */
184    unsigned int    HostRsvd; 
185    bool HostRsvdEn;
186
187    /* Output clock delay, in 9.26 nS steps */
188    unsigned int    ClkDelay;   
189
190    /* Invert the VALID and CLK signals. S-Mode only. */
191    bool OutputInvertValid;
192    bool InputInvertValid;
193    bool InputInvertClk;
194
195    /*
196    ** Parser band used for data that originates in the S-Pod. This is
197    ** interpreted as an playback parser band number if PbBand is true. Otherwise,
198    ** the data is identified as an input band parser. Note that BandEn
199    ** must be true to enable BandNo and PbBand. This value should be programmed
200    ** if the single stream transport does not originate from either the chip's
201    ** InBand or Playback paths but, instead originates from the S-Card itself. 
202    ** In this case, an unused InBand or Playback parser path would have to be
203    ** chosen for downstream PID parsing of the incoming single transport stream
204    ** from the S-Card (S-Mode only).
205    */
206    unsigned char BandNo;
207    bool PbBand;
208    bool BandEn;
209
210    /*
211    ** Replace the timestamp received from the interface with a new
212    ** internally generated one.
213    */
214    bool TimestampInsertEn;
215
216    /* Loopback mode, for tests only. */
217    bool Loopback;
218
219    /* Support for the parallel interface.  */
220        bool ParallelEn;
221
222    /* Output interface clock rate or source */
223    BXPT_Mpod_OutputClockRate OutputClockRate;
224    BXPT_Mpod_OutputClockDivider OutputClockDivider;
225
226    /* Delay between packets on the output interface. Specified in clocks. */
227    unsigned OutputPacketDelayCount;
228}
229BXPT_Mpod_Config;
230
231/***************************************************************************
232Summary:
233Get the default config for the MultiPod interface.
234
235Description:
236Copy the default settings for the MultiPod registers into the Config
237structure, which is then used in a subsequent call to BXPT_Mpod_Init(). The
238user can customize the default values as needed before calling BXPT_Mpod_Init().
239
240Returns:
241    void
242
243See Also:
244BXPT_Mpod_Init
245****************************************************************************/
246void BXPT_Mpod_GetDefaultConfig(
247    BXPT_Handle hXpt,                           /* [in] Handle for this transport */
248    BXPT_Mpod_Config *Config
249    ); 
250
251/***************************************************************************
252Summary:
253Initialize the MultiPod interface.
254
255Description:
256The initial configuration of the MultiPod interface is loaded, then the interface
257is enabled. Custom configuration is supported by setting the members of the
258BXPT_Mpod_Config struct. After initializing the interface, parser data can
259be sent through the interface by calling BXPT_Mpod_RouteToMpod().
260
261Returns:
262    BERR_SUCCESS                - MultiPod interface initialized.
263
264See Also:
265BXPT_Mpod_Shutdown, BXPT_Mpod_RouteToMpod
266****************************************************************************/
267BERR_Code BXPT_Mpod_Init(
268    BXPT_Handle hXpt,                           /* [in] Handle for this transport */
269    const BXPT_Mpod_Config *Config
270    ); 
271
272/***************************************************************************
273Summary:
274Shutdown the MultiPod interface.
275
276Description:
277All parser bands are configured to bypass the MultiPod interface, after which
278the interface is disabled.
279
280Returns:
281    BERR_SUCCESS                - MultiPod interface shutdown.
282
283See Also:
284BXPT_Mpod_Init
285****************************************************************************/
286BERR_Code BXPT_Mpod_Shutdown(
287    BXPT_Handle hXpt                            /* [in] Handle for this transport */
288    ); 
289
290/***************************************************************************
291Summary:
292Get PODRES field from the incoming MultiPod headers.
293
294Description:
295Get the value of the PODRES field in the last MultiPod header received.
296
297Returns:
298    unsigned int                - The PODRES field retrieved.
299****************************************************************************/
300unsigned int BXPT_Mpod_GetPodRes(
301    BXPT_Handle hXpt                /* [in] Handle for this transport */
302    );
303
304/***************************************************************************
305Summary:
306Send all PIDS on a parser band out the MPOD interface.
307
308Description:
309Data for the selected parser is routed throught the MultiPod interface.
310
311Returns:
312    BERR_SUCCESS                - Parser data routed to interface.
313    BERR_INVALID_PARAMETER      - Bad parser parameter
314
315See Also:
316BXPT_Mpod_Init, BXPT_Mpod_AllPass
317****************************************************************************/
318BERR_Code BXPT_Mpod_RouteToMpod(
319    BXPT_Handle hXpt,           /* [in] Handle for this instance of transport. */
320    BXPT_ParserType ParserType, /* [in] Playback or front-end parser */
321    unsigned ParserNum,         /* [in] Which parser to get data from */
322    bool Enable                 /* [in] Route data to the MPOD interface if true */
323    );
324
325/***************************************************************************
326Summary:
327Send PID-filtered data out the MPOD interface.
328
329Description:
330Data for the selected parser is routed throught the MultiPod interface.
331Only data on enabled PID channels mapped to the parser will be sent.
332
333Returns:
334    BERR_SUCCESS                - Parser data routed to interface.
335    BERR_INVALID_PARAMETER      - Bad parser parameter
336
337See Also:
338BXPT_Mpod_Init, BXPT_Mpod_AllPass
339****************************************************************************/
340BERR_Code BXPT_Mpod_RouteToMpodPidFiltered(
341    BXPT_Handle hXpt,           /* [in] Handle for this instance of transport. */
342    BXPT_ParserType ParserType, /* [in] Playback or front-end parser */
343    unsigned ParserNum,         /* [in] Which parser to get data from */
344    bool MpodPidFilter,         /* [in] enable pid filtering prior to the MCARD */
345    bool ContinuityCountCheck,  /* [in] enable CC checking after the MCARD */
346    bool Enable                 /* [in] Route data to the MPOD interface if true */
347    );
348
349/***************************************************************************
350Summary:
351Send all parser band data out the MPOD interface.
352
353Description:
354For routing data to the MultiPod, the PID channel assignments are ignored.
355All data arriving at the given parser band is routed to the interface.
356
357Returns:
358    BERR_SUCCESS                - All data routed to interface.
359    BERR_INVALID_PARAMETER      - Bad parser parameter
360
361See Also:
362BXPT_Mpod_Init, BXPT_Mpod_RouteToMpod
363****************************************************************************/
364BERR_Code BXPT_Mpod_AllPass(
365    BXPT_Handle hXpt,           /* [in] Handle for this instance of transport. */
366    BXPT_ParserType ParserType, /* [in] Playback or front-end parser */
367    unsigned ParserNum,         /* [in] Which parser to get data from */
368    bool Enable                 /* [in] All pass mode enabled if true, disabled if false */
369    );
370
371#ifdef __cplusplus
372}
373#endif
374
375#endif /* #ifndef BXPT_MPOD_H__ */
376
377/* end of file */
378
379
Note: See TracBrowser for help on using the repository browser.