c079c5a4bf86b26a012cded057a5a97b633961fa
[openwrt/staging/mkresin.git] / target / linux / brcm63xx-2.6 / patches / 001-bcm963xx.patch
1 diff -urN linux.old/arch/mips/bcm963xx/bcm63xx_led.c linux.dev/arch/mips/bcm963xx/bcm63xx_led.c
2 --- linux.old/arch/mips/bcm963xx/bcm63xx_led.c 1970-01-01 01:00:00.000000000 +0100
3 +++ linux.dev/arch/mips/bcm963xx/bcm63xx_led.c 2006-08-25 00:39:38.000000000 +0200
4 @@ -0,0 +1,582 @@
5 +/*
6 +<:copyright-gpl
7 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8 +
9 + This program is free software; you can distribute it and/or modify it
10 + under the terms of the GNU General Public License (Version 2) as
11 + published by the Free Software Foundation.
12 +
13 + This program is distributed in the hope it will be useful, but WITHOUT
14 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 + for more details.
17 +
18 + You should have received a copy of the GNU General Public License along
19 + with this program; if not, write to the Free Software Foundation, Inc.,
20 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 +:>
22 +*/
23 +/***************************************************************************
24 + * File Name : bcm63xx_led.c
25 + *
26 + * Description:
27 + *
28 + * This file contains bcm963xx board led control API functions.
29 + *
30 + * To use it, do the following
31 + *
32 + * 1). define in the board.c the following led mappping (this is for 6345GW board):
33 + * const LED_MAP_PAIR cLedMapping45GW[] =
34 + * { // led name Initial state physical pin (ledMask)
35 + * {kLedUsb, kLedStateOff, GPIO_LED_PIN_7},
36 + * {kLedAdsl, kLedStateOff, GPIO_LED_PIN_8},
37 + * {kLedPPP, kLedStateOff, GPIO_LED_PIN_9}, // PPP and WanData share PIN_9
38 + * {kLedWanData, kLedStateOff, GPIO_LED_PIN_9},
39 + * {kLedWireless, kLedStateOff, GPIO_LED_PIN_10},
40 + * {kLedEnd, kLedStateOff, 0 } // NOTE: kLedEnd has to be at the end.
41 + *
42 + * 2). };To initialize led API and initial state of the leds, call the following function with the mapping
43 + * pointer from the above struct
44 + *
45 + * boardLedInit((PLED_MAP_PAIR) &cLedMapping45R);
46 + *
47 + * 3). Sample call for kernel mode:
48 + *
49 + * kerSysLedCtrl(kLedAdsl, kLedStateBlinkOnce); // kLedxxx defines in board.h
50 + *
51 + * 4). Sample call for user mode
52 + *
53 + * sysLedCtrl(kLedAdsl, kLedStateBlinkOnce); // kLedxxx defines in board_api.h
54 + *
55 + *
56 + * Created on : 10/28/2002 seanl
57 + *
58 + ***************************************************************************/
59 +
60 +/* Includes. */
61 +#include <linux/init.h>
62 +#include <linux/fs.h>
63 +#include <linux/capability.h>
64 +#include <linux/slab.h>
65 +#include <linux/errno.h>
66 +#include <linux/module.h>
67 +#include <linux/netdevice.h>
68 +#include <asm/uaccess.h>
69 +
70 +#include <bcm_map_part.h>
71 +#include <board.h>
72 +
73 +#define k100ms (HZ / 10) // ~100 ms
74 +#define kFastBlinkCount 0 // ~100ms
75 +#define kSlowBlinkCount 5 // ~600ms
76 +
77 +#define MAX_VIRT_LEDS 12
78 +
79 +// uncomment // for debug led
80 +//#define DEBUG_LED
81 +
82 +// global variables:
83 +struct timer_list gLedTimer;
84 +int gTimerOn = FALSE;
85 +int gLedCount = 0;
86 +
87 +typedef struct ledinfo
88 +{
89 + unsigned short ledMask; // mask for led: ie. giop 10 = 0x0400
90 + unsigned short ledActiveLow; // GPIO bit reset to turn on LED
91 + unsigned short ledMaskFail; // mask for led: ie. giop 10 = 0x0400
92 + unsigned short ledActiveLowFail;// GPIO bit reset to turn on LED
93 + BOARD_LED_STATE ledState; // current led state
94 + BOARD_LED_STATE savedLedState; // used in blink once for restore to the orignal ledState
95 + int blinkCountDown; // if == 0, do blink (toggle). Is assgined value and dec by 1 at each timer.
96 +} LED_INFO, *PLED_INFO;
97 +
98 +static PLED_INFO gLed = NULL;
99 +static PLED_INFO gpVirtLeds[MAX_VIRT_LEDS];
100 +static HANDLE_LED_FUNC gLedHwFunc[MAX_VIRT_LEDS];
101 +static HANDLE_LED_FUNC gLedHwFailFunc[MAX_VIRT_LEDS];
102 +
103 +#if 0 /* BROKEN */
104 +#if defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
105 +static int gLedOffInBridgeMode = 1;
106 +#elif defined(CONFIG_BCM96345)
107 +static int gLedOffInBridgeMode = 0;
108 +#endif
109 +#endif
110 +
111 +void ledTimerExpire(void);
112 +int initLedInfo( PLED_MAP_PAIR pCurMap, PLED_INFO pCurLed );
113 +
114 +//**************************************************************************************
115 +// LED operations
116 +//**************************************************************************************
117 +
118 +// turn led on and set the ledState
119 +void ledOn(PLED_INFO pLed)
120 +{
121 + if( pLed->ledMask )
122 + {
123 + GPIO->GPIODir |= pLed->ledMask; // turn on the direction bit in case was turned off by some one
124 + if( pLed->ledActiveLow )
125 + GPIO->GPIOio &= ~pLed->ledMask; // turn on the led
126 + else
127 + GPIO->GPIOio |= pLed->ledMask; // turn on the led
128 + pLed->ledState = pLed->savedLedState = kLedStateOn;
129 + }
130 +}
131 +
132 +
133 +// turn led off and set the ledState
134 +void ledOff(PLED_INFO pLed)
135 +{
136 + if( pLed->ledMask )
137 + {
138 + GPIO->GPIODir |= pLed->ledMask; // turn on the direction bit in case was turned off by some one
139 + if( pLed->ledActiveLow )
140 + GPIO->GPIOio |= pLed->ledMask; // turn off the led
141 + else
142 + GPIO->GPIOio &= ~pLed->ledMask; // turn off the led
143 + pLed->ledState = pLed->savedLedState = kLedStateOff;
144 + }
145 +}
146 +
147 +// turn led on and set the ledState
148 +void ledOnFail(PLED_INFO pLed)
149 +{
150 + if( pLed->ledMaskFail )
151 + {
152 + GPIO->GPIODir |= pLed->ledMaskFail; // turn on the direction bit in case was turned off by some one
153 + if( pLed->ledActiveLowFail )
154 + GPIO->GPIOio &= ~pLed->ledMaskFail;// turn on the led
155 + else
156 + GPIO->GPIOio |= pLed->ledMaskFail; // turn on the led
157 + pLed->ledState = pLed->savedLedState = kLedStateFail;
158 + }
159 +}
160 +
161 +
162 +// turn led off and set the ledState
163 +void ledOffFail(PLED_INFO pLed)
164 +{
165 + if( pLed->ledMaskFail )
166 + {
167 + GPIO->GPIODir |= pLed->ledMaskFail; // turn on the direction bit in case was turned off by some one
168 + if( pLed->ledActiveLowFail )
169 + GPIO->GPIOio |= pLed->ledMaskFail; // turn off the led
170 + else
171 + GPIO->GPIOio &= ~pLed->ledMaskFail;// turn off the led
172 + pLed->ledState = pLed->savedLedState = kLedStateOff;
173 + }
174 +}
175 +
176 +
177 +// toggle the led and return the current ledState
178 +BOARD_LED_STATE ledToggle(PLED_INFO pLed)
179 +{
180 + GPIO->GPIODir |= pLed->ledMask; // turn on the direction bit in case was turned off by some one
181 + if (GPIO->GPIOio & pLed->ledMask)
182 + {
183 + GPIO->GPIOio &= ~(pLed->ledMask);
184 + return( (pLed->ledActiveLow) ? kLedStateOn : kLedStateOff );
185 + }
186 + else
187 + {
188 + GPIO->GPIOio |= pLed->ledMask;
189 + return( (pLed->ledActiveLow) ? kLedStateOff : kLedStateOn );
190 + }
191 +}
192 +
193 +
194 +// led timer. Will return if timer is already on
195 +void ledTimerStart(void)
196 +{
197 + if (gTimerOn)
198 + return;
199 +
200 +#if defined(DEBUG_LED)
201 + printk("led: add_timer\n");
202 +#endif
203 +
204 + init_timer(&gLedTimer);
205 + gLedTimer.function = (void*)ledTimerExpire;
206 + gLedTimer.expires = jiffies + k100ms; // timer expires in ~100ms
207 + add_timer (&gLedTimer);
208 + gTimerOn = TRUE;
209 +}
210 +
211 +
212 +// led timer expire kicks in about ~100ms and perform the led operation according to the ledState and
213 +// restart the timer according to ledState
214 +void ledTimerExpire(void)
215 +{
216 + int i;
217 + PLED_INFO pCurLed;
218 +
219 + gTimerOn = FALSE;
220 +
221 + for (i = 0, pCurLed = gLed; i < gLedCount; i++, pCurLed++)
222 + {
223 +#if defined(DEBUG_LED)
224 + printk("led[%d]: Mask=0x%04x, State = %d, blcd=%d\n", i, pCurLed->ledMask, pCurLed->ledState, pCurLed->blinkCountDown);
225 +#endif
226 + switch (pCurLed->ledState)
227 + {
228 + case kLedStateOn:
229 + case kLedStateOff:
230 + case kLedStateFail:
231 + pCurLed->blinkCountDown = 0; // reset the blink count down
232 + break;
233 +
234 + case kLedStateBlinkOnce:
235 + ledToggle(pCurLed);
236 + pCurLed->blinkCountDown = 0; // reset to 0
237 + pCurLed->ledState = pCurLed->savedLedState;
238 + if (pCurLed->ledState == kLedStateSlowBlinkContinues ||
239 + pCurLed->ledState == kLedStateFastBlinkContinues)
240 + ledTimerStart(); // start timer if in blinkContinues stats
241 + break;
242 +
243 + case kLedStateSlowBlinkContinues:
244 + if (pCurLed->blinkCountDown-- == 0)
245 + {
246 + pCurLed->blinkCountDown = kSlowBlinkCount;
247 + ledToggle(pCurLed);
248 + }
249 + ledTimerStart();
250 + break;
251 +
252 + case kLedStateFastBlinkContinues:
253 + if (pCurLed->blinkCountDown-- == 0)
254 + {
255 + pCurLed->blinkCountDown = kFastBlinkCount;
256 + ledToggle(pCurLed);
257 + }
258 + ledTimerStart();
259 + break;
260 +
261 + default:
262 + printk("Invalid state = %d\n", pCurLed->ledState);
263 + }
264 + }
265 +}
266 +
267 +// initialize the gLedCount and allocate and fill gLed struct
268 +void __init boardLedInit(PLED_MAP_PAIR cLedMapping)
269 +{
270 + PLED_MAP_PAIR p1, p2;
271 + PLED_INFO pCurLed;
272 + int needTimer = FALSE;
273 + int alreadyUsed = 0;
274 +
275 +#if defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
276 + /* Set blink rate for BCM6348/BCM6338 hardware LEDs. */
277 + GPIO->LEDCtrl &= ~LED_INTERVAL_SET_MASK;
278 + GPIO->LEDCtrl |= LED_INTERVAL_SET_80MS;
279 +#endif
280 +
281 + memset( gpVirtLeds, 0x00, sizeof(gpVirtLeds) );
282 + memset( gLedHwFunc, 0x00, sizeof(gLedHwFunc) );
283 + memset( gLedHwFailFunc, 0x00, sizeof(gLedHwFailFunc) );
284 +
285 + gLedCount = 0;
286 +
287 + // Check for multiple LED names and multiple LED GPIO pins that share the
288 + // same physical board LED.
289 + for( p1 = cLedMapping; p1->ledName != kLedEnd; p1++ )
290 + {
291 + alreadyUsed = 0;
292 + for( p2 = cLedMapping; p2 != p1; p2++ )
293 + {
294 + if( (p1->ledMask && p1->ledMask == p2->ledMask) ||
295 + (p1->ledMaskFail && p1->ledMaskFail == p2->ledMaskFail) )
296 + {
297 + alreadyUsed = 1;
298 + break;
299 + }
300 + }
301 +
302 + if( alreadyUsed == 0 )
303 + gLedCount++;
304 + }
305 +
306 + gLed = (PLED_INFO) kmalloc((gLedCount * sizeof(LED_INFO)), GFP_KERNEL);
307 + if( gLed == NULL )
308 + {
309 + printk( "LED memory allocation error.\n" );
310 + return;
311 + }
312 +
313 + memset( gLed, 0x00, gLedCount * sizeof(LED_INFO) );
314 +
315 + // initial the gLed with unique ledMask and initial state. If more than 1 ledNames share the physical led
316 + // (ledMask) the first defined led's ledInitState will be used.
317 + pCurLed = gLed;
318 + for( p1 = cLedMapping; p1->ledName != kLedEnd; p1++ )
319 + {
320 + if( (int) p1->ledName > MAX_VIRT_LEDS )
321 + continue;
322 +
323 + alreadyUsed = 0;
324 + for( p2 = cLedMapping; p2 != p1; p2++ )
325 + {
326 + if( (p1->ledMask && p1->ledMask == p2->ledMask) ||
327 + (p1->ledMaskFail && p1->ledMaskFail == p2->ledMaskFail) )
328 + {
329 + alreadyUsed = 1;
330 + break;
331 + }
332 + }
333 +
334 + if( alreadyUsed == 0 )
335 + {
336 + // Initialize the board LED for the first time.
337 + needTimer = initLedInfo( p1, pCurLed );
338 + gpVirtLeds[(int) p1->ledName] = pCurLed;
339 + pCurLed++;
340 + }
341 + else
342 + {
343 + PLED_INFO pLed;
344 + for( pLed = gLed; pLed != pCurLed; pLed++ )
345 + {
346 + // Find the LED_INFO structure that has already been initialized.
347 + if((pLed->ledMask && pLed->ledMask == p1->ledMask) ||
348 + (pLed->ledMaskFail && pLed->ledMaskFail==p1->ledMaskFail))
349 + {
350 + // The board LED has already been initialized but possibly
351 + // not completely initialized.
352 + if( p1->ledMask )
353 + {
354 + pLed->ledMask = p1->ledMask;
355 + pLed->ledActiveLow = p1->ledActiveLow;
356 + }
357 + if( p1->ledMaskFail )
358 + {
359 + pLed->ledMaskFail = p1->ledMaskFail;
360 + pLed->ledActiveLowFail = p1->ledActiveLowFail;
361 + }
362 + gpVirtLeds[(int) p1->ledName] = pLed;
363 + break;
364 + }
365 + }
366 + }
367 + }
368 +
369 + if (needTimer)
370 + ledTimerStart();
371 +
372 +#if defined(DEBUG_LED)
373 + int i;
374 + for (i=0; i < gLedCount; i++)
375 + printk("initLed: led[%d]: mask=0x%04x, state=%d\n", i,(gLed+i)->ledMask, (gLed+i)->ledState);
376 +#endif
377 +
378 +}
379 +
380 +// Initialize a structure that contains information about a physical board LED
381 +// control. The board LED may contain more than one GPIO pin to control a
382 +// normal condition (green) or a failure condition (red).
383 +int initLedInfo( PLED_MAP_PAIR pCurMap, PLED_INFO pCurLed )
384 +{
385 + int needTimer = FALSE;
386 + pCurLed->ledState = pCurLed->savedLedState = pCurMap->ledInitState;
387 + pCurLed->ledMask = pCurMap->ledMask;
388 + pCurLed->ledActiveLow = pCurMap->ledActiveLow;
389 + pCurLed->ledMaskFail = pCurMap->ledMaskFail;
390 + pCurLed->ledActiveLowFail = pCurMap->ledActiveLowFail;
391 +
392 + switch (pCurLed->ledState)
393 + {
394 + case kLedStateOn:
395 + pCurLed->blinkCountDown = 0; // reset the blink count down
396 + ledOn(pCurLed);
397 + break;
398 + case kLedStateOff:
399 + pCurLed->blinkCountDown = 0; // reset the blink count down
400 + ledOff(pCurLed);
401 + break;
402 + case kLedStateFail:
403 + pCurLed->blinkCountDown = 0; // reset the blink count down
404 + ledOnFail(pCurLed);
405 + break;
406 + case kLedStateBlinkOnce:
407 + pCurLed->blinkCountDown = 1;
408 + needTimer = TRUE;
409 + break;
410 + case kLedStateSlowBlinkContinues:
411 + pCurLed->blinkCountDown = kSlowBlinkCount;
412 + needTimer = TRUE;
413 + break;
414 + case kLedStateFastBlinkContinues:
415 + pCurLed->blinkCountDown = kFastBlinkCount;
416 + needTimer = TRUE;
417 + break;
418 + default:
419 + printk("Invalid state = %d\n", pCurLed->ledState);
420 + }
421 +
422 + return( needTimer );
423 +}
424 +
425 +#if 0 /* BROKEN */
426 +// Determines if there is at least one interface in bridge mode. Bridge mode
427 +// is determined by the cfm convention of naming bridge interfaces nas17
428 +// through nas24.
429 +static int isBridgedProtocol(void)
430 +{
431 + extern int dev_get(const char *name);
432 + const int firstBridgeId = 17;
433 + const int lastBridgeId = 24;
434 + int i;
435 + int ret = FALSE;
436 + char name[16];
437 +
438 + for( i = firstBridgeId; i <= lastBridgeId; i++ )
439 + {
440 + sprintf( name, "nas%d", i );
441 +
442 + if( dev_get(name) )
443 + {
444 + ret = TRUE;
445 + break;
446 + }
447 + }
448 +
449 + return(ret);
450 +}
451 +#endif
452 +
453 +// led ctrl. Maps the ledName to the corresponding ledInfoPtr and perform the led operation
454 +void boardLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
455 +{
456 + PLED_INFO ledInfoPtr;
457 +
458 + // do the mapping from virtual to physical led
459 + if( (int) ledName < MAX_VIRT_LEDS )
460 + ledInfoPtr = gpVirtLeds[(int) ledName];
461 + else
462 + ledInfoPtr = NULL;
463 +
464 + if (ledInfoPtr == NULL)
465 + return;
466 +
467 + if( ledState != kLedStateFail && gLedHwFunc[(int) ledName] )
468 + {
469 + (*gLedHwFunc[(int) ledName]) (ledName, ledState);
470 + ledOffFail(ledInfoPtr);
471 + return;
472 + }
473 + else
474 + if( ledState == kLedStateFail && gLedHwFailFunc[(int) ledName] )
475 + {
476 + (*gLedHwFailFunc[(int) ledName]) (ledName, ledState);
477 + ledOff(ledInfoPtr);
478 + return;
479 + }
480 +
481 +#if 0 /* BROKEN */
482 + // Do not blink the WAN Data LED if at least one interface is in bridge mode.
483 + if(gLedOffInBridgeMode == 1 && (ledName == kLedWanData || ledName == kLedPPP))
484 + {
485 + static int BridgedProtocol = -1;
486 +
487 + if( BridgedProtocol == -1 )
488 + BridgedProtocol = isBridgedProtocol();
489 +
490 + if( BridgedProtocol == TRUE )
491 + return;
492 + }
493 +#endif
494 +
495 + // If the state is kLedStateFail and there is not a failure LED defined
496 + // in the board parameters, change the state to kLedStateFastBlinkContinues.
497 + if( ledState == kLedStateFail && ledInfoPtr->ledMaskFail == 0 )
498 + ledState = kLedStateFastBlinkContinues;
499 +
500 + switch (ledState)
501 + {
502 + case kLedStateOn:
503 + // First, turn off the complimentary (failure) LED GPIO.
504 + if( ledInfoPtr->ledMaskFail )
505 + ledOffFail(ledInfoPtr);
506 + else
507 + if( gLedHwFailFunc[(int) ledName] )
508 + (*gLedHwFailFunc[(int) ledName]) (ledName, kLedStateOff);
509 +
510 + // Next, turn on the specified LED GPIO.
511 + ledOn(ledInfoPtr);
512 + break;
513 +
514 + case kLedStateOff:
515 + // First, turn off the complimentary (failure) LED GPIO.
516 + if( ledInfoPtr->ledMaskFail )
517 + ledOffFail(ledInfoPtr);
518 + else
519 + if( gLedHwFailFunc[(int) ledName] )
520 + (*gLedHwFailFunc[(int) ledName]) (ledName, kLedStateOff);
521 +
522 + // Next, turn off the specified LED GPIO.
523 + ledOff(ledInfoPtr);
524 + break;
525 +
526 + case kLedStateFail:
527 + // First, turn off the complimentary (normal) LED GPIO.
528 + if( ledInfoPtr->ledMask )
529 + ledOff(ledInfoPtr);
530 + else
531 + if( gLedHwFunc[(int) ledName] )
532 + (*gLedHwFunc[(int) ledName]) (ledName, kLedStateOff);
533 +
534 + // Next, turn on (red) the specified LED GPIO.
535 + ledOnFail(ledInfoPtr);
536 + break;
537 +
538 + case kLedStateBlinkOnce:
539 + // skip blinkOnce if it is already in Slow/Fast blink continues state
540 + if (ledInfoPtr->savedLedState == kLedStateSlowBlinkContinues ||
541 + ledInfoPtr->savedLedState == kLedStateFastBlinkContinues)
542 + ;
543 + else
544 + {
545 + if (ledInfoPtr->blinkCountDown == 0) // skip the call if it is 1
546 + {
547 + ledToggle(ledInfoPtr);
548 + ledInfoPtr->blinkCountDown = 1; // it will be reset to 0 when timer expires
549 + ledInfoPtr->ledState = kLedStateBlinkOnce;
550 + ledTimerStart();
551 + }
552 + }
553 + break;
554 +
555 + case kLedStateSlowBlinkContinues:
556 + ledInfoPtr->blinkCountDown = kSlowBlinkCount;
557 + ledInfoPtr->ledState = kLedStateSlowBlinkContinues;
558 + ledInfoPtr->savedLedState = kLedStateSlowBlinkContinues;
559 + ledTimerStart();
560 + break;
561 +
562 + case kLedStateFastBlinkContinues:
563 + ledInfoPtr->blinkCountDown = kFastBlinkCount;
564 + ledInfoPtr->ledState = kLedStateFastBlinkContinues;
565 + ledInfoPtr->savedLedState = kLedStateFastBlinkContinues;
566 + ledTimerStart();
567 + break;
568 +
569 + default:
570 + printk("Invalid led state\n");
571 + }
572 +}
573 +
574 +// This function is called for an LED that is controlled by hardware.
575 +void kerSysLedRegisterHwHandler( BOARD_LED_NAME ledName,
576 + HANDLE_LED_FUNC ledHwFunc, int ledFailType )
577 +{
578 + if( (int) ledName < MAX_VIRT_LEDS )
579 + {
580 + if( ledFailType == 1 )
581 + gLedHwFailFunc[(int) ledName] = ledHwFunc;
582 + else
583 + gLedHwFunc[(int) ledName] = ledHwFunc;
584 + }
585 +}
586 +
587 diff -urN linux.old/arch/mips/bcm963xx/board.c linux.dev/arch/mips/bcm963xx/board.c
588 --- linux.old/arch/mips/bcm963xx/board.c 1970-01-01 01:00:00.000000000 +0100
589 +++ linux.dev/arch/mips/bcm963xx/board.c 2006-08-27 21:02:04.000000000 +0200
590 @@ -0,0 +1,559 @@
591 +/*
592 +<:copyright-gpl
593 + Copyright 2002 Broadcom Corp. All Rights Reserved.
594 +
595 + This program is free software; you can distribute it and/or modify it
596 + under the terms of the GNU General Public License (Version 2) as
597 + published by the Free Software Foundation.
598 +
599 + This program is distributed in the hope it will be useful, but WITHOUT
600 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
601 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
602 + for more details.
603 +
604 + You should have received a copy of the GNU General Public License along
605 + with this program; if not, write to the Free Software Foundation, Inc.,
606 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
607 +:>
608 +*/
609 +
610 +/* Includes. */
611 +#include <linux/version.h>
612 +#include <linux/init.h>
613 +#include <linux/fs.h>
614 +#include <linux/interrupt.h>
615 +#include <linux/capability.h>
616 +#include <linux/slab.h>
617 +#include <linux/errno.h>
618 +#include <linux/module.h>
619 +#include <linux/pagemap.h>
620 +#include <asm/uaccess.h>
621 +#include <linux/wait.h>
622 +#include <linux/poll.h>
623 +#include <linux/sched.h>
624 +#include <linux/list.h>
625 +#include <linux/if.h>
626 +#include <linux/spinlock.h>
627 +
628 +#include <bcm_map_part.h>
629 +#include <board.h>
630 +#include <bcmTag.h>
631 +#include "boardparms.h"
632 +#include "bcm_intr.h"
633 +#include "board.h"
634 +#include "bcm_map_part.h"
635 +
636 +static DEFINE_SPINLOCK(board_lock);
637 +
638 +/* Typedefs. */
639 +#if defined (NON_CONSECUTIVE_MAC)
640 +// used to be the last octet. Now changed to the first 5 bits of the the forth octet
641 +// to reduced the duplicated MAC addresses.
642 +#define CHANGED_OCTET 3
643 +#define SHIFT_BITS 3
644 +#else
645 +#define CHANGED_OCTET 1
646 +#define SHIFT_BITS 0
647 +#endif
648 +
649 +typedef struct
650 +{
651 + unsigned long ulId;
652 + char chInUse;
653 + char chReserved[3];
654 +} MAC_ADDR_INFO, *PMAC_ADDR_INFO;
655 +
656 +typedef struct
657 +{
658 + unsigned long ulSdramSize;
659 + unsigned long ulPsiSize;
660 + unsigned long ulNumMacAddrs;
661 + unsigned long ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
662 + MAC_ADDR_INFO MacAddrs[1];
663 +} NVRAM_INFO, *PNVRAM_INFO;
664 +
665 +typedef struct
666 +{
667 + unsigned long eventmask;
668 +} BOARD_IOC, *PBOARD_IOC;
669 +
670 +
671 +/*Dyinggasp callback*/
672 +typedef void (*cb_dgasp_t)(void *arg);
673 +typedef struct _CB_DGASP__LIST
674 +{
675 + struct list_head list;
676 + char name[IFNAMSIZ];
677 + cb_dgasp_t cb_dgasp_fn;
678 + void *context;
679 +}CB_DGASP_LIST , *PCB_DGASP_LIST;
680 +
681 +
682 +static LED_MAP_PAIR LedMapping[] =
683 +{ // led name Initial state physical pin (ledMask)
684 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
685 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
686 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
687 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
688 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
689 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
690 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
691 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
692 + {kLedEnd, kLedStateOff, 0, 0, 0, 0} // NOTE: kLedEnd has to be at the end.
693 +};
694 +
695 +/* Externs. */
696 +extern struct file fastcall *fget_light(unsigned int fd, int *fput_needed);
697 +extern unsigned int nr_free_pages (void);
698 +extern const char *get_system_type(void);
699 +extern void kerSysFlashInit(void);
700 +extern unsigned long get_nvram_start_addr(void);
701 +extern unsigned long get_scratch_pad_start_addr(void);
702 +extern unsigned long getMemorySize(void);
703 +extern void __init boardLedInit(PLED_MAP_PAIR);
704 +extern void boardLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
705 +extern void kerSysLedRegisterHandler( BOARD_LED_NAME ledName,
706 + HANDLE_LED_FUNC ledHwFunc, int ledFailType );
707 +
708 +/* Prototypes. */
709 +void __init InitNvramInfo( void );
710 +
711 +/* DyingGasp function prototype */
712 +static void __init kerSysDyingGaspMapIntr(void);
713 +static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs);
714 +static void __init kerSysInitDyingGaspHandler( void );
715 +static void __exit kerSysDeinitDyingGaspHandler( void );
716 +/* -DyingGasp function prototype - */
717 +
718 +static PNVRAM_INFO g_pNvramInfo = NULL;
719 +static int g_ledInitialized = 0;
720 +static CB_DGASP_LIST *g_cb_dgasp_list_head = NULL;
721 +
722 +static int g_wakeup_monitor = 0;
723 +static struct file *g_monitor_file = NULL;
724 +static struct task_struct *g_monitor_task = NULL;
725 +static unsigned int (*g_orig_fop_poll)
726 + (struct file *, struct poll_table_struct *) = NULL;
727 +
728 +void kerSysMipsSoftReset(void)
729 +{
730 + if (PERF->RevID == 0x634800A1) {
731 + typedef void (*FNPTR) (void);
732 + FNPTR bootaddr = (FNPTR) FLASH_BASE;
733 + int i;
734 +
735 + /* Disable interrupts. */
736 + //cli();
737 + spin_lock_irq(&board_lock);
738 +
739 + /* Reset all blocks. */
740 + PERF->BlockSoftReset &= ~BSR_ALL_BLOCKS;
741 + for( i = 0; i < 1000000; i++ )
742 + ;
743 + PERF->BlockSoftReset |= BSR_ALL_BLOCKS;
744 + /* Jump to the power on address. */
745 + (*bootaddr) ();
746 + }
747 + else
748 + PERF->pll_control |= SOFT_RESET; // soft reset mips
749 +}
750 +
751 +
752 +int kerSysGetMacAddress( unsigned char *pucaMacAddr, unsigned long ulId )
753 +{
754 + int nRet = 0;
755 + PMAC_ADDR_INFO pMai = NULL;
756 + PMAC_ADDR_INFO pMaiFreeNoId = NULL;
757 + PMAC_ADDR_INFO pMaiFreeId = NULL;
758 + unsigned long i = 0, ulIdxNoId = 0, ulIdxId = 0, shiftedIdx = 0;
759 +
760 + /* CMO -- Fix le problème avec les adresses mac que l'on n'arrive pas
761 + * * à relire plusieurs fois */
762 + /* inv_xde */
763 +#if 0
764 + if (boot_loader_type == BOOT_CFE)
765 + memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,
766 + NVRAM_MAC_ADDRESS_LEN );
767 + else {
768 +#endif
769 + pucaMacAddr[0] = 0x00;
770 + pucaMacAddr[1] = 0x07;
771 + pucaMacAddr[2] = 0x3A;
772 + pucaMacAddr[3] = 0xFF;
773 + pucaMacAddr[4] = 0xFF;
774 + pucaMacAddr[5] = 0xFF;
775 +#if 0
776 + }
777 +#endif
778 +
779 + return nRet;
780 +} /* kerSysGetMacAddr */
781 +
782 +int kerSysReleaseMacAddress( unsigned char *pucaMacAddr )
783 +{
784 + int nRet = -EINVAL;
785 + unsigned long ulIdx = 0;
786 + int idx = (pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] -
787 + g_pNvramInfo->ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET]);
788 +
789 + // if overflow 255 (negitive), add 256 to have the correct index
790 + if (idx < 0)
791 + idx += 256;
792 + ulIdx = (unsigned long) (idx >> SHIFT_BITS);
793 +
794 + if( ulIdx < g_pNvramInfo->ulNumMacAddrs )
795 + {
796 + PMAC_ADDR_INFO pMai = &g_pNvramInfo->MacAddrs[ulIdx];
797 + if( pMai->chInUse == 1 )
798 + {
799 + pMai->chInUse = 0;
800 + nRet = 0;
801 + }
802 + }
803 +
804 + return( nRet );
805 +} /* kerSysReleaseMacAddr */
806 +
807 +int kerSysGetSdramSize( void )
808 +{
809 + if (boot_loader_type == BOOT_CFE) {
810 + return( (int) g_pNvramInfo->ulSdramSize );
811 + }
812 + else {
813 + printk("kerSysGetSdramSize : 0x%08X\n", (int)getMemorySize() + 0x00040000);
814 + return((int)getMemorySize() + 0x00040000);
815 + }
816 +} /* kerSysGetSdramSize */
817 +
818 +
819 +void kerSysLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
820 +{
821 + if (g_ledInitialized)
822 + boardLedCtrl(ledName, ledState);
823 +}
824 +
825 +unsigned int kerSysMonitorPollHook( struct file *f, struct poll_table_struct *t)
826 +{
827 + int mask = (*g_orig_fop_poll) (f, t);
828 +
829 + if( g_wakeup_monitor == 1 && g_monitor_file == f )
830 + {
831 + /* If g_wakeup_monitor is non-0, the user mode application needs to
832 + * return from a blocking select function. Return POLLPRI which will
833 + * cause the select to return with the exception descriptor set.
834 + */
835 + mask |= POLLPRI;
836 + g_wakeup_monitor = 0;
837 + }
838 +
839 + return( mask );
840 +}
841 +
842 +/* Put the user mode application that monitors link state on a run queue. */
843 +void kerSysWakeupMonitorTask( void )
844 +{
845 + g_wakeup_monitor = 1;
846 + if( g_monitor_task )
847 + wake_up_process( g_monitor_task );
848 +}
849 +
850 +//<<JUNHON, 2004/09/15, get reset button status , tim hou , 05/04/12
851 +int kerSysGetResetHold(void)
852 +{
853 + unsigned short gpio;
854 +
855 + if( BpGetPressAndHoldResetGpio( &gpio ) == BP_SUCCESS )
856 + {
857 + unsigned long gpio_mask = GPIO_NUM_TO_MASK(gpio);
858 + volatile unsigned long *gpio_reg = &GPIO->GPIOio;
859 +
860 + if( (gpio & ~BP_ACTIVE_MASK) >= 32 )
861 + {
862 + gpio_mask = GPIO_NUM_TO_MASK_HIGH(gpio);
863 + gpio_reg = &GPIO->GPIOio_high;
864 + }
865 + //printk("gpio=%04x,gpio_mask=%04x,gpio_reg=%04x\n",gpio,gpio_mask,*gpio_reg);
866 + if(*gpio_reg & gpio_mask) //press down
867 + return RESET_BUTTON_UP;
868 + }
869 + return RESET_BUTTON_PRESSDOWN;
870 +}
871 +//<<JUNHON, 2004/09/15
872 +
873 +/***************************************************************************
874 + * Dying gasp ISR and functions.
875 + ***************************************************************************/
876 +#define KERSYS_DBG printk
877 +
878 +#if defined(CONFIG_BCM96345)
879 +#define CYCLE_PER_US 70
880 +#elif defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
881 +/* The BCM6348 cycles per microsecond is really variable since the BCM6348
882 + * MIPS speed can vary depending on the PLL settings. However, an appoximate
883 + * value of 120 will still work OK for the test being done.
884 + */
885 +#define CYCLE_PER_US 120
886 +#endif
887 +#define DG_GLITCH_TO (100*CYCLE_PER_US)
888 +
889 +static void __init kerSysDyingGaspMapIntr()
890 +{
891 + unsigned long ulIntr;
892 +
893 +#if defined(CONFIG_BCM96348) || defined(_BCM96348_) || defined(CONFIG_BCM96338) || defined(_BCM96338_)
894 + if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
895 + BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, INTERRUPT_ID_DG);
896 + BcmHalInterruptEnable( INTERRUPT_ID_DG );
897 + }
898 +#elif defined(CONFIG_BCM96345) || defined(_BCM96345_)
899 + if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
900 + ulIntr += INTERRUPT_ID_EXTERNAL_0;
901 + BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, ulIntr);
902 + BcmHalInterruptEnable( ulIntr );
903 + }
904 +#endif
905 +
906 +}
907 +
908 +void kerSysSetWdTimer(ulong timeUs)
909 +{
910 + TIMER->WatchDogDefCount = timeUs * (FPERIPH/1000000);
911 + TIMER->WatchDogCtl = 0xFF00;
912 + TIMER->WatchDogCtl = 0x00FF;
913 +}
914 +
915 +ulong kerSysGetCycleCount(void)
916 +{
917 + ulong cnt;
918 +#ifdef _WIN32_WCE
919 + cnt = 0;
920 +#else
921 + __asm volatile("mfc0 %0, $9":"=d"(cnt));
922 +#endif
923 + return(cnt);
924 +}
925 +
926 +static Bool kerSysDyingGaspCheckPowerLoss(void)
927 +{
928 + ulong clk0;
929 + ulong ulIntr;
930 +
931 + ulIntr = 0;
932 + clk0 = kerSysGetCycleCount();
933 +
934 + UART->Data = 'D';
935 + UART->Data = '%';
936 + UART->Data = 'G';
937 +
938 +#if defined(CONFIG_BCM96345)
939 + BpGetAdslDyingGaspExtIntr( &ulIntr );
940 +
941 + do {
942 + ulong clk1;
943 +
944 + clk1 = kerSysGetCycleCount(); /* time cleared */
945 + /* wait a little to get new reading */
946 + while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
947 + ;
948 + } while ((0 == (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT)))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
949 +
950 + if (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT))) { /* power glitch */
951 + BcmHalInterruptEnable( ulIntr + INTERRUPT_ID_EXTERNAL_0);
952 + KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
953 + return 0;
954 + }
955 +#elif (defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)) && !defined(VXWORKS)
956 + do {
957 + ulong clk1;
958 +
959 + clk1 = kerSysGetCycleCount(); /* time cleared */
960 + /* wait a little to get new reading */
961 + while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
962 + ;
963 + } while ((PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
964 +
965 + if (!(PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET)))) {
966 + BcmHalInterruptEnable( INTERRUPT_ID_DG );
967 + KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
968 + return 0;
969 + }
970 +#endif
971 + return 1;
972 +}
973 +
974 +static void kerSysDyingGaspShutdown( void )
975 +{
976 + kerSysSetWdTimer(1000000);
977 +#if defined(CONFIG_BCM96345)
978 + PERF->blkEnables &= ~(EMAC_CLK_EN | USB_CLK_EN | CPU_CLK_EN);
979 +#elif defined(CONFIG_BCM96348)
980 + PERF->blkEnables &= ~(EMAC_CLK_EN | USBS_CLK_EN | USBH_CLK_EN | SAR_CLK_EN);
981 +#endif
982 +}
983 +
984 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
985 +static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs)
986 +#else
987 +static unsigned int kerSysDyingGaspIsr(void)
988 +#endif
989 +{
990 + struct list_head *pos;
991 + CB_DGASP_LIST *tmp, *dsl = NULL;
992 +
993 + if (kerSysDyingGaspCheckPowerLoss()) {
994 +
995 + /* first to turn off everything other than dsl */
996 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
997 + tmp = list_entry(pos, CB_DGASP_LIST, list);
998 + if(strncmp(tmp->name, "dsl", 3)) {
999 + (tmp->cb_dgasp_fn)(tmp->context);
1000 + }else {
1001 + dsl = tmp;
1002 + }
1003 + }
1004 +
1005 + /* now send dgasp */
1006 + if(dsl)
1007 + (dsl->cb_dgasp_fn)(dsl->context);
1008 +
1009 + /* reset and shutdown system */
1010 + kerSysDyingGaspShutdown();
1011 + }
1012 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
1013 +return( IRQ_HANDLED );
1014 +#else
1015 + return( 1 );
1016 +#endif
1017 +}
1018 +
1019 +static void __init kerSysInitDyingGaspHandler( void )
1020 +{
1021 + CB_DGASP_LIST *new_node;
1022 +
1023 + if( g_cb_dgasp_list_head != NULL) {
1024 + printk("Error: kerSysInitDyingGaspHandler: list head is not null\n");
1025 + return;
1026 + }
1027 + new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
1028 + memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
1029 + INIT_LIST_HEAD(&new_node->list);
1030 + g_cb_dgasp_list_head = new_node;
1031 +
1032 +} /* kerSysInitDyingGaspHandler */
1033 +
1034 +static void __exit kerSysDeinitDyingGaspHandler( void )
1035 +{
1036 + struct list_head *pos;
1037 + CB_DGASP_LIST *tmp;
1038 +
1039 + if(g_cb_dgasp_list_head == NULL)
1040 + return;
1041 +
1042 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
1043 + tmp = list_entry(pos, CB_DGASP_LIST, list);
1044 + list_del(pos);
1045 + kfree(tmp);
1046 + }
1047 +
1048 + kfree(g_cb_dgasp_list_head);
1049 + g_cb_dgasp_list_head = NULL;
1050 +
1051 +} /* kerSysDeinitDyingGaspHandler */
1052 +
1053 +void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context)
1054 +{
1055 + CB_DGASP_LIST *new_node;
1056 +
1057 + if( g_cb_dgasp_list_head == NULL) {
1058 + printk("Error: kerSysRegisterDyingGaspHandler: list head is null\n");
1059 + return;
1060 + }
1061 +
1062 + if( devname == NULL || cbfn == NULL ) {
1063 + printk("Error: kerSysRegisterDyingGaspHandler: register info not enough (%s,%x,%x)\n", devname, (unsigned int)cbfn, (unsigned int)context);
1064 + return;
1065 + }
1066 +
1067 + new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
1068 + memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
1069 + INIT_LIST_HEAD(&new_node->list);
1070 + strncpy(new_node->name, devname, IFNAMSIZ);
1071 + new_node->cb_dgasp_fn = (cb_dgasp_t)cbfn;
1072 + new_node->context = context;
1073 + list_add(&new_node->list, &g_cb_dgasp_list_head->list);
1074 +
1075 + printk("dgasp: kerSysRegisterDyingGaspHandler: %s registered \n", devname);
1076 +
1077 +} /* kerSysRegisterDyingGaspHandler */
1078 +
1079 +void kerSysDeregisterDyingGaspHandler(char *devname)
1080 +{
1081 + struct list_head *pos;
1082 + CB_DGASP_LIST *tmp;
1083 +
1084 + if(g_cb_dgasp_list_head == NULL) {
1085 + printk("Error: kerSysDeregisterDyingGaspHandler: list head is null\n");
1086 + return;
1087 + }
1088 +
1089 + if(devname == NULL) {
1090 + printk("Error: kerSysDeregisterDyingGaspHandler: devname is null\n");
1091 + return;
1092 + }
1093 +
1094 + printk("kerSysDeregisterDyingGaspHandler: %s is deregistering\n", devname);
1095 +
1096 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
1097 + tmp = list_entry(pos, CB_DGASP_LIST, list);
1098 + if(!strcmp(tmp->name, devname)) {
1099 + list_del(pos);
1100 + kfree(tmp);
1101 + printk("kerSysDeregisterDyingGaspHandler: %s is deregistered\n", devname);
1102 + return;
1103 + }
1104 + }
1105 + printk("kerSysDeregisterDyingGaspHandler: %s not (de)registered\n", devname);
1106 +
1107 +} /* kerSysDeregisterDyingGaspHandler */
1108 +
1109 +//EXPORT_SYMBOL(kerSysNvRamGet);
1110 +EXPORT_SYMBOL(kerSysGetMacAddress);
1111 +EXPORT_SYMBOL(kerSysReleaseMacAddress);
1112 +EXPORT_SYMBOL(kerSysGetSdramSize);
1113 +EXPORT_SYMBOL(kerSysLedCtrl);
1114 +EXPORT_SYMBOL(kerSysGetResetHold);
1115 +EXPORT_SYMBOL(kerSysLedRegisterHwHandler);
1116 +EXPORT_SYMBOL(BpGetBoardIds);
1117 +EXPORT_SYMBOL(BpGetSdramSize);
1118 +EXPORT_SYMBOL(BpGetPsiSize);
1119 +EXPORT_SYMBOL(BpGetEthernetMacInfo);
1120 +EXPORT_SYMBOL(BpGetRj11InnerOuterPairGpios);
1121 +EXPORT_SYMBOL(BpGetPressAndHoldResetGpio);
1122 +EXPORT_SYMBOL(BpGetVoipResetGpio);
1123 +EXPORT_SYMBOL(BpGetVoipIntrGpio);
1124 +EXPORT_SYMBOL(BpGetPcmciaResetGpio);
1125 +EXPORT_SYMBOL(BpGetRtsCtsUartGpios);
1126 +EXPORT_SYMBOL(BpGetAdslLedGpio);
1127 +EXPORT_SYMBOL(BpGetAdslFailLedGpio);
1128 +EXPORT_SYMBOL(BpGetWirelessLedGpio);
1129 +EXPORT_SYMBOL(BpGetUsbLedGpio);
1130 +EXPORT_SYMBOL(BpGetHpnaLedGpio);
1131 +EXPORT_SYMBOL(BpGetWanDataLedGpio);
1132 +EXPORT_SYMBOL(BpGetPppLedGpio);
1133 +EXPORT_SYMBOL(BpGetPppFailLedGpio);
1134 +EXPORT_SYMBOL(BpGetVoipLedGpio);
1135 +EXPORT_SYMBOL(BpGetWirelessExtIntr);
1136 +EXPORT_SYMBOL(BpGetAdslDyingGaspExtIntr);
1137 +EXPORT_SYMBOL(BpGetVoipExtIntr);
1138 +EXPORT_SYMBOL(BpGetHpnaExtIntr);
1139 +EXPORT_SYMBOL(BpGetHpnaChipSelect);
1140 +EXPORT_SYMBOL(BpGetVoipChipSelect);
1141 +EXPORT_SYMBOL(BpGetWirelessSesBtnGpio);
1142 +EXPORT_SYMBOL(BpGetWirelessSesExtIntr);
1143 +EXPORT_SYMBOL(BpGetWirelessSesLedGpio);
1144 +EXPORT_SYMBOL(kerSysRegisterDyingGaspHandler);
1145 +EXPORT_SYMBOL(kerSysDeregisterDyingGaspHandler);
1146 +EXPORT_SYMBOL(kerSysGetCycleCount);
1147 +EXPORT_SYMBOL(kerSysSetWdTimer);
1148 +EXPORT_SYMBOL(kerSysWakeupMonitorTask);
1149 +
1150 diff -urN linux.old/arch/mips/bcm963xx/boardparms.c linux.dev/arch/mips/bcm963xx/boardparms.c
1151 --- linux.old/arch/mips/bcm963xx/boardparms.c 1970-01-01 01:00:00.000000000 +0100
1152 +++ linux.dev/arch/mips/bcm963xx/boardparms.c 2006-08-25 00:39:38.000000000 +0200
1153 @@ -0,0 +1,2391 @@
1154 +/*
1155 +<:copyright-gpl
1156 +
1157 + Copyright 2003 Broadcom Corp. All Rights Reserved.
1158 +
1159 + This program is free software; you can distribute it and/or modify it
1160 + under the terms of the GNU General Public License (Version 2) as
1161 + published by the Free Software Foundation.
1162 +
1163 + This program is distributed in the hope it will be useful, but WITHOUT
1164 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1165 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1166 + for more details.
1167 +
1168 + You should have received a copy of the GNU General Public License along
1169 + with this program; if not, write to the Free Software Foundation, Inc.,
1170 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1171 +
1172 +:>
1173 +*/
1174 +/**************************************************************************
1175 + * File Name : boardparms.c
1176 + *
1177 + * Description: This file contains the implementation for the BCM63xx board
1178 + * parameter access functions.
1179 + *
1180 + * Updates : 07/14/2003 Created.
1181 + ***************************************************************************/
1182 +
1183 +/* Includes. */
1184 +#include "boardparms.h"
1185 +
1186 +/* Defines. */
1187 +
1188 +/* Default psi size in K bytes */
1189 +#define BP_PSI_DEFAULT_SIZE 24
1190 +
1191 +/* Typedefs */
1192 +typedef struct boardparameters
1193 +{
1194 + char szBoardId[BP_BOARD_ID_LEN]; /* board id string */
1195 + ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS];
1196 + VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP];
1197 + unsigned short usSdramSize; /* SDRAM size and type */
1198 + unsigned short usPsiSize; /* persistent storage in K bytes */
1199 + unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */
1200 + unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */
1201 + unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */
1202 + unsigned short usGpioPcmciaReset; /* GPIO pin or not defined */
1203 + unsigned short usGpioUartRts; /* GPIO pin or not defined */
1204 + unsigned short usGpioUartCts; /* GPIO pin or not defined */
1205 + unsigned short usGpioLedAdsl; /* GPIO pin or not defined */
1206 + unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */
1207 + unsigned short usGpioLedWireless; /* GPIO pin or not defined */
1208 + unsigned short usGpioLedUsb; /* GPIO pin or not defined */
1209 + unsigned short usGpioLedHpna; /* GPIO pin or not defined */
1210 + unsigned short usGpioLedWanData; /* GPIO pin or not defined */
1211 + unsigned short usGpioLedPpp; /* GPIO pin or not defined */
1212 + unsigned short usGpioLedPppFail; /* GPIO pin or not defined */
1213 + unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */
1214 + unsigned short usGpioLedBlAlarm; /* GPIO pin or not defined */
1215 + unsigned short usGpioLedBlResetCfg; /* GPIO pin or not defined */
1216 + unsigned short usGpioLedBlStop; /* GPIO pin or not defined */
1217 + unsigned short usExtIntrWireless; /* ext intr or not defined */
1218 + unsigned short usExtIntrAdslDyingGasp; /* ext intr or not defined */
1219 + unsigned short usExtIntrHpna; /* ext intr or not defined */
1220 + unsigned short usCsHpna; /* chip select not defined */
1221 + unsigned short usAntInUseWireless; /* antenna in use or not defined */
1222 + unsigned short usGpioSesBtnWireless; /* GPIO pin or not defined */
1223 + unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */
1224 + unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */
1225 +} BOARD_PARAMETERS, *PBOARD_PARAMETERS;
1226 +
1227 +/* Variables */
1228 +#if defined(_BCM96338_) || defined(CONFIG_BCM96338)
1229 +static BOARD_PARAMETERS g_bcm96338sv =
1230 +{
1231 + "96338SV", /* szBoardId */
1232 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1233 + 0x01, /* ucPhyAddress */
1234 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1235 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1236 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1237 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1238 + BP_NOT_DEFINED, /* usGpioPhyReset */
1239 + 0x01, /* numSwitchPorts */
1240 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1241 + BP_NOT_DEFINED}, /* usReverseMii */
1242 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1243 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1244 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1245 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1246 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1247 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1248 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1249 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1250 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1251 + BP_NOT_DEFINED, /* usGpioUartRts */
1252 + BP_NOT_DEFINED, /* usGpioUartCts */
1253 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1254 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1255 + BP_NOT_DEFINED, /* usGpioLedWireless */
1256 + BP_NOT_DEFINED, /* usGpioLedUsb */
1257 + BP_NOT_DEFINED, /* usGpioLedHpna */
1258 + BP_NOT_DEFINED, /* usGpioLedWanData */
1259 + BP_NOT_DEFINED, /* usGpioLedPpp */
1260 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1261 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1262 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1263 + BP_NOT_DEFINED, /* usGpioLedBlResetCfg */
1264 + BP_NOT_DEFINED, /* usGpioLedBlStop */
1265 + BP_NOT_DEFINED, /* usExtIntrWireless */
1266 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1267 + BP_NOT_DEFINED, /* usExtIntrHpna */
1268 + BP_NOT_DEFINED, /* usCsHpna */
1269 + BP_NOT_DEFINED, /* usAntInUseWireless */
1270 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1271 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1272 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1273 +};
1274 +static BOARD_PARAMETERS g_bcm96338l2m8m =
1275 +{
1276 + "96338L-2M-8M", /* szBoardId */
1277 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1278 + 0x01, /* ucPhyAddress */
1279 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1280 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1281 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1282 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1283 + BP_NOT_DEFINED, /* usGpioPhyReset */
1284 + 0x01, /* numSwitchPorts */
1285 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1286 + BP_NOT_DEFINED}, /* usReverseMii */
1287 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1288 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1289 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1290 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1291 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1292 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1293 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1294 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1295 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1296 + BP_NOT_DEFINED, /* usGpioUartRts */
1297 + BP_NOT_DEFINED, /* usGpioUartCts */
1298 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1299 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1300 + BP_NOT_DEFINED, /* usGpioLedWireless */
1301 + BP_NOT_DEFINED, /* usGpioLedUsb */
1302 + BP_NOT_DEFINED, /* usGpioLedHpna */
1303 + BP_GPIO_3_AL, /* usGpioLedWanData */
1304 + BP_GPIO_3_AL, /* usGpioLedPpp */
1305 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1306 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1307 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1308 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1309 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1310 + BP_NOT_DEFINED, /* usExtIntrWireless */
1311 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1312 + BP_NOT_DEFINED, /* usExtIntrHpna */
1313 + BP_NOT_DEFINED, /* usCsHpna */
1314 + BP_NOT_DEFINED, /* usAntInUseWireless */
1315 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1316 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1317 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1318 +};
1319 +static PBOARD_PARAMETERS g_BoardParms[] =
1320 + {&g_bcm96338sv, &g_bcm96338l2m8m, 0};
1321 +#endif
1322 +
1323 +#if defined(_BCM96345_) || defined(CONFIG_BCM96345)
1324 +static BOARD_PARAMETERS g_bcm96345r =
1325 +{
1326 + "96345R", /* szBoardId */
1327 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1328 + 0x01, /* ucPhyAddress */
1329 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1330 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1331 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1332 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1333 + BP_NOT_DEFINED, /* usGpioPhyReset */
1334 + 0x01, /* numSwitchPorts */
1335 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1336 + BP_NOT_DEFINED}, /* usReverseMii */
1337 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1338 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1339 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1340 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1341 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1342 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1343 + BP_GPIO_12_AH, /* usGpioRj11OuterPair */
1344 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1345 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1346 + BP_NOT_DEFINED, /* usGpioUartRts */
1347 + BP_NOT_DEFINED, /* usGpioUartCts */
1348 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1349 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1350 + BP_NOT_DEFINED, /* usGpioLedWireless */
1351 + BP_NOT_DEFINED, /* usGpioLedUsb */
1352 + BP_NOT_DEFINED, /* usGpioLedHpna */
1353 + BP_GPIO_8_AH, /* usGpioLedWanData */
1354 + BP_GPIO_9_AH, /* usGpioLedPpp */
1355 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1356 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1357 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1358 + BP_GPIO_9_AH, /* usGpioLedBlResetCfg */
1359 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1360 + BP_NOT_DEFINED, /* usExtIntrWireless */
1361 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1362 + BP_NOT_DEFINED, /* usExtIntrHpna */
1363 + BP_NOT_DEFINED, /* usCsHpna */
1364 + BP_NOT_DEFINED, /* usAntInUseWireless */
1365 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1366 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1367 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1368 +};
1369 +
1370 +static BOARD_PARAMETERS g_bcm96345gw2 =
1371 +{
1372 + /* A hardware jumper determines whether GPIO 13 is used for Press and Hold
1373 + * Reset or RTS.
1374 + */
1375 + "96345GW2", /* szBoardId */
1376 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1377 + 0x00, /* ucPhyAddress */
1378 + BP_GPIO_0_AH, /* usGpioPhySpiSck */
1379 + BP_GPIO_4_AH, /* usGpioPhySpiSs */
1380 + BP_GPIO_12_AH, /* usGpioPhySpiMosi */
1381 + BP_GPIO_11_AH, /* usGpioPhySpiMiso */
1382 + BP_NOT_DEFINED, /* usGpioPhyReset */
1383 + 0x04, /* numSwitchPorts */
1384 + BP_ENET_CONFIG_GPIO, /* usConfigType */
1385 + BP_ENET_REVERSE_MII}, /* usReverseMii */
1386 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1387 + {{BP_VOIP_DSP, /* ucDspType */
1388 + 0x00, /* ucDspAddress */
1389 + BP_EXT_INTR_1, /* usExtIntrVoip */
1390 + BP_GPIO_6_AH, /* usGpioVoipReset */
1391 + BP_GPIO_15_AH, /* usGpioVoipIntr */
1392 + BP_NOT_DEFINED, /* usGpioLedVoip */
1393 + BP_CS_2}, /* usCsVoip */
1394 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1395 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1396 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1397 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1398 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1399 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1400 + BP_GPIO_2_AH, /* usGpioPcmciaReset */
1401 + BP_GPIO_13_AH, /* usGpioUartRts */
1402 + BP_GPIO_9_AH, /* usGpioUartCts */
1403 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1404 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1405 + BP_NOT_DEFINED, /* usGpioLedWireless */
1406 + BP_GPIO_7_AH, /* usGpioLedUsb */
1407 + BP_NOT_DEFINED, /* usGpioLedHpna */
1408 + BP_GPIO_8_AH, /* usGpioLedWanData */
1409 + BP_NOT_DEFINED, /* usGpioLedPpp */
1410 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1411 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1412 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1413 + BP_GPIO_7_AH, /* usGpioLedBlResetCfg */
1414 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1415 + BP_EXT_INTR_2, /* usExtIntrWireless */
1416 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1417 + BP_NOT_DEFINED, /* usExtIntrHpna */
1418 + BP_NOT_DEFINED, /* usCsHpna */
1419 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1420 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1421 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1422 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1423 +};
1424 +
1425 +static BOARD_PARAMETERS g_bcm96345gw =
1426 +{
1427 + "96345GW", /* szBoardId */
1428 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1429 + 0x00, /* ucPhyAddress */
1430 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1431 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1432 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1433 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1434 + BP_NOT_DEFINED, /* usGpioPhyReset */
1435 + 0x04, /* numSwitchPorts */
1436 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1437 + BP_ENET_NO_REVERSE_MII}, /* usReverseMii */
1438 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1439 + {{BP_VOIP_DSP, /* ucDspType */
1440 + 0x00, /* ucDspAddress */
1441 + BP_EXT_INTR_1, /* usExtIntrVoip */
1442 + BP_GPIO_6_AH, /* usGpioVoipReset */
1443 + BP_GPIO_15_AH, /* usGpioVoipIntr */
1444 + BP_NOT_DEFINED, /* usGpioLedVoip */
1445 + BP_CS_2}, /* usCsVoip */
1446 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1447 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1448 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1449 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1450 + BP_GPIO_1_AH, /* usGpioRj11OuterPair */
1451 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1452 + BP_GPIO_2_AH, /* usGpioPcmciaReset */
1453 + BP_NOT_DEFINED, /* usGpioUartRts */
1454 + BP_NOT_DEFINED, /* usGpioUartCts */
1455 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1456 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1457 + BP_GPIO_10_AH, /* usGpioLedWireless */
1458 + BP_GPIO_7_AH, /* usGpioLedUsb */
1459 + BP_NOT_DEFINED, /* usGpioLedHpna */
1460 + BP_GPIO_8_AH, /* usGpioLedWanData */
1461 + BP_NOT_DEFINED, /* usGpioLedPpp */
1462 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1463 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1464 + BP_GPIO_9_AH, /* usGpioLedBlAlarm */
1465 + BP_GPIO_10_AH, /* usGpioLedBlResetCfg */
1466 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1467 + BP_EXT_INTR_2, /* usExtIntrWireless */
1468 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1469 + BP_EXT_INTR_3, /* usExtIntrHpna */
1470 + BP_CS_1, /* usCsHpna */
1471 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1472 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1473 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1474 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1475 +};
1476 +
1477 +static BOARD_PARAMETERS g_bcm96335r =
1478 +{
1479 + "96335R", /* szBoardId */
1480 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1481 + 0x01, /* ucPhyAddress */
1482 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1483 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1484 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1485 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1486 + BP_NOT_DEFINED, /* usGpioPhyReset */
1487 + 0x01, /* numSwitchPorts */
1488 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1489 + BP_NOT_DEFINED}, /* usReverseMii */
1490 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1491 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1492 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1493 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1494 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1495 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1496 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1497 + BP_GPIO_14_AH, /* usGpioPressAndHoldReset */
1498 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1499 + BP_NOT_DEFINED, /* usGpioUartRts */
1500 + BP_NOT_DEFINED, /* usGpioUartCts */
1501 + BP_GPIO_9_AH, /* usGpioLedAdsl */
1502 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1503 + BP_NOT_DEFINED, /* usGpioLedWireless */
1504 + BP_NOT_DEFINED, /* usGpioLedUsb */
1505 + BP_NOT_DEFINED, /* usGpioLedHpna */
1506 + BP_GPIO_9_AH, /* usGpioLedWanData */
1507 + BP_GPIO_8_AH, /* usGpioLedPpp */
1508 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1509 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1510 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1511 + BP_GPIO_8_AH, /* usGpioLedBlResetCfg */
1512 + BP_GPIO_9_AH, /* usGpioLedBlStop */
1513 + BP_NOT_DEFINED, /* usExtIntrWireless */
1514 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1515 + BP_NOT_DEFINED, /* usExtIntrHpna */
1516 + BP_NOT_DEFINED, /* usCsHpna */
1517 + BP_NOT_DEFINED, /* usAntInUseWireless */
1518 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1519 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1520 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1521 +};
1522 +
1523 +static BOARD_PARAMETERS g_bcm96345r0 =
1524 +{
1525 + "96345R0", /* szBoardId */
1526 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1527 + 0x01, /* ucPhyAddress */
1528 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1529 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1530 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1531 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1532 + BP_NOT_DEFINED, /* usGpioPhyReset */
1533 + 0x01, /* numSwitchPorts */
1534 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1535 + BP_NOT_DEFINED}, /* usReverseMii */
1536 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1537 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1538 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1539 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1540 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1541 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1542 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1543 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1544 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1545 + BP_NOT_DEFINED, /* usGpioUartRts */
1546 + BP_NOT_DEFINED, /* usGpioUartCts */
1547 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1548 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1549 + BP_NOT_DEFINED, /* usGpioLedWireless */
1550 + BP_NOT_DEFINED, /* usGpioLedUsb */
1551 + BP_NOT_DEFINED, /* usGpioLedHpna */
1552 + BP_GPIO_9_AH, /* usGpioLedWanData */
1553 + BP_GPIO_9_AH, /* usGpioLedPpp */
1554 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1555 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1556 + BP_GPIO_9_AH, /* usGpioLedBlAlarm */
1557 + BP_GPIO_8_AH, /* usGpioLedBlResetCfg */
1558 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1559 + BP_NOT_DEFINED, /* usExtIntrWireless */
1560 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1561 + BP_NOT_DEFINED, /* usExtIntrHpna */
1562 + BP_NOT_DEFINED, /* usCsHpna */
1563 + BP_NOT_DEFINED, /* usAntInUseWireless */
1564 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1565 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1566 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1567 +};
1568 +
1569 +static BOARD_PARAMETERS g_bcm96345rs =
1570 +{
1571 + "96345RS", /* szBoardId */
1572 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1573 + 0x00, /* ucPhyAddress */
1574 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1575 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1576 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1577 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1578 + BP_NOT_DEFINED, /* usGpioPhyReset */
1579 + 0x01, /* numSwitchPorts */
1580 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1581 + BP_ENET_NO_REVERSE_MII}, /* usReverseMii */
1582 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1583 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1584 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1585 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1586 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1587 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1588 + BP_GPIO_12_AH, /* usGpioRj11OuterPair */
1589 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1590 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1591 + BP_NOT_DEFINED, /* usGpioUartRts */
1592 + BP_NOT_DEFINED, /* usGpioUartCts */
1593 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1594 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1595 + BP_NOT_DEFINED, /* usGpioLedWireless */
1596 + BP_NOT_DEFINED, /* usGpioLedUsb */
1597 + BP_NOT_DEFINED, /* usGpioLedHpna */
1598 + BP_GPIO_8_AH, /* usGpioLedWanData */
1599 + BP_GPIO_9_AH, /* usGpioLedPpp */
1600 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1601 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1602 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1603 + BP_GPIO_9_AH, /* usGpioLedBlResetCfg */
1604 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1605 + BP_NOT_DEFINED, /* usExtIntrWireless */
1606 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1607 + BP_NOT_DEFINED, /* usExtIntrHpna */
1608 + BP_NOT_DEFINED, /* usCsHpna */
1609 + BP_NOT_DEFINED, /* usAntInUseWireless */
1610 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1611 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1612 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1613 +};
1614 +
1615 +static PBOARD_PARAMETERS g_BoardParms[] =
1616 + {&g_bcm96345r, &g_bcm96345gw2, &g_bcm96345gw, &g_bcm96335r, &g_bcm96345r0,
1617 + &g_bcm96345rs, 0};
1618 +#endif
1619 +
1620 +#if defined(_BCM96348_) || defined(CONFIG_BCM96348)
1621 +
1622 +static BOARD_PARAMETERS g_bcm96348r =
1623 +{
1624 + "96348R", /* szBoardId */
1625 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1626 + 0x01, /* ucPhyAddress */
1627 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1628 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1629 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1630 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1631 + BP_NOT_DEFINED, /* usGpioPhyReset */
1632 + 0x01, /* numSwitchPorts */
1633 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1634 + BP_NOT_DEFINED}, /* usReverseMii */
1635 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1636 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1637 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1638 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1639 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1640 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1641 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1642 + BP_GPIO_7_AH, /* usGpioPressAndHoldReset */
1643 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1644 + BP_NOT_DEFINED, /* usGpioUartRts */
1645 + BP_NOT_DEFINED, /* usGpioUartCts */
1646 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1647 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1648 + BP_NOT_DEFINED, /* usGpioLedWireless */
1649 + BP_NOT_DEFINED, /* usGpioLedUsb */
1650 + BP_NOT_DEFINED, /* usGpioLedHpna */
1651 + BP_GPIO_3_AL, /* usGpioLedWanData */
1652 + BP_GPIO_3_AL, /* usGpioLedPpp */
1653 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1654 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1655 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1656 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1657 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1658 + BP_NOT_DEFINED, /* usExtIntrWireless */
1659 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1660 + BP_NOT_DEFINED, /* usExtIntrHpna */
1661 + BP_NOT_DEFINED, /* usCsHpna */
1662 + BP_NOT_DEFINED, /* usAntInUseWireless */
1663 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1664 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1665 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1666 +};
1667 +
1668 +static BOARD_PARAMETERS g_bcm96348lv =
1669 +{
1670 + "96348LV", /* szBoardId */
1671 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1672 + 0x01, /* ucPhyAddress */
1673 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1674 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1675 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1676 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1677 + BP_NOT_DEFINED, /* usGpioPhyReset */
1678 + 0x01, /* numSwitchPorts */
1679 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1680 + BP_NOT_DEFINED}, /* usReverseMii */
1681 + {BP_ENET_EXTERNAL_PHY, /* ucPhyType */
1682 + 0x02, /* ucPhyAddress */
1683 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1684 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1685 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1686 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1687 + BP_GPIO_5_AL, /* usGpioPhyReset */
1688 + 0x01, /* numSwitchPorts */
1689 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1690 + BP_NOT_DEFINED}}, /* usReverseMii */
1691 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1692 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1693 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1694 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1695 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1696 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1697 + BP_GPIO_7_AH, /* usGpioPressAndHoldReset */
1698 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1699 + BP_NOT_DEFINED, /* usGpioUartRts */
1700 + BP_NOT_DEFINED, /* usGpioUartCts */
1701 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1702 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1703 + BP_NOT_DEFINED, /* usGpioLedWireless */
1704 + BP_NOT_DEFINED, /* usGpioLedUsb */
1705 + BP_NOT_DEFINED, /* usGpioLedHpna */
1706 + BP_GPIO_3_AL, /* usGpioLedWanData */
1707 + BP_GPIO_3_AL, /* usGpioLedPpp */
1708 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1709 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1710 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1711 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1712 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1713 + BP_NOT_DEFINED, /* usExtIntrWireless */
1714 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1715 + BP_NOT_DEFINED, /* usExtIntrHpna */
1716 + BP_NOT_DEFINED, /* usCsHpna */
1717 + BP_NOT_DEFINED, /* usAntInUseWireless */
1718 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1719 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1720 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1721 +};
1722 +
1723 +static BOARD_PARAMETERS g_bcm96348gw =
1724 +{
1725 + "96348GW", /* szBoardId */
1726 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1727 + 0x01, /* ucPhyAddress */
1728 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1729 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1730 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1731 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1732 + BP_NOT_DEFINED, /* usGpioPhyReset */
1733 + 0x01, /* numSwitchPorts */
1734 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1735 + BP_NOT_DEFINED}, /* usReverseMii */
1736 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1737 + 0x00, /* ucPhyAddress */
1738 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1739 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1740 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1741 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1742 + BP_NOT_DEFINED, /* usGpioPhyReset */
1743 + 0x03, /* numSwitchPorts */
1744 + BP_ENET_CONFIG_SPI_SSB_0, /* usConfigType */
1745 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1746 + {{BP_VOIP_DSP, /* ucDspType */
1747 + 0x00, /* ucDspAddress */
1748 + BP_EXT_INTR_2, /* usExtIntrVoip */
1749 + BP_GPIO_6_AH, /* usGpioVoipReset */
1750 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1751 + BP_NOT_DEFINED, /* usGpioLedVoip */
1752 + BP_CS_2}, /* usCsVoip */
1753 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1754 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1755 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1756 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1757 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1758 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1759 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1760 + BP_NOT_DEFINED, /* usGpioUartRts */
1761 + BP_NOT_DEFINED, /* usGpioUartCts */
1762 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1763 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1764 + BP_NOT_DEFINED, /* usGpioLedWireless */
1765 + BP_NOT_DEFINED, /* usGpioLedUsb */
1766 + BP_NOT_DEFINED, /* usGpioLedHpna */
1767 + BP_GPIO_3_AL, /* usGpioLedWanData */
1768 + BP_GPIO_3_AL, /* usGpioLedPpp */
1769 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1770 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1771 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1772 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1773 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1774 + BP_NOT_DEFINED, /* usExtIntrWireless */
1775 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1776 + BP_NOT_DEFINED, /* usExtIntrHpna */
1777 + BP_NOT_DEFINED, /* usCsHpna */
1778 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1779 + BP_NOT_DEFINED, /* BP_GPIO_35_AH, */ /* usGpioSesBtnWireless */
1780 + BP_NOT_DEFINED, /* BP_EXT_INTR_3, */ /* usExtIntrSesBtnWireless */
1781 + BP_NOT_DEFINED /* BP_GPIO_0_AL */ /* usGpioLedSesWireless */
1782 +};
1783 +
1784 +
1785 +static BOARD_PARAMETERS g_bcm96348gw_10 =
1786 +{
1787 + "96348GW-10", /* szBoardId */
1788 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1789 + 0x01, /* ucPhyAddress */
1790 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1791 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1792 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1793 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1794 + BP_NOT_DEFINED, /* usGpioPhyReset */
1795 + 0x01, /* numSwitchPorts */
1796 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1797 + BP_NOT_DEFINED}, /* usReverseMii */
1798 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1799 + 0x00, /* ucPhyAddress */
1800 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1801 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1802 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1803 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1804 + BP_NOT_DEFINED, /* usGpioPhyReset */
1805 + 0x03, /* numSwitchPorts */
1806 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1807 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1808 + {{BP_VOIP_DSP, /* ucDspType */
1809 + 0x00, /* ucDspAddress */
1810 + BP_EXT_INTR_2, /* usExtIntrVoip */
1811 + BP_GPIO_6_AH, /* usGpioVoipReset */
1812 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1813 + BP_NOT_DEFINED, /* usGpioLedVoip */
1814 + BP_CS_2}, /* usCsVoip */
1815 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1816 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1817 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1818 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1819 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1820 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1821 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1822 + BP_NOT_DEFINED, /* usGpioUartRts */
1823 + BP_NOT_DEFINED, /* usGpioUartCts */
1824 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1825 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1826 + BP_NOT_DEFINED, /* usGpioLedWireless */
1827 + BP_NOT_DEFINED, /* usGpioLedUsb */
1828 + BP_NOT_DEFINED, /* usGpioLedHpna */
1829 + BP_GPIO_3_AL, /* usGpioLedWanData */
1830 + BP_GPIO_3_AL, /* usGpioLedPpp */
1831 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1832 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1833 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1834 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1835 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1836 + BP_NOT_DEFINED, /* usExtIntrWireless */
1837 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1838 + BP_NOT_DEFINED, /* usExtIntrHpna */
1839 + BP_NOT_DEFINED, /* usCsHpna */
1840 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1841 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1842 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1843 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1844 +};
1845 +
1846 +static BOARD_PARAMETERS g_bcm96348gw_11 =
1847 +{
1848 + "96348GW-11", /* szBoardId */
1849 + {{BP_ENET_NO_PHY}, /* ucPhyType */
1850 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1851 + 0x00, /* ucPhyAddress */
1852 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1853 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1854 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1855 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1856 + BP_NOT_DEFINED, /* usGpioPhyReset */
1857 + 0x04, /* numSwitchPorts */
1858 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1859 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1860 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1861 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1862 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1863 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1864 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1865 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1866 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1867 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1868 + BP_NOT_DEFINED, /* usGpioUartRts */
1869 + BP_NOT_DEFINED, /* usGpioUartCts */
1870 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1871 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1872 + BP_NOT_DEFINED, /* usGpioLedWireless */
1873 + BP_NOT_DEFINED, /* usGpioLedUsb */
1874 + BP_NOT_DEFINED, /* usGpioLedHpna */
1875 + BP_GPIO_3_AL, /* usGpioLedWanData */
1876 + BP_GPIO_3_AL, /* usGpioLedPpp */
1877 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1878 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1879 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1880 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1881 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1882 + BP_NOT_DEFINED, /* usExtIntrWireless */
1883 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1884 + BP_NOT_DEFINED, /* usExtIntrHpna */
1885 + BP_NOT_DEFINED, /* usCsHpna */
1886 + BP_NOT_DEFINED, /* usAntInUseWireless */
1887 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1888 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1889 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1890 +};
1891 +
1892 +static BOARD_PARAMETERS g_bcm96348sv =
1893 +{
1894 + "96348SV", /* szBoardId */
1895 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1896 + 0x01, /* ucPhyAddress */
1897 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1898 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1899 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1900 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1901 + BP_NOT_DEFINED, /* usGpioPhyReset */
1902 + 0x01, /* numSwitchPorts */
1903 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1904 + BP_NOT_DEFINED}, /* usReverseMii */
1905 + {BP_ENET_EXTERNAL_PHY, /* ucPhyType */
1906 + 0x1f, /* ucPhyAddress */
1907 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1908 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1909 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1910 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1911 + BP_NOT_DEFINED, /* usGpioPhyReset */
1912 + 0x01, /* numSwitchPorts */
1913 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1914 + BP_NOT_DEFINED}}, /* usReverseMii */
1915 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1916 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1917 + BP_MEMORY_32MB_2_CHIP, /* usSdramSize */
1918 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1919 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1920 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1921 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1922 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1923 + BP_NOT_DEFINED, /* usGpioUartRts */
1924 + BP_NOT_DEFINED, /* usGpioUartCts */
1925 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1926 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1927 + BP_NOT_DEFINED, /* usGpioLedWireless */
1928 + BP_NOT_DEFINED, /* usGpioLedUsb */
1929 + BP_NOT_DEFINED, /* usGpioLedHpna */
1930 + BP_NOT_DEFINED, /* usGpioLedWanData */
1931 + BP_NOT_DEFINED, /* usGpioLedPpp */
1932 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1933 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1934 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1935 + BP_NOT_DEFINED, /* usGpioLedBlResetCfg */
1936 + BP_NOT_DEFINED, /* usGpioLedBlStop */
1937 + BP_NOT_DEFINED, /* usExtIntrWireless */
1938 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1939 + BP_NOT_DEFINED, /* usExtIntrHpna */
1940 + BP_NOT_DEFINED, /* usCsHpna */
1941 + BP_NOT_DEFINED, /* usAntInUseWireless */
1942 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1943 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1944 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1945 +};
1946 +
1947 +
1948 +static BOARD_PARAMETERS g_bcm96348gw_dualDsp =
1949 +{
1950 + "96348GW-DualDSP", /* szBoardId */
1951 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1952 + 0x01, /* ucPhyAddress */
1953 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1954 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1955 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1956 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1957 + BP_NOT_DEFINED, /* usGpioPhyReset */
1958 + 0x01, /* numSwitchPorts */
1959 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1960 + BP_NOT_DEFINED}, /* usReverseMii */
1961 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1962 + 0x00, /* ucPhyAddress */
1963 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1964 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1965 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1966 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1967 + BP_NOT_DEFINED, /* usGpioPhyReset */
1968 + 0x03, /* numSwitchPorts */
1969 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1970 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1971 + {{BP_VOIP_DSP, /* ucDspType */
1972 + 0x00, /* ucDspAddress */
1973 + BP_EXT_INTR_2, /* usExtIntrVoip */
1974 + BP_UNEQUIPPED, /* usGpioVoipReset */
1975 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1976 + BP_NOT_DEFINED, /* usGpioLedVoip */
1977 + BP_CS_2}, /* usCsVoip */
1978 + {BP_VOIP_DSP, /* ucDspType */
1979 + 0x01, /* ucDspAddress */
1980 + BP_EXT_INTR_3, /* usExtIntrVoip */
1981 + BP_UNEQUIPPED , /* usGpioVoipReset */
1982 + BP_GPIO_35_AH, /* usGpioVoipIntr */
1983 + BP_NOT_DEFINED, /* usGpioLedVoip */
1984 + BP_CS_3}}, /* usCsVoip */
1985 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1986 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1987 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1988 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1989 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1990 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1991 + BP_NOT_DEFINED, /* usGpioUartRts */
1992 + BP_NOT_DEFINED, /* usGpioUartCts */
1993 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1994 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1995 + BP_NOT_DEFINED, /* usGpioLedWireless */
1996 + BP_NOT_DEFINED, /* usGpioLedUsb */
1997 + BP_NOT_DEFINED, /* usGpioLedHpna */
1998 + BP_GPIO_3_AL, /* usGpioLedWanData */
1999 + BP_GPIO_3_AL, /* usGpioLedPpp */
2000 + BP_GPIO_4_AL, /* usGpioLedPppFail */
2001 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
2002 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
2003 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
2004 + BP_GPIO_1_AL, /* usGpioLedBlStop */
2005 + BP_NOT_DEFINED, /* usExtIntrWireless */
2006 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
2007 + BP_NOT_DEFINED, /* usExtIntrHpna */
2008 + BP_NOT_DEFINED, /* usCsHpna */
2009 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
2010 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
2011 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
2012 + BP_NOT_DEFINED /* usGpioLedSesWireless */
2013 +};
2014 +
2015 +
2016 +static BOARD_PARAMETERS g_bcmCustom_01 =
2017 +{
2018 + "BCMCUST_01", /* szBoardId */
2019 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
2020 + 0x01, /* ucPhyAddress */
2021 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
2022 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
2023 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
2024 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
2025 + BP_NOT_DEFINED, /* usGpioPhyReset */
2026 + 0x01, /* numSwitchPorts */
2027 + BP_ENET_CONFIG_MDIO, /* usConfigType */
2028 + BP_NOT_DEFINED}, /* usReverseMii */
2029 + {BP_ENET_NO_PHY, /* ucPhyType */
2030 + 0x00, /* ucPhyAddress */
2031 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
2032 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
2033 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
2034 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
2035 + BP_NOT_DEFINED, /* usGpioPhyReset */
2036 + 0x01, /* numSwitchPorts */
2037 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
2038 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
2039 + {{BP_VOIP_DSP, /* ucDspType */
2040 + 0x00, /* ucDspAddress */
2041 + BP_EXT_INTR_2, /* usExtIntrVoip */
2042 + BP_GPIO_36_AH, /* usGpioVoipReset */
2043 + BP_GPIO_34_AL, /* usGpioVoipIntr */
2044 + BP_NOT_DEFINED, /* usGpioLedVoip */
2045 + BP_CS_2}, /* usCsVoip */
2046 + {BP_VOIP_NO_DSP}}, /* ucDspType */
2047 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
2048 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
2049 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
2050 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
2051 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
2052 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
2053 + BP_NOT_DEFINED, /* usGpioUartRts */
2054 + BP_NOT_DEFINED, /* usGpioUartCts */
2055 + BP_NOT_DEFINED, /* usGpioLedAdsl */
2056 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
2057 + BP_NOT_DEFINED, /* usGpioLedWireless */
2058 + BP_NOT_DEFINED, /* usGpioLedUsb */
2059 + BP_NOT_DEFINED, /* usGpioLedHpna */
2060 + BP_GPIO_3_AL, /* usGpioLedWanData */
2061 + BP_GPIO_3_AL, /* usGpioLedPpp */
2062 + BP_GPIO_4_AL, /* usGpioLedPppFail */
2063 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
2064 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
2065 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
2066 + BP_GPIO_1_AL, /* usGpioLedBlStop */
2067 + BP_NOT_DEFINED, /* usExtIntrWireless */
2068 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
2069 + BP_NOT_DEFINED, /* usExtIntrHpna */
2070 + BP_NOT_DEFINED, /* usCsHpna */
2071 + BP_NOT_DEFINED, /* usAntInUseWireless */
2072 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
2073 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
2074 + BP_NOT_DEFINED /* usGpioLedSesWireless */
2075 +};
2076 +
2077 +static PBOARD_PARAMETERS g_BoardParms[] =
2078 + {&g_bcm96348r, &g_bcm96348lv, &g_bcm96348gw, &g_bcm96348gw_10,
2079 + &g_bcm96348gw_11, &g_bcm96348sv, &g_bcm96348gw_dualDsp,
2080 + &g_bcmCustom_01, 0};
2081 +#endif
2082 +
2083 +static PBOARD_PARAMETERS g_pCurrentBp = 0;
2084 +
2085 +/**************************************************************************
2086 + * Name : bpstrcmp
2087 + *
2088 + * Description: String compare for this file so it does not depend on an OS.
2089 + * (Linux kernel and CFE share this source file.)
2090 + *
2091 + * Parameters : [IN] dest - destination string
2092 + * [IN] src - source string
2093 + *
2094 + * Returns : -1 - dest < src, 1 - dest > src, 0 dest == src
2095 + ***************************************************************************/
2096 +static int bpstrcmp(const char *dest,const char *src);
2097 +static int bpstrcmp(const char *dest,const char *src)
2098 +{
2099 + while (*src && *dest)
2100 + {
2101 + if (*dest < *src) return -1;
2102 + if (*dest > *src) return 1;
2103 + dest++;
2104 + src++;
2105 + }
2106 +
2107 + if (*dest && !*src) return 1;
2108 + if (!*dest && *src) return -1;
2109 + return 0;
2110 +} /* bpstrcmp */
2111 +
2112 +/**************************************************************************
2113 + * Name : BpGetVoipDspConfig
2114 + *
2115 + * Description: Gets the DSP configuration from the board parameter
2116 + * structure for a given DSP index.
2117 + *
2118 + * Parameters : [IN] dspNum - DSP index (number)
2119 + *
2120 + * Returns : Pointer to DSP configuration block if found/valid, NULL
2121 + * otherwise.
2122 + ***************************************************************************/
2123 +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum );
2124 +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum )
2125 +{
2126 + VOIP_DSP_INFO *pDspConfig = 0;
2127 + int i;
2128 +
2129 + if( g_pCurrentBp )
2130 + {
2131 + for( i = 0 ; i < BP_MAX_VOIP_DSP ; i++ )
2132 + {
2133 + if( g_pCurrentBp->VoIPDspInfo[i].ucDspType != BP_VOIP_NO_DSP &&
2134 + g_pCurrentBp->VoIPDspInfo[i].ucDspAddress == dspNum )
2135 + {
2136 + pDspConfig = &g_pCurrentBp->VoIPDspInfo[i];
2137 + break;
2138 + }
2139 + }
2140 + }
2141 +
2142 + return pDspConfig;
2143 +}
2144 +
2145 +
2146 +/**************************************************************************
2147 + * Name : BpSetBoardId
2148 + *
2149 + * Description: This function find the BOARD_PARAMETERS structure for the
2150 + * specified board id string and assigns it to a global, static
2151 + * variable.
2152 + *
2153 + * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
2154 + *
2155 + * Returns : BP_SUCCESS - Success, value is returned.
2156 + * BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
2157 + * have a board parameters configuration record.
2158 + ***************************************************************************/
2159 +int BpSetBoardId( char *pszBoardId )
2160 +{
2161 + int nRet = BP_BOARD_ID_NOT_FOUND;
2162 + PBOARD_PARAMETERS *ppBp;
2163 +
2164 + for( ppBp = g_BoardParms; *ppBp; ppBp++ )
2165 + {
2166 + if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
2167 + {
2168 + g_pCurrentBp = *ppBp;
2169 + nRet = BP_SUCCESS;
2170 + break;
2171 + }
2172 + }
2173 +
2174 + return( nRet );
2175 +} /* BpSetBoardId */
2176 +
2177 +/**************************************************************************
2178 + * Name : BpGetBoardIds
2179 + *
2180 + * Description: This function returns all of the supported board id strings.
2181 + *
2182 + * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
2183 + * strings are returned in. Each id starts at BP_BOARD_ID_LEN
2184 + * boundary.
2185 + * [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
2186 + * were allocated in pszBoardIds.
2187 + *
2188 + * Returns : Number of board id strings returned.
2189 + ***************************************************************************/
2190 +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize )
2191 +{
2192 + PBOARD_PARAMETERS *ppBp;
2193 + int i;
2194 + char *src;
2195 + char *dest;
2196 +
2197 + for( i = 0, ppBp = g_BoardParms; *ppBp && nBoardIdsSize;
2198 + i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN )
2199 + {
2200 + dest = pszBoardIds;
2201 + src = (*ppBp)->szBoardId;
2202 + while( *src )
2203 + *dest++ = *src++;
2204 + *dest = '\0';
2205 + }
2206 +
2207 + return( i );
2208 +} /* BpGetBoardIds */
2209 +
2210 +/**************************************************************************
2211 + * Name : BpGetEthernetMacInfo
2212 + *
2213 + * Description: This function returns all of the supported board id strings.
2214 + *
2215 + * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
2216 + * buffers.
2217 + * [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
2218 + * are pointed to by pEnetInfos.
2219 + *
2220 + * Returns : BP_SUCCESS - Success, value is returned.
2221 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2222 + ***************************************************************************/
2223 +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos )
2224 +{
2225 + int i, nRet;
2226 +
2227 + if( g_pCurrentBp )
2228 + {
2229 + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
2230 + {
2231 + if( i < BP_MAX_ENET_MACS )
2232 + {
2233 + unsigned char *src = (unsigned char *)
2234 + &g_pCurrentBp->EnetMacInfos[i];
2235 + unsigned char *dest = (unsigned char *) pEnetInfos;
2236 + int len = sizeof(ETHERNET_MAC_INFO);
2237 + while( len-- )
2238 + *dest++ = *src++;
2239 + }
2240 + else
2241 + pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
2242 + }
2243 +
2244 + nRet = BP_SUCCESS;
2245 + }
2246 + else
2247 + {
2248 + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
2249 + pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
2250 +
2251 + nRet = BP_BOARD_ID_NOT_SET;
2252 + }
2253 +
2254 + return( nRet );
2255 +} /* BpGetEthernetMacInfo */
2256 +
2257 +/**************************************************************************
2258 + * Name : BpGetSdramSize
2259 + *
2260 + * Description: This function returns a constant that describees the board's
2261 + * SDRAM type and size.
2262 + *
2263 + * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
2264 + * is returned in.
2265 + *
2266 + * Returns : BP_SUCCESS - Success, value is returned.
2267 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2268 + ***************************************************************************/
2269 +int BpGetSdramSize( unsigned long *pulSdramSize )
2270 +{
2271 + int nRet;
2272 +
2273 + if( g_pCurrentBp )
2274 + {
2275 + *pulSdramSize = g_pCurrentBp->usSdramSize;
2276 + nRet = BP_SUCCESS;
2277 + }
2278 + else
2279 + {
2280 + *pulSdramSize = BP_NOT_DEFINED;
2281 + nRet = BP_BOARD_ID_NOT_SET;
2282 + }
2283 +
2284 + return( nRet );
2285 +} /* BpGetSdramSize */
2286 +
2287 +/**************************************************************************
2288 + * Name : BpGetPsiSize
2289 + *
2290 + * Description: This function returns the persistent storage size in K bytes.
2291 + *
2292 + * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
2293 + * storage size is returned in.
2294 + *
2295 + * Returns : BP_SUCCESS - Success, value is returned.
2296 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2297 + ***************************************************************************/
2298 +int BpGetPsiSize( unsigned long *pulPsiSize )
2299 +{
2300 + int nRet;
2301 +
2302 + if( g_pCurrentBp )
2303 + {
2304 + *pulPsiSize = g_pCurrentBp->usPsiSize;
2305 + nRet = BP_SUCCESS;
2306 + }
2307 + else
2308 + {
2309 + *pulPsiSize = BP_NOT_DEFINED;
2310 + nRet = BP_BOARD_ID_NOT_SET;
2311 + }
2312 +
2313 + return( nRet );
2314 +} /* BpGetPsiSize */
2315 +
2316 +/**************************************************************************
2317 + * Name : BpGetRj11InnerOuterPairGpios
2318 + *
2319 + * Description: This function returns the GPIO pin assignments for changing
2320 + * between the RJ11 inner pair and RJ11 outer pair.
2321 + *
2322 + * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
2323 + * GPIO pin is returned in.
2324 + * [OUT] pusOuter - Address of short word that the RJ11 outer pair
2325 + * GPIO pin is returned in.
2326 + *
2327 + * Returns : BP_SUCCESS - Success, values are returned.
2328 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2329 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2330 + * for the board.
2331 + ***************************************************************************/
2332 +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
2333 + unsigned short *pusOuter )
2334 +{
2335 + int nRet;
2336 +
2337 + if( g_pCurrentBp )
2338 + {
2339 + *pusInner = g_pCurrentBp->usGpioRj11InnerPair;
2340 + *pusOuter = g_pCurrentBp->usGpioRj11OuterPair;
2341 +
2342 + if( g_pCurrentBp->usGpioRj11InnerPair != BP_NOT_DEFINED &&
2343 + g_pCurrentBp->usGpioRj11OuterPair != BP_NOT_DEFINED )
2344 + {
2345 + nRet = BP_SUCCESS;
2346 + }
2347 + else
2348 + {
2349 + nRet = BP_VALUE_NOT_DEFINED;
2350 + }
2351 + }
2352 + else
2353 + {
2354 + *pusInner = *pusOuter = BP_NOT_DEFINED;
2355 + nRet = BP_BOARD_ID_NOT_SET;
2356 + }
2357 +
2358 + return( nRet );
2359 +} /* BpGetRj11InnerOuterPairGpios */
2360 +
2361 +/**************************************************************************
2362 + * Name : BpGetPressAndHoldResetGpio
2363 + *
2364 + * Description: This function returns the GPIO pin assignment for the press
2365 + * and hold reset button.
2366 + *
2367 + * Parameters : [OUT] pusValue - Address of short word that the press and hold
2368 + * reset button GPIO pin is returned in.
2369 + *
2370 + * Returns : BP_SUCCESS - Success, value is returned.
2371 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2372 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2373 + * for the board.
2374 + ***************************************************************************/
2375 +int BpGetPressAndHoldResetGpio( unsigned short *pusValue )
2376 +{
2377 + int nRet;
2378 +
2379 + if( g_pCurrentBp )
2380 + {
2381 + *pusValue = g_pCurrentBp->usGpioPressAndHoldReset;
2382 +
2383 + if( g_pCurrentBp->usGpioPressAndHoldReset != BP_NOT_DEFINED )
2384 + {
2385 + nRet = BP_SUCCESS;
2386 + }
2387 + else
2388 + {
2389 + nRet = BP_VALUE_NOT_DEFINED;
2390 + }
2391 + }
2392 + else
2393 + {
2394 + *pusValue = BP_NOT_DEFINED;
2395 + nRet = BP_BOARD_ID_NOT_SET;
2396 + }
2397 +
2398 + return( nRet );
2399 +} /* BpGetPressAndHoldResetGpio */
2400 +
2401 +/**************************************************************************
2402 + * Name : BpGetVoipResetGpio
2403 + *
2404 + * Description: This function returns the GPIO pin assignment for the VOIP
2405 + * Reset operation.
2406 + *
2407 + * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
2408 + * GPIO pin is returned in.
2409 + * [IN] dspNum - Address of the DSP to query.
2410 + *
2411 + * Returns : BP_SUCCESS - Success, value is returned.
2412 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2413 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2414 + * for the board.
2415 + ***************************************************************************/
2416 +int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue )
2417 +{
2418 + int nRet;
2419 +
2420 + if( g_pCurrentBp )
2421 + {
2422 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2423 +
2424 + if( pDspInfo )
2425 + {
2426 + *pusValue = pDspInfo->usGpioVoipReset;
2427 +
2428 + if( *pusValue != BP_NOT_DEFINED ||
2429 + *pusValue == BP_UNEQUIPPED )
2430 + {
2431 + nRet = BP_SUCCESS;
2432 + }
2433 + else
2434 + {
2435 + nRet = BP_VALUE_NOT_DEFINED;
2436 + }
2437 + }
2438 + else
2439 + {
2440 + *pusValue = BP_NOT_DEFINED;
2441 + nRet = BP_BOARD_ID_NOT_FOUND;
2442 + }
2443 + }
2444 + else
2445 + {
2446 + *pusValue = BP_NOT_DEFINED;
2447 + nRet = BP_BOARD_ID_NOT_SET;
2448 + }
2449 +
2450 + return( nRet );
2451 +} /* BpGetVoipResetGpio */
2452 +
2453 +/**************************************************************************
2454 + * Name : BpGetVoipIntrGpio
2455 + *
2456 + * Description: This function returns the GPIO pin assignment for VoIP interrupt.
2457 + *
2458 + * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
2459 + * GPIO pin is returned in.
2460 + * [IN] dspNum - Address of the DSP to query.
2461 + *
2462 + * Returns : BP_SUCCESS - Success, value is returned.
2463 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2464 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2465 + * for the board.
2466 + ***************************************************************************/
2467 +int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue )
2468 +{
2469 + int nRet;
2470 +
2471 + if( g_pCurrentBp )
2472 + {
2473 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2474 +
2475 + if( pDspInfo )
2476 + {
2477 + *pusValue = pDspInfo->usGpioVoipIntr;
2478 +
2479 + if( *pusValue != BP_NOT_DEFINED )
2480 + {
2481 + nRet = BP_SUCCESS;
2482 + }
2483 + else
2484 + {
2485 + nRet = BP_VALUE_NOT_DEFINED;
2486 + }
2487 + }
2488 + else
2489 + {
2490 + *pusValue = BP_NOT_DEFINED;
2491 + nRet = BP_BOARD_ID_NOT_FOUND;
2492 + }
2493 + }
2494 + else
2495 + {
2496 + *pusValue = BP_NOT_DEFINED;
2497 + nRet = BP_BOARD_ID_NOT_SET;
2498 + }
2499 +
2500 + return( nRet );
2501 +} /* BpGetVoipIntrGpio */
2502 +
2503 +/**************************************************************************
2504 + * Name : BpGetPcmciaResetGpio
2505 + *
2506 + * Description: This function returns the GPIO pin assignment for the PCMCIA
2507 + * Reset operation.
2508 + *
2509 + * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
2510 + * GPIO pin is returned in.
2511 + *
2512 + * Returns : BP_SUCCESS - Success, value is returned.
2513 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2514 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2515 + * for the board.
2516 + ***************************************************************************/
2517 +int BpGetPcmciaResetGpio( unsigned short *pusValue )
2518 +{
2519 + int nRet;
2520 +
2521 + if( g_pCurrentBp )
2522 + {
2523 + *pusValue = g_pCurrentBp->usGpioPcmciaReset;
2524 +
2525 + if( g_pCurrentBp->usGpioPcmciaReset != BP_NOT_DEFINED )
2526 + {
2527 + nRet = BP_SUCCESS;
2528 + }
2529 + else
2530 + {
2531 + nRet = BP_VALUE_NOT_DEFINED;
2532 + }
2533 + }
2534 + else
2535 + {
2536 + *pusValue = BP_NOT_DEFINED;
2537 + nRet = BP_BOARD_ID_NOT_SET;
2538 + }
2539 +
2540 + return( nRet );
2541 +} /* BpGetPcmciaResetGpio */
2542 +
2543 +/**************************************************************************
2544 + * Name : BpGetUartRtsCtsGpios
2545 + *
2546 + * Description: This function returns the GPIO pin assignments for RTS and CTS
2547 + * UART signals.
2548 + *
2549 + * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
2550 + * pin is returned in.
2551 + * [OUT] pusCts - Address of short word that the UART CTS GPIO
2552 + * pin is returned in.
2553 + *
2554 + * Returns : BP_SUCCESS - Success, values are returned.
2555 + * BP_BOARD_ID_NOT_SET - Error, board id input string does not
2556 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2557 + * for the board.
2558 + ***************************************************************************/
2559 +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts )
2560 +{
2561 + int nRet;
2562 +
2563 + if( g_pCurrentBp )
2564 + {
2565 + *pusRts = g_pCurrentBp->usGpioUartRts;
2566 + *pusCts = g_pCurrentBp->usGpioUartCts;
2567 +
2568 + if( g_pCurrentBp->usGpioUartRts != BP_NOT_DEFINED &&
2569 + g_pCurrentBp->usGpioUartCts != BP_NOT_DEFINED )
2570 + {
2571 + nRet = BP_SUCCESS;
2572 + }
2573 + else
2574 + {
2575 + nRet = BP_VALUE_NOT_DEFINED;
2576 + }
2577 + }
2578 + else
2579 + {
2580 + *pusRts = *pusCts = BP_NOT_DEFINED;
2581 + nRet = BP_BOARD_ID_NOT_SET;
2582 + }
2583 +
2584 + return( nRet );
2585 +} /* BpGetUartRtsCtsGpios */
2586 +
2587 +/**************************************************************************
2588 + * Name : BpGetAdslLedGpio
2589 + *
2590 + * Description: This function returns the GPIO pin assignment for the ADSL
2591 + * LED.
2592 + *
2593 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
2594 + * GPIO pin is returned in.
2595 + *
2596 + * Returns : BP_SUCCESS - Success, value is returned.
2597 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2598 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2599 + * for the board.
2600 + ***************************************************************************/
2601 +int BpGetAdslLedGpio( unsigned short *pusValue )
2602 +{
2603 + int nRet;
2604 +
2605 + if( g_pCurrentBp )
2606 + {
2607 + *pusValue = g_pCurrentBp->usGpioLedAdsl;
2608 +
2609 + if( g_pCurrentBp->usGpioLedAdsl != BP_NOT_DEFINED )
2610 + {
2611 + nRet = BP_SUCCESS;
2612 + }
2613 + else
2614 + {
2615 + nRet = BP_VALUE_NOT_DEFINED;
2616 + }
2617 + }
2618 + else
2619 + {
2620 + *pusValue = BP_NOT_DEFINED;
2621 + nRet = BP_BOARD_ID_NOT_SET;
2622 + }
2623 +
2624 + return( nRet );
2625 +} /* BpGetAdslLedGpio */
2626 +
2627 +/**************************************************************************
2628 + * Name : BpGetAdslFailLedGpio
2629 + *
2630 + * Description: This function returns the GPIO pin assignment for the ADSL
2631 + * LED that is used when there is a DSL connection failure.
2632 + *
2633 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
2634 + * GPIO pin is returned in.
2635 + *
2636 + * Returns : BP_SUCCESS - Success, value is returned.
2637 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2638 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2639 + * for the board.
2640 + ***************************************************************************/
2641 +int BpGetAdslFailLedGpio( unsigned short *pusValue )
2642 +{
2643 + int nRet;
2644 +
2645 + if( g_pCurrentBp )
2646 + {
2647 + *pusValue = g_pCurrentBp->usGpioLedAdslFail;
2648 +
2649 + if( g_pCurrentBp->usGpioLedAdslFail != BP_NOT_DEFINED )
2650 + {
2651 + nRet = BP_SUCCESS;
2652 + }
2653 + else
2654 + {
2655 + nRet = BP_VALUE_NOT_DEFINED;
2656 + }
2657 + }
2658 + else
2659 + {
2660 + *pusValue = BP_NOT_DEFINED;
2661 + nRet = BP_BOARD_ID_NOT_SET;
2662 + }
2663 +
2664 + return( nRet );
2665 +} /* BpGetAdslFailLedGpio */
2666 +
2667 +/**************************************************************************
2668 + * Name : BpGetWirelessLedGpio
2669 + *
2670 + * Description: This function returns the GPIO pin assignment for the Wireless
2671 + * LED.
2672 + *
2673 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
2674 + * GPIO pin is returned in.
2675 + *
2676 + * Returns : BP_SUCCESS - Success, value is returned.
2677 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2678 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2679 + * for the board.
2680 + ***************************************************************************/
2681 +int BpGetWirelessLedGpio( unsigned short *pusValue )
2682 +{
2683 + int nRet;
2684 +
2685 + if( g_pCurrentBp )
2686 + {
2687 + *pusValue = g_pCurrentBp->usGpioLedWireless;
2688 +
2689 + if( g_pCurrentBp->usGpioLedWireless != BP_NOT_DEFINED )
2690 + {
2691 + nRet = BP_SUCCESS;
2692 + }
2693 + else
2694 + {
2695 + nRet = BP_VALUE_NOT_DEFINED;
2696 + }
2697 + }
2698 + else
2699 + {
2700 + *pusValue = BP_NOT_DEFINED;
2701 + nRet = BP_BOARD_ID_NOT_SET;
2702 + }
2703 +
2704 + return( nRet );
2705 +} /* BpGetWirelessLedGpio */
2706 +
2707 +/**************************************************************************
2708 + * Name : BpGetWirelessAntInUse
2709 + *
2710 + * Description: This function returns the antennas in use for wireless
2711 + *
2712 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
2713 + * is in use.
2714 + *
2715 + * Returns : BP_SUCCESS - Success, value is returned.
2716 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2717 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2718 + * for the board.
2719 + ***************************************************************************/
2720 +int BpGetWirelessAntInUse( unsigned short *pusValue )
2721 +{
2722 + int nRet;
2723 +
2724 + if( g_pCurrentBp )
2725 + {
2726 + *pusValue = g_pCurrentBp->usAntInUseWireless;
2727 +
2728 + if( g_pCurrentBp->usAntInUseWireless != BP_NOT_DEFINED )
2729 + {
2730 + nRet = BP_SUCCESS;
2731 + }
2732 + else
2733 + {
2734 + nRet = BP_VALUE_NOT_DEFINED;
2735 + }
2736 + }
2737 + else
2738 + {
2739 + *pusValue = BP_NOT_DEFINED;
2740 + nRet = BP_BOARD_ID_NOT_SET;
2741 + }
2742 +
2743 + return( nRet );
2744 +} /* BpGetWirelessAntInUse */
2745 +
2746 +/**************************************************************************
2747 + * Name : BpGetWirelessSesBtnGpio
2748 + *
2749 + * Description: This function returns the GPIO pin assignment for the Wireless
2750 + * Ses Button.
2751 + *
2752 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
2753 + * GPIO pin is returned in.
2754 + *
2755 + * Returns : BP_SUCCESS - Success, value is returned.
2756 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2757 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2758 + * for the board.
2759 + ***************************************************************************/
2760 +int BpGetWirelessSesBtnGpio( unsigned short *pusValue )
2761 +{
2762 + int nRet;
2763 +
2764 + if( g_pCurrentBp )
2765 + {
2766 + *pusValue = g_pCurrentBp->usGpioSesBtnWireless;
2767 +
2768 + if( g_pCurrentBp->usGpioSesBtnWireless != BP_NOT_DEFINED )
2769 + {
2770 + nRet = BP_SUCCESS;
2771 + }
2772 + else
2773 + {
2774 + nRet = BP_VALUE_NOT_DEFINED;
2775 + }
2776 + }
2777 + else
2778 + {
2779 + *pusValue = BP_NOT_DEFINED;
2780 + nRet = BP_BOARD_ID_NOT_SET;
2781 + }
2782 +
2783 + return( nRet );
2784 +} /* BpGetWirelessSesBtnGpio */
2785 +
2786 +/**************************************************************************
2787 + * Name : BpGetWirelessSesExtIntr
2788 + *
2789 + * Description: This function returns the external interrupt number for the
2790 + * Wireless Ses Button.
2791 + *
2792 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
2793 + * external interrup is returned in.
2794 + *
2795 + * Returns : BP_SUCCESS - Success, value is returned.
2796 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2797 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2798 + * for the board.
2799 + ***************************************************************************/
2800 +int BpGetWirelessSesExtIntr( unsigned short *pusValue )
2801 +{
2802 + int nRet;
2803 +
2804 + if( g_pCurrentBp )
2805 + {
2806 + *pusValue = g_pCurrentBp->usExtIntrSesBtnWireless;
2807 +
2808 + if( g_pCurrentBp->usExtIntrSesBtnWireless != BP_NOT_DEFINED )
2809 + {
2810 + nRet = BP_SUCCESS;
2811 + }
2812 + else
2813 + {
2814 + nRet = BP_VALUE_NOT_DEFINED;
2815 + }
2816 + }
2817 + else
2818 + {
2819 + *pusValue = BP_NOT_DEFINED;
2820 + nRet = BP_BOARD_ID_NOT_SET;
2821 + }
2822 +
2823 + return( nRet );
2824 +
2825 +} /* BpGetWirelessSesExtIntr */
2826 +
2827 +/**************************************************************************
2828 + * Name : BpGetWirelessSesLedGpio
2829 + *
2830 + * Description: This function returns the GPIO pin assignment for the Wireless
2831 + * Ses Led.
2832 + *
2833 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
2834 + * Led GPIO pin is returned in.
2835 + *
2836 + * Returns : BP_SUCCESS - Success, value is returned.
2837 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2838 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2839 + * for the board.
2840 + ***************************************************************************/
2841 +int BpGetWirelessSesLedGpio( unsigned short *pusValue )
2842 +{
2843 + int nRet;
2844 +
2845 + if( g_pCurrentBp )
2846 + {
2847 + *pusValue = g_pCurrentBp->usGpioLedSesWireless;
2848 +
2849 + if( g_pCurrentBp->usGpioLedSesWireless != BP_NOT_DEFINED )
2850 + {
2851 + nRet = BP_SUCCESS;
2852 + }
2853 + else
2854 + {
2855 + nRet = BP_VALUE_NOT_DEFINED;
2856 + }
2857 + }
2858 + else
2859 + {
2860 + *pusValue = BP_NOT_DEFINED;
2861 + nRet = BP_BOARD_ID_NOT_SET;
2862 + }
2863 +
2864 + return( nRet );
2865 +
2866 +} /* BpGetWirelessSesLedGpio */
2867 +
2868 +/**************************************************************************
2869 + * Name : BpGetUsbLedGpio
2870 + *
2871 + * Description: This function returns the GPIO pin assignment for the USB
2872 + * LED.
2873 + *
2874 + * Parameters : [OUT] pusValue - Address of short word that the USB LED
2875 + * GPIO pin is returned in.
2876 + *
2877 + * Returns : BP_SUCCESS - Success, value is returned.
2878 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2879 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2880 + * for the board.
2881 + ***************************************************************************/
2882 +int BpGetUsbLedGpio( unsigned short *pusValue )
2883 +{
2884 + int nRet;
2885 +
2886 + if( g_pCurrentBp )
2887 + {
2888 + *pusValue = g_pCurrentBp->usGpioLedUsb;
2889 +
2890 + if( g_pCurrentBp->usGpioLedUsb != BP_NOT_DEFINED )
2891 + {
2892 + nRet = BP_SUCCESS;
2893 + }
2894 + else
2895 + {
2896 + nRet = BP_VALUE_NOT_DEFINED;
2897 + }
2898 + }
2899 + else
2900 + {
2901 + *pusValue = BP_NOT_DEFINED;
2902 + nRet = BP_BOARD_ID_NOT_SET;
2903 + }
2904 +
2905 + return( nRet );
2906 +} /* BpGetUsbLedGpio */
2907 +
2908 +/**************************************************************************
2909 + * Name : BpGetHpnaLedGpio
2910 + *
2911 + * Description: This function returns the GPIO pin assignment for the HPNA
2912 + * LED.
2913 + *
2914 + * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
2915 + * GPIO pin is returned in.
2916 + *
2917 + * Returns : BP_SUCCESS - Success, value is returned.
2918 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2919 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2920 + * for the board.
2921 + ***************************************************************************/
2922 +int BpGetHpnaLedGpio( unsigned short *pusValue )
2923 +{
2924 + int nRet;
2925 +
2926 + if( g_pCurrentBp )
2927 + {
2928 + *pusValue = g_pCurrentBp->usGpioLedHpna;
2929 +
2930 + if( g_pCurrentBp->usGpioLedHpna != BP_NOT_DEFINED )
2931 + {
2932 + nRet = BP_SUCCESS;
2933 + }
2934 + else
2935 + {
2936 + nRet = BP_VALUE_NOT_DEFINED;
2937 + }
2938 + }
2939 + else
2940 + {
2941 + *pusValue = BP_NOT_DEFINED;
2942 + nRet = BP_BOARD_ID_NOT_SET;
2943 + }
2944 +
2945 + return( nRet );
2946 +} /* BpGetHpnaLedGpio */
2947 +
2948 +/**************************************************************************
2949 + * Name : BpGetWanDataLedGpio
2950 + *
2951 + * Description: This function returns the GPIO pin assignment for the WAN Data
2952 + * LED.
2953 + *
2954 + * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
2955 + * GPIO pin is returned in.
2956 + *
2957 + * Returns : BP_SUCCESS - Success, value is returned.
2958 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2959 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2960 + * for the board.
2961 + ***************************************************************************/
2962 +int BpGetWanDataLedGpio( unsigned short *pusValue )
2963 +{
2964 + int nRet;
2965 +
2966 + if( g_pCurrentBp )
2967 + {
2968 + *pusValue = g_pCurrentBp->usGpioLedWanData;
2969 +
2970 + if( g_pCurrentBp->usGpioLedWanData != BP_NOT_DEFINED )
2971 + {
2972 + nRet = BP_SUCCESS;
2973 + }
2974 + else
2975 + {
2976 + nRet = BP_VALUE_NOT_DEFINED;
2977 + }
2978 + }
2979 + else
2980 + {
2981 + *pusValue = BP_NOT_DEFINED;
2982 + nRet = BP_BOARD_ID_NOT_SET;
2983 + }
2984 +
2985 + return( nRet );
2986 +} /* BpGetWanDataLedGpio */
2987 +
2988 +/**************************************************************************
2989 + * Name : BpGetPppLedGpio
2990 + *
2991 + * Description: This function returns the GPIO pin assignment for the PPP
2992 + * LED.
2993 + *
2994 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
2995 + * GPIO pin is returned in.
2996 + *
2997 + * Returns : BP_SUCCESS - Success, value is returned.
2998 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2999 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3000 + * for the board.
3001 + ***************************************************************************/
3002 +int BpGetPppLedGpio( unsigned short *pusValue )
3003 +{
3004 + int nRet;
3005 +
3006 + if( g_pCurrentBp )
3007 + {
3008 + *pusValue = g_pCurrentBp->usGpioLedPpp;
3009 +
3010 + if( g_pCurrentBp->usGpioLedPpp != BP_NOT_DEFINED )
3011 + {
3012 + nRet = BP_SUCCESS;
3013 + }
3014 + else
3015 + {
3016 + nRet = BP_VALUE_NOT_DEFINED;
3017 + }
3018 + }
3019 + else
3020 + {
3021 + *pusValue = BP_NOT_DEFINED;
3022 + nRet = BP_BOARD_ID_NOT_SET;
3023 + }
3024 +
3025 + return( nRet );
3026 +} /* BpGetPppLedGpio */
3027 +
3028 +/**************************************************************************
3029 + * Name : BpGetPppFailLedGpio
3030 + *
3031 + * Description: This function returns the GPIO pin assignment for the PPP
3032 + * LED that is used when there is a PPP connection failure.
3033 + *
3034 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
3035 + * GPIO pin is returned in.
3036 + *
3037 + * Returns : BP_SUCCESS - Success, value is returned.
3038 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3039 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3040 + * for the board.
3041 + ***************************************************************************/
3042 +int BpGetPppFailLedGpio( unsigned short *pusValue )
3043 +{
3044 + int nRet;
3045 +
3046 + if( g_pCurrentBp )
3047 + {
3048 + *pusValue = g_pCurrentBp->usGpioLedPppFail;
3049 +
3050 + if( g_pCurrentBp->usGpioLedPppFail != BP_NOT_DEFINED )
3051 + {
3052 + nRet = BP_SUCCESS;
3053 + }
3054 + else
3055 + {
3056 + nRet = BP_VALUE_NOT_DEFINED;
3057 + }
3058 + }
3059 + else
3060 + {
3061 + *pusValue = BP_NOT_DEFINED;
3062 + nRet = BP_BOARD_ID_NOT_SET;
3063 + }
3064 +
3065 + return( nRet );
3066 +} /* BpGetPppFailLedGpio */
3067 +
3068 +/**************************************************************************
3069 + * Name : BpGetBootloaderPowerOnLedGpio
3070 + *
3071 + * Description: This function returns the GPIO pin assignment for the power
3072 + * on LED that is set by the bootloader.
3073 + *
3074 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
3075 + * GPIO pin is returned in.
3076 + *
3077 + * Returns : BP_SUCCESS - Success, value is returned.
3078 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3079 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3080 + * for the board.
3081 + ***************************************************************************/
3082 +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue )
3083 +{
3084 + int nRet;
3085 +
3086 + if( g_pCurrentBp )
3087 + {
3088 + *pusValue = g_pCurrentBp->usGpioLedBlPowerOn;
3089 +
3090 + if( g_pCurrentBp->usGpioLedBlPowerOn != BP_NOT_DEFINED )
3091 + {
3092 + nRet = BP_SUCCESS;
3093 + }
3094 + else
3095 + {
3096 + nRet = BP_VALUE_NOT_DEFINED;
3097 + }
3098 + }
3099 + else
3100 + {
3101 + *pusValue = BP_NOT_DEFINED;
3102 + nRet = BP_BOARD_ID_NOT_SET;
3103 + }
3104 +
3105 + return( nRet );
3106 +} /* BpGetBootloaderPowerOn */
3107 +
3108 +/**************************************************************************
3109 + * Name : BpGetBootloaderAlarmLedGpio
3110 + *
3111 + * Description: This function returns the GPIO pin assignment for the alarm
3112 + * LED that is set by the bootloader.
3113 + *
3114 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
3115 + * GPIO pin is returned in.
3116 + *
3117 + * Returns : BP_SUCCESS - Success, value is returned.
3118 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3119 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3120 + * for the board.
3121 + ***************************************************************************/
3122 +int BpGetBootloaderAlarmLedGpio( unsigned short *pusValue )
3123 +{
3124 + int nRet;
3125 +
3126 + if( g_pCurrentBp )
3127 + {
3128 + *pusValue = g_pCurrentBp->usGpioLedBlAlarm;
3129 +
3130 + if( g_pCurrentBp->usGpioLedBlAlarm != BP_NOT_DEFINED )
3131 + {
3132 + nRet = BP_SUCCESS;
3133 + }
3134 + else
3135 + {
3136 + nRet = BP_VALUE_NOT_DEFINED;
3137 + }
3138 + }
3139 + else
3140 + {
3141 + *pusValue = BP_NOT_DEFINED;
3142 + nRet = BP_BOARD_ID_NOT_SET;
3143 + }
3144 +
3145 + return( nRet );
3146 +} /* BpGetBootloaderAlarmLedGpio */
3147 +
3148 +/**************************************************************************
3149 + * Name : BpGetBootloaderResetCfgLedGpio
3150 + *
3151 + * Description: This function returns the GPIO pin assignment for the reset
3152 + * configuration LED that is set by the bootloader.
3153 + *
3154 + * Parameters : [OUT] pusValue - Address of short word that the reset
3155 + * configuration LED GPIO pin is returned in.
3156 + *
3157 + * Returns : BP_SUCCESS - Success, value is returned.
3158 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3159 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3160 + * for the board.
3161 + ***************************************************************************/
3162 +int BpGetBootloaderResetCfgLedGpio( unsigned short *pusValue )
3163 +{
3164 + int nRet;
3165 +
3166 + if( g_pCurrentBp )
3167 + {
3168 + *pusValue = g_pCurrentBp->usGpioLedBlResetCfg;
3169 +
3170 + if( g_pCurrentBp->usGpioLedBlResetCfg != BP_NOT_DEFINED )
3171 + {
3172 + nRet = BP_SUCCESS;
3173 + }
3174 + else
3175 + {
3176 + nRet = BP_VALUE_NOT_DEFINED;
3177 + }
3178 + }
3179 + else
3180 + {
3181 + *pusValue = BP_NOT_DEFINED;
3182 + nRet = BP_BOARD_ID_NOT_SET;
3183 + }
3184 +
3185 + return( nRet );
3186 +} /* BpGetBootloaderResetCfgLedGpio */
3187 +
3188 +/**************************************************************************
3189 + * Name : BpGetBootloaderStopLedGpio
3190 + *
3191 + * Description: This function returns the GPIO pin assignment for the break
3192 + * into bootloader LED that is set by the bootloader.
3193 + *
3194 + * Parameters : [OUT] pusValue - Address of short word that the break into
3195 + * bootloader LED GPIO pin is returned in.
3196 + *
3197 + * Returns : BP_SUCCESS - Success, value is returned.
3198 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3199 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3200 + * for the board.
3201 + ***************************************************************************/
3202 +int BpGetBootloaderStopLedGpio( unsigned short *pusValue )
3203 +{
3204 + int nRet;
3205 +
3206 + if( g_pCurrentBp )
3207 + {
3208 + *pusValue = g_pCurrentBp->usGpioLedBlStop;
3209 +
3210 + if( g_pCurrentBp->usGpioLedBlStop != BP_NOT_DEFINED )
3211 + {
3212 + nRet = BP_SUCCESS;
3213 + }
3214 + else
3215 + {
3216 + nRet = BP_VALUE_NOT_DEFINED;
3217 + }
3218 + }
3219 + else
3220 + {
3221 + *pusValue = BP_NOT_DEFINED;
3222 + nRet = BP_BOARD_ID_NOT_SET;
3223 + }
3224 +
3225 + return( nRet );
3226 +} /* BpGetBootloaderStopLedGpio */
3227 +
3228 +/**************************************************************************
3229 + * Name : BpGetVoipLedGpio
3230 + *
3231 + * Description: This function returns the GPIO pin assignment for the VOIP
3232 + * LED.
3233 + *
3234 + * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
3235 + * GPIO pin is returned in.
3236 + *
3237 + * Returns : BP_SUCCESS - Success, value is returned.
3238 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3239 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3240 + * for the board.
3241 + *
3242 + * Note : The VoIP structure would allow for having one LED per DSP
3243 + * however, the board initialization function assumes only one
3244 + * LED per functionality (ie one LED for VoIP). Therefore in
3245 + * order to keep this tidy and simple we do not make usage of the
3246 + * one-LED-per-DSP function. Instead, we assume that the LED for
3247 + * VoIP is unique and associated with DSP 0 (always present on
3248 + * any VoIP platform). If changing this to a LED-per-DSP function
3249 + * then one need to update the board initialization driver in
3250 + * bcmdrivers\opensource\char\board\bcm963xx\impl1
3251 + ***************************************************************************/
3252 +int BpGetVoipLedGpio( unsigned short *pusValue )
3253 +{
3254 + int nRet;
3255 +
3256 + if( g_pCurrentBp )
3257 + {
3258 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( 0 );
3259 +
3260 + if( pDspInfo )
3261 + {
3262 + *pusValue = pDspInfo->usGpioLedVoip;
3263 +
3264 + if( *pusValue != BP_NOT_DEFINED )
3265 + {
3266 + nRet = BP_SUCCESS;
3267 + }
3268 + else
3269 + {
3270 + nRet = BP_VALUE_NOT_DEFINED;
3271 + }
3272 + }
3273 + else
3274 + {
3275 + *pusValue = BP_NOT_DEFINED;
3276 + nRet = BP_BOARD_ID_NOT_FOUND;
3277 + }
3278 + }
3279 + else
3280 + {
3281 + *pusValue = BP_NOT_DEFINED;
3282 + nRet = BP_BOARD_ID_NOT_SET;
3283 + }
3284 +
3285 + return( nRet );
3286 +} /* BpGetVoipLedGpio */
3287 +
3288 +/**************************************************************************
3289 + * Name : BpGetWirelessExtIntr
3290 + *
3291 + * Description: This function returns the Wireless external interrupt number.
3292 + *
3293 + * Parameters : [OUT] pulValue - Address of short word that the wireless
3294 + * external interrupt number is returned in.
3295 + *
3296 + * Returns : BP_SUCCESS - Success, value is returned.
3297 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3298 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3299 + * for the board.
3300 + ***************************************************************************/
3301 +int BpGetWirelessExtIntr( unsigned long *pulValue )
3302 +{
3303 + int nRet;
3304 +
3305 + if( g_pCurrentBp )
3306 + {
3307 + *pulValue = g_pCurrentBp->usExtIntrWireless;
3308 +
3309 + if( g_pCurrentBp->usExtIntrWireless != BP_NOT_DEFINED )
3310 + {
3311 + nRet = BP_SUCCESS;
3312 + }
3313 + else
3314 + {
3315 + nRet = BP_VALUE_NOT_DEFINED;
3316 + }
3317 + }
3318 + else
3319 + {
3320 + *pulValue = BP_NOT_DEFINED;
3321 + nRet = BP_BOARD_ID_NOT_SET;
3322 + }
3323 +
3324 + return( nRet );
3325 +} /* BpGetWirelessExtIntr */
3326 +
3327 +/**************************************************************************
3328 + * Name : BpGetAdslDyingGaspExtIntr
3329 + *
3330 + * Description: This function returns the ADSL Dying Gasp external interrupt
3331 + * number.
3332 + *
3333 + * Parameters : [OUT] pulValue - Address of short word that the ADSL Dying Gasp
3334 + * external interrupt number is returned in.
3335 + *
3336 + * Returns : BP_SUCCESS - Success, value is returned.
3337 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3338 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3339 + * for the board.
3340 + ***************************************************************************/
3341 +int BpGetAdslDyingGaspExtIntr( unsigned long *pulValue )
3342 +{
3343 + int nRet;
3344 +
3345 + if( g_pCurrentBp )
3346 + {
3347 + *pulValue = g_pCurrentBp->usExtIntrAdslDyingGasp;
3348 +
3349 + if( g_pCurrentBp->usExtIntrAdslDyingGasp != BP_NOT_DEFINED )
3350 + {
3351 + nRet = BP_SUCCESS;
3352 + }
3353 + else
3354 + {
3355 + nRet = BP_VALUE_NOT_DEFINED;
3356 + }
3357 + }
3358 + else
3359 + {
3360 + *pulValue = BP_NOT_DEFINED;
3361 + nRet = BP_BOARD_ID_NOT_SET;
3362 + }
3363 +
3364 + return( nRet );
3365 +} /* BpGetAdslDyingGaspExtIntr */
3366 +
3367 +/**************************************************************************
3368 + * Name : BpGetVoipExtIntr
3369 + *
3370 + * Description: This function returns the VOIP external interrupt number.
3371 + *
3372 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
3373 + * external interrupt number is returned in.
3374 + * [IN] dspNum - Address of the DSP to query.
3375 + *
3376 + * Returns : BP_SUCCESS - Success, value is returned.
3377 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3378 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3379 + * for the board.
3380 + ***************************************************************************/
3381 +int BpGetVoipExtIntr( unsigned char dspNum, unsigned long *pulValue )
3382 +{
3383 + int nRet;
3384 +
3385 + if( g_pCurrentBp )
3386 + {
3387 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
3388 +
3389 + if( pDspInfo )
3390 + {
3391 + *pulValue = pDspInfo->usExtIntrVoip;
3392 +
3393 + if( *pulValue != BP_NOT_DEFINED )
3394 + {
3395 + nRet = BP_SUCCESS;
3396 + }
3397 + else
3398 + {
3399 + nRet = BP_VALUE_NOT_DEFINED;
3400 + }
3401 + }
3402 + else
3403 + {
3404 + *pulValue = BP_NOT_DEFINED;
3405 + nRet = BP_BOARD_ID_NOT_FOUND;
3406 + }
3407 + }
3408 + else
3409 + {
3410 + *pulValue = BP_NOT_DEFINED;
3411 + nRet = BP_BOARD_ID_NOT_SET;
3412 + }
3413 +
3414 + return( nRet );
3415 +} /* BpGetVoipExtIntr */
3416 +
3417 +/**************************************************************************
3418 + * Name : BpGetHpnaExtIntr
3419 + *
3420 + * Description: This function returns the HPNA external interrupt number.
3421 + *
3422 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
3423 + * external interrupt number is returned in.
3424 + *
3425 + * Returns : BP_SUCCESS - Success, value is returned.
3426 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3427 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3428 + * for the board.
3429 + ***************************************************************************/
3430 +int BpGetHpnaExtIntr( unsigned long *pulValue )
3431 +{
3432 + int nRet;
3433 +
3434 + if( g_pCurrentBp )
3435 + {
3436 + *pulValue = g_pCurrentBp->usExtIntrHpna;
3437 +
3438 + if( g_pCurrentBp->usExtIntrHpna != BP_NOT_DEFINED )
3439 + {
3440 + nRet = BP_SUCCESS;
3441 + }
3442 + else
3443 + {
3444 + nRet = BP_VALUE_NOT_DEFINED;
3445 + }
3446 + }
3447 + else
3448 + {
3449 + *pulValue = BP_NOT_DEFINED;
3450 + nRet = BP_BOARD_ID_NOT_SET;
3451 + }
3452 +
3453 + return( nRet );
3454 +} /* BpGetHpnaExtIntr */
3455 +
3456 +/**************************************************************************
3457 + * Name : BpGetHpnaChipSelect
3458 + *
3459 + * Description: This function returns the HPNA chip select number.
3460 + *
3461 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
3462 + * chip select number is returned in.
3463 + *
3464 + * Returns : BP_SUCCESS - Success, value is returned.
3465 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3466 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3467 + * for the board.
3468 + ***************************************************************************/
3469 +int BpGetHpnaChipSelect( unsigned long *pulValue )
3470 +{
3471 + int nRet;
3472 +
3473 + if( g_pCurrentBp )
3474 + {
3475 + *pulValue = g_pCurrentBp->usCsHpna;
3476 +
3477 + if( g_pCurrentBp->usCsHpna != BP_NOT_DEFINED )
3478 + {
3479 + nRet = BP_SUCCESS;
3480 + }
3481 + else
3482 + {
3483 + nRet = BP_VALUE_NOT_DEFINED;
3484 + }
3485 + }
3486 + else
3487 + {
3488 + *pulValue = BP_NOT_DEFINED;
3489 + nRet = BP_BOARD_ID_NOT_SET;
3490 + }
3491 +
3492 + return( nRet );
3493 +} /* BpGetHpnaChipSelect */
3494 +
3495 +/**************************************************************************
3496 + * Name : BpGetVoipChipSelect
3497 + *
3498 + * Description: This function returns the VOIP chip select number.
3499 + *
3500 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
3501 + * chip select number is returned in.
3502 + * [IN] dspNum - Address of the DSP to query.
3503 + *
3504 + * Returns : BP_SUCCESS - Success, value is returned.
3505 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3506 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3507 + * for the board.
3508 + ***************************************************************************/
3509 +int BpGetVoipChipSelect( unsigned char dspNum, unsigned long *pulValue )
3510 +{
3511 + int nRet;
3512 +
3513 + if( g_pCurrentBp )
3514 + {
3515 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
3516 +
3517 + if( pDspInfo )
3518 + {
3519 + *pulValue = pDspInfo->usCsVoip;
3520 +
3521 + if( *pulValue != BP_NOT_DEFINED )
3522 + {
3523 + nRet = BP_SUCCESS;
3524 + }
3525 + else
3526 + {
3527 + nRet = BP_VALUE_NOT_DEFINED;
3528 + }
3529 + }
3530 + else
3531 + {
3532 + *pulValue = BP_NOT_DEFINED;
3533 + nRet = BP_BOARD_ID_NOT_FOUND;
3534 + }
3535 + }
3536 + else
3537 + {
3538 + *pulValue = BP_NOT_DEFINED;
3539 + nRet = BP_BOARD_ID_NOT_SET;
3540 + }
3541 +
3542 + return( nRet );
3543 +} /* BpGetVoipChipSelect */
3544 +
3545 diff -urN linux.old/arch/mips/bcm963xx/boardparms.h linux.dev/arch/mips/bcm963xx/boardparms.h
3546 --- linux.old/arch/mips/bcm963xx/boardparms.h 1970-01-01 01:00:00.000000000 +0100
3547 +++ linux.dev/arch/mips/bcm963xx/boardparms.h 2006-08-25 00:39:38.000000000 +0200
3548 @@ -0,0 +1,758 @@
3549 +/*
3550 +<:copyright-gpl
3551 +
3552 + Copyright 2003 Broadcom Corp. All Rights Reserved.
3553 +
3554 + This program is free software; you can distribute it and/or modify it
3555 + under the terms of the GNU General Public License (Version 2) as
3556 + published by the Free Software Foundation.
3557 +
3558 + This program is distributed in the hope it will be useful, but WITHOUT
3559 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3560 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3561 + for more details.
3562 +
3563 + You should have received a copy of the GNU General Public License along
3564 + with this program; if not, write to the Free Software Foundation, Inc.,
3565 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
3566 +
3567 +:>
3568 +*/
3569 +/**************************************************************************
3570 + * File Name : boardparms.h
3571 + *
3572 + * Description: This file contains definitions and function prototypes for
3573 + * the BCM63xx board parameter access functions.
3574 + *
3575 + * Updates : 07/14/2003 Created.
3576 + ***************************************************************************/
3577 +
3578 +#if !defined(_BOARDPARMS_H)
3579 +#define _BOARDPARMS_H
3580 +
3581 +/* Return codes. */
3582 +#define BP_SUCCESS 0
3583 +#define BP_BOARD_ID_NOT_FOUND 1
3584 +#define BP_VALUE_NOT_DEFINED 2
3585 +#define BP_BOARD_ID_NOT_SET 3
3586 +
3587 +/* Values for BpGetSdramSize. */
3588 +#define BP_MEMORY_8MB_1_CHIP 0
3589 +#define BP_MEMORY_16MB_1_CHIP 1
3590 +#define BP_MEMORY_32MB_1_CHIP 2
3591 +#define BP_MEMORY_64MB_2_CHIP 3
3592 +#define BP_MEMORY_32MB_2_CHIP 4
3593 +#define BP_MEMORY_16MB_2_CHIP 5
3594 +
3595 +/* Values for EthernetMacInfo PhyType. */
3596 +#define BP_ENET_NO_PHY 0
3597 +#define BP_ENET_INTERNAL_PHY 1
3598 +#define BP_ENET_EXTERNAL_PHY 2
3599 +#define BP_ENET_EXTERNAL_SWITCH 3
3600 +
3601 +/* Values for EthernetMacInfo Configuration type. */
3602 +#define BP_ENET_CONFIG_MDIO 0 /* Internal PHY, External PHY, Switch+(no GPIO, no SPI, no MDIO Pseudo phy */
3603 +#define BP_ENET_CONFIG_GPIO 1 /* Bcm96345GW board + Bcm5325M/E */
3604 +#define BP_ENET_CONFIG_MDIO_PSEUDO_PHY 2 /* Bcm96348GW board + Bcm5325E */
3605 +#define BP_ENET_CONFIG_SPI_SSB_0 3 /* Bcm96348GW board + Bcm5325M/E */
3606 +#define BP_ENET_CONFIG_SPI_SSB_1 4 /* Bcm96348GW board + Bcm5325M/E */
3607 +#define BP_ENET_CONFIG_SPI_SSB_2 5 /* Bcm96348GW board + Bcm5325M/E */
3608 +#define BP_ENET_CONFIG_SPI_SSB_3 6 /* Bcm96348GW board + Bcm5325M/E */
3609 +
3610 +/* Values for EthernetMacInfo Reverse MII. */
3611 +#define BP_ENET_NO_REVERSE_MII 0
3612 +#define BP_ENET_REVERSE_MII 1
3613 +
3614 +/* Values for VoIPDSPInfo DSPType. */
3615 +#define BP_VOIP_NO_DSP 0
3616 +#define BP_VOIP_DSP 1
3617 +
3618 +
3619 +/* Values for GPIO pin assignments (AH = Active High, AL = Active Low). */
3620 +#define BP_ACTIVE_MASK 0x8000
3621 +#define BP_ACTIVE_HIGH 0x0000
3622 +#define BP_ACTIVE_LOW 0x8000
3623 +#define BP_GPIO_0_AH (0 | BP_ACTIVE_HIGH)
3624 +#define BP_GPIO_0_AL (0 | BP_ACTIVE_LOW)
3625 +#define BP_GPIO_1_AH (1 | BP_ACTIVE_HIGH)
3626 +#define BP_GPIO_1_AL (1 | BP_ACTIVE_LOW)
3627 +#define BP_GPIO_2_AH (2 | BP_ACTIVE_HIGH)
3628 +#define BP_GPIO_2_AL (2 | BP_ACTIVE_LOW)
3629 +#define BP_GPIO_3_AH (3 | BP_ACTIVE_HIGH)
3630 +#define BP_GPIO_3_AL (3 | BP_ACTIVE_LOW)
3631 +#define BP_GPIO_4_AH (4 | BP_ACTIVE_HIGH)
3632 +#define BP_GPIO_4_AL (4 | BP_ACTIVE_LOW)
3633 +#define BP_GPIO_5_AH (5 | BP_ACTIVE_HIGH)
3634 +#define BP_GPIO_5_AL (5 | BP_ACTIVE_LOW)
3635 +#define BP_GPIO_6_AH (6 | BP_ACTIVE_HIGH)
3636 +#define BP_GPIO_6_AL (6 | BP_ACTIVE_LOW)
3637 +#define BP_GPIO_7_AH (7 | BP_ACTIVE_HIGH)
3638 +#define BP_GPIO_7_AL (7 | BP_ACTIVE_LOW)
3639 +#define BP_GPIO_8_AH (8 | BP_ACTIVE_HIGH)
3640 +#define BP_GPIO_8_AL (8 | BP_ACTIVE_LOW)
3641 +#define BP_GPIO_9_AH (9 | BP_ACTIVE_HIGH)
3642 +#define BP_GPIO_9_AL (9 | BP_ACTIVE_LOW)
3643 +#define BP_GPIO_10_AH (10 | BP_ACTIVE_HIGH)
3644 +#define BP_GPIO_10_AL (10 | BP_ACTIVE_LOW)
3645 +#define BP_GPIO_11_AH (11 | BP_ACTIVE_HIGH)
3646 +#define BP_GPIO_11_AL (11 | BP_ACTIVE_LOW)
3647 +#define BP_GPIO_12_AH (12 | BP_ACTIVE_HIGH)
3648 +#define BP_GPIO_12_AL (12 | BP_ACTIVE_LOW)
3649 +#define BP_GPIO_13_AH (13 | BP_ACTIVE_HIGH)
3650 +#define BP_GPIO_13_AL (13 | BP_ACTIVE_LOW)
3651 +#define BP_GPIO_14_AH (14 | BP_ACTIVE_HIGH)
3652 +#define BP_GPIO_14_AL (14 | BP_ACTIVE_LOW)
3653 +#define BP_GPIO_15_AH (15 | BP_ACTIVE_HIGH)
3654 +#define BP_GPIO_15_AL (15 | BP_ACTIVE_LOW)
3655 +#define BP_GPIO_16_AH (16 | BP_ACTIVE_HIGH)
3656 +#define BP_GPIO_16_AL (16 | BP_ACTIVE_LOW)
3657 +#define BP_GPIO_17_AH (17 | BP_ACTIVE_HIGH)
3658 +#define BP_GPIO_17_AL (17 | BP_ACTIVE_LOW)
3659 +#define BP_GPIO_18_AH (18 | BP_ACTIVE_HIGH)
3660 +#define BP_GPIO_18_AL (18 | BP_ACTIVE_LOW)
3661 +#define BP_GPIO_19_AH (19 | BP_ACTIVE_HIGH)
3662 +#define BP_GPIO_19_AL (19 | BP_ACTIVE_LOW)
3663 +#define BP_GPIO_20_AH (20 | BP_ACTIVE_HIGH)
3664 +#define BP_GPIO_20_AL (20 | BP_ACTIVE_LOW)
3665 +#define BP_GPIO_21_AH (21 | BP_ACTIVE_HIGH)
3666 +#define BP_GPIO_21_AL (21 | BP_ACTIVE_LOW)
3667 +#define BP_GPIO_22_AH (22 | BP_ACTIVE_HIGH)
3668 +#define BP_GPIO_22_AL (22 | BP_ACTIVE_LOW)
3669 +#define BP_GPIO_23_AH (23 | BP_ACTIVE_HIGH)
3670 +#define BP_GPIO_23_AL (23 | BP_ACTIVE_LOW)
3671 +#define BP_GPIO_24_AH (24 | BP_ACTIVE_HIGH)
3672 +#define BP_GPIO_24_AL (24 | BP_ACTIVE_LOW)
3673 +#define BP_GPIO_25_AH (25 | BP_ACTIVE_HIGH)
3674 +#define BP_GPIO_25_AL (25 | BP_ACTIVE_LOW)
3675 +#define BP_GPIO_26_AH (26 | BP_ACTIVE_HIGH)
3676 +#define BP_GPIO_26_AL (26 | BP_ACTIVE_LOW)
3677 +#define BP_GPIO_27_AH (27 | BP_ACTIVE_HIGH)
3678 +#define BP_GPIO_27_AL (27 | BP_ACTIVE_LOW)
3679 +#define BP_GPIO_28_AH (28 | BP_ACTIVE_HIGH)
3680 +#define BP_GPIO_28_AL (28 | BP_ACTIVE_LOW)
3681 +#define BP_GPIO_29_AH (29 | BP_ACTIVE_HIGH)
3682 +#define BP_GPIO_29_AL (29 | BP_ACTIVE_LOW)
3683 +#define BP_GPIO_30_AH (30 | BP_ACTIVE_HIGH)
3684 +#define BP_GPIO_30_AL (30 | BP_ACTIVE_LOW)
3685 +#define BP_GPIO_31_AH (31 | BP_ACTIVE_HIGH)
3686 +#define BP_GPIO_31_AL (31 | BP_ACTIVE_LOW)
3687 +#define BP_GPIO_32_AH (32 | BP_ACTIVE_HIGH)
3688 +#define BP_GPIO_32_AL (32 | BP_ACTIVE_LOW)
3689 +#define BP_GPIO_33_AH (33 | BP_ACTIVE_HIGH)
3690 +#define BP_GPIO_33_AL (33 | BP_ACTIVE_LOW)
3691 +#define BP_GPIO_34_AH (34 | BP_ACTIVE_HIGH)
3692 +#define BP_GPIO_34_AL (34 | BP_ACTIVE_LOW)
3693 +#define BP_GPIO_35_AH (35 | BP_ACTIVE_HIGH)
3694 +#define BP_GPIO_35_AL (35 | BP_ACTIVE_LOW)
3695 +#define BP_GPIO_36_AH (36 | BP_ACTIVE_HIGH)
3696 +#define BP_GPIO_36_AL (36 | BP_ACTIVE_LOW)
3697 +
3698 +/* Values for external interrupt assignments. */
3699 +#define BP_EXT_INTR_0 0
3700 +#define BP_EXT_INTR_1 1
3701 +#define BP_EXT_INTR_2 2
3702 +#define BP_EXT_INTR_3 3
3703 +
3704 +/* Values for chip select assignments. */
3705 +#define BP_CS_0 0
3706 +#define BP_CS_1 1
3707 +#define BP_CS_2 2
3708 +#define BP_CS_3 3
3709 +
3710 +/* Value for GPIO and external interrupt fields that are not used. */
3711 +#define BP_NOT_DEFINED 0xffff
3712 +#define BP_HW_DEFINED 0xfff0
3713 +#define BP_UNEQUIPPED 0xfff1
3714 +
3715 +/* Maximum size of the board id string. */
3716 +#define BP_BOARD_ID_LEN 16
3717 +
3718 +/* Maximum number of Ethernet MACs. */
3719 +#define BP_MAX_ENET_MACS 2
3720 +
3721 +/* Maximum number of VoIP DSPs. */
3722 +#define BP_MAX_VOIP_DSP 2
3723 +
3724 +/* Wireless Antenna Settings. */
3725 +#define BP_WLAN_ANT_MAIN 0
3726 +#define BP_WLAN_ANT_AUX 1
3727 +#define BP_WLAN_ANT_BOTH 3
3728 +
3729 +#if !defined(__ASSEMBLER__)
3730 +
3731 +/* Information about an Ethernet MAC. If ucPhyType is BP_ENET_NO_PHY,
3732 + * then the other fields are not valid.
3733 + */
3734 +typedef struct EthernetMacInfo
3735 +{
3736 + unsigned char ucPhyType; /* BP_ENET_xxx */
3737 + unsigned char ucPhyAddress; /* 0 to 31 */
3738 + unsigned short usGpioPhySpiSck; /* GPIO pin or not defined */
3739 + unsigned short usGpioPhySpiSs; /* GPIO pin or not defined */
3740 + unsigned short usGpioPhySpiMosi; /* GPIO pin or not defined */
3741 + unsigned short usGpioPhySpiMiso; /* GPIO pin or not defined */
3742 + unsigned short usGpioPhyReset; /* GPIO pin or not defined (96348LV) */
3743 + unsigned short numSwitchPorts; /* Number of PHY ports */
3744 + unsigned short usConfigType; /* Configuration type */
3745 + unsigned short usReverseMii; /* Reverse MII */
3746 +} ETHERNET_MAC_INFO, *PETHERNET_MAC_INFO;
3747 +
3748 +
3749 +/* Information about VoIP DSPs. If ucDspType is BP_VOIP_NO_DSP,
3750 + * then the other fields are not valid.
3751 + */
3752 +typedef struct VoIPDspInfo
3753 +{
3754 + unsigned char ucDspType;
3755 + unsigned char ucDspAddress;
3756 + unsigned short usExtIntrVoip;
3757 + unsigned short usGpioVoipReset;
3758 + unsigned short usGpioVoipIntr;
3759 + unsigned short usGpioLedVoip;
3760 + unsigned short usCsVoip;
3761 +
3762 +} VOIP_DSP_INFO;
3763 +
3764 +
3765 +/**************************************************************************
3766 + * Name : BpSetBoardId
3767 + *
3768 + * Description: This function find the BOARD_PARAMETERS structure for the
3769 + * specified board id string and assigns it to a global, static
3770 + * variable.
3771 + *
3772 + * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
3773 + *
3774 + * Returns : BP_SUCCESS - Success, value is returned.
3775 + * BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
3776 + * have a board parameters configuration record.
3777 + ***************************************************************************/
3778 +int BpSetBoardId( char *pszBoardId );
3779 +
3780 +/**************************************************************************
3781 + * Name : BpGetBoardIds
3782 + *
3783 + * Description: This function returns all of the supported board id strings.
3784 + *
3785 + * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
3786 + * strings are returned in. Each id starts at BP_BOARD_ID_LEN
3787 + * boundary.
3788 + * [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
3789 + * were allocated in pszBoardIds.
3790 + *
3791 + * Returns : Number of board id strings returned.
3792 + ***************************************************************************/
3793 +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize );
3794 +
3795 +/**************************************************************************
3796 + * Name : BpGetEthernetMacInfo
3797 + *
3798 + * Description: This function returns all of the supported board id strings.
3799 + *
3800 + * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
3801 + * buffers.
3802 + * [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
3803 + * are pointed to by pEnetInfos.
3804 + *
3805 + * Returns : BP_SUCCESS - Success, value is returned.
3806 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3807 + ***************************************************************************/
3808 +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos );
3809 +
3810 +/**************************************************************************
3811 + * Name : BpGetSdramSize
3812 + *
3813 + * Description: This function returns a constant that describees the board's
3814 + * SDRAM type and size.
3815 + *
3816 + * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
3817 + * is returned in.
3818 + *
3819 + * Returns : BP_SUCCESS - Success, value is returned.
3820 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3821 + ***************************************************************************/
3822 +int BpGetSdramSize( unsigned long *pulSdramSize );
3823 +
3824 +/**************************************************************************
3825 + * Name : BpGetPsiSize
3826 + *
3827 + * Description: This function returns the persistent storage size in K bytes.
3828 + *
3829 + * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
3830 + * storage size is returned in.
3831 + *
3832 + * Returns : BP_SUCCESS - Success, value is returned.
3833 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3834 + ***************************************************************************/
3835 +int BpGetPsiSize( unsigned long *pulPsiSize );
3836 +
3837 +/**************************************************************************
3838 + * Name : BpGetRj11InnerOuterPairGpios
3839 + *
3840 + * Description: This function returns the GPIO pin assignments for changing
3841 + * between the RJ11 inner pair and RJ11 outer pair.
3842 + *
3843 + * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
3844 + * GPIO pin is returned in.
3845 + * [OUT] pusOuter - Address of short word that the RJ11 outer pair
3846 + * GPIO pin is returned in.
3847 + *
3848 + * Returns : BP_SUCCESS - Success, values are returned.
3849 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3850 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3851 + * for the board.
3852 + ***************************************************************************/
3853 +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
3854 + unsigned short *pusOuter );
3855 +
3856 +/**************************************************************************
3857 + * Name : BpGetPressAndHoldResetGpio
3858 + *
3859 + * Description: This function returns the GPIO pin assignment for the press
3860 + * and hold reset button.
3861 + *
3862 + * Parameters : [OUT] pusValue - Address of short word that the press and hold
3863 + * reset button GPIO pin is returned in.
3864 + *
3865 + * Returns : BP_SUCCESS - Success, value is returned.
3866 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3867 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3868 + * for the board.
3869 + ***************************************************************************/
3870 +int BpGetPressAndHoldResetGpio( unsigned short *pusValue );
3871 +
3872 +/**************************************************************************
3873 + * Name : BpGetVoipResetGpio
3874 + *
3875 + * Description: This function returns the GPIO pin assignment for the VOIP
3876 + * Reset operation.
3877 + *
3878 + * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
3879 + * GPIO pin is returned in.
3880 + * [IN] dspNum - Address of the DSP to query.
3881 + *
3882 + * Returns : BP_SUCCESS - Success, value is returned.
3883 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3884 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3885 + * for the board.
3886 + ***************************************************************************/
3887 +int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue );
3888 +
3889 +/**************************************************************************
3890 + * Name : BpGetVoipIntrGpio
3891 + *
3892 + * Description: This function returns the GPIO pin assignment for VoIP interrupt.
3893 + *
3894 + * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
3895 + * GPIO pin is returned in.
3896 + * [IN] dspNum - Address of the DSP to query.
3897 + *
3898 + * Returns : BP_SUCCESS - Success, value is returned.
3899 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3900 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3901 + * for the board.
3902 + ***************************************************************************/
3903 +int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue );
3904 +
3905 +/**************************************************************************
3906 + * Name : BpGetPcmciaResetGpio
3907 + *
3908 + * Description: This function returns the GPIO pin assignment for the PCMCIA
3909 + * Reset operation.
3910 + *
3911 + * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
3912 + * GPIO pin is returned in.
3913 + *
3914 + * Returns : BP_SUCCESS - Success, value is returned.
3915 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3916 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3917 + * for the board.
3918 + ***************************************************************************/
3919 +int BpGetPcmciaResetGpio( unsigned short *pusValue );
3920 +
3921 +/**************************************************************************
3922 + * Name : BpGetUartRtsCtsGpios
3923 + *
3924 + * Description: This function returns the GPIO pin assignments for RTS and CTS
3925 + * UART signals.
3926 + *
3927 + * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
3928 + * pin is returned in.
3929 + * [OUT] pusCts - Address of short word that the UART CTS GPIO
3930 + * pin is returned in.
3931 + *
3932 + * Returns : BP_SUCCESS - Success, values are returned.
3933 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3934 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3935 + * for the board.
3936 + ***************************************************************************/
3937 +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts );
3938 +
3939 +/**************************************************************************
3940 + * Name : BpGetAdslLedGpio
3941 + *
3942 + * Description: This function returns the GPIO pin assignment for the ADSL
3943 + * LED.
3944 + *
3945 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
3946 + * GPIO pin is returned in.
3947 + *
3948 + * Returns : BP_SUCCESS - Success, value is returned.
3949 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3950 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3951 + * for the board.
3952 + ***************************************************************************/
3953 +int BpGetAdslLedGpio( unsigned short *pusValue );
3954 +
3955 +/**************************************************************************
3956 + * Name : BpGetAdslFailLedGpio
3957 + *
3958 + * Description: This function returns the GPIO pin assignment for the ADSL
3959 + * LED that is used when there is a DSL connection failure.
3960 + *
3961 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
3962 + * GPIO pin is returned in.
3963 + *
3964 + * Returns : BP_SUCCESS - Success, value is returned.
3965 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3966 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3967 + * for the board.
3968 + ***************************************************************************/
3969 +int BpGetAdslFailLedGpio( unsigned short *pusValue );
3970 +
3971 +/**************************************************************************
3972 + * Name : BpGetWirelessLedGpio
3973 + *
3974 + * Description: This function returns the GPIO pin assignment for the Wireless
3975 + * LED.
3976 + *
3977 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
3978 + * GPIO pin is returned in.
3979 + *
3980 + * Returns : BP_SUCCESS - Success, value is returned.
3981 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3982 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3983 + * for the board.
3984 + ***************************************************************************/
3985 +int BpGetWirelessLedGpio( unsigned short *pusValue );
3986 +
3987 +/**************************************************************************
3988 + * Name : BpGetWirelessAntInUse
3989 + *
3990 + * Description: This function returns the antennas in use for wireless
3991 + *
3992 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
3993 + * is in use.
3994 + *
3995 + * Returns : BP_SUCCESS - Success, value is returned.
3996 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3997 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3998 + * for the board.
3999 + ***************************************************************************/
4000 +int BpGetWirelessAntInUse( unsigned short *pusValue );
4001 +
4002 +/**************************************************************************
4003 + * Name : BpGetWirelessSesBtnGpio
4004 + *
4005 + * Description: This function returns the GPIO pin assignment for the Wireless
4006 + * Ses Button.
4007 + *
4008 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4009 + * Button GPIO pin is returned in.
4010 + *
4011 + * Returns : BP_SUCCESS - Success, value is returned.
4012 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4013 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4014 + * for the board.
4015 + ***************************************************************************/
4016 +int BpGetWirelessSesBtnGpio( unsigned short *pusValue );
4017 +
4018 +/**************************************************************************
4019 + * Name : BpGetWirelessSesExtIntr
4020 + *
4021 + * Description: This function returns the external interrupt number for the
4022 + * Wireless Ses Button.
4023 + *
4024 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4025 + * external interrup is returned in.
4026 + *
4027 + * Returns : BP_SUCCESS - Success, value is returned.
4028 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4029 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4030 + * for the board.
4031 + ***************************************************************************/
4032 +int BpGetWirelessSesExtIntr( unsigned short *pusValue );
4033 +
4034 +/**************************************************************************
4035 + * Name : BpGetWirelessSesLedGpio
4036 + *
4037 + * Description: This function returns the GPIO pin assignment for the Wireless
4038 + * Ses Led.
4039 + *
4040 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4041 + * Led GPIO pin is returned in.
4042 + *
4043 + * Returns : BP_SUCCESS - Success, value is returned.
4044 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4045 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4046 + * for the board.
4047 + ***************************************************************************/
4048 +int BpGetWirelessSesLedGpio( unsigned short *pusValue );
4049 +
4050 +/**************************************************************************
4051 + * Name : BpGetUsbLedGpio
4052 + *
4053 + * Description: This function returns the GPIO pin assignment for the USB
4054 + * LED.
4055 + *
4056 + * Parameters : [OUT] pusValue - Address of short word that the USB LED
4057 + * GPIO pin is returned in.
4058 + *
4059 + * Returns : BP_SUCCESS - Success, value is returned.
4060 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4061 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4062 + * for the board.
4063 + ***************************************************************************/
4064 +int BpGetUsbLedGpio( unsigned short *pusValue );
4065 +
4066 +/**************************************************************************
4067 + * Name : BpGetHpnaLedGpio
4068 + *
4069 + * Description: This function returns the GPIO pin assignment for the HPNA
4070 + * LED.
4071 + *
4072 + * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
4073 + * GPIO pin is returned in.
4074 + *
4075 + * Returns : BP_SUCCESS - Success, value is returned.
4076 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4077 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4078 + * for the board.
4079 + ***************************************************************************/
4080 +int BpGetHpnaLedGpio( unsigned short *pusValue );
4081 +
4082 +/**************************************************************************
4083 + * Name : BpGetWanDataLedGpio
4084 + *
4085 + * Description: This function returns the GPIO pin assignment for the WAN Data
4086 + * LED.
4087 + *
4088 + * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
4089 + * GPIO pin is returned in.
4090 + *
4091 + * Returns : BP_SUCCESS - Success, value is returned.
4092 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4093 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4094 + * for the board.
4095 + ***************************************************************************/
4096 +int BpGetWanDataLedGpio( unsigned short *pusValue );
4097 +
4098 +/**************************************************************************
4099 + * Name : BpGetPppLedGpio
4100 + *
4101 + * Description: This function returns the GPIO pin assignment for the PPP
4102 + * LED.
4103 + *
4104 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
4105 + * GPIO pin is returned in.
4106 + *
4107 + * Returns : BP_SUCCESS - Success, value is returned.
4108 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4109 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4110 + * for the board.
4111 + ***************************************************************************/
4112 +int BpGetPppLedGpio( unsigned short *pusValue );
4113 +
4114 +/**************************************************************************
4115 + * Name : BpGetPppFailLedGpio
4116 + *
4117 + * Description: This function returns the GPIO pin assignment for the PPP
4118 + * LED that is used when there is a PPP connection failure.
4119 + *
4120 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
4121 + * GPIO pin is returned in.
4122 + *
4123 + * Returns : BP_SUCCESS - Success, value is returned.
4124 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4125 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4126 + * for the board.
4127 + ***************************************************************************/
4128 +int BpGetPppFailLedGpio( unsigned short *pusValue );
4129 +
4130 +/**************************************************************************
4131 + * Name : BpGetVoipLedGpio
4132 + *
4133 + * Description: This function returns the GPIO pin assignment for the VOIP
4134 + * LED.
4135 + *
4136 + * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
4137 + * GPIO pin is returned in.
4138 + *
4139 + * Returns : BP_SUCCESS - Success, value is returned.
4140 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4141 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4142 + * for the board.
4143 + ***************************************************************************/
4144 +int BpGetVoipLedGpio( unsigned short *pusValue );
4145 +
4146 +/**************************************************************************
4147 + * Name : BpGetBootloaderPowerOnLedGpio
4148 + *
4149 + * Description: This function returns the GPIO pin assignment for the power
4150 + * on LED that is set by the bootloader.
4151 + *
4152 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
4153 + * GPIO pin is returned in.
4154 + *
4155 + * Returns : BP_SUCCESS - Success, value is returned.
4156 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4157 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4158 + * for the board.
4159 + ***************************************************************************/
4160 +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue );
4161 +
4162 +/**************************************************************************
4163 + * Name : BpGetBootloaderAlarmLedGpio
4164 + *
<