1143ded74436c04bca1e1369530950d612e569af
[openwrt.git] / target / linux / brcm63xx-2.6 / files / arch / mips / bcm963xx / boardparms.c
1 /*
2 <:copyright-gpl 
3
4  Copyright 2003 Broadcom Corp. All Rights Reserved. 
5  
6  This program is free software; you can distribute it and/or modify it 
7  under the terms of the GNU General Public License (Version 2) as 
8  published by the Free Software Foundation. 
9  
10  This program is distributed in the hope it will be useful, but WITHOUT 
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
12  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
13  for more details. 
14  
15  You should have received a copy of the GNU General Public License along 
16  with this program; if not, write to the Free Software Foundation, Inc., 
17  59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 
18
19 :>
20 */
21 /**************************************************************************
22  * File Name  : boardparms.c
23  *
24  * Description: This file contains the implementation for the BCM63xx board
25  *              parameter access functions.
26  * 
27  * Updates    : 07/14/2003  Created.
28  ***************************************************************************/
29
30 /* Includes. */
31 #include "boardparms.h"
32
33 /* Defines. */
34
35 /* Default psi size in K bytes */
36 #define BP_PSI_DEFAULT_SIZE                     24   
37
38 /* Typedefs */
39 typedef struct boardparameters
40 {
41     char szBoardId[BP_BOARD_ID_LEN];        /* board id string */
42     ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS];
43     VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP];
44     unsigned short usSdramSize;             /* SDRAM size and type */
45     unsigned short usPsiSize;               /* persistent storage in K bytes */
46     unsigned short usGpioRj11InnerPair;     /* GPIO pin or not defined */
47     unsigned short usGpioRj11OuterPair;     /* GPIO pin or not defined */
48     unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */
49     unsigned short usGpioPcmciaReset;       /* GPIO pin or not defined */
50     unsigned short usGpioUartRts;           /* GPIO pin or not defined */
51     unsigned short usGpioUartCts;           /* GPIO pin or not defined */
52     unsigned short usGpioLedAdsl;           /* GPIO pin or not defined */
53     unsigned short usGpioLedAdslFail;       /* GPIO pin or not defined */
54     unsigned short usGpioLedWireless;       /* GPIO pin or not defined */
55     unsigned short usGpioLedUsb;            /* GPIO pin or not defined */
56     unsigned short usGpioLedHpna;           /* GPIO pin or not defined */
57     unsigned short usGpioLedWanData;        /* GPIO pin or not defined */
58     unsigned short usGpioLedPpp;            /* GPIO pin or not defined */
59     unsigned short usGpioLedPppFail;        /* GPIO pin or not defined */
60     unsigned short usGpioLedBlPowerOn;      /* GPIO pin or not defined */
61     unsigned short usGpioLedBlAlarm;        /* GPIO pin or not defined */
62     unsigned short usGpioLedBlResetCfg;     /* GPIO pin or not defined */
63     unsigned short usGpioLedBlStop;         /* GPIO pin or not defined */
64     unsigned short usExtIntrWireless;       /* ext intr or not defined */
65     unsigned short usExtIntrAdslDyingGasp;  /* ext intr or not defined */
66     unsigned short usExtIntrHpna;           /* ext intr or not defined */
67     unsigned short usCsHpna;                /* chip select not defined */
68     unsigned short usAntInUseWireless;      /* antenna in use or not defined */
69     unsigned short usGpioSesBtnWireless;    /* GPIO pin or not defined */
70     unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */        
71     unsigned short usGpioLedSesWireless;    /* GPIO pin or not defined */        
72 } BOARD_PARAMETERS, *PBOARD_PARAMETERS;
73
74 /* Variables */
75 #if defined(_BCM96338_) || defined(CONFIG_BCM96338)
76 static BOARD_PARAMETERS g_bcm96338sv =
77 {
78     "96338SV",                               /* szBoardId */
79     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
80       0x01,                                 /* ucPhyAddress */
81       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
82       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
83       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
84       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
85       BP_NOT_DEFINED,                       /* usGpioPhyReset */
86       0x01,                                 /* numSwitchPorts */
87       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
88       BP_NOT_DEFINED},                      /* usReverseMii */
89      {BP_ENET_NO_PHY}},                     /* ucPhyType */
90     {{BP_VOIP_NO_DSP},                      /* ucDspType */
91      {BP_VOIP_NO_DSP}},                     /* ucDspType */
92     BP_MEMORY_16MB_1_CHIP,                  /* usSdramSize */
93     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
94     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
95     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
96     BP_NOT_DEFINED,                         /* usGpioPressAndHoldReset */
97     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
98     BP_NOT_DEFINED,                         /* usGpioUartRts */
99     BP_NOT_DEFINED,                         /* usGpioUartCts */
100     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
101     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
102     BP_NOT_DEFINED,                         /* usGpioLedWireless */
103     BP_NOT_DEFINED,                         /* usGpioLedUsb */
104     BP_NOT_DEFINED,                         /* usGpioLedHpna */
105     BP_NOT_DEFINED,                         /* usGpioLedWanData */
106     BP_NOT_DEFINED,                         /* usGpioLedPpp */
107     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
108     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
109     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
110     BP_NOT_DEFINED,                         /* usGpioLedBlResetCfg */
111     BP_NOT_DEFINED,                         /* usGpioLedBlStop */
112     BP_NOT_DEFINED,                         /* usExtIntrWireless */
113     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
114     BP_NOT_DEFINED,                         /* usExtIntrHpna */
115     BP_NOT_DEFINED,                         /* usCsHpna */
116     BP_NOT_DEFINED,                         /* usAntInUseWireless */
117     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
118     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
119     BP_NOT_DEFINED                          /* usGpioLedSesWireless */     
120 };
121 static BOARD_PARAMETERS g_bcm96338l2m8m =
122 {
123     "96338L-2M-8M",                         /* szBoardId */
124     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
125       0x01,                                 /* ucPhyAddress */
126       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
127       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
128       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
129       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
130       BP_NOT_DEFINED,                       /* usGpioPhyReset */
131       0x01,                                 /* numSwitchPorts */
132       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
133       BP_NOT_DEFINED},                      /* usReverseMii */
134      {BP_ENET_NO_PHY}},                     /* ucPhyType */
135     {{BP_VOIP_NO_DSP},                      /* ucDspType */
136      {BP_VOIP_NO_DSP}},                     /* ucDspType */
137     BP_MEMORY_8MB_1_CHIP,                   /* usSdramSize */
138     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
139     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
140     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
141     BP_NOT_DEFINED,                         /* usGpioPressAndHoldReset */
142     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
143     BP_NOT_DEFINED,                         /* usGpioUartRts */
144     BP_NOT_DEFINED,                         /* usGpioUartCts */
145     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
146     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
147     BP_NOT_DEFINED,                         /* usGpioLedWireless */
148     BP_NOT_DEFINED,                         /* usGpioLedUsb */
149     BP_NOT_DEFINED,                         /* usGpioLedHpna */
150     BP_GPIO_3_AL,                           /* usGpioLedWanData */
151     BP_GPIO_3_AL,                           /* usGpioLedPpp */
152     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
153     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
154     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
155     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
156     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
157     BP_NOT_DEFINED,                         /* usExtIntrWireless */
158     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
159     BP_NOT_DEFINED,                         /* usExtIntrHpna */
160     BP_NOT_DEFINED,                         /* usCsHpna */
161     BP_NOT_DEFINED,                         /* usAntInUseWireless */
162     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */    
163     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
164     BP_NOT_DEFINED                          /* usGpioLedSesWireless */         
165 };
166 static PBOARD_PARAMETERS g_BoardParms[] =
167     {&g_bcm96338sv, &g_bcm96338l2m8m, 0};
168 #endif
169
170 #if defined(_BCM96345_) || defined(CONFIG_BCM96345)
171 static BOARD_PARAMETERS g_bcm96345r =
172 {
173     "96345R",                               /* szBoardId */
174     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
175       0x01,                                 /* ucPhyAddress */
176       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
177       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
178       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
179       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
180       BP_NOT_DEFINED,                       /* usGpioPhyReset */
181       0x01,                                 /* numSwitchPorts */
182       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
183       BP_NOT_DEFINED},                      /* usReverseMii */
184      {BP_ENET_NO_PHY}},                     /* ucPhyType */
185     {{BP_VOIP_NO_DSP},                      /* ucDspType */
186      {BP_VOIP_NO_DSP}},                     /* ucDspType */
187     BP_MEMORY_8MB_1_CHIP,                   /* usSdramSize */
188     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
189     BP_GPIO_11_AH,                          /* usGpioRj11InnerPair */
190     BP_GPIO_12_AH,                          /* usGpioRj11OuterPair */
191     BP_GPIO_13_AH,                          /* usGpioPressAndHoldReset */
192     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
193     BP_NOT_DEFINED,                         /* usGpioUartRts */
194     BP_NOT_DEFINED,                         /* usGpioUartCts */
195     BP_GPIO_8_AH,                           /* usGpioLedAdsl */
196     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
197     BP_NOT_DEFINED,                         /* usGpioLedWireless */
198     BP_NOT_DEFINED,                         /* usGpioLedUsb */
199     BP_NOT_DEFINED,                         /* usGpioLedHpna */
200     BP_GPIO_8_AH,                           /* usGpioLedWanData */
201     BP_GPIO_9_AH,                           /* usGpioLedPpp */
202     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
203     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
204     BP_GPIO_10_AH,                          /* usGpioLedBlAlarm */
205     BP_GPIO_9_AH,                           /* usGpioLedBlResetCfg */
206     BP_GPIO_8_AH,                           /* usGpioLedBlStop */
207     BP_NOT_DEFINED,                         /* usExtIntrWireless */
208     BP_EXT_INTR_0,                          /* usExtIntrAdslDyingGasp */
209     BP_NOT_DEFINED,                         /* usExtIntrHpna */
210     BP_NOT_DEFINED,                         /* usCsHpna */
211     BP_NOT_DEFINED,                         /* usAntInUseWireless */
212     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
213     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
214     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
215 };
216
217 static BOARD_PARAMETERS g_bcm96345gw2 =
218 {
219     /* A hardware jumper determines whether GPIO 13 is used for Press and Hold
220      * Reset or RTS.
221      */
222     "96345GW2",                             /* szBoardId */
223     {{BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
224       0x00,                                 /* ucPhyAddress */
225       BP_GPIO_0_AH,                         /* usGpioPhySpiSck */
226       BP_GPIO_4_AH,                         /* usGpioPhySpiSs */
227       BP_GPIO_12_AH,                        /* usGpioPhySpiMosi */
228       BP_GPIO_11_AH,                        /* usGpioPhySpiMiso */
229       BP_NOT_DEFINED,                       /* usGpioPhyReset */
230       0x04,                                 /* numSwitchPorts */
231       BP_ENET_CONFIG_GPIO,                  /* usConfigType */
232       BP_ENET_REVERSE_MII},                 /* usReverseMii */
233      {BP_ENET_NO_PHY}},                     /* ucPhyType */
234     {{BP_VOIP_DSP,                          /* ucDspType */
235       0x00,                                 /* ucDspAddress */
236       BP_EXT_INTR_1,                        /* usExtIntrVoip */
237       BP_GPIO_6_AH,                         /* usGpioVoipReset */
238       BP_GPIO_15_AH,                        /* usGpioVoipIntr */
239       BP_NOT_DEFINED,                       /* usGpioLedVoip */
240       BP_CS_2},                             /* usCsVoip */
241      {BP_VOIP_NO_DSP}},                     /* ucDspType */
242     BP_MEMORY_16MB_1_CHIP,                  /* usSdramSize */
243     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
244     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
245     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
246     BP_GPIO_13_AH,                          /* usGpioPressAndHoldReset */
247     BP_GPIO_2_AH,                           /* usGpioPcmciaReset */
248     BP_GPIO_13_AH,                          /* usGpioUartRts */
249     BP_GPIO_9_AH,                           /* usGpioUartCts */
250     BP_GPIO_8_AH,                           /* usGpioLedAdsl */
251     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
252     BP_NOT_DEFINED,                         /* usGpioLedWireless */
253     BP_GPIO_7_AH,                           /* usGpioLedUsb */
254     BP_NOT_DEFINED,                         /* usGpioLedHpna */
255     BP_GPIO_8_AH,                           /* usGpioLedWanData */
256     BP_NOT_DEFINED,                         /* usGpioLedPpp */
257     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
258     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
259     BP_GPIO_10_AH,                          /* usGpioLedBlAlarm */
260     BP_GPIO_7_AH,                           /* usGpioLedBlResetCfg */
261     BP_GPIO_8_AH,                           /* usGpioLedBlStop */
262     BP_EXT_INTR_2,                          /* usExtIntrWireless */
263     BP_EXT_INTR_0,                          /* usExtIntrAdslDyingGasp */
264     BP_NOT_DEFINED,                         /* usExtIntrHpna */
265     BP_NOT_DEFINED,                         /* usCsHpna */
266     BP_WLAN_ANT_MAIN,                       /* usAntInUseWireless */
267     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
268     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
269     BP_NOT_DEFINED                          /* usGpioLedSesWireless */    
270 };
271
272 static BOARD_PARAMETERS g_bcm96345gw =
273 {
274     "96345GW",                              /* szBoardId */
275     {{BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
276       0x00,                                 /* ucPhyAddress */
277       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
278       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
279       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
280       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
281       BP_NOT_DEFINED,                       /* usGpioPhyReset */
282       0x04,                                 /* numSwitchPorts */
283       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
284       BP_ENET_NO_REVERSE_MII},              /* usReverseMii */
285      {BP_ENET_NO_PHY}},                     /* ucPhyType */
286     {{BP_VOIP_DSP,                          /* ucDspType */
287       0x00,                                 /* ucDspAddress */
288       BP_EXT_INTR_1,                        /* usExtIntrVoip */
289       BP_GPIO_6_AH,                         /* usGpioVoipReset */
290       BP_GPIO_15_AH,                        /* usGpioVoipIntr */
291       BP_NOT_DEFINED,                       /* usGpioLedVoip */
292       BP_CS_2},                             /* usCsVoip */
293      {BP_VOIP_NO_DSP}},                     /* ucDspType */
294     BP_MEMORY_16MB_1_CHIP,                  /* usSdramSize */
295     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
296     BP_GPIO_11_AH,                          /* usGpioRj11InnerPair */
297     BP_GPIO_1_AH,                           /* usGpioRj11OuterPair */
298     BP_GPIO_13_AH,                          /* usGpioPressAndHoldReset */
299     BP_GPIO_2_AH,                           /* usGpioPcmciaReset */
300     BP_NOT_DEFINED,                         /* usGpioUartRts */
301     BP_NOT_DEFINED,                         /* usGpioUartCts */
302     BP_GPIO_8_AH,                           /* usGpioLedAdsl */
303     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
304     BP_GPIO_10_AH,                          /* usGpioLedWireless */
305     BP_GPIO_7_AH,                           /* usGpioLedUsb */
306     BP_NOT_DEFINED,                         /* usGpioLedHpna */
307     BP_GPIO_8_AH,                           /* usGpioLedWanData */
308     BP_NOT_DEFINED,                         /* usGpioLedPpp */
309     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
310     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
311     BP_GPIO_9_AH,                           /* usGpioLedBlAlarm */
312     BP_GPIO_10_AH,                          /* usGpioLedBlResetCfg */
313     BP_GPIO_8_AH,                           /* usGpioLedBlStop */
314     BP_EXT_INTR_2,                          /* usExtIntrWireless */
315     BP_EXT_INTR_0,                          /* usExtIntrAdslDyingGasp */
316     BP_EXT_INTR_3,                          /* usExtIntrHpna */
317     BP_CS_1,                                /* usCsHpna */
318     BP_WLAN_ANT_MAIN,                       /* usAntInUseWireless */
319     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
320     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
321     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
322 };
323
324 static BOARD_PARAMETERS g_bcm96335r =
325 {
326     "96335R",                               /* szBoardId */
327     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
328       0x01,                                 /* ucPhyAddress */
329       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
330       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
331       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
332       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
333       BP_NOT_DEFINED,                       /* usGpioPhyReset */
334       0x01,                                 /* numSwitchPorts */
335       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
336       BP_NOT_DEFINED},                      /* usReverseMii */
337      {BP_ENET_NO_PHY}},                     /* ucPhyType */
338     {{BP_VOIP_NO_DSP},                      /* ucDspType */
339      {BP_VOIP_NO_DSP}},                     /* ucDspType */
340     BP_MEMORY_8MB_1_CHIP,                   /* usSdramSize */
341     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
342     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
343     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
344     BP_GPIO_14_AH,                          /* usGpioPressAndHoldReset */
345     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
346     BP_NOT_DEFINED,                         /* usGpioUartRts */
347     BP_NOT_DEFINED,                         /* usGpioUartCts */
348     BP_GPIO_9_AH,                           /* usGpioLedAdsl */
349     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
350     BP_NOT_DEFINED,                         /* usGpioLedWireless */
351     BP_NOT_DEFINED,                         /* usGpioLedUsb */
352     BP_NOT_DEFINED,                         /* usGpioLedHpna */
353     BP_GPIO_9_AH,                           /* usGpioLedWanData */
354     BP_GPIO_8_AH,                           /* usGpioLedPpp */
355     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
356     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
357     BP_GPIO_10_AH,                          /* usGpioLedBlAlarm */
358     BP_GPIO_8_AH,                           /* usGpioLedBlResetCfg */
359     BP_GPIO_9_AH,                           /* usGpioLedBlStop */
360     BP_NOT_DEFINED,                         /* usExtIntrWireless */
361     BP_NOT_DEFINED,                         /* usExtIntrAdslDyingGasp */
362     BP_NOT_DEFINED,                         /* usExtIntrHpna */
363     BP_NOT_DEFINED,                         /* usCsHpna */
364     BP_NOT_DEFINED,                         /* usAntInUseWireless */
365     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
366     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
367     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
368 };
369
370 static BOARD_PARAMETERS g_bcm96345r0 =
371 {
372     "96345R0",                              /* szBoardId */
373     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
374       0x01,                                 /* ucPhyAddress */
375       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
376       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
377       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
378       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
379       BP_NOT_DEFINED,                       /* usGpioPhyReset */
380       0x01,                                 /* numSwitchPorts */
381       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
382       BP_NOT_DEFINED},                      /* usReverseMii */
383      {BP_ENET_NO_PHY}},                     /* ucPhyType */
384     {{BP_VOIP_NO_DSP},                      /* ucDspType */
385      {BP_VOIP_NO_DSP}},                     /* ucDspType */
386     BP_MEMORY_8MB_1_CHIP,                   /* usSdramSize */
387     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
388     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
389     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
390     BP_NOT_DEFINED,                         /* usGpioPressAndHoldReset */
391     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
392     BP_NOT_DEFINED,                         /* usGpioUartRts */
393     BP_NOT_DEFINED,                         /* usGpioUartCts */
394     BP_GPIO_8_AH,                           /* usGpioLedAdsl */
395     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
396     BP_NOT_DEFINED,                         /* usGpioLedWireless */
397     BP_NOT_DEFINED,                         /* usGpioLedUsb */
398     BP_NOT_DEFINED,                         /* usGpioLedHpna */
399     BP_GPIO_9_AH,                           /* usGpioLedWanData */
400     BP_GPIO_9_AH,                           /* usGpioLedPpp */
401     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
402     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
403     BP_GPIO_9_AH,                           /* usGpioLedBlAlarm */
404     BP_GPIO_8_AH,                           /* usGpioLedBlResetCfg */
405     BP_GPIO_8_AH,                           /* usGpioLedBlStop */
406     BP_NOT_DEFINED,                         /* usExtIntrWireless */
407     BP_NOT_DEFINED,                         /* usExtIntrAdslDyingGasp */
408     BP_NOT_DEFINED,                         /* usExtIntrHpna */
409     BP_NOT_DEFINED,                         /* usCsHpna */
410     BP_NOT_DEFINED,                         /* usAntInUseWireless */
411     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */     
412     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
413     BP_NOT_DEFINED                          /* usGpioLedSesWireless */    
414 };
415
416 static BOARD_PARAMETERS g_bcm96345rs =
417 {
418     "96345RS",                              /* szBoardId */
419     {{BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
420       0x00,                                 /* ucPhyAddress */
421       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
422       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
423       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
424       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
425       BP_NOT_DEFINED,                       /* usGpioPhyReset */
426       0x01,                                 /* numSwitchPorts */
427       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
428       BP_ENET_NO_REVERSE_MII},              /* usReverseMii */
429      {BP_ENET_NO_PHY}},                     /* ucPhyType */
430     {{BP_VOIP_NO_DSP},                      /* ucDspType */
431      {BP_VOIP_NO_DSP}},                     /* ucDspType */
432     BP_MEMORY_8MB_1_CHIP,                   /* usSdramSize */
433     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
434     BP_GPIO_11_AH,                          /* usGpioRj11InnerPair */
435     BP_GPIO_12_AH,                          /* usGpioRj11OuterPair */
436     BP_GPIO_13_AH,                          /* usGpioPressAndHoldReset */
437     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
438     BP_NOT_DEFINED,                         /* usGpioUartRts */
439     BP_NOT_DEFINED,                         /* usGpioUartCts */
440     BP_GPIO_8_AH,                           /* usGpioLedAdsl */
441     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
442     BP_NOT_DEFINED,                         /* usGpioLedWireless */
443     BP_NOT_DEFINED,                         /* usGpioLedUsb */
444     BP_NOT_DEFINED,                         /* usGpioLedHpna */
445     BP_GPIO_8_AH,                           /* usGpioLedWanData */
446     BP_GPIO_9_AH,                           /* usGpioLedPpp */
447     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
448     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
449     BP_GPIO_10_AH,                          /* usGpioLedBlAlarm */
450     BP_GPIO_9_AH,                           /* usGpioLedBlResetCfg */
451     BP_GPIO_8_AH,                           /* usGpioLedBlStop */
452     BP_NOT_DEFINED,                         /* usExtIntrWireless */
453     BP_EXT_INTR_0,                          /* usExtIntrAdslDyingGasp */
454     BP_NOT_DEFINED,                         /* usExtIntrHpna */
455     BP_NOT_DEFINED,                         /* usCsHpna */
456     BP_NOT_DEFINED,                         /* usAntInUseWireless */
457     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
458     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
459     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
460 };
461
462 static PBOARD_PARAMETERS g_BoardParms[] =
463     {&g_bcm96345r, &g_bcm96345gw2, &g_bcm96345gw, &g_bcm96335r, &g_bcm96345r0,
464      &g_bcm96345rs, 0};
465 #endif
466
467 #if defined(_BCM96348_) || defined(CONFIG_BCM96348)
468
469 static BOARD_PARAMETERS g_bcm96348r =
470 {
471     "96348R",                               /* szBoardId */
472     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
473       0x01,                                 /* ucPhyAddress */
474       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
475       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
476       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
477       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
478       BP_NOT_DEFINED,                       /* usGpioPhyReset */
479       0x01,                                 /* numSwitchPorts */
480       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
481       BP_NOT_DEFINED},                      /* usReverseMii */
482      {BP_ENET_NO_PHY}},                     /* ucPhyType */
483     {{BP_VOIP_NO_DSP},                      /* ucDspType */
484      {BP_VOIP_NO_DSP}},                     /* ucDspType */
485     BP_MEMORY_8MB_1_CHIP,                   /* usSdramSize */
486     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
487     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
488     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
489     BP_GPIO_7_AH,                           /* usGpioPressAndHoldReset */
490     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
491     BP_NOT_DEFINED,                         /* usGpioUartRts */
492     BP_NOT_DEFINED,                         /* usGpioUartCts */
493     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
494     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
495     BP_NOT_DEFINED,                         /* usGpioLedWireless */
496     BP_NOT_DEFINED,                         /* usGpioLedUsb */
497     BP_NOT_DEFINED,                         /* usGpioLedHpna */
498     BP_GPIO_3_AL,                           /* usGpioLedWanData */
499     BP_GPIO_3_AL,                           /* usGpioLedPpp */
500     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
501     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
502     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
503     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
504     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
505     BP_NOT_DEFINED,                         /* usExtIntrWireless */
506     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
507     BP_NOT_DEFINED,                         /* usExtIntrHpna */
508     BP_NOT_DEFINED,                         /* usCsHpna */
509     BP_NOT_DEFINED,                         /* usAntInUseWireless */
510     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
511     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
512     BP_NOT_DEFINED                          /* usGpioLedSesWireless */    
513 };
514
515 static BOARD_PARAMETERS g_bcm96348lv =
516 {
517     "96348LV",                               /* szBoardId */
518     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
519       0x01,                                 /* ucPhyAddress */
520       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
521       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
522       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
523       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
524       BP_NOT_DEFINED,                       /* usGpioPhyReset */
525       0x01,                                 /* numSwitchPorts */
526       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
527       BP_NOT_DEFINED},                      /* usReverseMii */
528      {BP_ENET_EXTERNAL_PHY,                 /* ucPhyType */
529       0x02,                                 /* ucPhyAddress */
530       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
531       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
532       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
533       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
534       BP_GPIO_5_AL,                         /* usGpioPhyReset */
535       0x01,                                 /* numSwitchPorts */
536       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
537       BP_NOT_DEFINED}},                     /* usReverseMii */
538     {{BP_VOIP_NO_DSP},                      /* ucDspType */
539      {BP_VOIP_NO_DSP}},                     /* ucDspType */
540     BP_MEMORY_16MB_2_CHIP,                  /* usSdramSize */
541     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
542     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
543     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
544     BP_GPIO_7_AH,                           /* usGpioPressAndHoldReset */
545     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
546     BP_NOT_DEFINED,                         /* usGpioUartRts */
547     BP_NOT_DEFINED,                         /* usGpioUartCts */
548     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
549     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
550     BP_NOT_DEFINED,                         /* usGpioLedWireless */
551     BP_NOT_DEFINED,                         /* usGpioLedUsb */
552     BP_NOT_DEFINED,                         /* usGpioLedHpna */
553     BP_GPIO_3_AL,                           /* usGpioLedWanData */
554     BP_GPIO_3_AL,                           /* usGpioLedPpp */
555     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
556     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
557     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
558     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
559     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
560     BP_NOT_DEFINED,                         /* usExtIntrWireless */
561     BP_NOT_DEFINED,                         /* usExtIntrAdslDyingGasp */
562     BP_NOT_DEFINED,                         /* usExtIntrHpna */
563     BP_NOT_DEFINED,                         /* usCsHpna */
564     BP_NOT_DEFINED,                         /* usAntInUseWireless */
565     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
566     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
567     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
568 };
569
570 static BOARD_PARAMETERS g_bcm96348gw =
571 {
572     "96348GW",                              /* szBoardId */
573     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
574       0x01,                                 /* ucPhyAddress */
575       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
576       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
577       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
578       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
579       BP_NOT_DEFINED,                       /* usGpioPhyReset */
580       0x01,                                 /* numSwitchPorts */
581       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
582       BP_NOT_DEFINED},                      /* usReverseMii */
583      {BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
584       0x00,                                 /* ucPhyAddress */
585       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
586       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
587       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
588       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
589       BP_NOT_DEFINED,                       /* usGpioPhyReset */
590       0x03,                                 /* numSwitchPorts */
591       BP_ENET_CONFIG_SPI_SSB_0,             /* usConfigType */
592       BP_ENET_REVERSE_MII}},                /* usReverseMii */
593     {{BP_VOIP_DSP,                          /* ucDspType */
594       0x00,                                 /* ucDspAddress */
595       BP_EXT_INTR_2,                        /* usExtIntrVoip */
596       BP_GPIO_6_AH,                         /* usGpioVoipReset */
597       BP_GPIO_34_AH,                        /* usGpioVoipIntr */
598       BP_NOT_DEFINED,                       /* usGpioLedVoip */
599       BP_CS_2},                             /* usCsVoip */
600      {BP_VOIP_NO_DSP}},                     /* ucDspType */
601     BP_MEMORY_16MB_2_CHIP,                  /* usSdramSize */
602     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
603     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
604     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
605     BP_GPIO_33_AL,                          /* usGpioPressAndHoldReset */
606     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
607     BP_NOT_DEFINED,                         /* usGpioUartRts */
608     BP_NOT_DEFINED,                         /* usGpioUartCts */
609     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
610     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
611     BP_NOT_DEFINED,                         /* usGpioLedWireless */
612     BP_NOT_DEFINED,                         /* usGpioLedUsb */
613     BP_NOT_DEFINED,                         /* usGpioLedHpna */
614     BP_GPIO_3_AL,                           /* usGpioLedWanData */
615     BP_GPIO_3_AL,                           /* usGpioLedPpp */
616     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
617     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
618     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
619     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
620     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
621     BP_NOT_DEFINED,                         /* usExtIntrWireless */
622     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
623     BP_NOT_DEFINED,                         /* usExtIntrHpna */
624     BP_NOT_DEFINED,                         /* usCsHpna */
625     BP_WLAN_ANT_MAIN,                       /* usAntInUseWireless */
626     BP_NOT_DEFINED, /* BP_GPIO_35_AH, */    /* usGpioSesBtnWireless */
627     BP_NOT_DEFINED, /* BP_EXT_INTR_3, */    /* usExtIntrSesBtnWireless */
628     BP_NOT_DEFINED  /* BP_GPIO_0_AL   */    /* usGpioLedSesWireless */
629 };
630
631
632 static BOARD_PARAMETERS g_bcm96348gw_10 =
633 {
634     "96348GW-10",                           /* szBoardId */
635     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
636       0x01,                                 /* ucPhyAddress */
637       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
638       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
639       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
640       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
641       BP_NOT_DEFINED,                       /* usGpioPhyReset */
642       0x01,                                 /* numSwitchPorts */
643       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
644       BP_NOT_DEFINED},                      /* usReverseMii */
645      {BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
646       0x00,                                 /* ucPhyAddress */
647       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
648       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
649       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
650       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
651       BP_NOT_DEFINED,                       /* usGpioPhyReset */
652       0x03,                                 /* numSwitchPorts */
653       BP_ENET_CONFIG_SPI_SSB_1,             /* usConfigType */
654       BP_ENET_REVERSE_MII}},                /* usReverseMii */
655     {{BP_VOIP_DSP,                          /* ucDspType */
656       0x00,                                 /* ucDspAddress */
657       BP_EXT_INTR_2,                        /* usExtIntrVoip */
658       BP_GPIO_6_AH,                         /* usGpioVoipReset */
659       BP_GPIO_34_AH,                        /* usGpioVoipIntr */
660       BP_NOT_DEFINED,                       /* usGpioLedVoip */
661       BP_CS_2},                             /* usCsVoip */
662      {BP_VOIP_NO_DSP}},                     /* ucDspType */
663     BP_MEMORY_16MB_2_CHIP,                  /* usSdramSize */
664     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
665     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
666     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
667     BP_GPIO_33_AL,                          /* usGpioPressAndHoldReset */
668     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
669     BP_NOT_DEFINED,                         /* usGpioUartRts */
670     BP_NOT_DEFINED,                         /* usGpioUartCts */
671     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
672     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
673     BP_NOT_DEFINED,                         /* usGpioLedWireless */
674     BP_NOT_DEFINED,                         /* usGpioLedUsb */
675     BP_NOT_DEFINED,                         /* usGpioLedHpna */
676     BP_GPIO_3_AL,                           /* usGpioLedWanData */
677     BP_GPIO_3_AL,                           /* usGpioLedPpp */
678     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
679     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
680     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
681     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
682     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
683     BP_NOT_DEFINED,                         /* usExtIntrWireless */
684     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
685     BP_NOT_DEFINED,                         /* usExtIntrHpna */
686     BP_NOT_DEFINED,                         /* usCsHpna */
687     BP_WLAN_ANT_MAIN,                       /* usAntInUseWireless */
688     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
689     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
690     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
691 };
692
693 static BOARD_PARAMETERS g_bcm96348gw_11 =
694 {
695     "96348GW-11",                           /* szBoardId */
696     {{BP_ENET_NO_PHY},                      /* ucPhyType */
697      {BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
698       0x00,                                 /* ucPhyAddress */
699       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
700       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
701       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
702       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
703       BP_NOT_DEFINED,                       /* usGpioPhyReset */
704       0x04,                                 /* numSwitchPorts */
705       BP_ENET_CONFIG_SPI_SSB_1,             /* usConfigType */
706       BP_ENET_REVERSE_MII}},                /* usReverseMii */
707     {{BP_VOIP_NO_DSP},                      /* ucDspType */
708      {BP_VOIP_NO_DSP}},                     /* ucDspType */
709     BP_MEMORY_16MB_2_CHIP,                  /* usSdramSize */
710     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
711     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
712     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
713     BP_GPIO_33_AL,                          /* usGpioPressAndHoldReset */
714     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
715     BP_NOT_DEFINED,                         /* usGpioUartRts */
716     BP_NOT_DEFINED,                         /* usGpioUartCts */
717     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
718     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
719     BP_NOT_DEFINED,                         /* usGpioLedWireless */
720     BP_NOT_DEFINED,                         /* usGpioLedUsb */
721     BP_NOT_DEFINED,                         /* usGpioLedHpna */
722     BP_GPIO_3_AL,                           /* usGpioLedWanData */
723     BP_GPIO_3_AL,                           /* usGpioLedPpp */
724     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
725     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
726     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
727     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
728     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
729     BP_NOT_DEFINED,                         /* usExtIntrWireless */
730     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
731     BP_NOT_DEFINED,                         /* usExtIntrHpna */
732     BP_NOT_DEFINED,                         /* usCsHpna */
733     BP_NOT_DEFINED,                         /* usAntInUseWireless */
734     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
735     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
736     BP_NOT_DEFINED                          /* usGpioLedSesWireless */    
737 };
738
739 static BOARD_PARAMETERS g_bcm96348sv =
740 {
741     "96348SV",                              /* szBoardId */
742     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
743       0x01,                                 /* ucPhyAddress */
744       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
745       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
746       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
747       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
748       BP_NOT_DEFINED,                       /* usGpioPhyReset */
749       0x01,                                 /* numSwitchPorts */
750       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
751       BP_NOT_DEFINED},                      /* usReverseMii */
752      {BP_ENET_EXTERNAL_PHY,                 /* ucPhyType */
753       0x1f,                                 /* ucPhyAddress */
754       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
755       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
756       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
757       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
758       BP_NOT_DEFINED,                       /* usGpioPhyReset */
759       0x01,                                 /* numSwitchPorts */
760       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
761       BP_NOT_DEFINED}},                     /* usReverseMii */
762     {{BP_VOIP_NO_DSP},                      /* ucDspType */
763      {BP_VOIP_NO_DSP}},                     /* ucDspType */
764     BP_MEMORY_32MB_2_CHIP,                  /* usSdramSize */
765     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
766     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
767     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
768     BP_NOT_DEFINED,                         /* usGpioPressAndHoldReset */
769     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
770     BP_NOT_DEFINED,                         /* usGpioUartRts */
771     BP_NOT_DEFINED,                         /* usGpioUartCts */
772     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
773     BP_NOT_DEFINED,                         /* usGpioLedAdslFail */
774     BP_NOT_DEFINED,                         /* usGpioLedWireless */
775     BP_NOT_DEFINED,                         /* usGpioLedUsb */
776     BP_NOT_DEFINED,                         /* usGpioLedHpna */
777     BP_NOT_DEFINED,                         /* usGpioLedWanData */
778     BP_NOT_DEFINED,                         /* usGpioLedPpp */
779     BP_NOT_DEFINED,                         /* usGpioLedPppFail */
780     BP_NOT_DEFINED,                         /* usGpioLedBlPowerOn */
781     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
782     BP_NOT_DEFINED,                         /* usGpioLedBlResetCfg */
783     BP_NOT_DEFINED,                         /* usGpioLedBlStop */
784     BP_NOT_DEFINED,                         /* usExtIntrWireless */
785     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
786     BP_NOT_DEFINED,                         /* usExtIntrHpna */
787     BP_NOT_DEFINED,                         /* usCsHpna */
788     BP_NOT_DEFINED,                         /* usAntInUseWireless */
789     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
790     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
791     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
792 };
793
794
795 static BOARD_PARAMETERS g_bcm96348gw_dualDsp =
796 {
797     "96348GW-DualDSP",                      /* szBoardId */
798     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
799       0x01,                                 /* ucPhyAddress */
800       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
801       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
802       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
803       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
804       BP_NOT_DEFINED,                       /* usGpioPhyReset */
805       0x01,                                 /* numSwitchPorts */
806       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
807       BP_NOT_DEFINED},                      /* usReverseMii */
808      {BP_ENET_EXTERNAL_SWITCH,              /* ucPhyType */
809       0x00,                                 /* ucPhyAddress */
810       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
811       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
812       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
813       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
814       BP_NOT_DEFINED,                       /* usGpioPhyReset */
815       0x03,                                 /* numSwitchPorts */
816       BP_ENET_CONFIG_SPI_SSB_1,             /* usConfigType */
817       BP_ENET_REVERSE_MII}},                /* usReverseMii */
818     {{BP_VOIP_DSP,                          /* ucDspType */
819       0x00,                                 /* ucDspAddress */
820       BP_EXT_INTR_2,                        /* usExtIntrVoip */
821       BP_UNEQUIPPED,                        /* usGpioVoipReset */
822       BP_GPIO_34_AH,                        /* usGpioVoipIntr */
823       BP_NOT_DEFINED,                       /* usGpioLedVoip */
824       BP_CS_2},                             /* usCsVoip */
825      {BP_VOIP_DSP,                          /* ucDspType */
826       0x01,                                 /* ucDspAddress */
827       BP_EXT_INTR_3,                        /* usExtIntrVoip */
828       BP_UNEQUIPPED ,                       /* usGpioVoipReset */
829       BP_GPIO_35_AH,                        /* usGpioVoipIntr */
830       BP_NOT_DEFINED,                       /* usGpioLedVoip */
831       BP_CS_3}},                            /* usCsVoip */
832     BP_MEMORY_16MB_2_CHIP,                  /* usSdramSize */
833     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
834     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
835     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
836     BP_GPIO_33_AL,                          /* usGpioPressAndHoldReset */
837     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
838     BP_NOT_DEFINED,                         /* usGpioUartRts */
839     BP_NOT_DEFINED,                         /* usGpioUartCts */
840     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
841     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
842     BP_NOT_DEFINED,                         /* usGpioLedWireless */
843     BP_NOT_DEFINED,                         /* usGpioLedUsb */
844     BP_NOT_DEFINED,                         /* usGpioLedHpna */
845     BP_GPIO_3_AL,                           /* usGpioLedWanData */
846     BP_GPIO_3_AL,                           /* usGpioLedPpp */
847     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
848     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
849     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
850     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
851     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
852     BP_NOT_DEFINED,                         /* usExtIntrWireless */
853     BP_HW_DEFINED,                          /* usExtIntrAdslDyingGasp */
854     BP_NOT_DEFINED,                         /* usExtIntrHpna */
855     BP_NOT_DEFINED,                         /* usCsHpna */
856     BP_WLAN_ANT_MAIN,                       /* usAntInUseWireless */
857     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
858     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
859     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
860 };
861
862
863 static BOARD_PARAMETERS g_bcmCustom_01 =
864 {
865      "BCMCUST_01",                          /* szBoardId */
866     {{BP_ENET_INTERNAL_PHY,                 /* ucPhyType */
867       0x01,                                 /* ucPhyAddress */
868       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
869       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
870       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
871       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
872       BP_NOT_DEFINED,                       /* usGpioPhyReset */
873       0x01,                                 /* numSwitchPorts */
874       BP_ENET_CONFIG_MDIO,                  /* usConfigType */
875       BP_NOT_DEFINED},                      /* usReverseMii */
876      {BP_ENET_NO_PHY,                       /* ucPhyType */
877       0x00,                                 /* ucPhyAddress */
878       BP_NOT_DEFINED,                       /* usGpioPhySpiSck */
879       BP_NOT_DEFINED,                       /* usGpioPhySpiSs */
880       BP_NOT_DEFINED,                       /* usGpioPhySpiMosi */
881       BP_NOT_DEFINED,                       /* usGpioPhySpiMiso */
882       BP_NOT_DEFINED,                       /* usGpioPhyReset */
883       0x01,                                 /* numSwitchPorts */
884       BP_ENET_CONFIG_SPI_SSB_1,             /* usConfigType */
885       BP_ENET_REVERSE_MII}},                /* usReverseMii */
886     {{BP_VOIP_DSP,                          /* ucDspType */
887       0x00,                                 /* ucDspAddress */
888       BP_EXT_INTR_2,                        /* usExtIntrVoip */
889       BP_GPIO_36_AH,                        /* usGpioVoipReset */
890       BP_GPIO_34_AL,                        /* usGpioVoipIntr */
891       BP_NOT_DEFINED,                       /* usGpioLedVoip */
892       BP_CS_2},                             /* usCsVoip */
893      {BP_VOIP_NO_DSP}},                     /* ucDspType */
894     BP_MEMORY_16MB_2_CHIP,                  /* usSdramSize */
895     BP_PSI_DEFAULT_SIZE,                    /* usPsiSize */
896     BP_NOT_DEFINED,                         /* usGpioRj11InnerPair */
897     BP_NOT_DEFINED,                         /* usGpioRj11OuterPair */
898     BP_GPIO_33_AL,                          /* usGpioPressAndHoldReset */
899     BP_NOT_DEFINED,                         /* usGpioPcmciaReset */
900     BP_NOT_DEFINED,                         /* usGpioUartRts */
901     BP_NOT_DEFINED,                         /* usGpioUartCts */
902     BP_NOT_DEFINED,                         /* usGpioLedAdsl */
903     BP_GPIO_2_AL,                           /* usGpioLedAdslFail */
904     BP_NOT_DEFINED,                         /* usGpioLedWireless */
905     BP_NOT_DEFINED,                         /* usGpioLedUsb */
906     BP_NOT_DEFINED,                         /* usGpioLedHpna */
907     BP_GPIO_3_AL,                           /* usGpioLedWanData */
908     BP_GPIO_3_AL,                           /* usGpioLedPpp */
909     BP_GPIO_4_AL,                           /* usGpioLedPppFail */
910     BP_GPIO_0_AL,                           /* usGpioLedBlPowerOn */
911     BP_NOT_DEFINED,                         /* usGpioLedBlAlarm */
912     BP_GPIO_3_AL,                           /* usGpioLedBlResetCfg */
913     BP_GPIO_1_AL,                           /* usGpioLedBlStop */
914     BP_NOT_DEFINED,                         /* usExtIntrWireless */
915     BP_NOT_DEFINED,                         /* usExtIntrAdslDyingGasp */
916     BP_NOT_DEFINED,                         /* usExtIntrHpna */
917     BP_NOT_DEFINED,                         /* usCsHpna */
918     BP_NOT_DEFINED,                         /* usAntInUseWireless */
919     BP_NOT_DEFINED,                         /* usGpioSesBtnWireless */
920     BP_NOT_DEFINED,                         /* usExtIntrSesBtnWireless */
921     BP_NOT_DEFINED                          /* usGpioLedSesWireless */
922 };
923
924 static PBOARD_PARAMETERS g_BoardParms[] =
925     {&g_bcm96348r, &g_bcm96348lv, &g_bcm96348gw, &g_bcm96348gw_10,
926      &g_bcm96348gw_11, &g_bcm96348sv, &g_bcm96348gw_dualDsp,
927      &g_bcmCustom_01, 0};
928 #endif
929
930 static PBOARD_PARAMETERS g_pCurrentBp = 0;
931
932 /**************************************************************************
933  * Name       : bpstrcmp
934  *
935  * Description: String compare for this file so it does not depend on an OS.
936  *              (Linux kernel and CFE share this source file.)
937  *
938  * Parameters : [IN] dest - destination string
939  *              [IN] src - source string
940  *
941  * Returns    : -1 - dest < src, 1 - dest > src, 0 dest == src
942  ***************************************************************************/
943 static int bpstrcmp(const char *dest,const char *src);
944 static int bpstrcmp(const char *dest,const char *src)
945 {
946     while (*src && *dest)
947     {
948         if (*dest < *src) return -1;
949         if (*dest > *src) return 1;
950         dest++;
951         src++;
952     }
953
954     if (*dest && !*src) return 1;
955     if (!*dest && *src) return -1;
956     return 0;
957 } /* bpstrcmp */
958
959 /**************************************************************************
960  * Name       : BpGetVoipDspConfig
961  *
962  * Description: Gets the DSP configuration from the board parameter
963  *              structure for a given DSP index.
964  *
965  * Parameters : [IN] dspNum - DSP index (number)
966  *
967  * Returns    : Pointer to DSP configuration block if found/valid, NULL
968  *              otherwise.
969  ***************************************************************************/
970 VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum );
971 VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum )
972 {
973     VOIP_DSP_INFO *pDspConfig = 0;
974     int i;
975
976     if( g_pCurrentBp )
977     {
978         for( i = 0 ; i < BP_MAX_VOIP_DSP ; i++ )
979         {
980             if( g_pCurrentBp->VoIPDspInfo[i].ucDspType != BP_VOIP_NO_DSP &&
981                 g_pCurrentBp->VoIPDspInfo[i].ucDspAddress == dspNum )
982             {
983                 pDspConfig = &g_pCurrentBp->VoIPDspInfo[i];
984                 break;
985             }
986         }
987     }
988
989     return pDspConfig;
990 }
991
992
993 /**************************************************************************
994  * Name       : BpSetBoardId
995  *
996  * Description: This function find the BOARD_PARAMETERS structure for the
997  *              specified board id string and assigns it to a global, static
998  *              variable.
999  *
1000  * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
1001  *
1002  * Returns    : BP_SUCCESS - Success, value is returned.
1003  *              BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
1004  *                  have a board parameters configuration record.
1005  ***************************************************************************/
1006 int BpSetBoardId( char *pszBoardId )
1007 {
1008     int nRet = BP_BOARD_ID_NOT_FOUND;
1009     PBOARD_PARAMETERS *ppBp;
1010
1011     for( ppBp = g_BoardParms; *ppBp; ppBp++ )
1012     {
1013         if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
1014         {
1015             g_pCurrentBp = *ppBp;
1016             nRet = BP_SUCCESS;
1017             break;
1018         }
1019     }
1020
1021     return( nRet );
1022 } /* BpSetBoardId */
1023
1024 /**************************************************************************
1025  * Name       : BpGetBoardIds
1026  *
1027  * Description: This function returns all of the supported board id strings.
1028  *
1029  * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
1030  *                  strings are returned in.  Each id starts at BP_BOARD_ID_LEN
1031  *                  boundary.
1032  *              [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
1033  *                  were allocated in pszBoardIds.
1034  *
1035  * Returns    : Number of board id strings returned.
1036  ***************************************************************************/
1037 int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize )
1038 {
1039     PBOARD_PARAMETERS *ppBp;
1040     int i;
1041     char *src;
1042     char *dest;
1043
1044     for( i = 0, ppBp = g_BoardParms; *ppBp && nBoardIdsSize;
1045         i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN )
1046     {
1047         dest = pszBoardIds;
1048         src = (*ppBp)->szBoardId;
1049         while( *src )
1050             *dest++ = *src++;
1051         *dest = '\0';
1052     }
1053
1054     return( i );
1055 } /* BpGetBoardIds */
1056
1057 /**************************************************************************
1058  * Name       : BpGetEthernetMacInfo
1059  *
1060  * Description: This function returns all of the supported board id strings.
1061  *
1062  * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
1063  *                  buffers.
1064  *              [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
1065  *                  are pointed to by pEnetInfos.
1066  *
1067  * Returns    : BP_SUCCESS - Success, value is returned.
1068  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1069  ***************************************************************************/
1070 int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos )
1071 {
1072     int i, nRet;
1073
1074     if( g_pCurrentBp )
1075     {
1076         for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
1077         {
1078             if( i < BP_MAX_ENET_MACS )
1079             {
1080                 unsigned char *src = (unsigned char *)
1081                     &g_pCurrentBp->EnetMacInfos[i];
1082                 unsigned char *dest = (unsigned char *) pEnetInfos;
1083                 int len = sizeof(ETHERNET_MAC_INFO);
1084                 while( len-- )
1085                     *dest++ = *src++;
1086             }
1087             else
1088                 pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
1089         }
1090
1091         nRet = BP_SUCCESS;
1092     }
1093     else
1094     {
1095         for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
1096             pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
1097
1098         nRet = BP_BOARD_ID_NOT_SET;
1099     }
1100
1101     return( nRet );
1102 } /* BpGetEthernetMacInfo */
1103
1104 /**************************************************************************
1105  * Name       : BpGetSdramSize
1106  *
1107  * Description: This function returns a constant that describees the board's
1108  *              SDRAM type and size.
1109  *
1110  * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
1111  *                  is returned in.
1112  *
1113  * Returns    : BP_SUCCESS - Success, value is returned.
1114  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1115  ***************************************************************************/
1116 int BpGetSdramSize( unsigned long *pulSdramSize )
1117 {
1118     int nRet;
1119
1120     if( g_pCurrentBp )
1121     {
1122         *pulSdramSize = g_pCurrentBp->usSdramSize;
1123         nRet = BP_SUCCESS;
1124     }
1125     else
1126     {
1127         *pulSdramSize = BP_NOT_DEFINED;
1128         nRet = BP_BOARD_ID_NOT_SET;
1129     }
1130
1131     return( nRet );
1132 } /* BpGetSdramSize */
1133
1134 /**************************************************************************
1135  * Name       : BpGetPsiSize
1136  *
1137  * Description: This function returns the persistent storage size in K bytes.
1138  *
1139  * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
1140  *                  storage size is returned in.
1141  *
1142  * Returns    : BP_SUCCESS - Success, value is returned.
1143  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1144  ***************************************************************************/
1145 int BpGetPsiSize( unsigned long *pulPsiSize )
1146 {
1147     int nRet;
1148
1149     if( g_pCurrentBp )
1150     {
1151         *pulPsiSize = g_pCurrentBp->usPsiSize;
1152         nRet = BP_SUCCESS;
1153     }
1154     else
1155     {
1156         *pulPsiSize = BP_NOT_DEFINED;
1157         nRet = BP_BOARD_ID_NOT_SET;
1158     }
1159
1160     return( nRet );
1161 } /* BpGetPsiSize */
1162
1163 /**************************************************************************
1164  * Name       : BpGetRj11InnerOuterPairGpios
1165  *
1166  * Description: This function returns the GPIO pin assignments for changing
1167  *              between the RJ11 inner pair and RJ11 outer pair.
1168  *
1169  * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
1170  *                  GPIO pin is returned in.
1171  *              [OUT] pusOuter - Address of short word that the RJ11 outer pair
1172  *                  GPIO pin is returned in.
1173  *
1174  * Returns    : BP_SUCCESS - Success, values are returned.
1175  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1176  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1177  *                  for the board.
1178  ***************************************************************************/
1179 int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
1180     unsigned short *pusOuter )
1181 {
1182     int nRet;
1183
1184     if( g_pCurrentBp )
1185     {
1186         *pusInner = g_pCurrentBp->usGpioRj11InnerPair;
1187         *pusOuter = g_pCurrentBp->usGpioRj11OuterPair;
1188
1189         if( g_pCurrentBp->usGpioRj11InnerPair != BP_NOT_DEFINED &&
1190             g_pCurrentBp->usGpioRj11OuterPair != BP_NOT_DEFINED )
1191         {
1192             nRet = BP_SUCCESS;
1193         }
1194         else
1195         {
1196             nRet = BP_VALUE_NOT_DEFINED;
1197         }
1198     }
1199     else
1200     {
1201         *pusInner = *pusOuter = BP_NOT_DEFINED;
1202         nRet = BP_BOARD_ID_NOT_SET;
1203     }
1204
1205     return( nRet );
1206 } /* BpGetRj11InnerOuterPairGpios */
1207
1208 /**************************************************************************
1209  * Name       : BpGetPressAndHoldResetGpio
1210  *
1211  * Description: This function returns the GPIO pin assignment for the press
1212  *              and hold reset button.
1213  *
1214  * Parameters : [OUT] pusValue - Address of short word that the press and hold
1215  *                  reset button GPIO pin is returned in.
1216  *
1217  * Returns    : BP_SUCCESS - Success, value is returned.
1218  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1219  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1220  *                  for the board.
1221  ***************************************************************************/
1222 int BpGetPressAndHoldResetGpio( unsigned short *pusValue )
1223 {
1224     int nRet;
1225
1226     if( g_pCurrentBp )
1227     {
1228         *pusValue = g_pCurrentBp->usGpioPressAndHoldReset;
1229
1230         if( g_pCurrentBp->usGpioPressAndHoldReset != BP_NOT_DEFINED )
1231         {
1232             nRet = BP_SUCCESS;
1233         }
1234         else
1235         {
1236             nRet = BP_VALUE_NOT_DEFINED;
1237         }
1238     }
1239     else
1240     {
1241         *pusValue = BP_NOT_DEFINED;
1242         nRet = BP_BOARD_ID_NOT_SET;
1243     }
1244
1245     return( nRet );
1246 } /* BpGetPressAndHoldResetGpio */
1247
1248 /**************************************************************************
1249  * Name       : BpGetVoipResetGpio
1250  *
1251  * Description: This function returns the GPIO pin assignment for the VOIP
1252  *              Reset operation.
1253  *
1254  * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
1255  *                  GPIO pin is returned in.
1256  *              [IN] dspNum - Address of the DSP to query.
1257  *
1258  * Returns    : BP_SUCCESS - Success, value is returned.
1259  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1260  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1261  *                  for the board.
1262  ***************************************************************************/
1263 int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue )
1264 {
1265     int nRet;
1266
1267     if( g_pCurrentBp )
1268     {
1269         VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
1270
1271         if( pDspInfo )
1272         {
1273            *pusValue = pDspInfo->usGpioVoipReset;
1274
1275            if( *pusValue != BP_NOT_DEFINED ||
1276                *pusValue == BP_UNEQUIPPED )
1277            {
1278               nRet = BP_SUCCESS;
1279            }
1280            else
1281            {
1282               nRet = BP_VALUE_NOT_DEFINED;
1283            }
1284         }
1285         else
1286         {
1287            *pusValue = BP_NOT_DEFINED;
1288            nRet = BP_BOARD_ID_NOT_FOUND;
1289         }
1290     }
1291     else
1292     {
1293         *pusValue = BP_NOT_DEFINED;
1294         nRet = BP_BOARD_ID_NOT_SET;
1295     }
1296
1297     return( nRet );
1298 } /* BpGetVoipResetGpio */
1299
1300 /**************************************************************************
1301  * Name       : BpGetVoipIntrGpio
1302  *
1303  * Description: This function returns the GPIO pin assignment for VoIP interrupt.
1304  *
1305  * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
1306  *                  GPIO pin is returned in.
1307  *              [IN] dspNum - Address of the DSP to query.
1308  *
1309  * Returns    : BP_SUCCESS - Success, value is returned.
1310  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1311  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1312  *                  for the board.
1313  ***************************************************************************/
1314 int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue )
1315 {
1316     int nRet;
1317
1318     if( g_pCurrentBp )
1319     {
1320         VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
1321
1322         if( pDspInfo )
1323         {
1324            *pusValue = pDspInfo->usGpioVoipIntr;
1325
1326            if( *pusValue != BP_NOT_DEFINED )
1327            {
1328               nRet = BP_SUCCESS;
1329            }
1330            else
1331            {
1332               nRet = BP_VALUE_NOT_DEFINED;
1333            }
1334         }
1335         else
1336         {
1337            *pusValue = BP_NOT_DEFINED;
1338            nRet = BP_BOARD_ID_NOT_FOUND;
1339         }
1340     }
1341     else
1342     {
1343         *pusValue = BP_NOT_DEFINED;
1344         nRet = BP_BOARD_ID_NOT_SET;
1345     }
1346
1347     return( nRet );
1348 } /* BpGetVoipIntrGpio */
1349
1350 /**************************************************************************
1351  * Name       : BpGetPcmciaResetGpio
1352  *
1353  * Description: This function returns the GPIO pin assignment for the PCMCIA
1354  *              Reset operation.
1355  *
1356  * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
1357  *                  GPIO pin is returned in.
1358  *
1359  * Returns    : BP_SUCCESS - Success, value is returned.
1360  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1361  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1362  *                  for the board.
1363  ***************************************************************************/
1364 int BpGetPcmciaResetGpio( unsigned short *pusValue )
1365 {
1366     int nRet;
1367
1368     if( g_pCurrentBp )
1369     {
1370         *pusValue = g_pCurrentBp->usGpioPcmciaReset;
1371
1372         if( g_pCurrentBp->usGpioPcmciaReset != BP_NOT_DEFINED )
1373         {
1374             nRet = BP_SUCCESS;
1375         }
1376         else
1377         {
1378             nRet = BP_VALUE_NOT_DEFINED;
1379         }
1380     }
1381     else
1382     {
1383         *pusValue = BP_NOT_DEFINED;
1384         nRet = BP_BOARD_ID_NOT_SET;
1385     }
1386
1387     return( nRet );
1388 } /* BpGetPcmciaResetGpio */
1389
1390 /**************************************************************************
1391  * Name       : BpGetUartRtsCtsGpios
1392  *
1393  * Description: This function returns the GPIO pin assignments for RTS and CTS
1394  *              UART signals.
1395  *
1396  * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
1397  *                  pin is returned in.
1398  *              [OUT] pusCts - Address of short word that the UART CTS GPIO
1399  *                  pin is returned in.
1400  *
1401  * Returns    : BP_SUCCESS - Success, values are returned.
1402  *              BP_BOARD_ID_NOT_SET - Error, board id input string does not
1403  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1404  *                  for the board.
1405  ***************************************************************************/
1406 int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts )
1407 {
1408     int nRet;
1409
1410     if( g_pCurrentBp )
1411     {
1412         *pusRts = g_pCurrentBp->usGpioUartRts;
1413         *pusCts = g_pCurrentBp->usGpioUartCts;
1414
1415         if( g_pCurrentBp->usGpioUartRts != BP_NOT_DEFINED &&
1416             g_pCurrentBp->usGpioUartCts != BP_NOT_DEFINED )
1417         {
1418             nRet = BP_SUCCESS;
1419         }
1420         else
1421         {
1422             nRet = BP_VALUE_NOT_DEFINED;
1423         }
1424     }
1425     else
1426     {
1427         *pusRts = *pusCts = BP_NOT_DEFINED;
1428         nRet = BP_BOARD_ID_NOT_SET;
1429     }
1430
1431     return( nRet );
1432 } /* BpGetUartRtsCtsGpios */
1433
1434 /**************************************************************************
1435  * Name       : BpGetAdslLedGpio
1436  *
1437  * Description: This function returns the GPIO pin assignment for the ADSL
1438  *              LED.
1439  *
1440  * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
1441  *                  GPIO pin is returned in.
1442  *
1443  * Returns    : BP_SUCCESS - Success, value is returned.
1444  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1445  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1446  *                  for the board.
1447  ***************************************************************************/
1448 int BpGetAdslLedGpio( unsigned short *pusValue )
1449 {
1450     int nRet;
1451
1452     if( g_pCurrentBp )
1453     {
1454         *pusValue = g_pCurrentBp->usGpioLedAdsl;
1455
1456         if( g_pCurrentBp->usGpioLedAdsl != BP_NOT_DEFINED )
1457         {
1458             nRet = BP_SUCCESS;
1459         }
1460         else
1461         {
1462             nRet = BP_VALUE_NOT_DEFINED;
1463         }
1464     }
1465     else
1466     {
1467         *pusValue = BP_NOT_DEFINED;
1468         nRet = BP_BOARD_ID_NOT_SET;
1469     }
1470
1471     return( nRet );
1472 } /* BpGetAdslLedGpio */
1473
1474 /**************************************************************************
1475  * Name       : BpGetAdslFailLedGpio
1476  *
1477  * Description: This function returns the GPIO pin assignment for the ADSL
1478  *              LED that is used when there is a DSL connection failure.
1479  *
1480  * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
1481  *                  GPIO pin is returned in.
1482  *
1483  * Returns    : BP_SUCCESS - Success, value is returned.
1484  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1485  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1486  *                  for the board.
1487  ***************************************************************************/
1488 int BpGetAdslFailLedGpio( unsigned short *pusValue )
1489 {
1490     int nRet;
1491
1492     if( g_pCurrentBp )
1493     {
1494         *pusValue = g_pCurrentBp->usGpioLedAdslFail;
1495
1496         if( g_pCurrentBp->usGpioLedAdslFail != BP_NOT_DEFINED )
1497         {
1498             nRet = BP_SUCCESS;
1499         }
1500         else
1501         {
1502             nRet = BP_VALUE_NOT_DEFINED;
1503         }
1504     }
1505     else
1506     {
1507         *pusValue = BP_NOT_DEFINED;
1508         nRet = BP_BOARD_ID_NOT_SET;
1509     }
1510
1511     return( nRet );
1512 } /* BpGetAdslFailLedGpio */
1513
1514 /**************************************************************************
1515  * Name       : BpGetWirelessLedGpio
1516  *
1517  * Description: This function returns the GPIO pin assignment for the Wireless
1518  *              LED.
1519  *
1520  * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
1521  *                  GPIO pin is returned in.
1522  *
1523  * Returns    : BP_SUCCESS - Success, value is returned.
1524  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1525  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1526  *                  for the board.
1527  ***************************************************************************/
1528 int BpGetWirelessLedGpio( unsigned short *pusValue )
1529 {
1530     int nRet;
1531
1532     if( g_pCurrentBp )
1533     {
1534         *pusValue = g_pCurrentBp->usGpioLedWireless;
1535
1536         if( g_pCurrentBp->usGpioLedWireless != BP_NOT_DEFINED )
1537         {
1538             nRet = BP_SUCCESS;
1539         }
1540         else
1541         {
1542             nRet = BP_VALUE_NOT_DEFINED;
1543         }
1544     }
1545     else
1546     {
1547         *pusValue = BP_NOT_DEFINED;
1548         nRet = BP_BOARD_ID_NOT_SET;
1549     }
1550
1551     return( nRet );
1552 } /* BpGetWirelessLedGpio */
1553
1554 /**************************************************************************
1555  * Name       : BpGetWirelessAntInUse
1556  *
1557  * Description: This function returns the antennas in use for wireless
1558  *
1559  * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
1560  *                  is in use.
1561  *
1562  * Returns    : BP_SUCCESS - Success, value is returned.
1563  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1564  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1565  *                  for the board.
1566  ***************************************************************************/
1567 int BpGetWirelessAntInUse( unsigned short *pusValue )
1568 {
1569     int nRet;
1570
1571     if( g_pCurrentBp )
1572     {
1573         *pusValue = g_pCurrentBp->usAntInUseWireless;
1574
1575         if( g_pCurrentBp->usAntInUseWireless != BP_NOT_DEFINED )
1576         {
1577             nRet = BP_SUCCESS;
1578         }
1579         else
1580         {
1581             nRet = BP_VALUE_NOT_DEFINED;
1582         }
1583     }
1584     else
1585     {
1586         *pusValue = BP_NOT_DEFINED;
1587         nRet = BP_BOARD_ID_NOT_SET;
1588     }
1589
1590     return( nRet );     
1591 } /* BpGetWirelessAntInUse */
1592
1593 /**************************************************************************
1594  * Name       : BpGetWirelessSesBtnGpio
1595  *
1596  * Description: This function returns the GPIO pin assignment for the Wireless
1597  *              Ses Button.
1598  *
1599  * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
1600  *                  GPIO pin is returned in.
1601  *
1602  * Returns    : BP_SUCCESS - Success, value is returned.
1603  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1604  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1605  *                  for the board.
1606  ***************************************************************************/
1607 int BpGetWirelessSesBtnGpio( unsigned short *pusValue )
1608 {
1609     int nRet;
1610
1611     if( g_pCurrentBp )
1612     {
1613         *pusValue = g_pCurrentBp->usGpioSesBtnWireless;
1614
1615         if( g_pCurrentBp->usGpioSesBtnWireless != BP_NOT_DEFINED )
1616         {
1617             nRet = BP_SUCCESS;
1618         }
1619         else
1620         {
1621             nRet = BP_VALUE_NOT_DEFINED;
1622         }
1623     }
1624     else
1625     {
1626         *pusValue = BP_NOT_DEFINED;
1627         nRet = BP_BOARD_ID_NOT_SET;
1628     }
1629
1630     return( nRet );     
1631 } /* BpGetWirelessSesBtnGpio */
1632
1633 /**************************************************************************
1634  * Name       : BpGetWirelessSesExtIntr
1635  *
1636  * Description: This function returns the external interrupt number for the 
1637  *              Wireless Ses Button.
1638  *
1639  * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
1640  *                  external interrup is returned in.
1641  *
1642  * Returns    : BP_SUCCESS - Success, value is returned.
1643  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1644  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1645  *                  for the board.
1646  ***************************************************************************/
1647 int BpGetWirelessSesExtIntr( unsigned short *pusValue )
1648 {
1649     int nRet;
1650
1651     if( g_pCurrentBp )
1652     {
1653         *pusValue = g_pCurrentBp->usExtIntrSesBtnWireless;
1654
1655         if( g_pCurrentBp->usExtIntrSesBtnWireless != BP_NOT_DEFINED )
1656         {
1657             nRet = BP_SUCCESS;
1658         }
1659         else
1660         {
1661             nRet = BP_VALUE_NOT_DEFINED;
1662         }
1663     }
1664     else
1665     {
1666         *pusValue = BP_NOT_DEFINED;
1667         nRet = BP_BOARD_ID_NOT_SET;
1668     }
1669
1670     return( nRet );     
1671                 
1672 } /* BpGetWirelessSesExtIntr */
1673
1674 /**************************************************************************
1675  * Name       : BpGetWirelessSesLedGpio
1676  *
1677  * Description: This function returns the GPIO pin assignment for the Wireless
1678  *              Ses Led.
1679  *
1680  * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
1681  *                  Led GPIO pin is returned in.
1682  *
1683  * Returns    : BP_SUCCESS - Success, value is returned.
1684  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1685  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1686  *                  for the board.
1687  ***************************************************************************/
1688 int BpGetWirelessSesLedGpio( unsigned short *pusValue )
1689 {
1690     int nRet;
1691
1692     if( g_pCurrentBp )
1693     {
1694         *pusValue = g_pCurrentBp->usGpioLedSesWireless;
1695
1696         if( g_pCurrentBp->usGpioLedSesWireless != BP_NOT_DEFINED )
1697         {
1698             nRet = BP_SUCCESS;
1699         }
1700         else
1701         {
1702             nRet = BP_VALUE_NOT_DEFINED;
1703         }
1704     }
1705     else
1706     {
1707         *pusValue = BP_NOT_DEFINED;
1708         nRet = BP_BOARD_ID_NOT_SET;
1709     }
1710
1711     return( nRet );
1712         
1713 } /* BpGetWirelessSesLedGpio */
1714
1715 /**************************************************************************
1716  * Name       : BpGetUsbLedGpio
1717  *
1718  * Description: This function returns the GPIO pin assignment for the USB
1719  *              LED.
1720  *
1721  * Parameters : [OUT] pusValue - Address of short word that the USB LED
1722  *                  GPIO pin is returned in.
1723  *
1724  * Returns    : BP_SUCCESS - Success, value is returned.
1725  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1726  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1727  *                  for the board.
1728  ***************************************************************************/
1729 int BpGetUsbLedGpio( unsigned short *pusValue )
1730 {
1731     int nRet;
1732
1733     if( g_pCurrentBp )
1734     {
1735         *pusValue = g_pCurrentBp->usGpioLedUsb;
1736
1737         if( g_pCurrentBp->usGpioLedUsb != BP_NOT_DEFINED )
1738         {
1739             nRet = BP_SUCCESS;
1740         }
1741         else
1742         {
1743             nRet = BP_VALUE_NOT_DEFINED;
1744         }
1745     }
1746     else
1747     {
1748         *pusValue = BP_NOT_DEFINED;
1749         nRet = BP_BOARD_ID_NOT_SET;
1750     }
1751
1752     return( nRet );
1753 } /* BpGetUsbLedGpio */
1754
1755 /**************************************************************************
1756  * Name       : BpGetHpnaLedGpio
1757  *
1758  * Description: This function returns the GPIO pin assignment for the HPNA
1759  *              LED.
1760  *
1761  * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
1762  *                  GPIO pin is returned in.
1763  *
1764  * Returns    : BP_SUCCESS - Success, value is returned.
1765  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1766  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1767  *                  for the board.
1768  ***************************************************************************/
1769 int BpGetHpnaLedGpio( unsigned short *pusValue )
1770 {
1771     int nRet;
1772
1773     if( g_pCurrentBp )
1774     {
1775         *pusValue = g_pCurrentBp->usGpioLedHpna;
1776
1777         if( g_pCurrentBp->usGpioLedHpna != BP_NOT_DEFINED )
1778         {
1779             nRet = BP_SUCCESS;
1780         }
1781         else
1782         {
1783             nRet = BP_VALUE_NOT_DEFINED;
1784         }
1785     }
1786     else
1787     {
1788         *pusValue = BP_NOT_DEFINED;
1789         nRet = BP_BOARD_ID_NOT_SET;
1790     }
1791
1792     return( nRet );
1793 } /* BpGetHpnaLedGpio */
1794
1795 /**************************************************************************
1796  * Name       : BpGetWanDataLedGpio
1797  *
1798  * Description: This function returns the GPIO pin assignment for the WAN Data
1799  *              LED.
1800  *
1801  * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
1802  *                  GPIO pin is returned in.
1803  *
1804  * Returns    : BP_SUCCESS - Success, value is returned.
1805  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1806  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1807  *                  for the board.
1808  ***************************************************************************/
1809 int BpGetWanDataLedGpio( unsigned short *pusValue )
1810 {
1811     int nRet;
1812
1813     if( g_pCurrentBp )
1814     {
1815         *pusValue = g_pCurrentBp->usGpioLedWanData;
1816
1817         if( g_pCurrentBp->usGpioLedWanData != BP_NOT_DEFINED )
1818         {
1819             nRet = BP_SUCCESS;
1820         }
1821         else
1822         {
1823             nRet = BP_VALUE_NOT_DEFINED;
1824         }
1825     }
1826     else
1827     {
1828         *pusValue = BP_NOT_DEFINED;
1829         nRet = BP_BOARD_ID_NOT_SET;
1830     }
1831
1832     return( nRet );
1833 } /* BpGetWanDataLedGpio */
1834
1835 /**************************************************************************
1836  * Name       : BpGetPppLedGpio
1837  *
1838  * Description: This function returns the GPIO pin assignment for the PPP
1839  *              LED.
1840  *
1841  * Parameters : [OUT] pusValue - Address of short word that the PPP LED
1842  *                  GPIO pin is returned in.
1843  *
1844  * Returns    : BP_SUCCESS - Success, value is returned.
1845  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1846  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1847  *                  for the board.
1848  ***************************************************************************/
1849 int BpGetPppLedGpio( unsigned short *pusValue )
1850 {
1851     int nRet;
1852
1853     if( g_pCurrentBp )
1854     {
1855         *pusValue = g_pCurrentBp->usGpioLedPpp;
1856
1857         if( g_pCurrentBp->usGpioLedPpp != BP_NOT_DEFINED )
1858         {
1859             nRet = BP_SUCCESS;
1860         }
1861         else
1862         {
1863             nRet = BP_VALUE_NOT_DEFINED;
1864         }
1865     }
1866     else
1867     {
1868         *pusValue = BP_NOT_DEFINED;
1869         nRet = BP_BOARD_ID_NOT_SET;
1870     }
1871
1872     return( nRet );
1873 } /* BpGetPppLedGpio */
1874
1875 /**************************************************************************
1876  * Name       : BpGetPppFailLedGpio
1877  *
1878  * Description: This function returns the GPIO pin assignment for the PPP
1879  *              LED that is used when there is a PPP connection failure.
1880  *
1881  * Parameters : [OUT] pusValue - Address of short word that the PPP LED
1882  *                  GPIO pin is returned in.
1883  *
1884  * Returns    : BP_SUCCESS - Success, value is returned.
1885  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1886  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1887  *                  for the board.
1888  ***************************************************************************/
1889 int BpGetPppFailLedGpio( unsigned short *pusValue )
1890 {
1891     int nRet;
1892
1893     if( g_pCurrentBp )
1894     {
1895         *pusValue = g_pCurrentBp->usGpioLedPppFail;
1896
1897         if( g_pCurrentBp->usGpioLedPppFail != BP_NOT_DEFINED )
1898         {
1899             nRet = BP_SUCCESS;
1900         }
1901         else
1902         {
1903             nRet = BP_VALUE_NOT_DEFINED;
1904         }
1905     }
1906     else
1907     {
1908         *pusValue = BP_NOT_DEFINED;
1909         nRet = BP_BOARD_ID_NOT_SET;
1910     }
1911
1912     return( nRet );
1913 } /* BpGetPppFailLedGpio */
1914
1915 /**************************************************************************
1916  * Name       : BpGetBootloaderPowerOnLedGpio
1917  *
1918  * Description: This function returns the GPIO pin assignment for the power
1919  *              on LED that is set by the bootloader.
1920  *
1921  * Parameters : [OUT] pusValue - Address of short word that the alarm LED
1922  *                  GPIO pin is returned in.
1923  *
1924  * Returns    : BP_SUCCESS - Success, value is returned.
1925  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1926  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1927  *                  for the board.
1928  ***************************************************************************/
1929 int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue )
1930 {
1931     int nRet;
1932
1933     if( g_pCurrentBp )
1934     {
1935         *pusValue = g_pCurrentBp->usGpioLedBlPowerOn;
1936
1937         if( g_pCurrentBp->usGpioLedBlPowerOn != BP_NOT_DEFINED )
1938         {
1939             nRet = BP_SUCCESS;
1940         }
1941         else
1942         {
1943             nRet = BP_VALUE_NOT_DEFINED;
1944         }
1945     }
1946     else
1947     {
1948         *pusValue = BP_NOT_DEFINED;
1949         nRet = BP_BOARD_ID_NOT_SET;
1950     }
1951
1952     return( nRet );
1953 } /* BpGetBootloaderPowerOn */
1954
1955 /**************************************************************************
1956  * Name       : BpGetBootloaderAlarmLedGpio
1957  *
1958  * Description: This function returns the GPIO pin assignment for the alarm
1959  *              LED that is set by the bootloader.
1960  *
1961  * Parameters : [OUT] pusValue - Address of short word that the alarm LED
1962  *                  GPIO pin is returned in.
1963  *
1964  * Returns    : BP_SUCCESS - Success, value is returned.
1965  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
1966  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
1967  *                  for the board.
1968  ***************************************************************************/
1969 int BpGetBootloaderAlarmLedGpio( unsigned short *pusValue )
1970 {
1971     int nRet;
1972
1973     if( g_pCurrentBp )
1974     {
1975         *pusValue = g_pCurrentBp->usGpioLedBlAlarm;
1976
1977         if( g_pCurrentBp->usGpioLedBlAlarm != BP_NOT_DEFINED )
1978         {
1979             nRet = BP_SUCCESS;
1980         }
1981         else
1982         {
1983             nRet = BP_VALUE_NOT_DEFINED;
1984         }
1985     }
1986     else
1987     {
1988         *pusValue = BP_NOT_DEFINED;
1989         nRet = BP_BOARD_ID_NOT_SET;
1990     }
1991
1992     return( nRet );
1993 } /* BpGetBootloaderAlarmLedGpio */
1994
1995 /**************************************************************************
1996  * Name       : BpGetBootloaderResetCfgLedGpio
1997  *
1998  * Description: This function returns the GPIO pin assignment for the reset
1999  *              configuration LED that is set by the bootloader.
2000  *
2001  * Parameters : [OUT] pusValue - Address of short word that the reset
2002  *                  configuration LED GPIO pin is returned in.
2003  *
2004  * Returns    : BP_SUCCESS - Success, value is returned.
2005  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2006  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2007  *                  for the board.
2008  ***************************************************************************/
2009 int BpGetBootloaderResetCfgLedGpio( unsigned short *pusValue )
2010 {
2011     int nRet;
2012
2013     if( g_pCurrentBp )
2014     {
2015         *pusValue = g_pCurrentBp->usGpioLedBlResetCfg;
2016
2017         if( g_pCurrentBp->usGpioLedBlResetCfg != BP_NOT_DEFINED )
2018         {
2019             nRet = BP_SUCCESS;
2020         }
2021         else
2022         {
2023             nRet = BP_VALUE_NOT_DEFINED;
2024         }
2025     }
2026     else
2027     {
2028         *pusValue = BP_NOT_DEFINED;
2029         nRet = BP_BOARD_ID_NOT_SET;
2030     }
2031
2032     return( nRet );
2033 } /* BpGetBootloaderResetCfgLedGpio */
2034
2035 /**************************************************************************
2036  * Name       : BpGetBootloaderStopLedGpio
2037  *
2038  * Description: This function returns the GPIO pin assignment for the break
2039  *              into bootloader LED that is set by the bootloader.
2040  *
2041  * Parameters : [OUT] pusValue - Address of short word that the break into
2042  *                  bootloader LED GPIO pin is returned in.
2043  *
2044  * Returns    : BP_SUCCESS - Success, value is returned.
2045  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2046  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2047  *                  for the board.
2048  ***************************************************************************/
2049 int BpGetBootloaderStopLedGpio( unsigned short *pusValue )
2050 {
2051     int nRet;
2052
2053     if( g_pCurrentBp )
2054     {
2055         *pusValue = g_pCurrentBp->usGpioLedBlStop;
2056
2057         if( g_pCurrentBp->usGpioLedBlStop != BP_NOT_DEFINED )
2058         {
2059             nRet = BP_SUCCESS;
2060         }
2061         else
2062         {
2063             nRet = BP_VALUE_NOT_DEFINED;
2064         }
2065     }
2066     else
2067     {
2068         *pusValue = BP_NOT_DEFINED;
2069         nRet = BP_BOARD_ID_NOT_SET;
2070     }
2071
2072     return( nRet );
2073 } /* BpGetBootloaderStopLedGpio */
2074
2075 /**************************************************************************
2076  * Name       : BpGetVoipLedGpio
2077  *
2078  * Description: This function returns the GPIO pin assignment for the VOIP
2079  *              LED.
2080  *
2081  * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
2082  *                  GPIO pin is returned in.
2083  *
2084  * Returns    : BP_SUCCESS - Success, value is returned.
2085  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2086  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2087  *                  for the board.
2088  *
2089  * Note       : The VoIP structure would allow for having one LED per DSP
2090  *              however, the board initialization function assumes only one
2091  *              LED per functionality (ie one LED for VoIP).  Therefore in
2092  *              order to keep this tidy and simple we do not make usage of the
2093  *              one-LED-per-DSP function.  Instead, we assume that the LED for
2094  *              VoIP is unique and associated with DSP 0 (always present on
2095  *              any VoIP platform).  If changing this to a LED-per-DSP function
2096  *              then one need to update the board initialization driver in
2097  *              bcmdrivers\opensource\char\board\bcm963xx\impl1
2098  ***************************************************************************/
2099 int BpGetVoipLedGpio( unsigned short *pusValue )
2100 {
2101     int nRet;
2102
2103     if( g_pCurrentBp )
2104     {
2105         VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( 0 );
2106
2107         if( pDspInfo )
2108         {
2109            *pusValue = pDspInfo->usGpioLedVoip;
2110
2111            if( *pusValue != BP_NOT_DEFINED )
2112            {
2113               nRet = BP_SUCCESS;
2114            }
2115            else
2116            {
2117               nRet = BP_VALUE_NOT_DEFINED;
2118            }
2119         }
2120         else
2121         {
2122            *pusValue = BP_NOT_DEFINED;
2123            nRet = BP_BOARD_ID_NOT_FOUND;
2124         }
2125     }
2126     else
2127     {
2128         *pusValue = BP_NOT_DEFINED;
2129         nRet = BP_BOARD_ID_NOT_SET;
2130     }
2131
2132     return( nRet );
2133 } /* BpGetVoipLedGpio */
2134
2135 /**************************************************************************
2136  * Name       : BpGetWirelessExtIntr
2137  *
2138  * Description: This function returns the Wireless external interrupt number.
2139  *
2140  * Parameters : [OUT] pulValue - Address of short word that the wireless
2141  *                  external interrupt number is returned in.
2142  *
2143  * Returns    : BP_SUCCESS - Success, value is returned.
2144  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2145  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2146  *                  for the board.
2147  ***************************************************************************/
2148 int BpGetWirelessExtIntr( unsigned long *pulValue )
2149 {
2150     int nRet;
2151
2152     if( g_pCurrentBp )
2153     {
2154         *pulValue = g_pCurrentBp->usExtIntrWireless;
2155
2156         if( g_pCurrentBp->usExtIntrWireless != BP_NOT_DEFINED )
2157         {
2158             nRet = BP_SUCCESS;
2159         }
2160         else
2161         {
2162             nRet = BP_VALUE_NOT_DEFINED;
2163         }
2164     }
2165     else
2166     {
2167         *pulValue = BP_NOT_DEFINED;
2168         nRet = BP_BOARD_ID_NOT_SET;
2169     }
2170
2171     return( nRet );
2172 } /* BpGetWirelessExtIntr */
2173
2174 /**************************************************************************
2175  * Name       : BpGetAdslDyingGaspExtIntr
2176  *
2177  * Description: This function returns the ADSL Dying Gasp external interrupt
2178  *              number.
2179  *
2180  * Parameters : [OUT] pulValue - Address of short word that the ADSL Dying Gasp
2181  *                  external interrupt number is returned in.
2182  *
2183  * Returns    : BP_SUCCESS - Success, value is returned.
2184  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2185  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2186  *                  for the board.
2187  ***************************************************************************/
2188 int BpGetAdslDyingGaspExtIntr( unsigned long *pulValue )
2189 {
2190     int nRet;
2191
2192     if( g_pCurrentBp )
2193     {
2194         *pulValue = g_pCurrentBp->usExtIntrAdslDyingGasp;
2195
2196         if( g_pCurrentBp->usExtIntrAdslDyingGasp != BP_NOT_DEFINED )
2197         {
2198             nRet = BP_SUCCESS;
2199         }
2200         else
2201         {
2202             nRet = BP_VALUE_NOT_DEFINED;
2203         }
2204     }
2205     else
2206     {
2207         *pulValue = BP_NOT_DEFINED;
2208         nRet = BP_BOARD_ID_NOT_SET;
2209     }
2210
2211     return( nRet );
2212 } /* BpGetAdslDyingGaspExtIntr */
2213
2214 /**************************************************************************
2215  * Name       : BpGetVoipExtIntr
2216  *
2217  * Description: This function returns the VOIP external interrupt number.
2218  *
2219  * Parameters : [OUT] pulValue - Address of short word that the VOIP
2220  *                  external interrupt number is returned in.
2221  *              [IN] dspNum - Address of the DSP to query.
2222  *
2223  * Returns    : BP_SUCCESS - Success, value is returned.
2224  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2225  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2226  *                  for the board.
2227  ***************************************************************************/
2228 int BpGetVoipExtIntr( unsigned char dspNum, unsigned long *pulValue )
2229 {
2230     int nRet;
2231
2232     if( g_pCurrentBp )
2233     {
2234         VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2235
2236         if( pDspInfo )
2237         {
2238            *pulValue = pDspInfo->usExtIntrVoip;
2239
2240            if( *pulValue != BP_NOT_DEFINED )
2241            {
2242               nRet = BP_SUCCESS;
2243            }
2244            else
2245            {
2246               nRet = BP_VALUE_NOT_DEFINED;
2247            }
2248         }
2249         else
2250         {
2251            *pulValue = BP_NOT_DEFINED;
2252            nRet = BP_BOARD_ID_NOT_FOUND;
2253         }
2254     }
2255     else
2256     {
2257         *pulValue = BP_NOT_DEFINED;
2258         nRet = BP_BOARD_ID_NOT_SET;
2259     }
2260
2261     return( nRet );
2262 } /* BpGetVoipExtIntr */
2263
2264 /**************************************************************************
2265  * Name       : BpGetHpnaExtIntr
2266  *
2267  * Description: This function returns the HPNA external interrupt number.
2268  *
2269  * Parameters : [OUT] pulValue - Address of short word that the HPNA
2270  *                  external interrupt number is returned in.
2271  *
2272  * Returns    : BP_SUCCESS - Success, value is returned.
2273  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2274  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2275  *                  for the board.
2276  ***************************************************************************/
2277 int BpGetHpnaExtIntr( unsigned long *pulValue )
2278 {
2279     int nRet;
2280
2281     if( g_pCurrentBp )
2282     {
2283         *pulValue = g_pCurrentBp->usExtIntrHpna;
2284
2285         if( g_pCurrentBp->usExtIntrHpna != BP_NOT_DEFINED )
2286         {
2287             nRet = BP_SUCCESS;
2288         }
2289         else
2290         {
2291             nRet = BP_VALUE_NOT_DEFINED;
2292         }
2293     }
2294     else
2295     {
2296         *pulValue = BP_NOT_DEFINED;
2297         nRet = BP_BOARD_ID_NOT_SET;
2298     }
2299
2300     return( nRet );
2301 } /* BpGetHpnaExtIntr */
2302
2303 /**************************************************************************
2304  * Name       : BpGetHpnaChipSelect
2305  *
2306  * Description: This function returns the HPNA chip select number.
2307  *
2308  * Parameters : [OUT] pulValue - Address of short word that the HPNA
2309  *                  chip select number is returned in.
2310  *
2311  * Returns    : BP_SUCCESS - Success, value is returned.
2312  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2313  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2314  *                  for the board.
2315  ***************************************************************************/
2316 int BpGetHpnaChipSelect( unsigned long *pulValue )
2317 {
2318     int nRet;
2319
2320     if( g_pCurrentBp )
2321     {
2322         *pulValue = g_pCurrentBp->usCsHpna;
2323
2324         if( g_pCurrentBp->usCsHpna != BP_NOT_DEFINED )
2325         {
2326             nRet = BP_SUCCESS;
2327         }
2328         else
2329         {
2330             nRet = BP_VALUE_NOT_DEFINED;
2331         }
2332     }
2333     else
2334     {
2335         *pulValue = BP_NOT_DEFINED;
2336         nRet = BP_BOARD_ID_NOT_SET;
2337     }
2338
2339     return( nRet );
2340 } /* BpGetHpnaChipSelect */
2341
2342 /**************************************************************************
2343  * Name       : BpGetVoipChipSelect
2344  *
2345  * Description: This function returns the VOIP chip select number.
2346  *
2347  * Parameters : [OUT] pulValue - Address of short word that the VOIP
2348  *                  chip select number is returned in.
2349  *              [IN] dspNum - Address of the DSP to query.
2350  *
2351  * Returns    : BP_SUCCESS - Success, value is returned.
2352  *              BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2353  *              BP_VALUE_NOT_DEFINED - At least one return value is not defined
2354  *                  for the board.
2355  ***************************************************************************/
2356 int BpGetVoipChipSelect( unsigned char dspNum, unsigned long *pulValue )
2357 {
2358     int nRet;
2359
2360     if( g_pCurrentBp )
2361     {
2362         VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2363
2364         if( pDspInfo )
2365         {
2366            *pulValue = pDspInfo->usCsVoip;
2367
2368            if( *pulValue != BP_NOT_DEFINED )
2369            {
2370               nRet = BP_SUCCESS;
2371            }
2372            else
2373            {
2374               nRet = BP_VALUE_NOT_DEFINED;
2375            }
2376         }
2377         else
2378         {
2379            *pulValue = BP_NOT_DEFINED;
2380            nRet = BP_BOARD_ID_NOT_FOUND;
2381         }
2382     }
2383     else
2384     {
2385         *pulValue = BP_NOT_DEFINED;
2386         nRet = BP_BOARD_ID_NOT_SET;
2387     }
2388
2389     return( nRet );
2390 } /* BpGetVoipChipSelect */
2391