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