source: svn/trunk/newcon3bcm2_21bu/nexus/platforms/97552/src/bfpga_name.c

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

first commit

  • Property svn:executable set to *
File size: 4.7 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2002-2007, 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: bfpga_name.c $
11 * $brcm_Revision: Hydra_Software_Devel/12 $
12 * $brcm_Date: 2/24/07 7:05p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /rockford/commondrivers/fpga/97038/bfpga_name.c $
19 *
20 * Hydra_Software_Devel/12   2/24/07 7:05p jgarrett
21 * PR 25900: Fixing names for 7400
22 *
23 * Hydra_Software_Devel/11   12/20/06 3:31p erickson
24 * PR25108: add 7403 support
25 *
26 * Hydra_Software_Devel/10   5/12/06 4:37p erickson
27 * PR20219: remove hardcoded value
28 *
29 * Hydra_Software_Devel/9   5/12/06 2:47p erickson
30 * PR20219: added PKT4 for 7401/7400
31 *
32 * Hydra_Software_Devel/8   10/20/05 3:54p vsilyaev
33 * PR 17710: Add suppor for 97401 board
34 *
35 * Hydra_Software_Devel/2   9/1/05 9:52a jasonh
36 * PR 16943: Removed warning.
37 *
38 * Hydra_Software_Devel/1   3/24/05 4:50p dlwin
39 * PR 14606: Merge to main development branch.
40 *
41 * Hydra_Software_Devel/5   9/29/04 11:34a marcusk
42 * PR12850: UPdated with support for AVC daughter card setting.
43 *
44 * Hydra_Software_Devel/4   2/13/04 11:45a vsilyaev
45 * PR 9588: Changed message priority to warning.
46 *
47 * Hydra_Software_Devel/3   2/6/04 5:32p marcusk
48 * PR9588: Fixed type in a name.
49 *
50 * Hydra_Software_Devel/2   2/4/04 3:52p marcusk
51 * PR9588: Updated with proper detection of POD and 1394 Ts selects
52 * (documentation was wrong)
53 *
54 * Hydra_Software_Devel/1   2/4/04 7:57a marcusk
55 * PR9588: Added support for fpga, tested and working.
56 *
57 ***************************************************************************/
58#include "bstd.h"
59#include "bfpga_name.h"
60
61BDBG_MODULE(BFPGA_NAME);
62
63static const char * BFPGA_TsSelectNames[] = {
64#if BCHP_CHIP==7401 || BCHP_CHIP == 7403
65        "MB 4500SDS",   /* 0 */
66        "MB 3517VSB",   /* 1 */
67        "RMX 0",                /* 2 */
68        "RMX 1",                /* 3 */
69        "Reserved 4",   /* 4 */
70        "1394",                 /* 5 */ 
71        "Reserved 6",   /* 6 */
72        "Streamer 1",   /* 7 */
73        "Slot0 TS2",    /* 8 */
74        "Slot0 TS3",    /* 9 */
75        "POD",                  /* 10 */
76        "Slot0 TS4",    /* 11 */
77        "Slot0 TS5",    /* 12 */
78        "Unknown 13",   /* 13 */
79        "Reserved 14",  /* 14 */
80        "Disabled"              /* 15 */
81#elif BCHP_CHIP==7400
82        "MB 4500SDS",   /* 0 */
83        "MB 3517VSB",   /* 1 */
84        "RMX 0",                /* 2 */
85        "RMX 1",                /* 3 */
86        "Reserved 4",   /* 4 */
87        "1394",                 /* 5 */ 
88        "Reserved 6",   /* 6 */
89        "Streamer 1",   /* 7 */
90        "Slot0 TS2",    /* 8 */
91        "Slot0 TS3",    /* 9 */
92        "POD",                  /* 10 */
93        "Slot1 TS4",    /* 11 */
94        "Slot1 TS5",    /* 12 */
95        "Unknown 13",   /* 13 */
96        "Slot 2",       /* 14 */
97        "Disabled"              /* 15 */
98#else
99        "3250 DS 1",
100        "3250 OOB",
101        "7038 HSX 1",
102        "7038 HSX 2",
103        "7041 TS 0",
104        "1394",
105        "Streamer 2",
106        "Streamer 1",
107        "3250 DS 2",
108        "7041 TS 1",
109        "POD",
110        "VSB/SDS 1",
111        "VSB/SDS 2",
112        "Reserved 1",
113    "MS-POD",
114        "Disabled"
115#endif
116};
117
118#if BCHP_CHIP == 7401 || BCHP_CHIP == 7400 || BCHP_CHIP == 7403
119/* PKT4 is available on 97038V4 boards. We have no way to detect version of board. Customers can turn this
120on if they wish. For other boards, default it on. */
121#define B_HAS_PKT4 1
122#endif
123
124static const char * BFPGA_OutputSelectNames[] = {
125        "Band 0",
126        "Band 1",
127        "Band 2",
128        "Band 3",
129        "1394",
130        "Test",
131        "POD",
132        "AVC"
133#if B_HAS_PKT4
134        ,"Band 4" /* 0x0B */
135#endif
136};
137
138const char * BFPGA_GetTsSelectName( BFPGA_TsSelect tsSelect )
139{
140        if (tsSelect >= sizeof(BFPGA_TsSelectNames)/sizeof(BFPGA_TsSelectNames[0])) return "unknown";
141       
142        return BFPGA_TsSelectNames[tsSelect];
143}
144
145const char * BFPGA_GetOutputSelectName( BFPGA_OutputSelect outSelect )
146{
147        if (outSelect >= sizeof(BFPGA_OutputSelectNames)/sizeof(BFPGA_OutputSelectNames[0])) return "unknown";
148       
149        return BFPGA_OutputSelectNames[outSelect];
150}
151
152void BFPGA_DumpConfiguration( BFPGA_Handle hFpga )
153{
154#if BDBG_DEBUG_BUILD
155        BFPGA_info fpgaInfo;
156#endif
157        unsigned i;
158        BFPGA_TsSelect tsSelect;
159        BFPGA_ClockPolarity inClock, outClock;
160        bool softConfig;
161
162        BDBG_ASSERT(!BFPGA_GetInfo( 
163                hFpga,
164                &fpgaInfo
165                ));
166
167        BDBG_WRN(("FPGA Version: 0x%X, Board Cfg: 0x%X, Strap: 0x%X", fpgaInfo.fpga_ver, fpgaInfo.board_cfg, fpgaInfo.strap_pins ));
168
169        for( i = 0; i < sizeof(BFPGA_OutputSelectNames)/sizeof(BFPGA_OutputSelectNames[0]); i++ )
170        {
171                BFPGA_GetTsOutput( hFpga, i, &tsSelect, &softConfig );
172                BFPGA_GetClockPolarity( hFpga, i, &inClock, &outClock );
173               
174                BDBG_WRN(("%-12s (clk %s) ==> %-8s (clk %s) %s", 
175                        BFPGA_GetTsSelectName(tsSelect), inClock?"-":"+", 
176                        BFPGA_GetOutputSelectName(i), outClock?"-":"+",
177                        softConfig?"custom":"default"));
178        }
179        return;
180}
181 
Note: See TracBrowser for help on using the repository browser.