1 diff -urN linux.old/arch/mips/bcm963xx/bcm63xx_led.c linux.dev/arch/mips/bcm963xx/bcm63xx_led.c
2 --- linux.old/arch/mips/bcm963xx/bcm63xx_led.c 1970-01-01 01:00:00.000000000 +0100
3 +++ linux.dev/arch/mips/bcm963xx/bcm63xx_led.c 2006-08-25 00:39:38.000000000 +0200
7 + Copyright 2002 Broadcom Corp. All Rights Reserved.
9 + This program is free software; you can distribute it and/or modify it
10 + under the terms of the GNU General Public License (Version 2) as
11 + published by the Free Software Foundation.
13 + This program is distributed in the hope it will be useful, but WITHOUT
14 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 + You should have received a copy of the GNU General Public License along
19 + with this program; if not, write to the Free Software Foundation, Inc.,
20 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 +/***************************************************************************
24 + * File Name : bcm63xx_led.c
28 + * This file contains bcm963xx board led control API functions.
30 + * To use it, do the following
32 + * 1). define in the board.c the following led mappping (this is for 6345GW board):
33 + * const LED_MAP_PAIR cLedMapping45GW[] =
34 + * { // led name Initial state physical pin (ledMask)
35 + * {kLedUsb, kLedStateOff, GPIO_LED_PIN_7},
36 + * {kLedAdsl, kLedStateOff, GPIO_LED_PIN_8},
37 + * {kLedPPP, kLedStateOff, GPIO_LED_PIN_9}, // PPP and WanData share PIN_9
38 + * {kLedWanData, kLedStateOff, GPIO_LED_PIN_9},
39 + * {kLedWireless, kLedStateOff, GPIO_LED_PIN_10},
40 + * {kLedEnd, kLedStateOff, 0 } // NOTE: kLedEnd has to be at the end.
42 + * 2). };To initialize led API and initial state of the leds, call the following function with the mapping
43 + * pointer from the above struct
45 + * boardLedInit((PLED_MAP_PAIR) &cLedMapping45R);
47 + * 3). Sample call for kernel mode:
49 + * kerSysLedCtrl(kLedAdsl, kLedStateBlinkOnce); // kLedxxx defines in board.h
51 + * 4). Sample call for user mode
53 + * sysLedCtrl(kLedAdsl, kLedStateBlinkOnce); // kLedxxx defines in board_api.h
56 + * Created on : 10/28/2002 seanl
58 + ***************************************************************************/
61 +#include <linux/init.h>
62 +#include <linux/fs.h>
63 +#include <linux/capability.h>
64 +#include <linux/slab.h>
65 +#include <linux/errno.h>
66 +#include <linux/module.h>
67 +#include <linux/netdevice.h>
68 +#include <asm/uaccess.h>
70 +#include <bcm_map_part.h>
73 +#define k100ms (HZ / 10) // ~100 ms
74 +#define kFastBlinkCount 0 // ~100ms
75 +#define kSlowBlinkCount 5 // ~600ms
77 +#define MAX_VIRT_LEDS 12
79 +// uncomment // for debug led
83 +struct timer_list gLedTimer;
84 +int gTimerOn = FALSE;
87 +typedef struct ledinfo
89 + unsigned short ledMask; // mask for led: ie. giop 10 = 0x0400
90 + unsigned short ledActiveLow; // GPIO bit reset to turn on LED
91 + unsigned short ledMaskFail; // mask for led: ie. giop 10 = 0x0400
92 + unsigned short ledActiveLowFail;// GPIO bit reset to turn on LED
93 + BOARD_LED_STATE ledState; // current led state
94 + BOARD_LED_STATE savedLedState; // used in blink once for restore to the orignal ledState
95 + int blinkCountDown; // if == 0, do blink (toggle). Is assgined value and dec by 1 at each timer.
96 +} LED_INFO, *PLED_INFO;
98 +static PLED_INFO gLed = NULL;
99 +static PLED_INFO gpVirtLeds[MAX_VIRT_LEDS];
100 +static HANDLE_LED_FUNC gLedHwFunc[MAX_VIRT_LEDS];
101 +static HANDLE_LED_FUNC gLedHwFailFunc[MAX_VIRT_LEDS];
104 +#if defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
105 +static int gLedOffInBridgeMode = 1;
106 +#elif defined(CONFIG_BCM96345)
107 +static int gLedOffInBridgeMode = 0;
111 +void ledTimerExpire(void);
112 +int initLedInfo( PLED_MAP_PAIR pCurMap, PLED_INFO pCurLed );
114 +//**************************************************************************************
116 +//**************************************************************************************
118 +// turn led on and set the ledState
119 +void ledOn(PLED_INFO pLed)
121 + if( pLed->ledMask )
123 + GPIO->GPIODir |= pLed->ledMask; // turn on the direction bit in case was turned off by some one
124 + if( pLed->ledActiveLow )
125 + GPIO->GPIOio &= ~pLed->ledMask; // turn on the led
127 + GPIO->GPIOio |= pLed->ledMask; // turn on the led
128 + pLed->ledState = pLed->savedLedState = kLedStateOn;
133 +// turn led off and set the ledState
134 +void ledOff(PLED_INFO pLed)
136 + if( pLed->ledMask )
138 + GPIO->GPIODir |= pLed->ledMask; // turn on the direction bit in case was turned off by some one
139 + if( pLed->ledActiveLow )
140 + GPIO->GPIOio |= pLed->ledMask; // turn off the led
142 + GPIO->GPIOio &= ~pLed->ledMask; // turn off the led
143 + pLed->ledState = pLed->savedLedState = kLedStateOff;
147 +// turn led on and set the ledState
148 +void ledOnFail(PLED_INFO pLed)
150 + if( pLed->ledMaskFail )
152 + GPIO->GPIODir |= pLed->ledMaskFail; // turn on the direction bit in case was turned off by some one
153 + if( pLed->ledActiveLowFail )
154 + GPIO->GPIOio &= ~pLed->ledMaskFail;// turn on the led
156 + GPIO->GPIOio |= pLed->ledMaskFail; // turn on the led
157 + pLed->ledState = pLed->savedLedState = kLedStateFail;
162 +// turn led off and set the ledState
163 +void ledOffFail(PLED_INFO pLed)
165 + if( pLed->ledMaskFail )
167 + GPIO->GPIODir |= pLed->ledMaskFail; // turn on the direction bit in case was turned off by some one
168 + if( pLed->ledActiveLowFail )
169 + GPIO->GPIOio |= pLed->ledMaskFail; // turn off the led
171 + GPIO->GPIOio &= ~pLed->ledMaskFail;// turn off the led
172 + pLed->ledState = pLed->savedLedState = kLedStateOff;
177 +// toggle the led and return the current ledState
178 +BOARD_LED_STATE ledToggle(PLED_INFO pLed)
180 + GPIO->GPIODir |= pLed->ledMask; // turn on the direction bit in case was turned off by some one
181 + if (GPIO->GPIOio & pLed->ledMask)
183 + GPIO->GPIOio &= ~(pLed->ledMask);
184 + return( (pLed->ledActiveLow) ? kLedStateOn : kLedStateOff );
188 + GPIO->GPIOio |= pLed->ledMask;
189 + return( (pLed->ledActiveLow) ? kLedStateOff : kLedStateOn );
194 +// led timer. Will return if timer is already on
195 +void ledTimerStart(void)
200 +#if defined(DEBUG_LED)
201 + printk("led: add_timer\n");
204 + init_timer(&gLedTimer);
205 + gLedTimer.function = (void*)ledTimerExpire;
206 + gLedTimer.expires = jiffies + k100ms; // timer expires in ~100ms
207 + add_timer (&gLedTimer);
212 +// led timer expire kicks in about ~100ms and perform the led operation according to the ledState and
213 +// restart the timer according to ledState
214 +void ledTimerExpire(void)
221 + for (i = 0, pCurLed = gLed; i < gLedCount; i++, pCurLed++)
223 +#if defined(DEBUG_LED)
224 + printk("led[%d]: Mask=0x%04x, State = %d, blcd=%d\n", i, pCurLed->ledMask, pCurLed->ledState, pCurLed->blinkCountDown);
226 + switch (pCurLed->ledState)
230 + case kLedStateFail:
231 + pCurLed->blinkCountDown = 0; // reset the blink count down
234 + case kLedStateBlinkOnce:
235 + ledToggle(pCurLed);
236 + pCurLed->blinkCountDown = 0; // reset to 0
237 + pCurLed->ledState = pCurLed->savedLedState;
238 + if (pCurLed->ledState == kLedStateSlowBlinkContinues ||
239 + pCurLed->ledState == kLedStateFastBlinkContinues)
240 + ledTimerStart(); // start timer if in blinkContinues stats
243 + case kLedStateSlowBlinkContinues:
244 + if (pCurLed->blinkCountDown-- == 0)
246 + pCurLed->blinkCountDown = kSlowBlinkCount;
247 + ledToggle(pCurLed);
252 + case kLedStateFastBlinkContinues:
253 + if (pCurLed->blinkCountDown-- == 0)
255 + pCurLed->blinkCountDown = kFastBlinkCount;
256 + ledToggle(pCurLed);
262 + printk("Invalid state = %d\n", pCurLed->ledState);
267 +// initialize the gLedCount and allocate and fill gLed struct
268 +void __init boardLedInit(PLED_MAP_PAIR cLedMapping)
270 + PLED_MAP_PAIR p1, p2;
272 + int needTimer = FALSE;
273 + int alreadyUsed = 0;
275 +#if defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
276 + /* Set blink rate for BCM6348/BCM6338 hardware LEDs. */
277 + GPIO->LEDCtrl &= ~LED_INTERVAL_SET_MASK;
278 + GPIO->LEDCtrl |= LED_INTERVAL_SET_80MS;
281 + memset( gpVirtLeds, 0x00, sizeof(gpVirtLeds) );
282 + memset( gLedHwFunc, 0x00, sizeof(gLedHwFunc) );
283 + memset( gLedHwFailFunc, 0x00, sizeof(gLedHwFailFunc) );
287 + // Check for multiple LED names and multiple LED GPIO pins that share the
288 + // same physical board LED.
289 + for( p1 = cLedMapping; p1->ledName != kLedEnd; p1++ )
292 + for( p2 = cLedMapping; p2 != p1; p2++ )
294 + if( (p1->ledMask && p1->ledMask == p2->ledMask) ||
295 + (p1->ledMaskFail && p1->ledMaskFail == p2->ledMaskFail) )
302 + if( alreadyUsed == 0 )
306 + gLed = (PLED_INFO) kmalloc((gLedCount * sizeof(LED_INFO)), GFP_KERNEL);
309 + printk( "LED memory allocation error.\n" );
313 + memset( gLed, 0x00, gLedCount * sizeof(LED_INFO) );
315 + // initial the gLed with unique ledMask and initial state. If more than 1 ledNames share the physical led
316 + // (ledMask) the first defined led's ledInitState will be used.
318 + for( p1 = cLedMapping; p1->ledName != kLedEnd; p1++ )
320 + if( (int) p1->ledName > MAX_VIRT_LEDS )
324 + for( p2 = cLedMapping; p2 != p1; p2++ )
326 + if( (p1->ledMask && p1->ledMask == p2->ledMask) ||
327 + (p1->ledMaskFail && p1->ledMaskFail == p2->ledMaskFail) )
334 + if( alreadyUsed == 0 )
336 + // Initialize the board LED for the first time.
337 + needTimer = initLedInfo( p1, pCurLed );
338 + gpVirtLeds[(int) p1->ledName] = pCurLed;
344 + for( pLed = gLed; pLed != pCurLed; pLed++ )
346 + // Find the LED_INFO structure that has already been initialized.
347 + if((pLed->ledMask && pLed->ledMask == p1->ledMask) ||
348 + (pLed->ledMaskFail && pLed->ledMaskFail==p1->ledMaskFail))
350 + // The board LED has already been initialized but possibly
351 + // not completely initialized.
354 + pLed->ledMask = p1->ledMask;
355 + pLed->ledActiveLow = p1->ledActiveLow;
357 + if( p1->ledMaskFail )
359 + pLed->ledMaskFail = p1->ledMaskFail;
360 + pLed->ledActiveLowFail = p1->ledActiveLowFail;
362 + gpVirtLeds[(int) p1->ledName] = pLed;
372 +#if defined(DEBUG_LED)
374 + for (i=0; i < gLedCount; i++)
375 + printk("initLed: led[%d]: mask=0x%04x, state=%d\n", i,(gLed+i)->ledMask, (gLed+i)->ledState);
380 +// Initialize a structure that contains information about a physical board LED
381 +// control. The board LED may contain more than one GPIO pin to control a
382 +// normal condition (green) or a failure condition (red).
383 +int initLedInfo( PLED_MAP_PAIR pCurMap, PLED_INFO pCurLed )
385 + int needTimer = FALSE;
386 + pCurLed->ledState = pCurLed->savedLedState = pCurMap->ledInitState;
387 + pCurLed->ledMask = pCurMap->ledMask;
388 + pCurLed->ledActiveLow = pCurMap->ledActiveLow;
389 + pCurLed->ledMaskFail = pCurMap->ledMaskFail;
390 + pCurLed->ledActiveLowFail = pCurMap->ledActiveLowFail;
392 + switch (pCurLed->ledState)
395 + pCurLed->blinkCountDown = 0; // reset the blink count down
399 + pCurLed->blinkCountDown = 0; // reset the blink count down
402 + case kLedStateFail:
403 + pCurLed->blinkCountDown = 0; // reset the blink count down
404 + ledOnFail(pCurLed);
406 + case kLedStateBlinkOnce:
407 + pCurLed->blinkCountDown = 1;
410 + case kLedStateSlowBlinkContinues:
411 + pCurLed->blinkCountDown = kSlowBlinkCount;
414 + case kLedStateFastBlinkContinues:
415 + pCurLed->blinkCountDown = kFastBlinkCount;
419 + printk("Invalid state = %d\n", pCurLed->ledState);
422 + return( needTimer );
426 +// Determines if there is at least one interface in bridge mode. Bridge mode
427 +// is determined by the cfm convention of naming bridge interfaces nas17
429 +static int isBridgedProtocol(void)
431 + extern int dev_get(const char *name);
432 + const int firstBridgeId = 17;
433 + const int lastBridgeId = 24;
438 + for( i = firstBridgeId; i <= lastBridgeId; i++ )
440 + sprintf( name, "nas%d", i );
442 + if( dev_get(name) )
453 +// led ctrl. Maps the ledName to the corresponding ledInfoPtr and perform the led operation
454 +void boardLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
456 + PLED_INFO ledInfoPtr;
458 + // do the mapping from virtual to physical led
459 + if( (int) ledName < MAX_VIRT_LEDS )
460 + ledInfoPtr = gpVirtLeds[(int) ledName];
464 + if (ledInfoPtr == NULL)
467 + if( ledState != kLedStateFail && gLedHwFunc[(int) ledName] )
469 + (*gLedHwFunc[(int) ledName]) (ledName, ledState);
470 + ledOffFail(ledInfoPtr);
474 + if( ledState == kLedStateFail && gLedHwFailFunc[(int) ledName] )
476 + (*gLedHwFailFunc[(int) ledName]) (ledName, ledState);
477 + ledOff(ledInfoPtr);
482 + // Do not blink the WAN Data LED if at least one interface is in bridge mode.
483 + if(gLedOffInBridgeMode == 1 && (ledName == kLedWanData || ledName == kLedPPP))
485 + static int BridgedProtocol = -1;
487 + if( BridgedProtocol == -1 )
488 + BridgedProtocol = isBridgedProtocol();
490 + if( BridgedProtocol == TRUE )
495 + // If the state is kLedStateFail and there is not a failure LED defined
496 + // in the board parameters, change the state to kLedStateFastBlinkContinues.
497 + if( ledState == kLedStateFail && ledInfoPtr->ledMaskFail == 0 )
498 + ledState = kLedStateFastBlinkContinues;
503 + // First, turn off the complimentary (failure) LED GPIO.
504 + if( ledInfoPtr->ledMaskFail )
505 + ledOffFail(ledInfoPtr);
507 + if( gLedHwFailFunc[(int) ledName] )
508 + (*gLedHwFailFunc[(int) ledName]) (ledName, kLedStateOff);
510 + // Next, turn on the specified LED GPIO.
515 + // First, turn off the complimentary (failure) LED GPIO.
516 + if( ledInfoPtr->ledMaskFail )
517 + ledOffFail(ledInfoPtr);
519 + if( gLedHwFailFunc[(int) ledName] )
520 + (*gLedHwFailFunc[(int) ledName]) (ledName, kLedStateOff);
522 + // Next, turn off the specified LED GPIO.
523 + ledOff(ledInfoPtr);
526 + case kLedStateFail:
527 + // First, turn off the complimentary (normal) LED GPIO.
528 + if( ledInfoPtr->ledMask )
529 + ledOff(ledInfoPtr);
531 + if( gLedHwFunc[(int) ledName] )
532 + (*gLedHwFunc[(int) ledName]) (ledName, kLedStateOff);
534 + // Next, turn on (red) the specified LED GPIO.
535 + ledOnFail(ledInfoPtr);
538 + case kLedStateBlinkOnce:
539 + // skip blinkOnce if it is already in Slow/Fast blink continues state
540 + if (ledInfoPtr->savedLedState == kLedStateSlowBlinkContinues ||
541 + ledInfoPtr->savedLedState == kLedStateFastBlinkContinues)
545 + if (ledInfoPtr->blinkCountDown == 0) // skip the call if it is 1
547 + ledToggle(ledInfoPtr);
548 + ledInfoPtr->blinkCountDown = 1; // it will be reset to 0 when timer expires
549 + ledInfoPtr->ledState = kLedStateBlinkOnce;
555 + case kLedStateSlowBlinkContinues:
556 + ledInfoPtr->blinkCountDown = kSlowBlinkCount;
557 + ledInfoPtr->ledState = kLedStateSlowBlinkContinues;
558 + ledInfoPtr->savedLedState = kLedStateSlowBlinkContinues;
562 + case kLedStateFastBlinkContinues:
563 + ledInfoPtr->blinkCountDown = kFastBlinkCount;
564 + ledInfoPtr->ledState = kLedStateFastBlinkContinues;
565 + ledInfoPtr->savedLedState = kLedStateFastBlinkContinues;
570 + printk("Invalid led state\n");
574 +// This function is called for an LED that is controlled by hardware.
575 +void kerSysLedRegisterHwHandler( BOARD_LED_NAME ledName,
576 + HANDLE_LED_FUNC ledHwFunc, int ledFailType )
578 + if( (int) ledName < MAX_VIRT_LEDS )
580 + if( ledFailType == 1 )
581 + gLedHwFailFunc[(int) ledName] = ledHwFunc;
583 + gLedHwFunc[(int) ledName] = ledHwFunc;
587 diff -urN linux.old/arch/mips/bcm963xx/board.c linux.dev/arch/mips/bcm963xx/board.c
588 --- linux.old/arch/mips/bcm963xx/board.c 1970-01-01 01:00:00.000000000 +0100
589 +++ linux.dev/arch/mips/bcm963xx/board.c 2006-08-25 15:16:26.000000000 +0200
593 + Copyright 2002 Broadcom Corp. All Rights Reserved.
595 + This program is free software; you can distribute it and/or modify it
596 + under the terms of the GNU General Public License (Version 2) as
597 + published by the Free Software Foundation.
599 + This program is distributed in the hope it will be useful, but WITHOUT
600 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
601 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
604 + You should have received a copy of the GNU General Public License along
605 + with this program; if not, write to the Free Software Foundation, Inc.,
606 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
611 +#include <linux/version.h>
612 +#include <linux/init.h>
613 +#include <linux/fs.h>
614 +#include <linux/interrupt.h>
615 +#include <linux/capability.h>
616 +#include <linux/slab.h>
617 +#include <linux/errno.h>
618 +#include <linux/module.h>
619 +#include <linux/pagemap.h>
620 +#include <asm/uaccess.h>
621 +#include <linux/wait.h>
622 +#include <linux/poll.h>
623 +#include <linux/sched.h>
624 +#include <linux/list.h>
625 +#include <linux/if.h>
626 +#include <linux/spinlock.h>
628 +#include <bcm_map_part.h>
631 +#include "boardparms.h"
632 +#include "bcm_intr.h"
634 +#include "bcm_map_part.h"
636 +static DEFINE_SPINLOCK(board_lock);
639 +#if defined (NON_CONSECUTIVE_MAC)
640 +// used to be the last octet. Now changed to the first 5 bits of the the forth octet
641 +// to reduced the duplicated MAC addresses.
642 +#define CHANGED_OCTET 3
643 +#define SHIFT_BITS 3
645 +#define CHANGED_OCTET 1
646 +#define SHIFT_BITS 0
651 + unsigned long ulId;
653 + char chReserved[3];
654 +} MAC_ADDR_INFO, *PMAC_ADDR_INFO;
658 + unsigned long ulSdramSize;
659 + unsigned long ulPsiSize;
660 + unsigned long ulNumMacAddrs;
661 + unsigned long ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
662 + MAC_ADDR_INFO MacAddrs[1];
663 +} NVRAM_INFO, *PNVRAM_INFO;
667 + unsigned long eventmask;
668 +} BOARD_IOC, *PBOARD_IOC;
671 +/*Dyinggasp callback*/
672 +typedef void (*cb_dgasp_t)(void *arg);
673 +typedef struct _CB_DGASP__LIST
675 + struct list_head list;
676 + char name[IFNAMSIZ];
677 + cb_dgasp_t cb_dgasp_fn;
679 +}CB_DGASP_LIST , *PCB_DGASP_LIST;
682 +static LED_MAP_PAIR LedMapping[] =
683 +{ // led name Initial state physical pin (ledMask)
684 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
685 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
686 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
687 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
688 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
689 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
690 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
691 + {kLedEnd, kLedStateOff, 0, 0, 0, 0},
692 + {kLedEnd, kLedStateOff, 0, 0, 0, 0} // NOTE: kLedEnd has to be at the end.
696 +extern struct file fastcall *fget_light(unsigned int fd, int *fput_needed);
697 +extern unsigned int nr_free_pages (void);
698 +extern const char *get_system_type(void);
699 +extern void kerSysFlashInit(void);
700 +extern unsigned long get_nvram_start_addr(void);
701 +extern unsigned long get_scratch_pad_start_addr(void);
702 +extern unsigned long getMemorySize(void);
703 +extern void __init boardLedInit(PLED_MAP_PAIR);
704 +extern void boardLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
705 +extern void kerSysLedRegisterHandler( BOARD_LED_NAME ledName,
706 + HANDLE_LED_FUNC ledHwFunc, int ledFailType );
709 +void __init InitNvramInfo( void );
711 +/* DyingGasp function prototype */
712 +static void __init kerSysDyingGaspMapIntr(void);
713 +static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs);
714 +static void __init kerSysInitDyingGaspHandler( void );
715 +static void __exit kerSysDeinitDyingGaspHandler( void );
716 +/* -DyingGasp function prototype - */
718 +static PNVRAM_INFO g_pNvramInfo = NULL;
719 +static int g_ledInitialized = 0;
720 +static CB_DGASP_LIST *g_cb_dgasp_list_head = NULL;
722 +static int g_wakeup_monitor = 0;
723 +static struct file *g_monitor_file = NULL;
724 +static struct task_struct *g_monitor_task = NULL;
725 +static unsigned int (*g_orig_fop_poll)
726 + (struct file *, struct poll_table_struct *) = NULL;
728 +void kerSysMipsSoftReset(void)
730 + if (PERF->RevID == 0x634800A1) {
731 + typedef void (*FNPTR) (void);
732 + FNPTR bootaddr = (FNPTR) FLASH_BASE;
735 + /* Disable interrupts. */
737 + spin_lock_irq(&board_lock);
739 + /* Reset all blocks. */
740 + PERF->BlockSoftReset &= ~BSR_ALL_BLOCKS;
741 + for( i = 0; i < 1000000; i++ )
743 + PERF->BlockSoftReset |= BSR_ALL_BLOCKS;
744 + /* Jump to the power on address. */
748 + PERF->pll_control |= SOFT_RESET; // soft reset mips
752 +int kerSysGetMacAddress( unsigned char *pucaMacAddr, unsigned long ulId )
755 + PMAC_ADDR_INFO pMai = NULL;
756 + PMAC_ADDR_INFO pMaiFreeNoId = NULL;
757 + PMAC_ADDR_INFO pMaiFreeId = NULL;
758 + unsigned long i = 0, ulIdxNoId = 0, ulIdxId = 0, shiftedIdx = 0;
760 + /* CMO -- Fix le problème avec les adresses mac que l'on n'arrive pas
761 + * * Ã relire plusieurs fois */
763 + if (boot_loader_type == BOOT_CFE)
764 + memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,
765 + NVRAM_MAC_ADDRESS_LEN );
767 + pucaMacAddr[0] = 0x00;
768 + pucaMacAddr[1] = 0x07;
769 + pucaMacAddr[2] = 0x3A;
770 + pucaMacAddr[3] = 0xFF;
771 + pucaMacAddr[4] = 0xFF;
772 + pucaMacAddr[5] = 0xFF;
776 +} /* kerSysGetMacAddr */
778 +int kerSysReleaseMacAddress( unsigned char *pucaMacAddr )
780 + int nRet = -EINVAL;
781 + unsigned long ulIdx = 0;
782 + int idx = (pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] -
783 + g_pNvramInfo->ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET]);
785 + // if overflow 255 (negitive), add 256 to have the correct index
788 + ulIdx = (unsigned long) (idx >> SHIFT_BITS);
790 + if( ulIdx < g_pNvramInfo->ulNumMacAddrs )
792 + PMAC_ADDR_INFO pMai = &g_pNvramInfo->MacAddrs[ulIdx];
793 + if( pMai->chInUse == 1 )
801 +} /* kerSysReleaseMacAddr */
803 +int kerSysGetSdramSize( void )
805 + if (boot_loader_type == BOOT_CFE) {
806 + return( (int) g_pNvramInfo->ulSdramSize );
809 + printk("kerSysGetSdramSize : 0x%08X\n", (int)getMemorySize() + 0x00040000);
810 + return((int)getMemorySize() + 0x00040000);
812 +} /* kerSysGetSdramSize */
815 +void kerSysLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
817 + if (g_ledInitialized)
818 + boardLedCtrl(ledName, ledState);
821 +unsigned int kerSysMonitorPollHook( struct file *f, struct poll_table_struct *t)
823 + int mask = (*g_orig_fop_poll) (f, t);
825 + if( g_wakeup_monitor == 1 && g_monitor_file == f )
827 + /* If g_wakeup_monitor is non-0, the user mode application needs to
828 + * return from a blocking select function. Return POLLPRI which will
829 + * cause the select to return with the exception descriptor set.
832 + g_wakeup_monitor = 0;
838 +/* Put the user mode application that monitors link state on a run queue. */
839 +void kerSysWakeupMonitorTask( void )
841 + g_wakeup_monitor = 1;
842 + if( g_monitor_task )
843 + wake_up_process( g_monitor_task );
846 +//<<JUNHON, 2004/09/15, get reset button status , tim hou , 05/04/12
847 +int kerSysGetResetHold(void)
849 + unsigned short gpio;
851 + if( BpGetPressAndHoldResetGpio( &gpio ) == BP_SUCCESS )
853 + unsigned long gpio_mask = GPIO_NUM_TO_MASK(gpio);
854 + volatile unsigned long *gpio_reg = &GPIO->GPIOio;
856 + if( (gpio & ~BP_ACTIVE_MASK) >= 32 )
858 + gpio_mask = GPIO_NUM_TO_MASK_HIGH(gpio);
859 + gpio_reg = &GPIO->GPIOio_high;
861 + //printk("gpio=%04x,gpio_mask=%04x,gpio_reg=%04x\n",gpio,gpio_mask,*gpio_reg);
862 + if(*gpio_reg & gpio_mask) //press down
863 + return RESET_BUTTON_UP;
865 + return RESET_BUTTON_PRESSDOWN;
867 +//<<JUNHON, 2004/09/15
869 +/***************************************************************************
870 + * Dying gasp ISR and functions.
871 + ***************************************************************************/
872 +#define KERSYS_DBG printk
874 +#if defined(CONFIG_BCM96345)
875 +#define CYCLE_PER_US 70
876 +#elif defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
877 +/* The BCM6348 cycles per microsecond is really variable since the BCM6348
878 + * MIPS speed can vary depending on the PLL settings. However, an appoximate
879 + * value of 120 will still work OK for the test being done.
881 +#define CYCLE_PER_US 120
883 +#define DG_GLITCH_TO (100*CYCLE_PER_US)
885 +static void __init kerSysDyingGaspMapIntr()
887 + unsigned long ulIntr;
889 +#if defined(CONFIG_BCM96348) || defined(_BCM96348_) || defined(CONFIG_BCM96338) || defined(_BCM96338_)
890 + if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
891 + BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, INTERRUPT_ID_DG);
892 + BcmHalInterruptEnable( INTERRUPT_ID_DG );
894 +#elif defined(CONFIG_BCM96345) || defined(_BCM96345_)
895 + if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
896 + ulIntr += INTERRUPT_ID_EXTERNAL_0;
897 + BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, ulIntr);
898 + BcmHalInterruptEnable( ulIntr );
904 +void kerSysSetWdTimer(ulong timeUs)
906 + TIMER->WatchDogDefCount = timeUs * (FPERIPH/1000000);
907 + TIMER->WatchDogCtl = 0xFF00;
908 + TIMER->WatchDogCtl = 0x00FF;
911 +ulong kerSysGetCycleCount(void)
917 + __asm volatile("mfc0 %0, $9":"=d"(cnt));
922 +static Bool kerSysDyingGaspCheckPowerLoss(void)
928 + clk0 = kerSysGetCycleCount();
934 +#if defined(CONFIG_BCM96345)
935 + BpGetAdslDyingGaspExtIntr( &ulIntr );
940 + clk1 = kerSysGetCycleCount(); /* time cleared */
941 + /* wait a little to get new reading */
942 + while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
944 + } while ((0 == (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT)))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
946 + if (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT))) { /* power glitch */
947 + BcmHalInterruptEnable( ulIntr + INTERRUPT_ID_EXTERNAL_0);
948 + KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
951 +#elif (defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)) && !defined(VXWORKS)
955 + clk1 = kerSysGetCycleCount(); /* time cleared */
956 + /* wait a little to get new reading */
957 + while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
959 + } while ((PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
961 + if (!(PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET)))) {
962 + BcmHalInterruptEnable( INTERRUPT_ID_DG );
963 + KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
970 +static void kerSysDyingGaspShutdown( void )
972 + kerSysSetWdTimer(1000000);
973 +#if defined(CONFIG_BCM96345)
974 + PERF->blkEnables &= ~(EMAC_CLK_EN | USB_CLK_EN | CPU_CLK_EN);
975 +#elif defined(CONFIG_BCM96348)
976 + PERF->blkEnables &= ~(EMAC_CLK_EN | USBS_CLK_EN | USBH_CLK_EN | SAR_CLK_EN);
980 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
981 +static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs)
983 +static unsigned int kerSysDyingGaspIsr(void)
986 + struct list_head *pos;
987 + CB_DGASP_LIST *tmp, *dsl = NULL;
989 + if (kerSysDyingGaspCheckPowerLoss()) {
991 + /* first to turn off everything other than dsl */
992 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
993 + tmp = list_entry(pos, CB_DGASP_LIST, list);
994 + if(strncmp(tmp->name, "dsl", 3)) {
995 + (tmp->cb_dgasp_fn)(tmp->context);
1001 + /* now send dgasp */
1003 + (dsl->cb_dgasp_fn)(dsl->context);
1005 + /* reset and shutdown system */
1006 + kerSysDyingGaspShutdown();
1008 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
1009 +return( IRQ_HANDLED );
1015 +static void __init kerSysInitDyingGaspHandler( void )
1017 + CB_DGASP_LIST *new_node;
1019 + if( g_cb_dgasp_list_head != NULL) {
1020 + printk("Error: kerSysInitDyingGaspHandler: list head is not null\n");
1023 + new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
1024 + memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
1025 + INIT_LIST_HEAD(&new_node->list);
1026 + g_cb_dgasp_list_head = new_node;
1028 +} /* kerSysInitDyingGaspHandler */
1030 +static void __exit kerSysDeinitDyingGaspHandler( void )
1032 + struct list_head *pos;
1033 + CB_DGASP_LIST *tmp;
1035 + if(g_cb_dgasp_list_head == NULL)
1038 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
1039 + tmp = list_entry(pos, CB_DGASP_LIST, list);
1044 + kfree(g_cb_dgasp_list_head);
1045 + g_cb_dgasp_list_head = NULL;
1047 +} /* kerSysDeinitDyingGaspHandler */
1049 +void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context)
1051 + CB_DGASP_LIST *new_node;
1053 + if( g_cb_dgasp_list_head == NULL) {
1054 + printk("Error: kerSysRegisterDyingGaspHandler: list head is null\n");
1058 + if( devname == NULL || cbfn == NULL ) {
1059 + printk("Error: kerSysRegisterDyingGaspHandler: register info not enough (%s,%x,%x)\n", devname, (unsigned int)cbfn, (unsigned int)context);
1063 + new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
1064 + memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
1065 + INIT_LIST_HEAD(&new_node->list);
1066 + strncpy(new_node->name, devname, IFNAMSIZ);
1067 + new_node->cb_dgasp_fn = (cb_dgasp_t)cbfn;
1068 + new_node->context = context;
1069 + list_add(&new_node->list, &g_cb_dgasp_list_head->list);
1071 + printk("dgasp: kerSysRegisterDyingGaspHandler: %s registered \n", devname);
1073 +} /* kerSysRegisterDyingGaspHandler */
1075 +void kerSysDeregisterDyingGaspHandler(char *devname)
1077 + struct list_head *pos;
1078 + CB_DGASP_LIST *tmp;
1080 + if(g_cb_dgasp_list_head == NULL) {
1081 + printk("Error: kerSysDeregisterDyingGaspHandler: list head is null\n");
1085 + if(devname == NULL) {
1086 + printk("Error: kerSysDeregisterDyingGaspHandler: devname is null\n");
1090 + printk("kerSysDeregisterDyingGaspHandler: %s is deregistering\n", devname);
1092 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
1093 + tmp = list_entry(pos, CB_DGASP_LIST, list);
1094 + if(!strcmp(tmp->name, devname)) {
1097 + printk("kerSysDeregisterDyingGaspHandler: %s is deregistered\n", devname);
1101 + printk("kerSysDeregisterDyingGaspHandler: %s not (de)registered\n", devname);
1103 +} /* kerSysDeregisterDyingGaspHandler */
1105 +//EXPORT_SYMBOL(kerSysNvRamGet);
1106 +EXPORT_SYMBOL(kerSysGetMacAddress);
1107 +EXPORT_SYMBOL(kerSysReleaseMacAddress);
1108 +EXPORT_SYMBOL(kerSysGetSdramSize);
1109 +EXPORT_SYMBOL(kerSysLedCtrl);
1110 +EXPORT_SYMBOL(kerSysGetResetHold);
1111 +EXPORT_SYMBOL(kerSysLedRegisterHwHandler);
1112 +EXPORT_SYMBOL(BpGetBoardIds);
1113 +EXPORT_SYMBOL(BpGetSdramSize);
1114 +EXPORT_SYMBOL(BpGetPsiSize);
1115 +EXPORT_SYMBOL(BpGetEthernetMacInfo);
1116 +EXPORT_SYMBOL(BpGetRj11InnerOuterPairGpios);
1117 +EXPORT_SYMBOL(BpGetPressAndHoldResetGpio);
1118 +EXPORT_SYMBOL(BpGetVoipResetGpio);
1119 +EXPORT_SYMBOL(BpGetVoipIntrGpio);
1120 +EXPORT_SYMBOL(BpGetPcmciaResetGpio);
1121 +EXPORT_SYMBOL(BpGetRtsCtsUartGpios);
1122 +EXPORT_SYMBOL(BpGetAdslLedGpio);
1123 +EXPORT_SYMBOL(BpGetAdslFailLedGpio);
1124 +EXPORT_SYMBOL(BpGetWirelessLedGpio);
1125 +EXPORT_SYMBOL(BpGetUsbLedGpio);
1126 +EXPORT_SYMBOL(BpGetHpnaLedGpio);
1127 +EXPORT_SYMBOL(BpGetWanDataLedGpio);
1128 +EXPORT_SYMBOL(BpGetPppLedGpio);
1129 +EXPORT_SYMBOL(BpGetPppFailLedGpio);
1130 +EXPORT_SYMBOL(BpGetVoipLedGpio);
1131 +EXPORT_SYMBOL(BpGetWirelessExtIntr);
1132 +EXPORT_SYMBOL(BpGetAdslDyingGaspExtIntr);
1133 +EXPORT_SYMBOL(BpGetVoipExtIntr);
1134 +EXPORT_SYMBOL(BpGetHpnaExtIntr);
1135 +EXPORT_SYMBOL(BpGetHpnaChipSelect);
1136 +EXPORT_SYMBOL(BpGetVoipChipSelect);
1137 +EXPORT_SYMBOL(BpGetWirelessSesBtnGpio);
1138 +EXPORT_SYMBOL(BpGetWirelessSesExtIntr);
1139 +EXPORT_SYMBOL(BpGetWirelessSesLedGpio);
1140 +EXPORT_SYMBOL(kerSysRegisterDyingGaspHandler);
1141 +EXPORT_SYMBOL(kerSysDeregisterDyingGaspHandler);
1142 +EXPORT_SYMBOL(kerSysGetCycleCount);
1143 +EXPORT_SYMBOL(kerSysSetWdTimer);
1144 +EXPORT_SYMBOL(kerSysWakeupMonitorTask);
1146 diff -urN linux.old/arch/mips/bcm963xx/boardparms.c linux.dev/arch/mips/bcm963xx/boardparms.c
1147 --- linux.old/arch/mips/bcm963xx/boardparms.c 1970-01-01 01:00:00.000000000 +0100
1148 +++ linux.dev/arch/mips/bcm963xx/boardparms.c 2006-08-25 00:39:38.000000000 +0200
1153 + Copyright 2003 Broadcom Corp. All Rights Reserved.
1155 + This program is free software; you can distribute it and/or modify it
1156 + under the terms of the GNU General Public License (Version 2) as
1157 + published by the Free Software Foundation.
1159 + This program is distributed in the hope it will be useful, but WITHOUT
1160 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1161 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1164 + You should have received a copy of the GNU General Public License along
1165 + with this program; if not, write to the Free Software Foundation, Inc.,
1166 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1170 +/**************************************************************************
1171 + * File Name : boardparms.c
1173 + * Description: This file contains the implementation for the BCM63xx board
1174 + * parameter access functions.
1176 + * Updates : 07/14/2003 Created.
1177 + ***************************************************************************/
1180 +#include "boardparms.h"
1184 +/* Default psi size in K bytes */
1185 +#define BP_PSI_DEFAULT_SIZE 24
1188 +typedef struct boardparameters
1190 + char szBoardId[BP_BOARD_ID_LEN]; /* board id string */
1191 + ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS];
1192 + VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP];
1193 + unsigned short usSdramSize; /* SDRAM size and type */
1194 + unsigned short usPsiSize; /* persistent storage in K bytes */
1195 + unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */
1196 + unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */
1197 + unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */
1198 + unsigned short usGpioPcmciaReset; /* GPIO pin or not defined */
1199 + unsigned short usGpioUartRts; /* GPIO pin or not defined */
1200 + unsigned short usGpioUartCts; /* GPIO pin or not defined */
1201 + unsigned short usGpioLedAdsl; /* GPIO pin or not defined */
1202 + unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */
1203 + unsigned short usGpioLedWireless; /* GPIO pin or not defined */
1204 + unsigned short usGpioLedUsb; /* GPIO pin or not defined */
1205 + unsigned short usGpioLedHpna; /* GPIO pin or not defined */
1206 + unsigned short usGpioLedWanData; /* GPIO pin or not defined */
1207 + unsigned short usGpioLedPpp; /* GPIO pin or not defined */
1208 + unsigned short usGpioLedPppFail; /* GPIO pin or not defined */
1209 + unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */
1210 + unsigned short usGpioLedBlAlarm; /* GPIO pin or not defined */
1211 + unsigned short usGpioLedBlResetCfg; /* GPIO pin or not defined */
1212 + unsigned short usGpioLedBlStop; /* GPIO pin or not defined */
1213 + unsigned short usExtIntrWireless; /* ext intr or not defined */
1214 + unsigned short usExtIntrAdslDyingGasp; /* ext intr or not defined */
1215 + unsigned short usExtIntrHpna; /* ext intr or not defined */
1216 + unsigned short usCsHpna; /* chip select not defined */
1217 + unsigned short usAntInUseWireless; /* antenna in use or not defined */
1218 + unsigned short usGpioSesBtnWireless; /* GPIO pin or not defined */
1219 + unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */
1220 + unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */
1221 +} BOARD_PARAMETERS, *PBOARD_PARAMETERS;
1224 +#if defined(_BCM96338_) || defined(CONFIG_BCM96338)
1225 +static BOARD_PARAMETERS g_bcm96338sv =
1227 + "96338SV", /* szBoardId */
1228 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1229 + 0x01, /* ucPhyAddress */
1230 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1231 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1232 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1233 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1234 + BP_NOT_DEFINED, /* usGpioPhyReset */
1235 + 0x01, /* numSwitchPorts */
1236 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1237 + BP_NOT_DEFINED}, /* usReverseMii */
1238 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1239 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1240 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1241 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1242 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1243 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1244 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1245 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1246 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1247 + BP_NOT_DEFINED, /* usGpioUartRts */
1248 + BP_NOT_DEFINED, /* usGpioUartCts */
1249 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1250 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1251 + BP_NOT_DEFINED, /* usGpioLedWireless */
1252 + BP_NOT_DEFINED, /* usGpioLedUsb */
1253 + BP_NOT_DEFINED, /* usGpioLedHpna */
1254 + BP_NOT_DEFINED, /* usGpioLedWanData */
1255 + BP_NOT_DEFINED, /* usGpioLedPpp */
1256 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1257 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1258 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1259 + BP_NOT_DEFINED, /* usGpioLedBlResetCfg */
1260 + BP_NOT_DEFINED, /* usGpioLedBlStop */
1261 + BP_NOT_DEFINED, /* usExtIntrWireless */
1262 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1263 + BP_NOT_DEFINED, /* usExtIntrHpna */
1264 + BP_NOT_DEFINED, /* usCsHpna */
1265 + BP_NOT_DEFINED, /* usAntInUseWireless */
1266 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1267 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1268 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1270 +static BOARD_PARAMETERS g_bcm96338l2m8m =
1272 + "96338L-2M-8M", /* szBoardId */
1273 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1274 + 0x01, /* ucPhyAddress */
1275 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1276 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1277 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1278 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1279 + BP_NOT_DEFINED, /* usGpioPhyReset */
1280 + 0x01, /* numSwitchPorts */
1281 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1282 + BP_NOT_DEFINED}, /* usReverseMii */
1283 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1284 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1285 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1286 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1287 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1288 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1289 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1290 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1291 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1292 + BP_NOT_DEFINED, /* usGpioUartRts */
1293 + BP_NOT_DEFINED, /* usGpioUartCts */
1294 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1295 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1296 + BP_NOT_DEFINED, /* usGpioLedWireless */
1297 + BP_NOT_DEFINED, /* usGpioLedUsb */
1298 + BP_NOT_DEFINED, /* usGpioLedHpna */
1299 + BP_GPIO_3_AL, /* usGpioLedWanData */
1300 + BP_GPIO_3_AL, /* usGpioLedPpp */
1301 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1302 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1303 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1304 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1305 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1306 + BP_NOT_DEFINED, /* usExtIntrWireless */
1307 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1308 + BP_NOT_DEFINED, /* usExtIntrHpna */
1309 + BP_NOT_DEFINED, /* usCsHpna */
1310 + BP_NOT_DEFINED, /* usAntInUseWireless */
1311 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1312 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1313 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1315 +static PBOARD_PARAMETERS g_BoardParms[] =
1316 + {&g_bcm96338sv, &g_bcm96338l2m8m, 0};
1319 +#if defined(_BCM96345_) || defined(CONFIG_BCM96345)
1320 +static BOARD_PARAMETERS g_bcm96345r =
1322 + "96345R", /* szBoardId */
1323 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1324 + 0x01, /* ucPhyAddress */
1325 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1326 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1327 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1328 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1329 + BP_NOT_DEFINED, /* usGpioPhyReset */
1330 + 0x01, /* numSwitchPorts */
1331 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1332 + BP_NOT_DEFINED}, /* usReverseMii */
1333 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1334 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1335 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1336 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1337 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1338 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1339 + BP_GPIO_12_AH, /* usGpioRj11OuterPair */
1340 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1341 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1342 + BP_NOT_DEFINED, /* usGpioUartRts */
1343 + BP_NOT_DEFINED, /* usGpioUartCts */
1344 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1345 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1346 + BP_NOT_DEFINED, /* usGpioLedWireless */
1347 + BP_NOT_DEFINED, /* usGpioLedUsb */
1348 + BP_NOT_DEFINED, /* usGpioLedHpna */
1349 + BP_GPIO_8_AH, /* usGpioLedWanData */
1350 + BP_GPIO_9_AH, /* usGpioLedPpp */
1351 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1352 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1353 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1354 + BP_GPIO_9_AH, /* usGpioLedBlResetCfg */
1355 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1356 + BP_NOT_DEFINED, /* usExtIntrWireless */
1357 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1358 + BP_NOT_DEFINED, /* usExtIntrHpna */
1359 + BP_NOT_DEFINED, /* usCsHpna */
1360 + BP_NOT_DEFINED, /* usAntInUseWireless */
1361 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1362 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1363 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1366 +static BOARD_PARAMETERS g_bcm96345gw2 =
1368 + /* A hardware jumper determines whether GPIO 13 is used for Press and Hold
1371 + "96345GW2", /* szBoardId */
1372 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1373 + 0x00, /* ucPhyAddress */
1374 + BP_GPIO_0_AH, /* usGpioPhySpiSck */
1375 + BP_GPIO_4_AH, /* usGpioPhySpiSs */
1376 + BP_GPIO_12_AH, /* usGpioPhySpiMosi */
1377 + BP_GPIO_11_AH, /* usGpioPhySpiMiso */
1378 + BP_NOT_DEFINED, /* usGpioPhyReset */
1379 + 0x04, /* numSwitchPorts */
1380 + BP_ENET_CONFIG_GPIO, /* usConfigType */
1381 + BP_ENET_REVERSE_MII}, /* usReverseMii */
1382 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1383 + {{BP_VOIP_DSP, /* ucDspType */
1384 + 0x00, /* ucDspAddress */
1385 + BP_EXT_INTR_1, /* usExtIntrVoip */
1386 + BP_GPIO_6_AH, /* usGpioVoipReset */
1387 + BP_GPIO_15_AH, /* usGpioVoipIntr */
1388 + BP_NOT_DEFINED, /* usGpioLedVoip */
1389 + BP_CS_2}, /* usCsVoip */
1390 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1391 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1392 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1393 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1394 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1395 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1396 + BP_GPIO_2_AH, /* usGpioPcmciaReset */
1397 + BP_GPIO_13_AH, /* usGpioUartRts */
1398 + BP_GPIO_9_AH, /* usGpioUartCts */
1399 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1400 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1401 + BP_NOT_DEFINED, /* usGpioLedWireless */
1402 + BP_GPIO_7_AH, /* usGpioLedUsb */
1403 + BP_NOT_DEFINED, /* usGpioLedHpna */
1404 + BP_GPIO_8_AH, /* usGpioLedWanData */
1405 + BP_NOT_DEFINED, /* usGpioLedPpp */
1406 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1407 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1408 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1409 + BP_GPIO_7_AH, /* usGpioLedBlResetCfg */
1410 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1411 + BP_EXT_INTR_2, /* usExtIntrWireless */
1412 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1413 + BP_NOT_DEFINED, /* usExtIntrHpna */
1414 + BP_NOT_DEFINED, /* usCsHpna */
1415 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1416 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1417 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1418 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1421 +static BOARD_PARAMETERS g_bcm96345gw =
1423 + "96345GW", /* szBoardId */
1424 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1425 + 0x00, /* ucPhyAddress */
1426 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1427 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1428 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1429 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1430 + BP_NOT_DEFINED, /* usGpioPhyReset */
1431 + 0x04, /* numSwitchPorts */
1432 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1433 + BP_ENET_NO_REVERSE_MII}, /* usReverseMii */
1434 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1435 + {{BP_VOIP_DSP, /* ucDspType */
1436 + 0x00, /* ucDspAddress */
1437 + BP_EXT_INTR_1, /* usExtIntrVoip */
1438 + BP_GPIO_6_AH, /* usGpioVoipReset */
1439 + BP_GPIO_15_AH, /* usGpioVoipIntr */
1440 + BP_NOT_DEFINED, /* usGpioLedVoip */
1441 + BP_CS_2}, /* usCsVoip */
1442 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1443 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1444 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1445 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1446 + BP_GPIO_1_AH, /* usGpioRj11OuterPair */
1447 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1448 + BP_GPIO_2_AH, /* usGpioPcmciaReset */
1449 + BP_NOT_DEFINED, /* usGpioUartRts */
1450 + BP_NOT_DEFINED, /* usGpioUartCts */
1451 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1452 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1453 + BP_GPIO_10_AH, /* usGpioLedWireless */
1454 + BP_GPIO_7_AH, /* usGpioLedUsb */
1455 + BP_NOT_DEFINED, /* usGpioLedHpna */
1456 + BP_GPIO_8_AH, /* usGpioLedWanData */
1457 + BP_NOT_DEFINED, /* usGpioLedPpp */
1458 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1459 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1460 + BP_GPIO_9_AH, /* usGpioLedBlAlarm */
1461 + BP_GPIO_10_AH, /* usGpioLedBlResetCfg */
1462 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1463 + BP_EXT_INTR_2, /* usExtIntrWireless */
1464 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1465 + BP_EXT_INTR_3, /* usExtIntrHpna */
1466 + BP_CS_1, /* usCsHpna */
1467 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1468 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1469 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1470 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1473 +static BOARD_PARAMETERS g_bcm96335r =
1475 + "96335R", /* szBoardId */
1476 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1477 + 0x01, /* ucPhyAddress */
1478 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1479 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1480 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1481 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1482 + BP_NOT_DEFINED, /* usGpioPhyReset */
1483 + 0x01, /* numSwitchPorts */
1484 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1485 + BP_NOT_DEFINED}, /* usReverseMii */
1486 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1487 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1488 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1489 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1490 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1491 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1492 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1493 + BP_GPIO_14_AH, /* usGpioPressAndHoldReset */
1494 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1495 + BP_NOT_DEFINED, /* usGpioUartRts */
1496 + BP_NOT_DEFINED, /* usGpioUartCts */
1497 + BP_GPIO_9_AH, /* usGpioLedAdsl */
1498 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1499 + BP_NOT_DEFINED, /* usGpioLedWireless */
1500 + BP_NOT_DEFINED, /* usGpioLedUsb */
1501 + BP_NOT_DEFINED, /* usGpioLedHpna */
1502 + BP_GPIO_9_AH, /* usGpioLedWanData */
1503 + BP_GPIO_8_AH, /* usGpioLedPpp */
1504 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1505 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1506 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1507 + BP_GPIO_8_AH, /* usGpioLedBlResetCfg */
1508 + BP_GPIO_9_AH, /* usGpioLedBlStop */
1509 + BP_NOT_DEFINED, /* usExtIntrWireless */
1510 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1511 + BP_NOT_DEFINED, /* usExtIntrHpna */
1512 + BP_NOT_DEFINED, /* usCsHpna */
1513 + BP_NOT_DEFINED, /* usAntInUseWireless */
1514 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1515 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1516 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1519 +static BOARD_PARAMETERS g_bcm96345r0 =
1521 + "96345R0", /* szBoardId */
1522 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1523 + 0x01, /* ucPhyAddress */
1524 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1525 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1526 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1527 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1528 + BP_NOT_DEFINED, /* usGpioPhyReset */
1529 + 0x01, /* numSwitchPorts */
1530 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1531 + BP_NOT_DEFINED}, /* usReverseMii */
1532 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1533 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1534 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1535 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1536 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1537 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1538 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1539 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1540 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1541 + BP_NOT_DEFINED, /* usGpioUartRts */
1542 + BP_NOT_DEFINED, /* usGpioUartCts */
1543 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1544 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1545 + BP_NOT_DEFINED, /* usGpioLedWireless */
1546 + BP_NOT_DEFINED, /* usGpioLedUsb */
1547 + BP_NOT_DEFINED, /* usGpioLedHpna */
1548 + BP_GPIO_9_AH, /* usGpioLedWanData */
1549 + BP_GPIO_9_AH, /* usGpioLedPpp */
1550 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1551 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1552 + BP_GPIO_9_AH, /* usGpioLedBlAlarm */
1553 + BP_GPIO_8_AH, /* usGpioLedBlResetCfg */
1554 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1555 + BP_NOT_DEFINED, /* usExtIntrWireless */
1556 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1557 + BP_NOT_DEFINED, /* usExtIntrHpna */
1558 + BP_NOT_DEFINED, /* usCsHpna */
1559 + BP_NOT_DEFINED, /* usAntInUseWireless */
1560 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1561 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1562 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1565 +static BOARD_PARAMETERS g_bcm96345rs =
1567 + "96345RS", /* szBoardId */
1568 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1569 + 0x00, /* ucPhyAddress */
1570 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1571 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1572 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1573 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1574 + BP_NOT_DEFINED, /* usGpioPhyReset */
1575 + 0x01, /* numSwitchPorts */
1576 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1577 + BP_ENET_NO_REVERSE_MII}, /* usReverseMii */
1578 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1579 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1580 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1581 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1582 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1583 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1584 + BP_GPIO_12_AH, /* usGpioRj11OuterPair */
1585 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1586 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1587 + BP_NOT_DEFINED, /* usGpioUartRts */
1588 + BP_NOT_DEFINED, /* usGpioUartCts */
1589 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1590 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1591 + BP_NOT_DEFINED, /* usGpioLedWireless */
1592 + BP_NOT_DEFINED, /* usGpioLedUsb */
1593 + BP_NOT_DEFINED, /* usGpioLedHpna */
1594 + BP_GPIO_8_AH, /* usGpioLedWanData */
1595 + BP_GPIO_9_AH, /* usGpioLedPpp */
1596 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1597 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1598 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1599 + BP_GPIO_9_AH, /* usGpioLedBlResetCfg */
1600 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1601 + BP_NOT_DEFINED, /* usExtIntrWireless */
1602 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1603 + BP_NOT_DEFINED, /* usExtIntrHpna */
1604 + BP_NOT_DEFINED, /* usCsHpna */
1605 + BP_NOT_DEFINED, /* usAntInUseWireless */
1606 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1607 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1608 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1611 +static PBOARD_PARAMETERS g_BoardParms[] =
1612 + {&g_bcm96345r, &g_bcm96345gw2, &g_bcm96345gw, &g_bcm96335r, &g_bcm96345r0,
1613 + &g_bcm96345rs, 0};
1616 +#if defined(_BCM96348_) || defined(CONFIG_BCM96348)
1618 +static BOARD_PARAMETERS g_bcm96348r =
1620 + "96348R", /* szBoardId */
1621 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1622 + 0x01, /* ucPhyAddress */
1623 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1624 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1625 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1626 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1627 + BP_NOT_DEFINED, /* usGpioPhyReset */
1628 + 0x01, /* numSwitchPorts */
1629 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1630 + BP_NOT_DEFINED}, /* usReverseMii */
1631 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1632 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1633 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1634 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1635 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1636 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1637 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1638 + BP_GPIO_7_AH, /* usGpioPressAndHoldReset */
1639 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1640 + BP_NOT_DEFINED, /* usGpioUartRts */
1641 + BP_NOT_DEFINED, /* usGpioUartCts */
1642 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1643 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1644 + BP_NOT_DEFINED, /* usGpioLedWireless */
1645 + BP_NOT_DEFINED, /* usGpioLedUsb */
1646 + BP_NOT_DEFINED, /* usGpioLedHpna */
1647 + BP_GPIO_3_AL, /* usGpioLedWanData */
1648 + BP_GPIO_3_AL, /* usGpioLedPpp */
1649 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1650 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1651 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1652 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1653 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1654 + BP_NOT_DEFINED, /* usExtIntrWireless */
1655 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1656 + BP_NOT_DEFINED, /* usExtIntrHpna */
1657 + BP_NOT_DEFINED, /* usCsHpna */
1658 + BP_NOT_DEFINED, /* usAntInUseWireless */
1659 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1660 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1661 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1664 +static BOARD_PARAMETERS g_bcm96348lv =
1666 + "96348LV", /* szBoardId */
1667 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1668 + 0x01, /* ucPhyAddress */
1669 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1670 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1671 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1672 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1673 + BP_NOT_DEFINED, /* usGpioPhyReset */
1674 + 0x01, /* numSwitchPorts */
1675 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1676 + BP_NOT_DEFINED}, /* usReverseMii */
1677 + {BP_ENET_EXTERNAL_PHY, /* ucPhyType */
1678 + 0x02, /* ucPhyAddress */
1679 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1680 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1681 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1682 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1683 + BP_GPIO_5_AL, /* usGpioPhyReset */
1684 + 0x01, /* numSwitchPorts */
1685 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1686 + BP_NOT_DEFINED}}, /* usReverseMii */
1687 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1688 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1689 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1690 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1691 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1692 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1693 + BP_GPIO_7_AH, /* usGpioPressAndHoldReset */
1694 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1695 + BP_NOT_DEFINED, /* usGpioUartRts */
1696 + BP_NOT_DEFINED, /* usGpioUartCts */
1697 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1698 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1699 + BP_NOT_DEFINED, /* usGpioLedWireless */
1700 + BP_NOT_DEFINED, /* usGpioLedUsb */
1701 + BP_NOT_DEFINED, /* usGpioLedHpna */
1702 + BP_GPIO_3_AL, /* usGpioLedWanData */
1703 + BP_GPIO_3_AL, /* usGpioLedPpp */
1704 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1705 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1706 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1707 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1708 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1709 + BP_NOT_DEFINED, /* usExtIntrWireless */
1710 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1711 + BP_NOT_DEFINED, /* usExtIntrHpna */
1712 + BP_NOT_DEFINED, /* usCsHpna */
1713 + BP_NOT_DEFINED, /* usAntInUseWireless */
1714 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1715 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1716 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1719 +static BOARD_PARAMETERS g_bcm96348gw =
1721 + "96348GW", /* szBoardId */
1722 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1723 + 0x01, /* ucPhyAddress */
1724 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1725 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1726 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1727 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1728 + BP_NOT_DEFINED, /* usGpioPhyReset */
1729 + 0x01, /* numSwitchPorts */
1730 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1731 + BP_NOT_DEFINED}, /* usReverseMii */
1732 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1733 + 0x00, /* ucPhyAddress */
1734 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1735 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1736 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1737 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1738 + BP_NOT_DEFINED, /* usGpioPhyReset */
1739 + 0x03, /* numSwitchPorts */
1740 + BP_ENET_CONFIG_SPI_SSB_0, /* usConfigType */
1741 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1742 + {{BP_VOIP_DSP, /* ucDspType */
1743 + 0x00, /* ucDspAddress */
1744 + BP_EXT_INTR_2, /* usExtIntrVoip */
1745 + BP_GPIO_6_AH, /* usGpioVoipReset */
1746 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1747 + BP_NOT_DEFINED, /* usGpioLedVoip */
1748 + BP_CS_2}, /* usCsVoip */
1749 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1750 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1751 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1752 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1753 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1754 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1755 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1756 + BP_NOT_DEFINED, /* usGpioUartRts */
1757 + BP_NOT_DEFINED, /* usGpioUartCts */
1758 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1759 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1760 + BP_NOT_DEFINED, /* usGpioLedWireless */
1761 + BP_NOT_DEFINED, /* usGpioLedUsb */
1762 + BP_NOT_DEFINED, /* usGpioLedHpna */
1763 + BP_GPIO_3_AL, /* usGpioLedWanData */
1764 + BP_GPIO_3_AL, /* usGpioLedPpp */
1765 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1766 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1767 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1768 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1769 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1770 + BP_NOT_DEFINED, /* usExtIntrWireless */
1771 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1772 + BP_NOT_DEFINED, /* usExtIntrHpna */
1773 + BP_NOT_DEFINED, /* usCsHpna */
1774 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1775 + BP_NOT_DEFINED, /* BP_GPIO_35_AH, */ /* usGpioSesBtnWireless */
1776 + BP_NOT_DEFINED, /* BP_EXT_INTR_3, */ /* usExtIntrSesBtnWireless */
1777 + BP_NOT_DEFINED /* BP_GPIO_0_AL */ /* usGpioLedSesWireless */
1781 +static BOARD_PARAMETERS g_bcm96348gw_10 =
1783 + "96348GW-10", /* szBoardId */
1784 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1785 + 0x01, /* ucPhyAddress */
1786 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1787 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1788 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1789 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1790 + BP_NOT_DEFINED, /* usGpioPhyReset */
1791 + 0x01, /* numSwitchPorts */
1792 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1793 + BP_NOT_DEFINED}, /* usReverseMii */
1794 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1795 + 0x00, /* ucPhyAddress */
1796 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1797 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1798 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1799 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1800 + BP_NOT_DEFINED, /* usGpioPhyReset */
1801 + 0x03, /* numSwitchPorts */
1802 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1803 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1804 + {{BP_VOIP_DSP, /* ucDspType */
1805 + 0x00, /* ucDspAddress */
1806 + BP_EXT_INTR_2, /* usExtIntrVoip */
1807 + BP_GPIO_6_AH, /* usGpioVoipReset */
1808 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1809 + BP_NOT_DEFINED, /* usGpioLedVoip */
1810 + BP_CS_2}, /* usCsVoip */
1811 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1812 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1813 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1814 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1815 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1816 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1817 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1818 + BP_NOT_DEFINED, /* usGpioUartRts */
1819 + BP_NOT_DEFINED, /* usGpioUartCts */
1820 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1821 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1822 + BP_NOT_DEFINED, /* usGpioLedWireless */
1823 + BP_NOT_DEFINED, /* usGpioLedUsb */
1824 + BP_NOT_DEFINED, /* usGpioLedHpna */
1825 + BP_GPIO_3_AL, /* usGpioLedWanData */
1826 + BP_GPIO_3_AL, /* usGpioLedPpp */
1827 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1828 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1829 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1830 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1831 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1832 + BP_NOT_DEFINED, /* usExtIntrWireless */
1833 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1834 + BP_NOT_DEFINED, /* usExtIntrHpna */
1835 + BP_NOT_DEFINED, /* usCsHpna */
1836 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1837 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1838 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1839 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1842 +static BOARD_PARAMETERS g_bcm96348gw_11 =
1844 + "96348GW-11", /* szBoardId */
1845 + {{BP_ENET_NO_PHY}, /* ucPhyType */
1846 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1847 + 0x00, /* ucPhyAddress */
1848 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1849 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1850 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1851 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1852 + BP_NOT_DEFINED, /* usGpioPhyReset */
1853 + 0x04, /* numSwitchPorts */
1854 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1855 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1856 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1857 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1858 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1859 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1860 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1861 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1862 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1863 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1864 + BP_NOT_DEFINED, /* usGpioUartRts */
1865 + BP_NOT_DEFINED, /* usGpioUartCts */
1866 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1867 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1868 + BP_NOT_DEFINED, /* usGpioLedWireless */
1869 + BP_NOT_DEFINED, /* usGpioLedUsb */
1870 + BP_NOT_DEFINED, /* usGpioLedHpna */
1871 + BP_GPIO_3_AL, /* usGpioLedWanData */
1872 + BP_GPIO_3_AL, /* usGpioLedPpp */
1873 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1874 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1875 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1876 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1877 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1878 + BP_NOT_DEFINED, /* usExtIntrWireless */
1879 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1880 + BP_NOT_DEFINED, /* usExtIntrHpna */
1881 + BP_NOT_DEFINED, /* usCsHpna */
1882 + BP_NOT_DEFINED, /* usAntInUseWireless */
1883 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1884 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1885 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1888 +static BOARD_PARAMETERS g_bcm96348sv =
1890 + "96348SV", /* szBoardId */
1891 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1892 + 0x01, /* ucPhyAddress */
1893 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1894 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1895 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1896 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1897 + BP_NOT_DEFINED, /* usGpioPhyReset */
1898 + 0x01, /* numSwitchPorts */
1899 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1900 + BP_NOT_DEFINED}, /* usReverseMii */
1901 + {BP_ENET_EXTERNAL_PHY, /* ucPhyType */
1902 + 0x1f, /* ucPhyAddress */
1903 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1904 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1905 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1906 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1907 + BP_NOT_DEFINED, /* usGpioPhyReset */
1908 + 0x01, /* numSwitchPorts */
1909 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1910 + BP_NOT_DEFINED}}, /* usReverseMii */
1911 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1912 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1913 + BP_MEMORY_32MB_2_CHIP, /* usSdramSize */
1914 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1915 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1916 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1917 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1918 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1919 + BP_NOT_DEFINED, /* usGpioUartRts */
1920 + BP_NOT_DEFINED, /* usGpioUartCts */
1921 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1922 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1923 + BP_NOT_DEFINED, /* usGpioLedWireless */
1924 + BP_NOT_DEFINED, /* usGpioLedUsb */
1925 + BP_NOT_DEFINED, /* usGpioLedHpna */
1926 + BP_NOT_DEFINED, /* usGpioLedWanData */
1927 + BP_NOT_DEFINED, /* usGpioLedPpp */
1928 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1929 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1930 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1931 + BP_NOT_DEFINED, /* usGpioLedBlResetCfg */
1932 + BP_NOT_DEFINED, /* usGpioLedBlStop */
1933 + BP_NOT_DEFINED, /* usExtIntrWireless */
1934 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1935 + BP_NOT_DEFINED, /* usExtIntrHpna */
1936 + BP_NOT_DEFINED, /* usCsHpna */
1937 + BP_NOT_DEFINED, /* usAntInUseWireless */
1938 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1939 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1940 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1944 +static BOARD_PARAMETERS g_bcm96348gw_dualDsp =
1946 + "96348GW-DualDSP", /* szBoardId */
1947 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1948 + 0x01, /* ucPhyAddress */
1949 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1950 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1951 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1952 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1953 + BP_NOT_DEFINED, /* usGpioPhyReset */
1954 + 0x01, /* numSwitchPorts */
1955 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1956 + BP_NOT_DEFINED}, /* usReverseMii */
1957 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1958 + 0x00, /* ucPhyAddress */
1959 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1960 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1961 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1962 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1963 + BP_NOT_DEFINED, /* usGpioPhyReset */
1964 + 0x03, /* numSwitchPorts */
1965 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1966 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1967 + {{BP_VOIP_DSP, /* ucDspType */
1968 + 0x00, /* ucDspAddress */
1969 + BP_EXT_INTR_2, /* usExtIntrVoip */
1970 + BP_UNEQUIPPED, /* usGpioVoipReset */
1971 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1972 + BP_NOT_DEFINED, /* usGpioLedVoip */
1973 + BP_CS_2}, /* usCsVoip */
1974 + {BP_VOIP_DSP, /* ucDspType */
1975 + 0x01, /* ucDspAddress */
1976 + BP_EXT_INTR_3, /* usExtIntrVoip */
1977 + BP_UNEQUIPPED , /* usGpioVoipReset */
1978 + BP_GPIO_35_AH, /* usGpioVoipIntr */
1979 + BP_NOT_DEFINED, /* usGpioLedVoip */
1980 + BP_CS_3}}, /* usCsVoip */
1981 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1982 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1983 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1984 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1985 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1986 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1987 + BP_NOT_DEFINED, /* usGpioUartRts */
1988 + BP_NOT_DEFINED, /* usGpioUartCts */
1989 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1990 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1991 + BP_NOT_DEFINED, /* usGpioLedWireless */
1992 + BP_NOT_DEFINED, /* usGpioLedUsb */
1993 + BP_NOT_DEFINED, /* usGpioLedHpna */
1994 + BP_GPIO_3_AL, /* usGpioLedWanData */
1995 + BP_GPIO_3_AL, /* usGpioLedPpp */
1996 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1997 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1998 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1999 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
2000 + BP_GPIO_1_AL, /* usGpioLedBlStop */
2001 + BP_NOT_DEFINED, /* usExtIntrWireless */
2002 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
2003 + BP_NOT_DEFINED, /* usExtIntrHpna */
2004 + BP_NOT_DEFINED, /* usCsHpna */
2005 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
2006 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
2007 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
2008 + BP_NOT_DEFINED /* usGpioLedSesWireless */
2012 +static BOARD_PARAMETERS g_bcmCustom_01 =
2014 + "BCMCUST_01", /* szBoardId */
2015 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
2016 + 0x01, /* ucPhyAddress */
2017 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
2018 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
2019 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
2020 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
2021 + BP_NOT_DEFINED, /* usGpioPhyReset */
2022 + 0x01, /* numSwitchPorts */
2023 + BP_ENET_CONFIG_MDIO, /* usConfigType */
2024 + BP_NOT_DEFINED}, /* usReverseMii */
2025 + {BP_ENET_NO_PHY, /* ucPhyType */
2026 + 0x00, /* ucPhyAddress */
2027 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
2028 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
2029 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
2030 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
2031 + BP_NOT_DEFINED, /* usGpioPhyReset */
2032 + 0x01, /* numSwitchPorts */
2033 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
2034 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
2035 + {{BP_VOIP_DSP, /* ucDspType */
2036 + 0x00, /* ucDspAddress */
2037 + BP_EXT_INTR_2, /* usExtIntrVoip */
2038 + BP_GPIO_36_AH, /* usGpioVoipReset */
2039 + BP_GPIO_34_AL, /* usGpioVoipIntr */
2040 + BP_NOT_DEFINED, /* usGpioLedVoip */
2041 + BP_CS_2}, /* usCsVoip */
2042 + {BP_VOIP_NO_DSP}}, /* ucDspType */
2043 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
2044 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
2045 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
2046 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
2047 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
2048 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
2049 + BP_NOT_DEFINED, /* usGpioUartRts */
2050 + BP_NOT_DEFINED, /* usGpioUartCts */
2051 + BP_NOT_DEFINED, /* usGpioLedAdsl */
2052 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
2053 + BP_NOT_DEFINED, /* usGpioLedWireless */
2054 + BP_NOT_DEFINED, /* usGpioLedUsb */
2055 + BP_NOT_DEFINED, /* usGpioLedHpna */
2056 + BP_GPIO_3_AL, /* usGpioLedWanData */
2057 + BP_GPIO_3_AL, /* usGpioLedPpp */
2058 + BP_GPIO_4_AL, /* usGpioLedPppFail */
2059 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
2060 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
2061 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
2062 + BP_GPIO_1_AL, /* usGpioLedBlStop */
2063 + BP_NOT_DEFINED, /* usExtIntrWireless */
2064 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
2065 + BP_NOT_DEFINED, /* usExtIntrHpna */
2066 + BP_NOT_DEFINED, /* usCsHpna */
2067 + BP_NOT_DEFINED, /* usAntInUseWireless */
2068 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
2069 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
2070 + BP_NOT_DEFINED /* usGpioLedSesWireless */
2073 +static PBOARD_PARAMETERS g_BoardParms[] =
2074 + {&g_bcm96348r, &g_bcm96348lv, &g_bcm96348gw, &g_bcm96348gw_10,
2075 + &g_bcm96348gw_11, &g_bcm96348sv, &g_bcm96348gw_dualDsp,
2076 + &g_bcmCustom_01, 0};
2079 +static PBOARD_PARAMETERS g_pCurrentBp = 0;
2081 +/**************************************************************************
2084 + * Description: String compare for this file so it does not depend on an OS.
2085 + * (Linux kernel and CFE share this source file.)
2087 + * Parameters : [IN] dest - destination string
2088 + * [IN] src - source string
2090 + * Returns : -1 - dest < src, 1 - dest > src, 0 dest == src
2091 + ***************************************************************************/
2092 +static int bpstrcmp(const char *dest,const char *src);
2093 +static int bpstrcmp(const char *dest,const char *src)
2095 + while (*src && *dest)
2097 + if (*dest < *src) return -1;
2098 + if (*dest > *src) return 1;
2103 + if (*dest && !*src) return 1;
2104 + if (!*dest && *src) return -1;
2108 +/**************************************************************************
2109 + * Name : BpGetVoipDspConfig
2111 + * Description: Gets the DSP configuration from the board parameter
2112 + * structure for a given DSP index.
2114 + * Parameters : [IN] dspNum - DSP index (number)
2116 + * Returns : Pointer to DSP configuration block if found/valid, NULL
2118 + ***************************************************************************/
2119 +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum );
2120 +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum )
2122 + VOIP_DSP_INFO *pDspConfig = 0;
2125 + if( g_pCurrentBp )
2127 + for( i = 0 ; i < BP_MAX_VOIP_DSP ; i++ )
2129 + if( g_pCurrentBp->VoIPDspInfo[i].ucDspType != BP_VOIP_NO_DSP &&
2130 + g_pCurrentBp->VoIPDspInfo[i].ucDspAddress == dspNum )
2132 + pDspConfig = &g_pCurrentBp->VoIPDspInfo[i];
2138 + return pDspConfig;
2142 +/**************************************************************************
2143 + * Name : BpSetBoardId
2145 + * Description: This function find the BOARD_PARAMETERS structure for the
2146 + * specified board id string and assigns it to a global, static
2149 + * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
2151 + * Returns : BP_SUCCESS - Success, value is returned.
2152 + * BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
2153 + * have a board parameters configuration record.
2154 + ***************************************************************************/
2155 +int BpSetBoardId( char *pszBoardId )
2157 + int nRet = BP_BOARD_ID_NOT_FOUND;
2158 + PBOARD_PARAMETERS *ppBp;
2160 + for( ppBp = g_BoardParms; *ppBp; ppBp++ )
2162 + if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
2164 + g_pCurrentBp = *ppBp;
2165 + nRet = BP_SUCCESS;
2171 +} /* BpSetBoardId */
2173 +/**************************************************************************
2174 + * Name : BpGetBoardIds
2176 + * Description: This function returns all of the supported board id strings.
2178 + * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
2179 + * strings are returned in. Each id starts at BP_BOARD_ID_LEN
2181 + * [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
2182 + * were allocated in pszBoardIds.
2184 + * Returns : Number of board id strings returned.
2185 + ***************************************************************************/
2186 +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize )
2188 + PBOARD_PARAMETERS *ppBp;
2193 + for( i = 0, ppBp = g_BoardParms; *ppBp && nBoardIdsSize;
2194 + i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN )
2196 + dest = pszBoardIds;
2197 + src = (*ppBp)->szBoardId;
2204 +} /* BpGetBoardIds */
2206 +/**************************************************************************
2207 + * Name : BpGetEthernetMacInfo
2209 + * Description: This function returns all of the supported board id strings.
2211 + * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
2213 + * [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
2214 + * are pointed to by pEnetInfos.
2216 + * Returns : BP_SUCCESS - Success, value is returned.
2217 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2218 + ***************************************************************************/
2219 +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos )
2223 + if( g_pCurrentBp )
2225 + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
2227 + if( i < BP_MAX_ENET_MACS )
2229 + unsigned char *src = (unsigned char *)
2230 + &g_pCurrentBp->EnetMacInfos[i];
2231 + unsigned char *dest = (unsigned char *) pEnetInfos;
2232 + int len = sizeof(ETHERNET_MAC_INFO);
2237 + pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
2240 + nRet = BP_SUCCESS;
2244 + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
2245 + pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
2247 + nRet = BP_BOARD_ID_NOT_SET;
2251 +} /* BpGetEthernetMacInfo */
2253 +/**************************************************************************
2254 + * Name : BpGetSdramSize
2256 + * Description: This function returns a constant that describees the board's
2257 + * SDRAM type and size.
2259 + * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
2262 + * Returns : BP_SUCCESS - Success, value is returned.
2263 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2264 + ***************************************************************************/
2265 +int BpGetSdramSize( unsigned long *pulSdramSize )
2269 + if( g_pCurrentBp )
2271 + *pulSdramSize = g_pCurrentBp->usSdramSize;
2272 + nRet = BP_SUCCESS;
2276 + *pulSdramSize = BP_NOT_DEFINED;
2277 + nRet = BP_BOARD_ID_NOT_SET;
2281 +} /* BpGetSdramSize */
2283 +/**************************************************************************
2284 + * Name : BpGetPsiSize
2286 + * Description: This function returns the persistent storage size in K bytes.
2288 + * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
2289 + * storage size is returned in.
2291 + * Returns : BP_SUCCESS - Success, value is returned.
2292 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2293 + ***************************************************************************/
2294 +int BpGetPsiSize( unsigned long *pulPsiSize )
2298 + if( g_pCurrentBp )
2300 + *pulPsiSize = g_pCurrentBp->usPsiSize;
2301 + nRet = BP_SUCCESS;
2305 + *pulPsiSize = BP_NOT_DEFINED;
2306 + nRet = BP_BOARD_ID_NOT_SET;
2310 +} /* BpGetPsiSize */
2312 +/**************************************************************************
2313 + * Name : BpGetRj11InnerOuterPairGpios
2315 + * Description: This function returns the GPIO pin assignments for changing
2316 + * between the RJ11 inner pair and RJ11 outer pair.
2318 + * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
2319 + * GPIO pin is returned in.
2320 + * [OUT] pusOuter - Address of short word that the RJ11 outer pair
2321 + * GPIO pin is returned in.
2323 + * Returns : BP_SUCCESS - Success, values are returned.
2324 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2325 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2327 + ***************************************************************************/
2328 +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
2329 + unsigned short *pusOuter )
2333 + if( g_pCurrentBp )
2335 + *pusInner = g_pCurrentBp->usGpioRj11InnerPair;
2336 + *pusOuter = g_pCurrentBp->usGpioRj11OuterPair;
2338 + if( g_pCurrentBp->usGpioRj11InnerPair != BP_NOT_DEFINED &&
2339 + g_pCurrentBp->usGpioRj11OuterPair != BP_NOT_DEFINED )
2341 + nRet = BP_SUCCESS;
2345 + nRet = BP_VALUE_NOT_DEFINED;
2350 + *pusInner = *pusOuter = BP_NOT_DEFINED;
2351 + nRet = BP_BOARD_ID_NOT_SET;
2355 +} /* BpGetRj11InnerOuterPairGpios */
2357 +/**************************************************************************
2358 + * Name : BpGetPressAndHoldResetGpio
2360 + * Description: This function returns the GPIO pin assignment for the press
2361 + * and hold reset button.
2363 + * Parameters : [OUT] pusValue - Address of short word that the press and hold
2364 + * reset button GPIO pin is returned in.
2366 + * Returns : BP_SUCCESS - Success, value is returned.
2367 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2368 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2370 + ***************************************************************************/
2371 +int BpGetPressAndHoldResetGpio( unsigned short *pusValue )
2375 + if( g_pCurrentBp )
2377 + *pusValue = g_pCurrentBp->usGpioPressAndHoldReset;
2379 + if( g_pCurrentBp->usGpioPressAndHoldReset != BP_NOT_DEFINED )
2381 + nRet = BP_SUCCESS;
2385 + nRet = BP_VALUE_NOT_DEFINED;
2390 + *pusValue = BP_NOT_DEFINED;
2391 + nRet = BP_BOARD_ID_NOT_SET;
2395 +} /* BpGetPressAndHoldResetGpio */
2397 +/**************************************************************************
2398 + * Name : BpGetVoipResetGpio
2400 + * Description: This function returns the GPIO pin assignment for the VOIP
2401 + * Reset operation.
2403 + * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
2404 + * GPIO pin is returned in.
2405 + * [IN] dspNum - Address of the DSP to query.
2407 + * Returns : BP_SUCCESS - Success, value is returned.
2408 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2409 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2411 + ***************************************************************************/
2412 +int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue )
2416 + if( g_pCurrentBp )
2418 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2422 + *pusValue = pDspInfo->usGpioVoipReset;
2424 + if( *pusValue != BP_NOT_DEFINED ||
2425 + *pusValue == BP_UNEQUIPPED )
2427 + nRet = BP_SUCCESS;
2431 + nRet = BP_VALUE_NOT_DEFINED;
2436 + *pusValue = BP_NOT_DEFINED;
2437 + nRet = BP_BOARD_ID_NOT_FOUND;
2442 + *pusValue = BP_NOT_DEFINED;
2443 + nRet = BP_BOARD_ID_NOT_SET;
2447 +} /* BpGetVoipResetGpio */
2449 +/**************************************************************************
2450 + * Name : BpGetVoipIntrGpio
2452 + * Description: This function returns the GPIO pin assignment for VoIP interrupt.
2454 + * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
2455 + * GPIO pin is returned in.
2456 + * [IN] dspNum - Address of the DSP to query.
2458 + * Returns : BP_SUCCESS - Success, value is returned.
2459 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2460 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2462 + ***************************************************************************/
2463 +int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue )
2467 + if( g_pCurrentBp )
2469 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2473 + *pusValue = pDspInfo->usGpioVoipIntr;
2475 + if( *pusValue != BP_NOT_DEFINED )
2477 + nRet = BP_SUCCESS;
2481 + nRet = BP_VALUE_NOT_DEFINED;
2486 + *pusValue = BP_NOT_DEFINED;
2487 + nRet = BP_BOARD_ID_NOT_FOUND;
2492 + *pusValue = BP_NOT_DEFINED;
2493 + nRet = BP_BOARD_ID_NOT_SET;
2497 +} /* BpGetVoipIntrGpio */
2499 +/**************************************************************************
2500 + * Name : BpGetPcmciaResetGpio
2502 + * Description: This function returns the GPIO pin assignment for the PCMCIA
2503 + * Reset operation.
2505 + * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
2506 + * GPIO pin is returned in.
2508 + * Returns : BP_SUCCESS - Success, value is returned.
2509 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2510 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2512 + ***************************************************************************/
2513 +int BpGetPcmciaResetGpio( unsigned short *pusValue )
2517 + if( g_pCurrentBp )
2519 + *pusValue = g_pCurrentBp->usGpioPcmciaReset;
2521 + if( g_pCurrentBp->usGpioPcmciaReset != BP_NOT_DEFINED )
2523 + nRet = BP_SUCCESS;
2527 + nRet = BP_VALUE_NOT_DEFINED;
2532 + *pusValue = BP_NOT_DEFINED;
2533 + nRet = BP_BOARD_ID_NOT_SET;
2537 +} /* BpGetPcmciaResetGpio */
2539 +/**************************************************************************
2540 + * Name : BpGetUartRtsCtsGpios
2542 + * Description: This function returns the GPIO pin assignments for RTS and CTS
2545 + * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
2546 + * pin is returned in.
2547 + * [OUT] pusCts - Address of short word that the UART CTS GPIO
2548 + * pin is returned in.
2550 + * Returns : BP_SUCCESS - Success, values are returned.
2551 + * BP_BOARD_ID_NOT_SET - Error, board id input string does not
2552 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2554 + ***************************************************************************/
2555 +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts )
2559 + if( g_pCurrentBp )
2561 + *pusRts = g_pCurrentBp->usGpioUartRts;
2562 + *pusCts = g_pCurrentBp->usGpioUartCts;
2564 + if( g_pCurrentBp->usGpioUartRts != BP_NOT_DEFINED &&
2565 + g_pCurrentBp->usGpioUartCts != BP_NOT_DEFINED )
2567 + nRet = BP_SUCCESS;
2571 + nRet = BP_VALUE_NOT_DEFINED;
2576 + *pusRts = *pusCts = BP_NOT_DEFINED;
2577 + nRet = BP_BOARD_ID_NOT_SET;
2581 +} /* BpGetUartRtsCtsGpios */
2583 +/**************************************************************************
2584 + * Name : BpGetAdslLedGpio
2586 + * Description: This function returns the GPIO pin assignment for the ADSL
2589 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
2590 + * GPIO pin is returned in.
2592 + * Returns : BP_SUCCESS - Success, value is returned.
2593 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2594 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2596 + ***************************************************************************/
2597 +int BpGetAdslLedGpio( unsigned short *pusValue )
2601 + if( g_pCurrentBp )
2603 + *pusValue = g_pCurrentBp->usGpioLedAdsl;
2605 + if( g_pCurrentBp->usGpioLedAdsl != BP_NOT_DEFINED )
2607 + nRet = BP_SUCCESS;
2611 + nRet = BP_VALUE_NOT_DEFINED;
2616 + *pusValue = BP_NOT_DEFINED;
2617 + nRet = BP_BOARD_ID_NOT_SET;
2621 +} /* BpGetAdslLedGpio */
2623 +/**************************************************************************
2624 + * Name : BpGetAdslFailLedGpio
2626 + * Description: This function returns the GPIO pin assignment for the ADSL
2627 + * LED that is used when there is a DSL connection failure.
2629 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
2630 + * GPIO pin is returned in.
2632 + * Returns : BP_SUCCESS - Success, value is returned.
2633 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2634 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2636 + ***************************************************************************/
2637 +int BpGetAdslFailLedGpio( unsigned short *pusValue )
2641 + if( g_pCurrentBp )
2643 + *pusValue = g_pCurrentBp->usGpioLedAdslFail;
2645 + if( g_pCurrentBp->usGpioLedAdslFail != BP_NOT_DEFINED )
2647 + nRet = BP_SUCCESS;
2651 + nRet = BP_VALUE_NOT_DEFINED;
2656 + *pusValue = BP_NOT_DEFINED;
2657 + nRet = BP_BOARD_ID_NOT_SET;
2661 +} /* BpGetAdslFailLedGpio */
2663 +/**************************************************************************
2664 + * Name : BpGetWirelessLedGpio
2666 + * Description: This function returns the GPIO pin assignment for the Wireless
2669 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
2670 + * GPIO pin is returned in.
2672 + * Returns : BP_SUCCESS - Success, value is returned.
2673 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2674 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2676 + ***************************************************************************/
2677 +int BpGetWirelessLedGpio( unsigned short *pusValue )
2681 + if( g_pCurrentBp )
2683 + *pusValue = g_pCurrentBp->usGpioLedWireless;
2685 + if( g_pCurrentBp->usGpioLedWireless != BP_NOT_DEFINED )
2687 + nRet = BP_SUCCESS;
2691 + nRet = BP_VALUE_NOT_DEFINED;
2696 + *pusValue = BP_NOT_DEFINED;
2697 + nRet = BP_BOARD_ID_NOT_SET;
2701 +} /* BpGetWirelessLedGpio */
2703 +/**************************************************************************
2704 + * Name : BpGetWirelessAntInUse
2706 + * Description: This function returns the antennas in use for wireless
2708 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
2711 + * Returns : BP_SUCCESS - Success, value is returned.
2712 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2713 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2715 + ***************************************************************************/
2716 +int BpGetWirelessAntInUse( unsigned short *pusValue )
2720 + if( g_pCurrentBp )
2722 + *pusValue = g_pCurrentBp->usAntInUseWireless;
2724 + if( g_pCurrentBp->usAntInUseWireless != BP_NOT_DEFINED )
2726 + nRet = BP_SUCCESS;
2730 + nRet = BP_VALUE_NOT_DEFINED;
2735 + *pusValue = BP_NOT_DEFINED;
2736 + nRet = BP_BOARD_ID_NOT_SET;
2740 +} /* BpGetWirelessAntInUse */
2742 +/**************************************************************************
2743 + * Name : BpGetWirelessSesBtnGpio
2745 + * Description: This function returns the GPIO pin assignment for the Wireless
2748 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
2749 + * GPIO pin is returned in.
2751 + * Returns : BP_SUCCESS - Success, value is returned.
2752 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2753 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2755 + ***************************************************************************/
2756 +int BpGetWirelessSesBtnGpio( unsigned short *pusValue )
2760 + if( g_pCurrentBp )
2762 + *pusValue = g_pCurrentBp->usGpioSesBtnWireless;
2764 + if( g_pCurrentBp->usGpioSesBtnWireless != BP_NOT_DEFINED )
2766 + nRet = BP_SUCCESS;
2770 + nRet = BP_VALUE_NOT_DEFINED;
2775 + *pusValue = BP_NOT_DEFINED;
2776 + nRet = BP_BOARD_ID_NOT_SET;
2780 +} /* BpGetWirelessSesBtnGpio */
2782 +/**************************************************************************
2783 + * Name : BpGetWirelessSesExtIntr
2785 + * Description: This function returns the external interrupt number for the
2786 + * Wireless Ses Button.
2788 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
2789 + * external interrup is returned in.
2791 + * Returns : BP_SUCCESS - Success, value is returned.
2792 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2793 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2795 + ***************************************************************************/
2796 +int BpGetWirelessSesExtIntr( unsigned short *pusValue )
2800 + if( g_pCurrentBp )
2802 + *pusValue = g_pCurrentBp->usExtIntrSesBtnWireless;
2804 + if( g_pCurrentBp->usExtIntrSesBtnWireless != BP_NOT_DEFINED )
2806 + nRet = BP_SUCCESS;
2810 + nRet = BP_VALUE_NOT_DEFINED;
2815 + *pusValue = BP_NOT_DEFINED;
2816 + nRet = BP_BOARD_ID_NOT_SET;
2821 +} /* BpGetWirelessSesExtIntr */
2823 +/**************************************************************************
2824 + * Name : BpGetWirelessSesLedGpio
2826 + * Description: This function returns the GPIO pin assignment for the Wireless
2829 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
2830 + * Led GPIO pin is returned in.
2832 + * Returns : BP_SUCCESS - Success, value is returned.
2833 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2834 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2836 + ***************************************************************************/
2837 +int BpGetWirelessSesLedGpio( unsigned short *pusValue )
2841 + if( g_pCurrentBp )
2843 + *pusValue = g_pCurrentBp->usGpioLedSesWireless;
2845 + if( g_pCurrentBp->usGpioLedSesWireless != BP_NOT_DEFINED )
2847 + nRet = BP_SUCCESS;
2851 + nRet = BP_VALUE_NOT_DEFINED;
2856 + *pusValue = BP_NOT_DEFINED;
2857 + nRet = BP_BOARD_ID_NOT_SET;
2862 +} /* BpGetWirelessSesLedGpio */
2864 +/**************************************************************************
2865 + * Name : BpGetUsbLedGpio
2867 + * Description: This function returns the GPIO pin assignment for the USB
2870 + * Parameters : [OUT] pusValue - Address of short word that the USB LED
2871 + * GPIO pin is returned in.
2873 + * Returns : BP_SUCCESS - Success, value is returned.
2874 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2875 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2877 + ***************************************************************************/
2878 +int BpGetUsbLedGpio( unsigned short *pusValue )
2882 + if( g_pCurrentBp )
2884 + *pusValue = g_pCurrentBp->usGpioLedUsb;
2886 + if( g_pCurrentBp->usGpioLedUsb != BP_NOT_DEFINED )
2888 + nRet = BP_SUCCESS;
2892 + nRet = BP_VALUE_NOT_DEFINED;
2897 + *pusValue = BP_NOT_DEFINED;
2898 + nRet = BP_BOARD_ID_NOT_SET;
2902 +} /* BpGetUsbLedGpio */
2904 +/**************************************************************************
2905 + * Name : BpGetHpnaLedGpio
2907 + * Description: This function returns the GPIO pin assignment for the HPNA
2910 + * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
2911 + * GPIO pin is returned in.
2913 + * Returns : BP_SUCCESS - Success, value is returned.
2914 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2915 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2917 + ***************************************************************************/
2918 +int BpGetHpnaLedGpio( unsigned short *pusValue )
2922 + if( g_pCurrentBp )
2924 + *pusValue = g_pCurrentBp->usGpioLedHpna;
2926 + if( g_pCurrentBp->usGpioLedHpna != BP_NOT_DEFINED )
2928 + nRet = BP_SUCCESS;
2932 + nRet = BP_VALUE_NOT_DEFINED;
2937 + *pusValue = BP_NOT_DEFINED;
2938 + nRet = BP_BOARD_ID_NOT_SET;
2942 +} /* BpGetHpnaLedGpio */
2944 +/**************************************************************************
2945 + * Name : BpGetWanDataLedGpio
2947 + * Description: This function returns the GPIO pin assignment for the WAN Data
2950 + * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
2951 + * GPIO pin is returned in.
2953 + * Returns : BP_SUCCESS - Success, value is returned.
2954 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2955 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2957 + ***************************************************************************/
2958 +int BpGetWanDataLedGpio( unsigned short *pusValue )
2962 + if( g_pCurrentBp )
2964 + *pusValue = g_pCurrentBp->usGpioLedWanData;
2966 + if( g_pCurrentBp->usGpioLedWanData != BP_NOT_DEFINED )
2968 + nRet = BP_SUCCESS;
2972 + nRet = BP_VALUE_NOT_DEFINED;
2977 + *pusValue = BP_NOT_DEFINED;
2978 + nRet = BP_BOARD_ID_NOT_SET;
2982 +} /* BpGetWanDataLedGpio */
2984 +/**************************************************************************
2985 + * Name : BpGetPppLedGpio
2987 + * Description: This function returns the GPIO pin assignment for the PPP
2990 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
2991 + * GPIO pin is returned in.
2993 + * Returns : BP_SUCCESS - Success, value is returned.
2994 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2995 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2997 + ***************************************************************************/
2998 +int BpGetPppLedGpio( unsigned short *pusValue )
3002 + if( g_pCurrentBp )
3004 + *pusValue = g_pCurrentBp->usGpioLedPpp;
3006 + if( g_pCurrentBp->usGpioLedPpp != BP_NOT_DEFINED )
3008 + nRet = BP_SUCCESS;
3012 + nRet = BP_VALUE_NOT_DEFINED;
3017 + *pusValue = BP_NOT_DEFINED;
3018 + nRet = BP_BOARD_ID_NOT_SET;
3022 +} /* BpGetPppLedGpio */
3024 +/**************************************************************************
3025 + * Name : BpGetPppFailLedGpio
3027 + * Description: This function returns the GPIO pin assignment for the PPP
3028 + * LED that is used when there is a PPP connection failure.
3030 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
3031 + * GPIO pin is returned in.
3033 + * Returns : BP_SUCCESS - Success, value is returned.
3034 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3035 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3037 + ***************************************************************************/
3038 +int BpGetPppFailLedGpio( unsigned short *pusValue )
3042 + if( g_pCurrentBp )
3044 + *pusValue = g_pCurrentBp->usGpioLedPppFail;
3046 + if( g_pCurrentBp->usGpioLedPppFail != BP_NOT_DEFINED )
3048 + nRet = BP_SUCCESS;
3052 + nRet = BP_VALUE_NOT_DEFINED;
3057 + *pusValue = BP_NOT_DEFINED;
3058 + nRet = BP_BOARD_ID_NOT_SET;
3062 +} /* BpGetPppFailLedGpio */
3064 +/**************************************************************************
3065 + * Name : BpGetBootloaderPowerOnLedGpio
3067 + * Description: This function returns the GPIO pin assignment for the power
3068 + * on LED that is set by the bootloader.
3070 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
3071 + * GPIO pin is returned in.
3073 + * Returns : BP_SUCCESS - Success, value is returned.
3074 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3075 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3077 + ***************************************************************************/
3078 +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue )
3082 + if( g_pCurrentBp )
3084 + *pusValue = g_pCurrentBp->usGpioLedBlPowerOn;
3086 + if( g_pCurrentBp->usGpioLedBlPowerOn != BP_NOT_DEFINED )
3088 + nRet = BP_SUCCESS;
3092 + nRet = BP_VALUE_NOT_DEFINED;
3097 + *pusValue = BP_NOT_DEFINED;
3098 + nRet = BP_BOARD_ID_NOT_SET;
3102 +} /* BpGetBootloaderPowerOn */
3104 +/**************************************************************************
3105 + * Name : BpGetBootloaderAlarmLedGpio
3107 + * Description: This function returns the GPIO pin assignment for the alarm
3108 + * LED that is set by the bootloader.
3110 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
3111 + * GPIO pin is returned in.
3113 + * Returns : BP_SUCCESS - Success, value is returned.
3114 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3115 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3117 + ***************************************************************************/
3118 +int BpGetBootloaderAlarmLedGpio( unsigned short *pusValue )
3122 + if( g_pCurrentBp )
3124 + *pusValue = g_pCurrentBp->usGpioLedBlAlarm;
3126 + if( g_pCurrentBp->usGpioLedBlAlarm != BP_NOT_DEFINED )
3128 + nRet = BP_SUCCESS;
3132 + nRet = BP_VALUE_NOT_DEFINED;
3137 + *pusValue = BP_NOT_DEFINED;
3138 + nRet = BP_BOARD_ID_NOT_SET;
3142 +} /* BpGetBootloaderAlarmLedGpio */
3144 +/**************************************************************************
3145 + * Name : BpGetBootloaderResetCfgLedGpio
3147 + * Description: This function returns the GPIO pin assignment for the reset
3148 + * configuration LED that is set by the bootloader.
3150 + * Parameters : [OUT] pusValue - Address of short word that the reset
3151 + * configuration LED GPIO pin is returned in.
3153 + * Returns : BP_SUCCESS - Success, value is returned.
3154 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3155 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3157 + ***************************************************************************/
3158 +int BpGetBootloaderResetCfgLedGpio( unsigned short *pusValue )
3162 + if( g_pCurrentBp )
3164 + *pusValue = g_pCurrentBp->usGpioLedBlResetCfg;
3166 + if( g_pCurrentBp->usGpioLedBlResetCfg != BP_NOT_DEFINED )
3168 + nRet = BP_SUCCESS;
3172 + nRet = BP_VALUE_NOT_DEFINED;
3177 + *pusValue = BP_NOT_DEFINED;
3178 + nRet = BP_BOARD_ID_NOT_SET;
3182 +} /* BpGetBootloaderResetCfgLedGpio */
3184 +/**************************************************************************
3185 + * Name : BpGetBootloaderStopLedGpio
3187 + * Description: This function returns the GPIO pin assignment for the break
3188 + * into bootloader LED that is set by the bootloader.
3190 + * Parameters : [OUT] pusValue - Address of short word that the break into
3191 + * bootloader LED GPIO pin is returned in.
3193 + * Returns : BP_SUCCESS - Success, value is returned.
3194 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3195 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3197 + ***************************************************************************/
3198 +int BpGetBootloaderStopLedGpio( unsigned short *pusValue )
3202 + if( g_pCurrentBp )
3204 + *pusValue = g_pCurrentBp->usGpioLedBlStop;
3206 + if( g_pCurrentBp->usGpioLedBlStop != BP_NOT_DEFINED )
3208 + nRet = BP_SUCCESS;
3212 + nRet = BP_VALUE_NOT_DEFINED;
3217 + *pusValue = BP_NOT_DEFINED;
3218 + nRet = BP_BOARD_ID_NOT_SET;
3222 +} /* BpGetBootloaderStopLedGpio */
3224 +/**************************************************************************
3225 + * Name : BpGetVoipLedGpio
3227 + * Description: This function returns the GPIO pin assignment for the VOIP
3230 + * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
3231 + * GPIO pin is returned in.
3233 + * Returns : BP_SUCCESS - Success, value is returned.
3234 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3235 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3238 + * Note : The VoIP structure would allow for having one LED per DSP
3239 + * however, the board initialization function assumes only one
3240 + * LED per functionality (ie one LED for VoIP). Therefore in
3241 + * order to keep this tidy and simple we do not make usage of the
3242 + * one-LED-per-DSP function. Instead, we assume that the LED for
3243 + * VoIP is unique and associated with DSP 0 (always present on
3244 + * any VoIP platform). If changing this to a LED-per-DSP function
3245 + * then one need to update the board initialization driver in
3246 + * bcmdrivers\opensource\char\board\bcm963xx\impl1
3247 + ***************************************************************************/
3248 +int BpGetVoipLedGpio( unsigned short *pusValue )
3252 + if( g_pCurrentBp )
3254 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( 0 );
3258 + *pusValue = pDspInfo->usGpioLedVoip;
3260 + if( *pusValue != BP_NOT_DEFINED )
3262 + nRet = BP_SUCCESS;
3266 + nRet = BP_VALUE_NOT_DEFINED;
3271 + *pusValue = BP_NOT_DEFINED;
3272 + nRet = BP_BOARD_ID_NOT_FOUND;
3277 + *pusValue = BP_NOT_DEFINED;
3278 + nRet = BP_BOARD_ID_NOT_SET;
3282 +} /* BpGetVoipLedGpio */
3284 +/**************************************************************************
3285 + * Name : BpGetWirelessExtIntr
3287 + * Description: This function returns the Wireless external interrupt number.
3289 + * Parameters : [OUT] pulValue - Address of short word that the wireless
3290 + * external interrupt number is returned in.
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
3296 + ***************************************************************************/
3297 +int BpGetWirelessExtIntr( unsigned long *pulValue )
3301 + if( g_pCurrentBp )
3303 + *pulValue = g_pCurrentBp->usExtIntrWireless;
3305 + if( g_pCurrentBp->usExtIntrWireless != BP_NOT_DEFINED )
3307 + nRet = BP_SUCCESS;
3311 + nRet = BP_VALUE_NOT_DEFINED;
3316 + *pulValue = BP_NOT_DEFINED;
3317 + nRet = BP_BOARD_ID_NOT_SET;
3321 +} /* BpGetWirelessExtIntr */
3323 +/**************************************************************************
3324 + * Name : BpGetAdslDyingGaspExtIntr
3326 + * Description: This function returns the ADSL Dying Gasp external interrupt
3329 + * Parameters : [OUT] pulValue - Address of short word that the ADSL Dying Gasp
3330 + * external interrupt number is returned in.
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
3336 + ***************************************************************************/
3337 +int BpGetAdslDyingGaspExtIntr( unsigned long *pulValue )
3341 + if( g_pCurrentBp )
3343 + *pulValue = g_pCurrentBp->usExtIntrAdslDyingGasp;
3345 + if( g_pCurrentBp->usExtIntrAdslDyingGasp != BP_NOT_DEFINED )
3347 + nRet = BP_SUCCESS;
3351 + nRet = BP_VALUE_NOT_DEFINED;
3356 + *pulValue = BP_NOT_DEFINED;
3357 + nRet = BP_BOARD_ID_NOT_SET;
3361 +} /* BpGetAdslDyingGaspExtIntr */
3363 +/**************************************************************************
3364 + * Name : BpGetVoipExtIntr
3366 + * Description: This function returns the VOIP external interrupt number.
3368 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
3369 + * external interrupt number is returned in.
3370 + * [IN] dspNum - Address of the DSP to query.
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
3376 + ***************************************************************************/
3377 +int BpGetVoipExtIntr( unsigned char dspNum, unsigned long *pulValue )
3381 + if( g_pCurrentBp )
3383 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
3387 + *pulValue = pDspInfo->usExtIntrVoip;
3389 + if( *pulValue != BP_NOT_DEFINED )
3391 + nRet = BP_SUCCESS;
3395 + nRet = BP_VALUE_NOT_DEFINED;
3400 + *pulValue = BP_NOT_DEFINED;
3401 + nRet = BP_BOARD_ID_NOT_FOUND;
3406 + *pulValue = BP_NOT_DEFINED;
3407 + nRet = BP_BOARD_ID_NOT_SET;
3411 +} /* BpGetVoipExtIntr */
3413 +/**************************************************************************
3414 + * Name : BpGetHpnaExtIntr
3416 + * Description: This function returns the HPNA external interrupt number.
3418 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
3419 + * external interrupt number is returned in.
3421 + * Returns : BP_SUCCESS - Success, value is returned.
3422 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3423 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3425 + ***************************************************************************/
3426 +int BpGetHpnaExtIntr( unsigned long *pulValue )
3430 + if( g_pCurrentBp )
3432 + *pulValue = g_pCurrentBp->usExtIntrHpna;
3434 + if( g_pCurrentBp->usExtIntrHpna != BP_NOT_DEFINED )
3436 + nRet = BP_SUCCESS;
3440 + nRet = BP_VALUE_NOT_DEFINED;
3445 + *pulValue = BP_NOT_DEFINED;
3446 + nRet = BP_BOARD_ID_NOT_SET;
3450 +} /* BpGetHpnaExtIntr */
3452 +/**************************************************************************
3453 + * Name : BpGetHpnaChipSelect
3455 + * Description: This function returns the HPNA chip select number.
3457 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
3458 + * chip select number is returned in.
3460 + * Returns : BP_SUCCESS - Success, value is returned.
3461 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3462 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3464 + ***************************************************************************/
3465 +int BpGetHpnaChipSelect( unsigned long *pulValue )
3469 + if( g_pCurrentBp )
3471 + *pulValue = g_pCurrentBp->usCsHpna;
3473 + if( g_pCurrentBp->usCsHpna != BP_NOT_DEFINED )
3475 + nRet = BP_SUCCESS;
3479 + nRet = BP_VALUE_NOT_DEFINED;
3484 + *pulValue = BP_NOT_DEFINED;
3485 + nRet = BP_BOARD_ID_NOT_SET;
3489 +} /* BpGetHpnaChipSelect */
3491 +/**************************************************************************
3492 + * Name : BpGetVoipChipSelect
3494 + * Description: This function returns the VOIP chip select number.
3496 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
3497 + * chip select number is returned in.
3498 + * [IN] dspNum - Address of the DSP to query.
3500 + * Returns : BP_SUCCESS - Success, value is returned.
3501 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3502 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3504 + ***************************************************************************/
3505 +int BpGetVoipChipSelect( unsigned char dspNum, unsigned long *pulValue )
3509 + if( g_pCurrentBp )
3511 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
3515 + *pulValue = pDspInfo->usCsVoip;
3517 + if( *pulValue != BP_NOT_DEFINED )
3519 + nRet = BP_SUCCESS;
3523 + nRet = BP_VALUE_NOT_DEFINED;
3528 + *pulValue = BP_NOT_DEFINED;
3529 + nRet = BP_BOARD_ID_NOT_FOUND;
3534 + *pulValue = BP_NOT_DEFINED;
3535 + nRet = BP_BOARD_ID_NOT_SET;
3539 +} /* BpGetVoipChipSelect */
3541 diff -urN linux.old/arch/mips/bcm963xx/boardparms.h linux.dev/arch/mips/bcm963xx/boardparms.h
3542 --- linux.old/arch/mips/bcm963xx/boardparms.h 1970-01-01 01:00:00.000000000 +0100
3543 +++ linux.dev/arch/mips/bcm963xx/boardparms.h 2006-08-25 00:39:38.000000000 +0200
3548 + Copyright 2003 Broadcom Corp. All Rights Reserved.
3550 + This program is free software; you can distribute it and/or modify it
3551 + under the terms of the GNU General Public License (Version 2) as
3552 + published by the Free Software Foundation.
3554 + This program is distributed in the hope it will be useful, but WITHOUT
3555 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3556 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3559 + You should have received a copy of the GNU General Public License along
3560 + with this program; if not, write to the Free Software Foundation, Inc.,
3561 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
3565 +/**************************************************************************
3566 + * File Name : boardparms.h
3568 + * Description: This file contains definitions and function prototypes for
3569 + * the BCM63xx board parameter access functions.
3571 + * Updates : 07/14/2003 Created.
3572 + ***************************************************************************/
3574 +#if !defined(_BOARDPARMS_H)
3575 +#define _BOARDPARMS_H
3577 +/* Return codes. */
3578 +#define BP_SUCCESS 0
3579 +#define BP_BOARD_ID_NOT_FOUND 1
3580 +#define BP_VALUE_NOT_DEFINED 2
3581 +#define BP_BOARD_ID_NOT_SET 3
3583 +/* Values for BpGetSdramSize. */
3584 +#define BP_MEMORY_8MB_1_CHIP 0
3585 +#define BP_MEMORY_16MB_1_CHIP 1
3586 +#define BP_MEMORY_32MB_1_CHIP 2
3587 +#define BP_MEMORY_64MB_2_CHIP 3
3588 +#define BP_MEMORY_32MB_2_CHIP 4
3589 +#define BP_MEMORY_16MB_2_CHIP 5
3591 +/* Values for EthernetMacInfo PhyType. */
3592 +#define BP_ENET_NO_PHY 0
3593 +#define BP_ENET_INTERNAL_PHY 1
3594 +#define BP_ENET_EXTERNAL_PHY 2
3595 +#define BP_ENET_EXTERNAL_SWITCH 3
3597 +/* Values for EthernetMacInfo Configuration type. */
3598 +#define BP_ENET_CONFIG_MDIO 0 /* Internal PHY, External PHY, Switch+(no GPIO, no SPI, no MDIO Pseudo phy */
3599 +#define BP_ENET_CONFIG_GPIO 1 /* Bcm96345GW board + Bcm5325M/E */
3600 +#define BP_ENET_CONFIG_MDIO_PSEUDO_PHY 2 /* Bcm96348GW board + Bcm5325E */
3601 +#define BP_ENET_CONFIG_SPI_SSB_0 3 /* Bcm96348GW board + Bcm5325M/E */
3602 +#define BP_ENET_CONFIG_SPI_SSB_1 4 /* Bcm96348GW board + Bcm5325M/E */
3603 +#define BP_ENET_CONFIG_SPI_SSB_2 5 /* Bcm96348GW board + Bcm5325M/E */
3604 +#define BP_ENET_CONFIG_SPI_SSB_3 6 /* Bcm96348GW board + Bcm5325M/E */
3606 +/* Values for EthernetMacInfo Reverse MII. */
3607 +#define BP_ENET_NO_REVERSE_MII 0
3608 +#define BP_ENET_REVERSE_MII 1
3610 +/* Values for VoIPDSPInfo DSPType. */
3611 +#define BP_VOIP_NO_DSP 0
3612 +#define BP_VOIP_DSP 1
3615 +/* Values for GPIO pin assignments (AH = Active High, AL = Active Low). */
3616 +#define BP_ACTIVE_MASK 0x8000
3617 +#define BP_ACTIVE_HIGH 0x0000
3618 +#define BP_ACTIVE_LOW 0x8000
3619 +#define BP_GPIO_0_AH (0 | BP_ACTIVE_HIGH)
3620 +#define BP_GPIO_0_AL (0 | BP_ACTIVE_LOW)
3621 +#define BP_GPIO_1_AH (1 | BP_ACTIVE_HIGH)
3622 +#define BP_GPIO_1_AL (1 | BP_ACTIVE_LOW)
3623 +#define BP_GPIO_2_AH (2 | BP_ACTIVE_HIGH)
3624 +#define BP_GPIO_2_AL (2 | BP_ACTIVE_LOW)
3625 +#define BP_GPIO_3_AH (3 | BP_ACTIVE_HIGH)
3626 +#define BP_GPIO_3_AL (3 | BP_ACTIVE_LOW)
3627 +#define BP_GPIO_4_AH (4 | BP_ACTIVE_HIGH)
3628 +#define BP_GPIO_4_AL (4 | BP_ACTIVE_LOW)
3629 +#define BP_GPIO_5_AH (5 | BP_ACTIVE_HIGH)
3630 +#define BP_GPIO_5_AL (5 | BP_ACTIVE_LOW)
3631 +#define BP_GPIO_6_AH (6 | BP_ACTIVE_HIGH)
3632 +#define BP_GPIO_6_AL (6 | BP_ACTIVE_LOW)
3633 +#define BP_GPIO_7_AH (7 | BP_ACTIVE_HIGH)
3634 +#define BP_GPIO_7_AL (7 | BP_ACTIVE_LOW)
3635 +#define BP_GPIO_8_AH (8 | BP_ACTIVE_HIGH)
3636 +#define BP_GPIO_8_AL (8 | BP_ACTIVE_LOW)
3637 +#define BP_GPIO_9_AH (9 | BP_ACTIVE_HIGH)
3638 +#define BP_GPIO_9_AL (9 | BP_ACTIVE_LOW)
3639 +#define BP_GPIO_10_AH (10 | BP_ACTIVE_HIGH)
3640 +#define BP_GPIO_10_AL (10 | BP_ACTIVE_LOW)
3641 +#define BP_GPIO_11_AH (11 | BP_ACTIVE_HIGH)
3642 +#define BP_GPIO_11_AL (11 | BP_ACTIVE_LOW)
3643 +#define BP_GPIO_12_AH (12 | BP_ACTIVE_HIGH)
3644 +#define BP_GPIO_12_AL (12 | BP_ACTIVE_LOW)
3645 +#define BP_GPIO_13_AH (13 | BP_ACTIVE_HIGH)
3646 +#define BP_GPIO_13_AL (13 | BP_ACTIVE_LOW)
3647 +#define BP_GPIO_14_AH (14 | BP_ACTIVE_HIGH)
3648 +#define BP_GPIO_14_AL (14 | BP_ACTIVE_LOW)
3649 +#define BP_GPIO_15_AH (15 | BP_ACTIVE_HIGH)
3650 +#define BP_GPIO_15_AL (15 | BP_ACTIVE_LOW)
3651 +#define BP_GPIO_16_AH (16 | BP_ACTIVE_HIGH)
3652 +#define BP_GPIO_16_AL (16 | BP_ACTIVE_LOW)
3653 +#define BP_GPIO_17_AH (17 | BP_ACTIVE_HIGH)
3654 +#define BP_GPIO_17_AL (17 | BP_ACTIVE_LOW)
3655 +#define BP_GPIO_18_AH (18 | BP_ACTIVE_HIGH)
3656 +#define BP_GPIO_18_AL (18 | BP_ACTIVE_LOW)
3657 +#define BP_GPIO_19_AH (19 | BP_ACTIVE_HIGH)
3658 +#define BP_GPIO_19_AL (19 | BP_ACTIVE_LOW)
3659 +#define BP_GPIO_20_AH (20 | BP_ACTIVE_HIGH)
3660 +#define BP_GPIO_20_AL (20 | BP_ACTIVE_LOW)
3661 +#define BP_GPIO_21_AH (21 | BP_ACTIVE_HIGH)
3662 +#define BP_GPIO_21_AL (21 | BP_ACTIVE_LOW)
3663 +#define BP_GPIO_22_AH (22 | BP_ACTIVE_HIGH)
3664 +#define BP_GPIO_22_AL (22 | BP_ACTIVE_LOW)
3665 +#define BP_GPIO_23_AH (23 | BP_ACTIVE_HIGH)
3666 +#define BP_GPIO_23_AL (23 | BP_ACTIVE_LOW)
3667 +#define BP_GPIO_24_AH (24 | BP_ACTIVE_HIGH)
3668 +#define BP_GPIO_24_AL (24 | BP_ACTIVE_LOW)
3669 +#define BP_GPIO_25_AH (25 | BP_ACTIVE_HIGH)
3670 +#define BP_GPIO_25_AL (25 | BP_ACTIVE_LOW)
3671 +#define BP_GPIO_26_AH (26 | BP_ACTIVE_HIGH)
3672 +#define BP_GPIO_26_AL (26 | BP_ACTIVE_LOW)
3673 +#define BP_GPIO_27_AH (27 | BP_ACTIVE_HIGH)
3674 +#define BP_GPIO_27_AL (27 | BP_ACTIVE_LOW)
3675 +#define BP_GPIO_28_AH (28 | BP_ACTIVE_HIGH)
3676 +#define BP_GPIO_28_AL (28 | BP_ACTIVE_LOW)
3677 +#define BP_GPIO_29_AH (29 | BP_ACTIVE_HIGH)
3678 +#define BP_GPIO_29_AL (29 | BP_ACTIVE_LOW)
3679 +#define BP_GPIO_30_AH (30 | BP_ACTIVE_HIGH)
3680 +#define BP_GPIO_30_AL (30 | BP_ACTIVE_LOW)
3681 +#define BP_GPIO_31_AH (31 | BP_ACTIVE_HIGH)
3682 +#define BP_GPIO_31_AL (31 | BP_ACTIVE_LOW)
3683 +#define BP_GPIO_32_AH (32 | BP_ACTIVE_HIGH)
3684 +#define BP_GPIO_32_AL (32 | BP_ACTIVE_LOW)
3685 +#define BP_GPIO_33_AH (33 | BP_ACTIVE_HIGH)
3686 +#define BP_GPIO_33_AL (33 | BP_ACTIVE_LOW)
3687 +#define BP_GPIO_34_AH (34 | BP_ACTIVE_HIGH)
3688 +#define BP_GPIO_34_AL (34 | BP_ACTIVE_LOW)
3689 +#define BP_GPIO_35_AH (35 | BP_ACTIVE_HIGH)
3690 +#define BP_GPIO_35_AL (35 | BP_ACTIVE_LOW)
3691 +#define BP_GPIO_36_AH (36 | BP_ACTIVE_HIGH)
3692 +#define BP_GPIO_36_AL (36 | BP_ACTIVE_LOW)
3694 +/* Values for external interrupt assignments. */
3695 +#define BP_EXT_INTR_0 0
3696 +#define BP_EXT_INTR_1 1
3697 +#define BP_EXT_INTR_2 2
3698 +#define BP_EXT_INTR_3 3
3700 +/* Values for chip select assignments. */
3706 +/* Value for GPIO and external interrupt fields that are not used. */
3707 +#define BP_NOT_DEFINED 0xffff
3708 +#define BP_HW_DEFINED 0xfff0
3709 +#define BP_UNEQUIPPED 0xfff1
3711 +/* Maximum size of the board id string. */
3712 +#define BP_BOARD_ID_LEN 16
3714 +/* Maximum number of Ethernet MACs. */
3715 +#define BP_MAX_ENET_MACS 2
3717 +/* Maximum number of VoIP DSPs. */
3718 +#define BP_MAX_VOIP_DSP 2
3720 +/* Wireless Antenna Settings. */
3721 +#define BP_WLAN_ANT_MAIN 0
3722 +#define BP_WLAN_ANT_AUX 1
3723 +#define BP_WLAN_ANT_BOTH 3
3725 +#if !defined(__ASSEMBLER__)
3727 +/* Information about an Ethernet MAC. If ucPhyType is BP_ENET_NO_PHY,
3728 + * then the other fields are not valid.
3730 +typedef struct EthernetMacInfo
3732 + unsigned char ucPhyType; /* BP_ENET_xxx */
3733 + unsigned char ucPhyAddress; /* 0 to 31 */
3734 + unsigned short usGpioPhySpiSck; /* GPIO pin or not defined */
3735 + unsigned short usGpioPhySpiSs; /* GPIO pin or not defined */
3736 + unsigned short usGpioPhySpiMosi; /* GPIO pin or not defined */
3737 + unsigned short usGpioPhySpiMiso; /* GPIO pin or not defined */
3738 + unsigned short usGpioPhyReset; /* GPIO pin or not defined (96348LV) */
3739 + unsigned short numSwitchPorts; /* Number of PHY ports */
3740 + unsigned short usConfigType; /* Configuration type */
3741 + unsigned short usReverseMii; /* Reverse MII */
3742 +} ETHERNET_MAC_INFO, *PETHERNET_MAC_INFO;
3745 +/* Information about VoIP DSPs. If ucDspType is BP_VOIP_NO_DSP,
3746 + * then the other fields are not valid.
3748 +typedef struct VoIPDspInfo
3750 + unsigned char ucDspType;
3751 + unsigned char ucDspAddress;
3752 + unsigned short usExtIntrVoip;
3753 + unsigned short usGpioVoipReset;
3754 + unsigned short usGpioVoipIntr;
3755 + unsigned short usGpioLedVoip;
3756 + unsigned short usCsVoip;
3761 +/**************************************************************************
3762 + * Name : BpSetBoardId
3764 + * Description: This function find the BOARD_PARAMETERS structure for the
3765 + * specified board id string and assigns it to a global, static
3768 + * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
3770 + * Returns : BP_SUCCESS - Success, value is returned.
3771 + * BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
3772 + * have a board parameters configuration record.
3773 + ***************************************************************************/
3774 +int BpSetBoardId( char *pszBoardId );
3776 +/**************************************************************************
3777 + * Name : BpGetBoardIds
3779 + * Description: This function returns all of the supported board id strings.
3781 + * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
3782 + * strings are returned in. Each id starts at BP_BOARD_ID_LEN
3784 + * [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
3785 + * were allocated in pszBoardIds.
3787 + * Returns : Number of board id strings returned.
3788 + ***************************************************************************/
3789 +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize );
3791 +/**************************************************************************
3792 + * Name : BpGetEthernetMacInfo
3794 + * Description: This function returns all of the supported board id strings.
3796 + * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
3798 + * [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
3799 + * are pointed to by pEnetInfos.
3801 + * Returns : BP_SUCCESS - Success, value is returned.
3802 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3803 + ***************************************************************************/
3804 +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos );
3806 +/**************************************************************************
3807 + * Name : BpGetSdramSize
3809 + * Description: This function returns a constant that describees the board's
3810 + * SDRAM type and size.
3812 + * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
3815 + * Returns : BP_SUCCESS - Success, value is returned.
3816 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3817 + ***************************************************************************/
3818 +int BpGetSdramSize( unsigned long *pulSdramSize );
3820 +/**************************************************************************
3821 + * Name : BpGetPsiSize
3823 + * Description: This function returns the persistent storage size in K bytes.
3825 + * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
3826 + * storage size is returned in.
3828 + * Returns : BP_SUCCESS - Success, value is returned.
3829 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3830 + ***************************************************************************/
3831 +int BpGetPsiSize( unsigned long *pulPsiSize );
3833 +/**************************************************************************
3834 + * Name : BpGetRj11InnerOuterPairGpios
3836 + * Description: This function returns the GPIO pin assignments for changing
3837 + * between the RJ11 inner pair and RJ11 outer pair.
3839 + * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
3840 + * GPIO pin is returned in.
3841 + * [OUT] pusOuter - Address of short word that the RJ11 outer pair
3842 + * GPIO pin is returned in.
3844 + * Returns : BP_SUCCESS - Success, values are returned.
3845 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3846 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3848 + ***************************************************************************/
3849 +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
3850 + unsigned short *pusOuter );
3852 +/**************************************************************************
3853 + * Name : BpGetPressAndHoldResetGpio
3855 + * Description: This function returns the GPIO pin assignment for the press
3856 + * and hold reset button.
3858 + * Parameters : [OUT] pusValue - Address of short word that the press and hold
3859 + * reset button GPIO pin is returned in.
3861 + * Returns : BP_SUCCESS - Success, value is returned.
3862 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3863 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3865 + ***************************************************************************/
3866 +int BpGetPressAndHoldResetGpio( unsigned short *pusValue );
3868 +/**************************************************************************
3869 + * Name : BpGetVoipResetGpio
3871 + * Description: This function returns the GPIO pin assignment for the VOIP
3872 + * Reset operation.
3874 + * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
3875 + * GPIO pin is returned in.
3876 + * [IN] dspNum - Address of the DSP to query.
3878 + * Returns : BP_SUCCESS - Success, value is returned.
3879 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3880 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3882 + ***************************************************************************/
3883 +int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue );
3885 +/**************************************************************************
3886 + * Name : BpGetVoipIntrGpio
3888 + * Description: This function returns the GPIO pin assignment for VoIP interrupt.
3890 + * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
3891 + * GPIO pin is returned in.
3892 + * [IN] dspNum - Address of the DSP to query.
3894 + * Returns : BP_SUCCESS - Success, value is returned.
3895 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3896 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3898 + ***************************************************************************/
3899 +int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue );
3901 +/**************************************************************************
3902 + * Name : BpGetPcmciaResetGpio
3904 + * Description: This function returns the GPIO pin assignment for the PCMCIA
3905 + * Reset operation.
3907 + * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
3908 + * GPIO pin is returned in.
3910 + * Returns : BP_SUCCESS - Success, value is returned.
3911 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3912 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3914 + ***************************************************************************/
3915 +int BpGetPcmciaResetGpio( unsigned short *pusValue );
3917 +/**************************************************************************
3918 + * Name : BpGetUartRtsCtsGpios
3920 + * Description: This function returns the GPIO pin assignments for RTS and CTS
3923 + * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
3924 + * pin is returned in.
3925 + * [OUT] pusCts - Address of short word that the UART CTS GPIO
3926 + * pin is returned in.
3928 + * Returns : BP_SUCCESS - Success, values are returned.
3929 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3930 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3932 + ***************************************************************************/
3933 +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts );
3935 +/**************************************************************************
3936 + * Name : BpGetAdslLedGpio
3938 + * Description: This function returns the GPIO pin assignment for the ADSL
3941 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
3942 + * GPIO pin is returned in.
3944 + * Returns : BP_SUCCESS - Success, value is returned.
3945 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3946 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3948 + ***************************************************************************/
3949 +int BpGetAdslLedGpio( unsigned short *pusValue );
3951 +/**************************************************************************
3952 + * Name : BpGetAdslFailLedGpio
3954 + * Description: This function returns the GPIO pin assignment for the ADSL
3955 + * LED that is used when there is a DSL connection failure.
3957 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
3958 + * GPIO pin is returned in.
3960 + * Returns : BP_SUCCESS - Success, value is returned.
3961 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3962 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3964 + ***************************************************************************/
3965 +int BpGetAdslFailLedGpio( unsigned short *pusValue );
3967 +/**************************************************************************
3968 + * Name : BpGetWirelessLedGpio
3970 + * Description: This function returns the GPIO pin assignment for the Wireless
3973 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
3974 + * GPIO pin is returned in.
3976 + * Returns : BP_SUCCESS - Success, value is returned.
3977 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3978 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3980 + ***************************************************************************/
3981 +int BpGetWirelessLedGpio( unsigned short *pusValue );
3983 +/**************************************************************************
3984 + * Name : BpGetWirelessAntInUse
3986 + * Description: This function returns the antennas in use for wireless
3988 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
3991 + * Returns : BP_SUCCESS - Success, value is returned.
3992 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3993 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3995 + ***************************************************************************/
3996 +int BpGetWirelessAntInUse( unsigned short *pusValue );
3998 +/**************************************************************************
3999 + * Name : BpGetWirelessSesBtnGpio
4001 + * Description: This function returns the GPIO pin assignment for the Wireless
4004 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4005 + * Button GPIO pin is returned in.
4007 + * Returns : BP_SUCCESS - Success, value is returned.
4008 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4009 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4011 + ***************************************************************************/
4012 +int BpGetWirelessSesBtnGpio( unsigned short *pusValue );
4014 +/**************************************************************************
4015 + * Name : BpGetWirelessSesExtIntr
4017 + * Description: This function returns the external interrupt number for the
4018 + * Wireless Ses Button.
4020 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4021 + * external interrup is returned in.
4023 + * Returns : BP_SUCCESS - Success, value is returned.
4024 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4025 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4027 + ***************************************************************************/
4028 +int BpGetWirelessSesExtIntr( unsigned short *pusValue );
4030 +/**************************************************************************
4031 + * Name : BpGetWirelessSesLedGpio
4033 + * Description: This function returns the GPIO pin assignment for the Wireless
4036 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4037 + * Led GPIO pin is returned in.
4039 + * Returns : BP_SUCCESS - Success, value is returned.
4040 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4041 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4043 + ***************************************************************************/
4044 +int BpGetWirelessSesLedGpio( unsigned short *pusValue );
4046 +/**************************************************************************
4047 + * Name : BpGetUsbLedGpio
4049 + * Description: This function returns the GPIO pin assignment for the USB
4052 + * Parameters : [OUT] pusValue - Address of short word that the USB LED
4053 + * GPIO pin is returned in.
4055 + * Returns : BP_SUCCESS - Success, value is returned.
4056 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4057 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4059 + ***************************************************************************/
4060 +int BpGetUsbLedGpio( unsigned short *pusValue );
4062 +/**************************************************************************
4063 + * Name : BpGetHpnaLedGpio
4065 + * Description: This function returns the GPIO pin assignment for the HPNA
4068 + * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
4069 + * GPIO pin is returned in.
4071 + * Returns : BP_SUCCESS - Success, value is returned.
4072 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4073 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4075 + ***************************************************************************/
4076 +int BpGetHpnaLedGpio( unsigned short *pusValue );
4078 +/**************************************************************************
4079 + * Name : BpGetWanDataLedGpio
4081 + * Description: This function returns the GPIO pin assignment for the WAN Data
4084 + * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
4085 + * GPIO pin is returned in.
4087 + * Returns : BP_SUCCESS - Success, value is returned.
4088 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4089 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4091 + ***************************************************************************/
4092 +int BpGetWanDataLedGpio( unsigned short *pusValue );
4094 +/**************************************************************************
4095 + * Name : BpGetPppLedGpio
4097 + * Description: This function returns the GPIO pin assignment for the PPP
4100 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
4101 + * GPIO pin is returned in.
4103 + * Returns : BP_SUCCESS - Success, value is returned.
4104 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4105 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4107 + ***************************************************************************/
4108 +int BpGetPppLedGpio( unsigned short *pusValue );
4110 +/**************************************************************************
4111 + * Name : BpGetPppFailLedGpio
4113 + * Description: This function returns the GPIO pin assignment for the PPP
4114 + * LED that is used when there is a PPP connection failure.
4116 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
4117 + * GPIO pin is returned in.
4119 + * Returns : BP_SUCCESS - Success, value is returned.
4120 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4121 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4123 + ***************************************************************************/
4124 +int BpGetPppFailLedGpio( unsigned short *pusValue );
4126 +/**************************************************************************
4127 + * Name : BpGetVoipLedGpio
4129 + * Description: This function returns the GPIO pin assignment for the VOIP
4132 + * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
4133 + * GPIO pin is returned in.
4135 + * Returns : BP_SUCCESS - Success, value is returned.
4136 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4137 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4139 + ***************************************************************************/
4140 +int BpGetVoipLedGpio( unsigned short *pusValue );
4142 +/**************************************************************************
4143 + * Name : BpGetBootloaderPowerOnLedGpio
4145 + * Description: This function returns the GPIO pin assignment for the power
4146 + * on LED that is set by the bootloader.
4148 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
4149 + * GPIO pin is returned in.
4151 + * Returns : BP_SUCCESS - Success, value is returned.
4152 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4153 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4155 + ***************************************************************************/
4156 +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue );
4158 +/**************************************************************************
4159 + * Name : BpGetBootloaderAlarmLedGpio
4161 + * Description: This function returns the GPIO pin assignment for the alarm
4162 + * LED that is set by the bootloader.
4164 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
4165 + * GPIO pin is returned in.
4167 + * Returns : BP_SUCCESS - Success, value is returned.
4168 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4169 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4171 + ***************************************************************************/
4172 +int BpGetBootloaderAlarmLedGpio( unsigned short *pusValue );
4174 +/**************************************************************************
4175 + * Name : BpGetBootloaderResetCfgLedGpio
4177 + * Description: This function returns the GPIO pin assignment for the reset
4178 + * configuration LED that is set by the bootloader.
4180 + * Parameters : [OUT] pusValue - Address of short word that the reset
4181 + * configuration LED GPIO pin is returned in.
4183 + * Returns : BP_SUCCESS - Success, value is returned.
4184 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4185 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4187 + ***************************************************************************/
4188 +int BpGetBootloaderResetCfgLedGpio( unsigned short *pusValue );
4190 +/**************************************************************************
4191 + * Name : BpGetBootloaderStopLedGpio
4193 + * Description: This function returns the GPIO pin assignment for the break
4194 + * into bootloader LED that is set by the bootloader.
4196 + * Parameters : [OUT] pusValue - Address of short word that the break into
4197 + * bootloader LED GPIO pin is returned in.
4199 + * Returns : BP_SUCCESS - Success, value is returned.
4200 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4201 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4203 + ***************************************************************************/
4204 +int BpGetBootloaderStopLedGpio( unsigned short *pusValue );
4206 +/**************************************************************************
4207 + * Name : BpGetWirelessExtIntr
4209 + * Description: This function returns the Wireless external interrupt number.
4211 + * Parameters : [OUT] pulValue - Address of short word that the wireless
4212 + * external interrupt number is returned in.
4214 + * Returns : BP_SUCCESS - Success, value is returned.
4215 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4216 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4218 + ***************************************************************************/
4219 +int BpGetWirelessExtIntr( unsigned long *pulValue );
4221 +/**************************************************************************
4222 + * Name : BpGetAdslDyingGaspExtIntr
4224 + * Description: This function returns the ADSL Dying Gasp external interrupt
4227 + * Parameters : [OUT] pulValue - Address of short word that the ADSL Dying Gasp
4228 + * external interrupt number is returned in.
4230 + * Returns : BP_SUCCESS - Success, value is returned.
4231 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4232 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4234 + ***************************************************************************/
4235 +int BpGetAdslDyingGaspExtIntr( unsigned long *pulValue );
4237 +/**************************************************************************
4238 + * Name : BpGetVoipExtIntr
4240 + * Description: This function returns the VOIP external interrupt number.
4242 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
4243 + * external interrupt number is returned in.
4244 + * [IN] dspNum - Address of the DSP to query.
4246 + * Returns : BP_SUCCESS - Success, value is returned.
4247 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4248 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4250 + ***************************************************************************/
4251 +int BpGetVoipExtIntr( unsigned char dspNum, unsigned long *pulValue );
4253 +/**************************************************************************
4254 + * Name : BpGetHpnaExtIntr
4256 + * Description: This function returns the HPNA external interrupt number.
4258 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
4259 + * external interrupt number is returned in.
4261 + * Returns : BP_SUCCESS - Success, value is returned.
4262 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4263 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4265 + ***************************************************************************/
4266 +int BpGetHpnaExtIntr( unsigned long *pulValue );
4268 +/**************************************************************************
4269 + * Name : BpGetHpnaChipSelect
4271 + * Description: This function returns the HPNA chip select number.
4273 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
4274 + * chip select number is returned in.
4276 + * Returns : BP_SUCCESS - Success, value is returned.
4277 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4278 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4280 + ***************************************************************************/
4281 +int BpGetHpnaChipSelect( unsigned long *pulValue );
4283 +/**************************************************************************
4284 + * Name : BpGetVoipChipSelect
4286 + * Description: This function returns the VOIP chip select number.
4288 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
4289 + * chip select number is returned in.
4290 + * [IN] dspNum - Address of the DSP to query.
4292 + * Returns : BP_SUCCESS - Success, value is returned.
4293 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4294 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4296 + ***************************************************************************/
4297 +int BpGetVoipChipSelect( unsigned char dspNum, unsigned long *pulValue );
4299 +#endif /* __ASSEMBLER__ */
4301 +#endif /* _BOARDPARMS_H */
4303 diff -urN linux.old/arch/mips/bcm963xx/include/6338_intr.h linux.dev/arch/mips/bcm963xx/include/6338_intr.h
4304 --- linux.old/arch/mips/bcm963xx/include/6338_intr.h 1970-01-01 01:00:00.000000000 +0100
4305 +++ linux.dev/arch/mips/bcm963xx/include/6338_intr.h 2006-08-25 00:39:38.000000000 +0200
4309 + Copyright 2003 Broadcom Corp. All Rights Reserved.
4311 + This program is free software; you can distribute it and/or modify it
4312 + under the terms of the GNU General Public License (Version 2) as
4313 + published by the Free Software Foundation.
4315 + This program is distributed in the hope it will be useful, but WITHOUT
4316 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4317 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4320 + You should have received a copy of the GNU General Public License along
4321 + with this program; if not, write to the Free Software Foundation, Inc.,
4322 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4326 +#ifndef __6338_INTR_H
4327 +#define __6338_INTR_H
4329 +/*=====================================================================*/
4330 +/* BCM6338 External Interrupt Level Assignments */
4331 +/*=====================================================================*/
4332 +#define INTERRUPT_ID_EXTERNAL_0 3
4333 +#define INTERRUPT_ID_EXTERNAL_1 4
4334 +#define INTERRUPT_ID_EXTERNAL_2 5
4335 +#define INTERRUPT_ID_EXTERNAL_3 6
4337 +/*=====================================================================*/
4338 +/* BCM6338 Timer Interrupt Level Assignments */
4339 +/*=====================================================================*/
4340 +#define MIPS_TIMER_INT 7
4342 +/*=====================================================================*/
4343 +/* Peripheral ISR Table Offset */
4344 +/*=====================================================================*/
4345 +#define INTERNAL_ISR_TABLE_OFFSET 8
4347 +/*=====================================================================*/
4348 +/* Logical Peripheral Interrupt IDs */
4349 +/*=====================================================================*/
4351 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
4352 +#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
4353 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
4354 +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 4)
4355 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 5)
4356 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 6)
4357 +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 7)
4358 +#define INTERRUPT_ID_EMAC1 (INTERNAL_ISR_TABLE_OFFSET + 8)
4359 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 9)
4360 +#define INTERRUPT_ID_SDRAM (INTERNAL_ISR_TABLE_OFFSET + 10)
4361 +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 11)
4362 +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 12)
4363 +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 13)
4364 +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 14)
4365 +#define INTERRUPT_ID_EMAC1_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 15)
4366 +#define INTERRUPT_ID_EMAC1_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 16)
4367 +#define INTERRUPT_ID_SDIO (INTERNAL_ISR_TABLE_OFFSET + 17)
4369 +#endif /* __BCM6338_H */
4371 diff -urN linux.old/arch/mips/bcm963xx/include/6338_map_part.h linux.dev/arch/mips/bcm963xx/include/6338_map_part.h
4372 --- linux.old/arch/mips/bcm963xx/include/6338_map_part.h 1970-01-01 01:00:00.000000000 +0100
4373 +++ linux.dev/arch/mips/bcm963xx/include/6338_map_part.h 2006-08-25 00:39:38.000000000 +0200
4377 + Copyright 2004 Broadcom Corp. All Rights Reserved.
4379 + This program is free software; you can distribute it and/or modify it
4380 + under the terms of the GNU General Public License (Version 2) as
4381 + published by the Free Software Foundation.
4383 + This program is distributed in the hope it will be useful, but WITHOUT
4384 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4385 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4388 + You should have received a copy of the GNU General Public License along
4389 + with this program; if not, write to the Free Software Foundation, Inc.,
4390 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4394 +#ifndef __BCM6338_MAP_H
4395 +#define __BCM6338_MAP_H
4397 +#include "bcmtypes.h"
4399 +#define PERF_BASE 0xfffe0000
4400 +#define TIMR_BASE 0xfffe0200
4401 +#define UART_BASE 0xfffe0300
4402 +#define GPIO_BASE 0xfffe0400
4403 +#define SPI_BASE 0xfffe0c00
4405 +typedef struct PerfControl {
4407 + uint16 testControl;
4408 + uint16 blkEnables;
4409 +#define EMAC_CLK_EN 0x0010
4410 +#define USBS_CLK_EN 0x0010
4411 +#define SAR_CLK_EN 0x0020
4413 +#define SPI_CLK_EN 0x0200
4415 + uint32 pll_control;
4416 +#define SOFT_RESET 0x00000001
4422 +#define EI_SENSE_SHFT 0
4423 +#define EI_STATUS_SHFT 5
4424 +#define EI_CLEAR_SHFT 10
4425 +#define EI_MASK_SHFT 15
4426 +#define EI_INSENS_SHFT 20
4427 +#define EI_LEVEL_SHFT 25
4429 + uint32 unused[4]; /* (18) */
4430 + uint32 BlockSoftReset; /* (28) */
4431 +#define BSR_SPI 0x00000001
4432 +#define BSR_EMAC 0x00000004
4433 +#define BSR_USBH 0x00000008
4434 +#define BSR_USBS 0x00000010
4435 +#define BSR_ADSL 0x00000020
4436 +#define BSR_DMAMEM 0x00000040
4437 +#define BSR_SAR 0x00000080
4438 +#define BSR_ACLC 0x00000100
4439 +#define BSR_ADSL_MIPS_PLL 0x00000400
4440 +#define BSR_ALL_BLOCKS \
4441 + (BSR_SPI | BSR_EMAC | BSR_USBH | BSR_USBS | BSR_ADSL | BSR_DMAMEM | \
4442 + BSR_SAR | BSR_ACLC | BSR_ADSL_MIPS_PLL)
4445 +#define PERF ((volatile PerfControl * const) PERF_BASE)
4448 +typedef struct Timer {
4451 +#define TIMER0EN 0x01
4452 +#define TIMER1EN 0x02
4453 +#define TIMER2EN 0x04
4455 +#define TIMER0 0x01
4456 +#define TIMER1 0x02
4457 +#define TIMER2 0x04
4458 +#define WATCHDOG 0x08
4462 +#define TIMERENABLE 0x80000000
4463 +#define RSTCNTCLR 0x40000000
4467 + uint32 WatchDogDefCount;
4469 + /* Write 0xff00 0x00ff to Start timer
4470 + * Write 0xee00 0x00ee to Stop and re-load default count
4471 + * Read from this register returns current watch dog count
4473 + uint32 WatchDogCtl;
4475 + /* Number of 40-MHz ticks for WD Reset pulse to last */
4476 + uint32 WDResetCount;
4479 +#define TIMER ((volatile Timer * const) TIMR_BASE)
4480 +typedef struct UartChannel {
4483 +#define BRGEN 0x80 /* Control register bit defs */
4486 +#define LOOPBK 0x10
4487 +#define TXPARITYEN 0x08
4488 +#define TXPARITYEVEN 0x04
4489 +#define RXPARITYEN 0x02
4490 +#define RXPARITYEVEN 0x01
4493 +#define XMITBREAK 0x40
4494 +#define BITS5SYM 0x00
4495 +#define BITS6SYM 0x10
4496 +#define BITS7SYM 0x20
4497 +#define BITS8SYM 0x30
4498 +#define ONESTOP 0x07
4499 +#define TWOSTOP 0x0f
4500 + /* 4-LSBS represent STOP bits/char
4501 + * in 1/8 bit-time intervals. Zero
4502 + * represents 1/8 stop bit interval.
4503 + * Fifteen represents 2 stop bits.
4506 +#define RSTTXFIFOS 0x80
4507 +#define RSTRXFIFOS 0x40
4508 + /* 5-bit TimeoutCnt is in low bits of this register.
4509 + * This count represents the number of characters
4510 + * idle times before setting receive Irq when below threshold
4513 + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
4516 + byte txf_levl; /* Read-only fifo depth */
4517 + byte rxf_levl; /* Read-only fifo depth */
4518 + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
4519 + * RxThreshold. Irq can be asserted
4520 + * when rx fifo> thresh, txfifo<thresh
4522 + byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
4523 + * if these bits are also enabled to GPIO_o
4529 + byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
4530 + * detect irq on rising AND falling
4531 + * edges for corresponding GPIO_i
4532 + * if enabled (edge insensitive)
4534 + byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
4535 + * 0 for negedge sense if
4536 + * not configured for edge
4537 + * insensitive (see above)
4538 + * Lower 4 bits: Mask to enable change
4539 + * detection IRQ for corresponding
4542 + byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
4543 + * have changed (may set IRQ).
4544 + * read automatically clears bit
4545 + * Lower 4 bits are actual status
4548 + uint16 intMask; /* Same Bit defs for Mask and status */
4550 +#define DELTAIP 0x0001
4551 +#define TXUNDERR 0x0002
4552 +#define TXOVFERR 0x0004
4553 +#define TXFIFOTHOLD 0x0008
4554 +#define TXREADLATCH 0x0010
4555 +#define TXFIFOEMT 0x0020
4556 +#define RXUNDERR 0x0040
4557 +#define RXOVFERR 0x0080
4558 +#define RXTIMEOUT 0x0100
4559 +#define RXFIFOFULL 0x0200
4560 +#define RXFIFOTHOLD 0x0400
4561 +#define RXFIFONE 0x0800
4562 +#define RXFRAMERR 0x1000
4563 +#define RXPARERR 0x2000
4564 +#define RXBRK 0x4000
4567 + uint16 Data; /* Write to TX, Read from RX */
4568 + /* bits 11:8 are BRK,PAR,FRM errors */
4574 +#define UART ((volatile Uart * const) UART_BASE)
4576 +typedef struct GpioControl {
4578 + uint32 GPIODir; /* bits 7:0 */
4580 + uint32 GPIOio; /* bits 7:0 */
4582 +#define LED3_STROBE 0x08000000
4583 +#define LED2_STROBE 0x04000000
4584 +#define LED1_STROBE 0x02000000
4585 +#define LED0_STROBE 0x01000000
4586 +#define LED_TEST 0x00010000
4587 +#define LED3_DISABLE_LINK_ACT 0x00008000
4588 +#define LED2_DISABLE_LINK_ACT 0x00004000
4589 +#define LED1_DISABLE_LINK_ACT 0x00002000
4590 +#define LED0_DISABLE_LINK_ACT 0x00001000
4591 +#define LED_INTERVAL_SET_MASK 0x00000f00
4592 +#define LED_INTERVAL_SET_320MS 0x00000500
4593 +#define LED_INTERVAL_SET_160MS 0x00000400
4594 +#define LED_INTERVAL_SET_80MS 0x00000300
4595 +#define LED_INTERVAL_SET_40MS 0x00000200
4596 +#define LED_INTERVAL_SET_20MS 0x00000100
4597 +#define LED3_ON 0x00000080
4598 +#define LED2_ON 0x00000040
4599 +#define LED1_ON 0x00000020
4600 +#define LED0_ON 0x00000010
4601 +#define LED3_ENABLE 0x00000008
4602 +#define LED2_ENABLE 0x00000004
4603 +#define LED1_ENABLE 0x00000002
4604 +#define LED0_ENABLE 0x00000001
4605 + uint32 SpiSlaveCfg;
4606 +#define SPI_SLAVE_RESET 0x00010000
4607 +#define SPI_RESTRICT 0x00000400
4608 +#define SPI_DELAY_DISABLE 0x00000200
4609 +#define SPI_PROBE_MUX_SEL_MASK 0x000001e0
4610 +#define SPI_SER_ADDR_CFG_MASK 0x0000000c
4611 +#define SPI_MODE 0x00000001
4612 + uint32 vRegConfig;
4615 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
4617 +/* Number to mask conversion macro used for GPIODir and GPIOio */
4618 +#define GPIO_NUM_MAX_BITS_MASK 0x0f
4619 +#define GPIO_NUM_TO_MASK(X) (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
4625 +typedef struct SpiControl {
4626 + uint16 spiCmd; /* (0x0): SPI command */
4627 +#define SPI_CMD_START_IMMEDIATE 3
4629 +#define SPI_CMD_COMMAND_SHIFT 0
4630 +#define SPI_CMD_DEVICE_ID_SHIFT 4
4631 +#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
4633 + byte spiIntStatus; /* (0x2): SPI interrupt status */
4634 + byte spiMaskIntStatus; /* (0x3): SPI masked interrupt status */
4636 + byte spiIntMask; /* (0x4): SPI interrupt mask */
4637 +#define SPI_INTR_CMD_DONE 0x01
4638 +#define SPI_INTR_CLEAR_ALL 0x1f
4640 + byte spiStatus; /* (0x5): SPI status */
4642 + byte spiClkCfg; /* (0x6): SPI clock configuration */
4644 + byte spiFillByte; /* (0x7): SPI fill byte */
4647 + byte spiMsgTail; /* (0x9): msgtail */
4649 + byte spiRxTail; /* (0xB): rxtail */
4651 + uint32 unused2[13]; /* (0x0c - 0x3c) reserved */
4653 + byte spiMsgCtl; /* (0x40) control byte */
4654 +#define HALF_DUPLEX_W 1
4655 +#define HALF_DUPLEX_R 2
4656 +#define SPI_MSG_TYPE_SHIFT 6
4657 +#define SPI_BYTE_CNT_SHIFT 0
4658 + byte spiMsgData[63]; /* (0x41 - 0x7f) msg data */
4659 + byte spiRxDataFifo[64]; /* (0x80 - 0xbf) rx data */
4660 + byte unused3[64]; /* (0xc0 - 0xff) reserved */
4663 +#define SPI ((volatile SpiControl * const) SPI_BASE)
4666 +** External Bus Interface
4668 +typedef struct EbiChipSelect {
4669 + uint32 base; /* base address in upper 24 bits */
4670 +#define EBI_SIZE_8K 0
4671 +#define EBI_SIZE_16K 1
4672 +#define EBI_SIZE_32K 2
4673 +#define EBI_SIZE_64K 3
4674 +#define EBI_SIZE_128K 4
4675 +#define EBI_SIZE_256K 5
4676 +#define EBI_SIZE_512K 6
4677 +#define EBI_SIZE_1M 7
4678 +#define EBI_SIZE_2M 8
4679 +#define EBI_SIZE_4M 9
4680 +#define EBI_SIZE_8M 10
4681 +#define EBI_SIZE_16M 11
4682 +#define EBI_SIZE_32M 12
4683 +#define EBI_SIZE_64M 13
4684 +#define EBI_SIZE_128M 14
4685 +#define EBI_SIZE_256M 15
4687 +#define EBI_ENABLE 0x00000001 /* .. enable this range */
4688 +#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
4689 +#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
4690 +#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
4691 +#define EBI_WREN 0x00000020 /* enable posted writes */
4692 +#define EBI_POLARITY 0x00000040 /* .. set to invert something,
4693 + ** don't know what yet */
4694 +#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
4695 +#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
4696 +#define EBI_FIFO 0x00000200 /* .. use fifo */
4697 +#define EBI_RE 0x00000400 /* .. Reverse Endian */
4700 +typedef struct MpiRegisters {
4701 + EbiChipSelect cs[1]; /* size chip select configuration */
4704 +#define MPI ((volatile MpiRegisters * const) MPI_BASE)
4709 diff -urN linux.old/arch/mips/bcm963xx/include/6345_intr.h linux.dev/arch/mips/bcm963xx/include/6345_intr.h
4710 --- linux.old/arch/mips/bcm963xx/include/6345_intr.h 1970-01-01 01:00:00.000000000 +0100
4711 +++ linux.dev/arch/mips/bcm963xx/include/6345_intr.h 2006-08-25 00:39:38.000000000 +0200
4715 + Copyright 2002 Broadcom Corp. All Rights Reserved.
4717 + This program is free software; you can distribute it and/or modify it
4718 + under the terms of the GNU General Public License (Version 2) as
4719 + published by the Free Software Foundation.
4721 + This program is distributed in the hope it will be useful, but WITHOUT
4722 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4723 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4726 + You should have received a copy of the GNU General Public License along
4727 + with this program; if not, write to the Free Software Foundation, Inc.,
4728 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4732 +#ifndef __6345_INTR_H
4733 +#define __6345_INTR_H
4736 +/*=====================================================================*/
4737 +/* BCM6345 External Interrupt Level Assignments */
4738 +/*=====================================================================*/
4739 +#define INTERRUPT_ID_EXTERNAL_0 3
4740 +#define INTERRUPT_ID_EXTERNAL_1 4
4741 +#define INTERRUPT_ID_EXTERNAL_2 5
4742 +#define INTERRUPT_ID_EXTERNAL_3 6
4744 +/*=====================================================================*/
4745 +/* BCM6345 Timer Interrupt Level Assignments */
4746 +/*=====================================================================*/
4747 +#define MIPS_TIMER_INT 7
4749 +/*=====================================================================*/
4750 +/* Peripheral ISR Table Offset */
4751 +/*=====================================================================*/
4752 +#define INTERNAL_ISR_TABLE_OFFSET 8
4753 +#define DMA_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 13)
4755 +/*=====================================================================*/
4756 +/* Logical Peripheral Interrupt IDs */
4757 +/*=====================================================================*/
4759 +/* Internal peripheral interrupt IDs */
4760 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
4761 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
4762 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 3)
4763 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 4)
4764 +#define INTERRUPT_ID_USB (INTERNAL_ISR_TABLE_OFFSET + 5)
4765 +#define INTERRUPT_ID_EMAC (INTERNAL_ISR_TABLE_OFFSET + 8)
4766 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 12)
4768 +/* DMA channel interrupt IDs */
4769 +#define INTERRUPT_ID_EMAC_RX_CHAN (DMA_ISR_TABLE_OFFSET + EMAC_RX_CHAN)
4770 +#define INTERRUPT_ID_EMAC_TX_CHAN (DMA_ISR_TABLE_OFFSET + EMAC_TX_CHAN)
4771 +#define INTERRUPT_ID_EBI_RX_CHAN (DMA_ISR_TABLE_OFFSET + EBI_RX_CHAN)
4772 +#define INTERRUPT_ID_EBI_TX_CHAN (DMA_ISR_TABLE_OFFSET + EBI_TX_CHAN)
4773 +#define INTERRUPT_ID_RESERVED_RX_CHAN (DMA_ISR_TABLE_OFFSET + RESERVED_RX_CHAN)
4774 +#define INTERRUPT_ID_RESERVED_TX_CHAN (DMA_ISR_TABLE_OFFSET + RESERVED_TX_CHAN)
4775 +#define INTERRUPT_ID_USB_BULK_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_BULK_RX_CHAN)
4776 +#define INTERRUPT_ID_USB_BULK_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_BULK_TX_CHAN)
4777 +#define INTERRUPT_ID_USB_CNTL_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_CNTL_RX_CHAN)
4778 +#define INTERRUPT_ID_USB_CNTL_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_CNTL_TX_CHAN)
4779 +#define INTERRUPT_ID_USB_ISO_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_ISO_RX_CHAN)
4780 +#define INTERRUPT_ID_USB_ISO_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_ISO_TX_CHAN)
4783 +#endif /* __BCM6345_H */
4785 diff -urN linux.old/arch/mips/bcm963xx/include/6345_map_part.h linux.dev/arch/mips/bcm963xx/include/6345_map_part.h
4786 --- linux.old/arch/mips/bcm963xx/include/6345_map_part.h 1970-01-01 01:00:00.000000000 +0100
4787 +++ linux.dev/arch/mips/bcm963xx/include/6345_map_part.h 2006-08-25 00:39:38.000000000 +0200
4791 + Copyright 2002 Broadcom Corp. All Rights Reserved.
4793 + This program is free software; you can distribute it and/or modify it
4794 + under the terms of the GNU General Public License (Version 2) as
4795 + published by the Free Software Foundation.
4797 + This program is distributed in the hope it will be useful, but WITHOUT
4798 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4799 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4802 + You should have received a copy of the GNU General Public License along
4803 + with this program; if not, write to the Free Software Foundation, Inc.,
4804 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4808 +#ifndef __BCM6345_MAP_H
4809 +#define __BCM6345_MAP_H
4812 +#include "bcmtypes.h"
4813 +#include "6345_intr.h"
4815 +typedef struct IntControl {
4817 + uint16 testControl;
4818 + uint16 blkEnables;
4819 +#define USB_CLK_EN 0x0100
4820 +#define EMAC_CLK_EN 0x0080
4821 +#define UART_CLK_EN 0x0008
4822 +#define CPU_CLK_EN 0x0001
4824 + uint32 pll_control;
4825 +#define SOFT_RESET 0x00000001
4831 +#define EI_SENSE_SHFT 0
4832 +#define EI_STATUS_SHFT 4
4833 +#define EI_CLEAR_SHFT 8
4834 +#define EI_MASK_SHFT 12
4835 +#define EI_INSENS_SHFT 16
4836 +#define EI_LEVEL_SHFT 20
4839 +#define INTC_BASE 0xfffe0000
4840 +#define PERF ((volatile IntControl * const) INTC_BASE)
4842 +#define TIMR_BASE 0xfffe0200
4843 +typedef struct Timer {
4846 +#define TIMER0EN 0x01
4847 +#define TIMER1EN 0x02
4848 +#define TIMER2EN 0x04
4850 +#define TIMER0 0x01
4851 +#define TIMER1 0x02
4852 +#define TIMER2 0x04
4853 +#define WATCHDOG 0x08
4857 +#define TIMERENABLE 0x80000000
4858 +#define RSTCNTCLR 0x40000000
4862 + uint32 WatchDogDefCount;
4864 + /* Write 0xff00 0x00ff to Start timer
4865 + * Write 0xee00 0x00ee to Stop and re-load default count
4866 + * Read from this register returns current watch dog count
4868 + uint32 WatchDogCtl;
4870 + /* Number of 40-MHz ticks for WD Reset pulse to last */
4871 + uint32 WDResetCount;
4874 +#define TIMER ((volatile Timer * const) TIMR_BASE)
4876 +typedef struct UartChannel {
4879 +#define BRGEN 0x80 /* Control register bit defs */
4882 +#define TXPARITYEN 0x08
4883 +#define TXPARITYEVEN 0x04
4884 +#define RXPARITYEN 0x02
4885 +#define RXPARITYEVEN 0x01
4887 +#define BITS5SYM 0x00
4888 +#define BITS6SYM 0x10
4889 +#define BITS7SYM 0x20
4890 +#define BITS8SYM 0x30
4891 +#define XMITBREAK 0x40
4892 +#define ONESTOP 0x07
4893 +#define TWOSTOP 0x0f
4896 +#define RSTTXFIFOS 0x80
4897 +#define RSTRXFIFOS 0x40
4906 + byte DeltaIPEdgeNoSense;
4907 + byte DeltaIPConfig_Mask;
4908 + byte DeltaIP_SyncIP;
4911 +#define TXUNDERR 0x0002
4912 +#define TXOVFERR 0x0004
4913 +#define TXFIFOEMT 0x0020
4914 +#define RXOVFERR 0x0080
4915 +#define RXFIFONE 0x0800
4916 +#define RXFRAMERR 0x1000
4917 +#define RXPARERR 0x2000
4918 +#define RXBRK 0x4000
4926 +#define UART_BASE 0xfffe0300
4927 +#define UART ((volatile Uart * const) UART_BASE)
4929 +typedef struct GpioControl {
4943 +#define GPIO_BASE 0xfffe0400
4944 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
4946 +#define GPIO_NUM_MAX_BITS_MASK 0x0f
4947 +#define GPIO_NUM_TO_MASK(X) (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
4952 diff -urN linux.old/arch/mips/bcm963xx/include/6348_intr.h linux.dev/arch/mips/bcm963xx/include/6348_intr.h
4953 --- linux.old/arch/mips/bcm963xx/include/6348_intr.h 1970-01-01 01:00:00.000000000 +0100
4954 +++ linux.dev/arch/mips/bcm963xx/include/6348_intr.h 2006-08-25 00:39:38.000000000 +0200
4958 + Copyright 2003 Broadcom Corp. All Rights Reserved.
4960 + This program is free software; you can distribute it and/or modify it
4961 + under the terms of the GNU General Public License (Version 2) as
4962 + published by the Free Software Foundation.
4964 + This program is distributed in the hope it will be useful, but WITHOUT
4965 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4966 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4969 + You should have received a copy of the GNU General Public License along
4970 + with this program; if not, write to the Free Software Foundation, Inc.,
4971 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4975 +#ifndef __6348_INTR_H
4976 +#define __6348_INTR_H
4979 +/*=====================================================================*/
4980 +/* BCM6348 External Interrupt Level Assignments */
4981 +/*=====================================================================*/
4982 +#define INTERRUPT_ID_EXTERNAL_0 3
4983 +#define INTERRUPT_ID_EXTERNAL_1 4
4984 +#define INTERRUPT_ID_EXTERNAL_2 5
4985 +#define INTERRUPT_ID_EXTERNAL_3 6
4987 +/*=====================================================================*/
4988 +/* BCM6348 Timer Interrupt Level Assignments */
4989 +/*=====================================================================*/
4990 +#define MIPS_TIMER_INT 7
4992 +/*=====================================================================*/
4993 +/* Peripheral ISR Table Offset */
4994 +/*=====================================================================*/
4995 +#define INTERNAL_ISR_TABLE_OFFSET 8
4997 +/*=====================================================================*/
4998 +/* Logical Peripheral Interrupt IDs */
4999 +/*=====================================================================*/
5001 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
5002 +#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
5003 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
5004 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 4)
5005 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 5)
5006 +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 6)
5007 +#define INTERRUPT_ID_EMAC2 (INTERNAL_ISR_TABLE_OFFSET + 7)
5008 +#define INTERRUPT_ID_EMAC1 (INTERNAL_ISR_TABLE_OFFSET + 8)
5009 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 9)
5010 +#define INTERRUPT_ID_M2M (INTERNAL_ISR_TABLE_OFFSET + 10)
5011 +#define INTERRUPT_ID_ACLC (INTERNAL_ISR_TABLE_OFFSET + 11)
5012 +#define INTERRUPT_ID_USBH (INTERNAL_ISR_TABLE_OFFSET + 12)
5013 +#define INTERRUPT_ID_SDRAM (INTERNAL_ISR_TABLE_OFFSET + 13)
5014 +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 14)
5015 +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 15)
5016 +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 16)
5017 +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 17)
5018 +#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 18)
5019 +#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 19)
5020 +#define INTERRUPT_ID_EMAC1_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 20)
5021 +#define INTERRUPT_ID_EMAC1_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 21)
5022 +#define INTERRUPT_ID_EMAC2_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 22)
5023 +#define INTERRUPT_ID_EMAC2_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 23)
5024 +#define INTERRUPT_ID_MPI (INTERNAL_ISR_TABLE_OFFSET + 24)
5025 +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 25)
5028 +#endif /* __BCM6348_H */
5030 diff -urN linux.old/arch/mips/bcm963xx/include/6348_map_part.h linux.dev/arch/mips/bcm963xx/include/6348_map_part.h
5031 --- linux.old/arch/mips/bcm963xx/include/6348_map_part.h 1970-01-01 01:00:00.000000000 +0100
5032 +++ linux.dev/arch/mips/bcm963xx/include/6348_map_part.h 2006-08-25 00:39:38.000000000 +0200
5036 + Copyright 2002 Broadcom Corp. All Rights Reserved.
5038 + This program is free software; you can distribute it and/or modify it
5039 + under the terms of the GNU General Public License (Version 2) as
5040 + published by the Free Software Foundation.
5042 + This program is distributed in the hope it will be useful, but WITHOUT
5043 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5044 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5047 + You should have received a copy of the GNU General Public License along
5048 + with this program; if not, write to the Free Software Foundation, Inc.,
5049 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5053 +#ifndef __BCM6348_MAP_H
5054 +#define __BCM6348_MAP_H
5056 +#include "bcmtypes.h"
5058 +#define PERF_BASE 0xfffe0000
5059 +#define TIMR_BASE 0xfffe0200
5060 +#define UART_BASE 0xfffe0300
5061 +#define GPIO_BASE 0xfffe0400
5062 +#define MPI_BASE 0xfffe2000 /* MPI control registers */
5063 +#define USB_HOST_BASE 0xfffe1b00 /* USB host registers */
5064 +#define USB_HOST_NON_OHCI 0xfffe1c00 /* USB host non-OHCI registers */
5066 +typedef struct PerfControl {
5068 + uint16 testControl;
5069 + uint16 blkEnables;
5070 +#define EMAC_CLK_EN 0x0010
5071 +#define SAR_CLK_EN 0x0020
5072 +#define USBS_CLK_EN 0x0040
5073 +#define USBH_CLK_EN 0x0100
5075 + uint32 pll_control;
5076 +#define SOFT_RESET 0x00000001
5082 +#define EI_SENSE_SHFT 0
5083 +#define EI_STATUS_SHFT 5
5084 +#define EI_CLEAR_SHFT 10
5085 +#define EI_MASK_SHFT 15
5086 +#define EI_INSENS_SHFT 20
5087 +#define EI_LEVEL_SHFT 25
5089 + uint32 unused[4]; /* (18) */
5090 + uint32 BlockSoftReset; /* (28) */
5091 +#define BSR_SPI 0x00000001
5092 +#define BSR_EMAC 0x00000004
5093 +#define BSR_USBH 0x00000008
5094 +#define BSR_USBS 0x00000010
5095 +#define BSR_ADSL 0x00000020
5096 +#define BSR_DMAMEM 0x00000040
5097 +#define BSR_SAR 0x00000080
5098 +#define BSR_ACLC 0x00000100
5099 +#define BSR_ADSL_MIPS_PLL 0x00000400
5100 +#define BSR_ALL_BLOCKS \
5101 + (BSR_SPI | BSR_EMAC | BSR_USBH | BSR_USBS | BSR_ADSL | BSR_DMAMEM | \
5102 + BSR_SAR | BSR_ACLC | BSR_ADSL_MIPS_PLL)
5103 + uint32 unused2[2]; /* (2c) */
5104 + uint32 PllStrap; /* (34) */
5105 +#define PLL_N1_SHFT 20
5106 +#define PLL_N1_MASK (7<<PLL_N1_SHFT)
5107 +#define PLL_N2_SHFT 15
5108 +#define PLL_N2_MASK (0x1f<<PLL_N2_SHFT)
5109 +#define PLL_M1_REF_SHFT 12
5110 +#define PLL_M1_REF_MASK (7<<PLL_M1_REF_SHFT)
5111 +#define PLL_M2_REF_SHFT 9
5112 +#define PLL_M2_REF_MASK (7<<PLL_M2_REF_SHFT)
5113 +#define PLL_M1_CPU_SHFT 6
5114 +#define PLL_M1_CPU_MASK (7<<PLL_M1_CPU_SHFT)
5115 +#define PLL_M1_BUS_SHFT 3
5116 +#define PLL_M1_BUS_MASK (7<<PLL_M1_BUS_SHFT)
5117 +#define PLL_M2_BUS_SHFT 0
5118 +#define PLL_M2_BUS_MASK (7<<PLL_M2_BUS_SHFT)
5121 +#define PERF ((volatile PerfControl * const) PERF_BASE)
5123 +typedef struct Timer {
5126 +#define TIMER0EN 0x01
5127 +#define TIMER1EN 0x02
5128 +#define TIMER2EN 0x04
5130 +#define TIMER0 0x01
5131 +#define TIMER1 0x02
5132 +#define TIMER2 0x04
5133 +#define WATCHDOG 0x08
5137 +#define TIMERENABLE 0x80000000
5138 +#define RSTCNTCLR 0x40000000
5142 + uint32 WatchDogDefCount;
5144 + /* Write 0xff00 0x00ff to Start timer
5145 + * Write 0xee00 0x00ee to Stop and re-load default count
5146 + * Read from this register returns current watch dog count
5148 + uint32 WatchDogCtl;
5150 + /* Number of 40-MHz ticks for WD Reset pulse to last */
5151 + uint32 WDResetCount;
5154 +#define TIMER ((volatile Timer * const) TIMR_BASE)
5156 +typedef struct UartChannel {
5159 +#define BRGEN 0x80 /* Control register bit defs */
5162 +#define LOOPBK 0x10
5163 +#define TXPARITYEN 0x08
5164 +#define TXPARITYEVEN 0x04
5165 +#define RXPARITYEN 0x02
5166 +#define RXPARITYEVEN 0x01
5169 +#define XMITBREAK 0x40
5170 +#define BITS5SYM 0x00
5171 +#define BITS6SYM 0x10
5172 +#define BITS7SYM 0x20
5173 +#define BITS8SYM 0x30
5174 +#define ONESTOP 0x07
5175 +#define TWOSTOP 0x0f
5176 + /* 4-LSBS represent STOP bits/char
5177 + * in 1/8 bit-time intervals. Zero
5178 + * represents 1/8 stop bit interval.
5179 + * Fifteen represents 2 stop bits.
5182 +#define RSTTXFIFOS 0x80
5183 +#define RSTRXFIFOS 0x40
5184 + /* 5-bit TimeoutCnt is in low bits of this register.
5185 + * This count represents the number of characters
5186 + * idle times before setting receive Irq when below threshold
5189 + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
5192 + byte txf_levl; /* Read-only fifo depth */
5193 + byte rxf_levl; /* Read-only fifo depth */
5194 + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
5195 + * RxThreshold. Irq can be asserted
5196 + * when rx fifo> thresh, txfifo<thresh
5198 + byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
5199 + * if these bits are also enabled to GPIO_o
5205 + byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
5206 + * detect irq on rising AND falling
5207 + * edges for corresponding GPIO_i
5208 + * if enabled (edge insensitive)
5210 + byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
5211 + * 0 for negedge sense if
5212 + * not configured for edge
5213 + * insensitive (see above)
5214 + * Lower 4 bits: Mask to enable change
5215 + * detection IRQ for corresponding
5218 + byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
5219 + * have changed (may set IRQ).
5220 + * read automatically clears bit
5221 + * Lower 4 bits are actual status
5224 + uint16 intMask; /* Same Bit defs for Mask and status */
5226 +#define DELTAIP 0x0001
5227 +#define TXUNDERR 0x0002
5228 +#define TXOVFERR 0x0004
5229 +#define TXFIFOTHOLD 0x0008
5230 +#define TXREADLATCH 0x0010
5231 +#define TXFIFOEMT 0x0020
5232 +#define RXUNDERR 0x0040
5233 +#define RXOVFERR 0x0080
5234 +#define RXTIMEOUT 0x0100
5235 +#define RXFIFOFULL 0x0200
5236 +#define RXFIFOTHOLD 0x0400
5237 +#define RXFIFONE 0x0800
5238 +#define RXFRAMERR 0x1000
5239 +#define RXPARERR 0x2000
5240 +#define RXBRK 0x4000
5243 + uint16 Data; /* Write to TX, Read from RX */
5244 + /* bits 11:8 are BRK,PAR,FRM errors */
5250 +#define UART ((volatile Uart * const) UART_BASE)
5252 +typedef struct GpioControl {
5253 + uint32 GPIODir_high; /* bits 36:32 */
5254 + uint32 GPIODir; /* bits 31:00 */
5255 + uint32 GPIOio_high; /* bits 36:32 */
5256 + uint32 GPIOio; /* bits 31:00 */
5258 +#define LED3_STROBE 0x08000000
5259 +#define LED2_STROBE 0x04000000
5260 +#define LED1_STROBE 0x02000000
5261 +#define LED0_STROBE 0x01000000
5262 +#define LED_TEST 0x00010000
5263 +#define LED3_DISABLE_LINK_ACT 0x00008000
5264 +#define LED2_DISABLE_LINK_ACT 0x00004000
5265 +#define LED1_DISABLE_LINK_ACT 0x00002000
5266 +#define LED0_DISABLE_LINK_ACT 0x00001000
5267 +#define LED_INTERVAL_SET_MASK 0x00000f00
5268 +#define LED_INTERVAL_SET_320MS 0x00000500
5269 +#define LED_INTERVAL_SET_160MS 0x00000400
5270 +#define LED_INTERVAL_SET_80MS 0x00000300
5271 +#define LED_INTERVAL_SET_40MS 0x00000200
5272 +#define LED_INTERVAL_SET_20MS 0x00000100
5273 +#define LED3_ON 0x00000080
5274 +#define LED2_ON 0x00000040
5275 +#define LED1_ON 0x00000020
5276 +#define LED0_ON 0x00000010
5277 +#define LED3_ENABLE 0x00000008
5278 +#define LED2_ENABLE 0x00000004
5279 +#define LED1_ENABLE 0x00000002
5280 +#define LED0_ENABLE 0x00000001
5281 + uint32 SpiSlaveCfg;
5282 +#define SPI_SLAVE_RESET 0x00010000
5283 +#define SPI_RESTRICT 0x00000400
5284 +#define SPI_DELAY_DISABLE 0x00000200
5285 +#define SPI_PROBE_MUX_SEL_MASK 0x000001e0
5286 +#define SPI_SER_ADDR_CFG_MASK 0x0000000c
5287 +#define SPI_MODE 0x00000001
5289 +#define GROUP4_DIAG 0x00090000
5290 +#define GROUP4_UTOPIA 0x00080000
5291 +#define GROUP4_LEGACY_LED 0x00030000
5292 +#define GROUP4_MII_SNOOP 0x00020000
5293 +#define GROUP4_EXT_EPHY 0x00010000
5294 +#define GROUP3_DIAG 0x00009000
5295 +#define GROUP3_UTOPIA 0x00008000
5296 +#define GROUP3_EXT_MII 0x00007000
5297 +#define GROUP2_DIAG 0x00000900
5298 +#define GROUP2_PCI 0x00000500
5299 +#define GROUP1_DIAG 0x00000090
5300 +#define GROUP1_UTOPIA 0x00000080
5301 +#define GROUP1_SPI_UART 0x00000060
5302 +#define GROUP1_SPI_MASTER 0x00000060
5303 +#define GROUP1_MII_PCCARD 0x00000040
5304 +#define GROUP1_MII_SNOOP 0x00000020
5305 +#define GROUP1_EXT_EPHY 0x00000010
5306 +#define GROUP0_DIAG 0x00000009
5307 +#define GROUP0_EXT_MII 0x00000007
5311 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
5313 +/* Number to mask conversion macro used for GPIODir and GPIOio */
5314 +#define GPIO_NUM_TOTAL_BITS_MASK 0x3f
5315 +#define GPIO_NUM_MAX_BITS_MASK 0x1f
5316 +#define GPIO_NUM_TO_MASK(X) ( (((X) & GPIO_NUM_TOTAL_BITS_MASK) < 32) ? (1 << ((X) & GPIO_NUM_MAX_BITS_MASK)) : (0) )
5318 +/* Number to mask conversion macro used for GPIODir_high and GPIOio_high */
5319 +#define GPIO_NUM_MAX_BITS_MASK_HIGH 0x07
5320 +#define GPIO_NUM_TO_MASK_HIGH(X) ( (((X) & GPIO_NUM_TOTAL_BITS_MASK) >= 32) ? (1 << ((X-32) & GPIO_NUM_MAX_BITS_MASK_HIGH)) : (0) )
5324 +** External Bus Interface
5326 +typedef struct EbiChipSelect {
5327 + uint32 base; /* base address in upper 24 bits */
5328 +#define EBI_SIZE_8K 0
5329 +#define EBI_SIZE_16K 1
5330 +#define EBI_SIZE_32K 2
5331 +#define EBI_SIZE_64K 3
5332 +#define EBI_SIZE_128K 4
5333 +#define EBI_SIZE_256K 5
5334 +#define EBI_SIZE_512K 6
5335 +#define EBI_SIZE_1M 7
5336 +#define EBI_SIZE_2M 8
5337 +#define EBI_SIZE_4M 9
5338 +#define EBI_SIZE_8M 10
5339 +#define EBI_SIZE_16M 11
5340 +#define EBI_SIZE_32M 12
5341 +#define EBI_SIZE_64M 13
5342 +#define EBI_SIZE_128M 14
5343 +#define EBI_SIZE_256M 15
5345 +#define EBI_ENABLE 0x00000001 /* .. enable this range */
5346 +#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
5347 +#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
5348 +#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
5349 +#define EBI_WREN 0x00000020 /* enable posted writes */
5350 +#define EBI_POLARITY 0x00000040 /* .. set to invert something,
5351 + ** don't know what yet */
5352 +#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
5353 +#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
5354 +#define EBI_FIFO 0x00000200 /* .. use fifo */
5355 +#define EBI_RE 0x00000400 /* .. Reverse Endian */
5358 +typedef struct MpiRegisters {
5359 + EbiChipSelect cs[7]; /* size chip select configuration */
5360 +#define EBI_CS0_BASE 0
5361 +#define EBI_CS1_BASE 1
5362 +#define EBI_CS2_BASE 2
5363 +#define EBI_CS3_BASE 3
5364 +#define PCMCIA_COMMON_BASE 4
5365 +#define PCMCIA_ATTRIBUTE_BASE 5
5366 +#define PCMCIA_IO_BASE 6
5367 + uint32 unused0[2]; /* reserved */
5368 + uint32 ebi_control; /* ebi control */
5369 + uint32 unused1[4]; /* reserved */
5370 +#define EBI_ACCESS_TIMEOUT 0x000007FF
5371 + uint32 pcmcia_cntl1; /* pcmcia control 1 */
5372 +#define PCCARD_CARD_RESET 0x00040000
5373 +#define CARDBUS_ENABLE 0x00008000
5374 +#define PCMCIA_ENABLE 0x00004000
5375 +#define PCMCIA_GPIO_ENABLE 0x00002000
5376 +#define CARDBUS_IDSEL 0x00001F00
5377 +#define VS2_OEN 0x00000080
5378 +#define VS1_OEN 0x00000040
5379 +#define VS2_OUT 0x00000020
5380 +#define VS1_OUT 0x00000010
5381 +#define VS2_IN 0x00000008
5382 +#define VS1_IN 0x00000004
5383 +#define CD2_IN 0x00000002
5384 +#define CD1_IN 0x00000001
5385 +#define VS_MASK 0x0000000C
5386 +#define CD_MASK 0x00000003
5387 + uint32 unused2; /* reserved */
5388 + uint32 pcmcia_cntl2; /* pcmcia control 2 */
5389 +#define PCMCIA_BYTESWAP_DIS 0x00000002
5390 +#define PCMCIA_HALFWORD_EN 0x00000001
5391 +#define RW_ACTIVE_CNT_BIT 2
5392 +#define INACTIVE_CNT_BIT 8
5393 +#define CE_SETUP_CNT_BIT 16
5394 +#define CE_HOLD_CNT_BIT 24
5395 + uint32 unused3[40]; /* reserved */
5397 + uint32 sp0range; /* PCI to internal system bus address space */
5406 + uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
5407 +#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
5408 +#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
5409 +#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
5410 +#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
5411 +#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
5412 +#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
5414 + uint32 l2pmrange1; /* internal system bus to PCI memory space */
5415 +#define PCI_SIZE_64K 0xFFFF0000
5416 +#define PCI_SIZE_128K 0xFFFE0000
5417 +#define PCI_SIZE_256K 0xFFFC0000
5418 +#define PCI_SIZE_512K 0xFFF80000
5419 +#define PCI_SIZE_1M 0xFFF00000
5420 +#define PCI_SIZE_2M 0xFFE00000
5421 +#define PCI_SIZE_4M 0xFFC00000
5422 +#define PCI_SIZE_8M 0xFF800000
5423 +#define PCI_SIZE_16M 0xFF000000
5424 +#define PCI_SIZE_32M 0xFE000000
5425 + uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
5426 + uint32 l2pmremap1;
5427 +#define CARDBUS_MEM 0x00000004
5428 +#define MEM_WINDOW_EN 0x00000001
5429 + uint32 l2pmrange2;
5431 + uint32 l2pmremap2;
5432 + uint32 l2piorange; /* internal system bus to PCI I/O space */
5434 + uint32 l2pioremap;
5436 + uint32 pcimodesel;
5437 +#define PCI2_INT_BUS_RD_PREFECH 0x000000F0
5438 +#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
5439 +#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
5441 + uint32 pciintstat; /* PCI interrupt mask/status */
5442 +#define MAILBOX1_SENT 0x08
5443 +#define MAILBOX0_SENT 0x04
5444 +#define MAILBOX1_MSG_RCV 0x02
5445 +#define MAILBOX0_MSG_RCV 0x01
5446 + uint32 locbuscntrl; /* internal system bus control */
5447 +#define DIR_U2P_NOSWAP 0x00000002
5448 +#define EN_PCI_GPIO 0x00000001
5449 + uint32 locintstat; /* internal system bus interrupt mask/status */
5450 +#define CSERR 0x0200
5451 +#define SERR 0x0100
5452 +#define EXT_PCI_INT 0x0080
5453 +#define DIR_FAILED 0x0040
5454 +#define DIR_COMPLETE 0x0020
5455 +#define PCI_CFG 0x0010
5456 + uint32 unused5[7];
5461 + uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
5462 +#define PCI_CFG_REG_WRITE_EN 0x00000080
5463 +#define PCI_CFG_ADDR 0x0000003C
5464 + uint32 pcicfgdata; /* internal system bus PCI configuration data */
5466 + uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
5467 +#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
5468 +#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
5469 +#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
5470 +#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
5471 + uint32 locch2intStat;
5472 +#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
5473 +#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
5474 +#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
5475 + uint32 locch2intMask;
5477 + uint32 locch2descaddr;
5478 + uint32 locch2status1;
5479 +#define LOCAL_DESC_STATE 0xE0000000
5480 +#define PCI_DESC_STATE 0x1C000000
5481 +#define BYTE_DONE 0x03FFC000
5482 +#define RING_ADDR 0x00003FFF
5483 + uint32 locch2status2;
5484 +#define BUFPTR_OFFSET 0x1FFF0000
5485 +#define PCI_MASTER_STATE 0x000000C0
5486 +#define LOC_MASTER_STATE 0x00000038
5487 +#define CONTROL_STATE 0x00000007
5490 + uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
5491 +#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
5492 +#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
5493 + uint32 locch1intstat;
5494 + uint32 locch1intmask;
5496 + uint32 locch1descaddr;
5497 + uint32 locch1status1;
5498 + uint32 locch1status2;
5501 + uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
5502 + uint32 pcich1intstat;
5503 + uint32 pcich1intmask;
5504 + uint32 pcich1descaddr;
5505 + uint32 pcich1status1;
5506 + uint32 pcich1status2;
5508 + uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
5509 + uint32 pcich2intstat;
5510 + uint32 pcich2intmask;
5511 + uint32 pcich2descaddr;
5512 + uint32 pcich2status1;
5513 + uint32 pcich2status2;
5515 + uint32 perm_id; /* permanent device and vendor id */
5516 + uint32 perm_rev; /* permanent revision id */
5519 +#define MPI ((volatile MpiRegisters * const) MPI_BASE)
5521 +/* PCI configuration address space start offset 0x40 */
5522 +#define BRCM_PCI_CONFIG_TIMER 0x40
5523 +#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
5524 +#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
5526 +/* USB host non-Open HCI register, USB_HOST_NON_OHCI, bit definitions. */
5527 +#define NON_OHCI_ENABLE_PORT1 0x00000001 /* Use USB port 1 for host, not dev */
5528 +#define NON_OHCI_BYTE_SWAP 0x00000008 /* Swap USB host registers */
5530 +#define USBH_NON_OHCI ((volatile unsigned long * const) USB_HOST_NON_OHCI)
5534 diff -urN linux.old/arch/mips/bcm963xx/include/bcm_intr.h linux.dev/arch/mips/bcm963xx/include/bcm_intr.h
5535 --- linux.old/arch/mips/bcm963xx/include/bcm_intr.h 1970-01-01 01:00:00.000000000 +0100
5536 +++ linux.dev/arch/mips/bcm963xx/include/bcm_intr.h 2006-08-25 00:39:38.000000000 +0200
5540 + Copyright 2003 Broadcom Corp. All Rights Reserved.
5542 + This program is free software; you can distribute it and/or modify it
5543 + under the terms of the GNU General Public License (Version 2) as
5544 + published by the Free Software Foundation.
5546 + This program is distributed in the hope it will be useful, but WITHOUT
5547 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5548 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5551 + You should have received a copy of the GNU General Public License along
5552 + with this program; if not, write to the Free Software Foundation, Inc.,
5553 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5557 +#ifndef __BCM_INTR_H
5558 +#define __BCM_INTR_H
5564 +#if defined(CONFIG_BCM96338)
5565 +#include <6338_intr.h>
5567 +#if defined(CONFIG_BCM96345)
5568 +#include <6345_intr.h>
5570 +#if defined(CONFIG_BCM96348)
5571 +#include <6348_intr.h>
5576 +typedef int (*FN_HANDLER) (int, void *, struct pt_regs *);
5579 +extern void enable_brcm_irq(unsigned int irq);
5580 +extern void disable_brcm_irq(unsigned int irq);
5581 +extern int request_external_irq(unsigned int irq,
5582 + FN_HANDLER handler, unsigned long irqflags,
5583 + const char * devname, void *dev_id);
5584 +extern unsigned int BcmHalMapInterrupt(FN_HANDLER isr, unsigned int param,
5585 + unsigned int interruptId);
5586 +extern void dump_intr_regs(void);
5588 +/* compatibility definitions */
5589 +#define BcmHalInterruptEnable(irq) enable_brcm_irq( irq )
5590 +#define BcmHalInterruptDisable(irq) disable_brcm_irq( irq )
5597 diff -urN linux.old/arch/mips/bcm963xx/include/bcm_map_part.h linux.dev/arch/mips/bcm963xx/include/bcm_map_part.h
5598 --- linux.old/arch/mips/bcm963xx/include/bcm_map_part.h 1970-01-01 01:00:00.000000000 +0100
5599 +++ linux.dev/arch/mips/bcm963xx/include/bcm_map_part.h 2006-08-25 00:39:38.000000000 +0200
5603 + Copyright 2004 Broadcom Corp. All Rights Reserved.
5605 + This program is free software; you can distribute it and/or modify it
5606 + under the terms of the GNU General Public License (Version 2) as
5607 + published by the Free Software Foundation.
5609 + This program is distributed in the hope it will be useful, but WITHOUT
5610 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5611 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5614 + You should have received a copy of the GNU General Public License along
5615 + with this program; if not, write to the Free Software Foundation, Inc.,
5616 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5620 +#ifndef __BCM_MAP_PART_H
5621 +#define __BCM_MAP_PART_H
5623 +#if defined(CONFIG_BCM96338)
5624 +#include <6338_map_part.h>
5626 +#if defined(CONFIG_BCM96345)
5627 +#include <6345_map_part.h>
5629 +#if defined(CONFIG_BCM96348)
5630 +#include <6348_map_part.h>
5635 diff -urN linux.old/arch/mips/bcm963xx/include/bcmpci.h linux.dev/arch/mips/bcm963xx/include/bcmpci.h
5636 --- linux.old/arch/mips/bcm963xx/include/bcmpci.h 1970-01-01 01:00:00.000000000 +0100
5637 +++ linux.dev/arch/mips/bcm963xx/include/bcmpci.h 2006-08-25 00:39:38.000000000 +0200
5641 + Copyright 2004 Broadcom Corp. All Rights Reserved.
5643 + This program is free software; you can distribute it and/or modify it
5644 + under the terms of the GNU General Public License (Version 2) as
5645 + published by the Free Software Foundation.
5647 + This program is distributed in the hope it will be useful, but WITHOUT
5648 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5649 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5652 + You should have received a copy of the GNU General Public License along
5653 + with this program; if not, write to the Free Software Foundation, Inc.,
5654 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5659 +// bcmpci.h - bcm96348 PCI, Cardbus, and PCMCIA definition
5664 +/* Memory window in internal system bus address space */
5665 +#define BCM_PCI_MEM_BASE 0x08000000
5666 +/* IO window in internal system bus address space */
5667 +#define BCM_PCI_IO_BASE 0x0C000000
5669 +#define BCM_PCI_ADDR_MASK 0x1fffffff
5671 +/* Memory window size (range) */
5672 +#define BCM_PCI_MEM_SIZE_16MB 0x01000000
5673 +/* IO window size (range) */
5674 +#define BCM_PCI_IO_SIZE_64KB 0x00010000
5676 +/* PCI Configuration and I/O space acesss */
5677 +#define BCM_PCI_CFG(d, f, o) ( (d << 11) | (f << 8) | (o/4 << 2) )
5679 +/* fake USB PCI slot */
5680 +#define USB_HOST_SLOT 9
5681 +#define USB_BAR0_MEM_SIZE 0x0800
5683 +#define BCM_HOST_MEM_SPACE1 0x10000000
5684 +#define BCM_HOST_MEM_SPACE2 0x00000000
5687 + * EBI bus clock is 33MHz and share with PCI bus
5688 + * each clock cycle is 30ns.
5690 +/* attribute memory access wait cnt for 4306 */
5691 +#define PCMCIA_ATTR_CE_HOLD 3 // data hold time 70ns
5692 +#define PCMCIA_ATTR_CE_SETUP 3 // data setup time 50ns
5693 +#define PCMCIA_ATTR_INACTIVE 6 // time between read/write cycles 180ns. For the total cycle time 600ns (cnt1+cnt2+cnt3+cnt4)
5694 +#define PCMCIA_ATTR_ACTIVE 10 // OE/WE pulse width 300ns
5696 +/* common memory access wait cnt for 4306 */
5697 +#define PCMCIA_MEM_CE_HOLD 1 // data hold time 30ns
5698 +#define PCMCIA_MEM_CE_SETUP 1 // data setup time 30ns
5699 +#define PCMCIA_MEM_INACTIVE 2 // time between read/write cycles 40ns. For the total cycle time 250ns (cnt1+cnt2+cnt3+cnt4)
5700 +#define PCMCIA_MEM_ACTIVE 5 // OE/WE pulse width 150ns
5702 +#define PCCARD_VCC_MASK 0x00070000 // Mask Reset also
5703 +#define PCCARD_VCC_33V 0x00010000
5704 +#define PCCARD_VCC_50V 0x00020000
5707 + MPI_CARDTYPE_NONE, // No Card in slot
5708 + MPI_CARDTYPE_PCMCIA, // 16-bit PCMCIA card in slot
5709 + MPI_CARDTYPE_CARDBUS, // 32-bit CardBus card in slot
5712 +#define CARDBUS_SLOT 0 // Slot 0 is default for CardBus
5714 +#define pcmciaAttrOffset 0x00200000
5715 +#define pcmciaMemOffset 0x00000000
5716 +// Needs to be right above PCI I/O space. Give 0x8000 (32K) to PCMCIA.
5717 +#define pcmciaIoOffset (BCM_PCI_IO_BASE + 0x80000)
5718 +// Base Address is that mapped into the MPI ChipSelect registers.
5719 +// UBUS bridge MemoryWindow 0 outputs a 0x00 for the base.
5720 +#define pcmciaBase 0xbf000000
5721 +#define pcmciaAttr (pcmciaAttrOffset | pcmciaBase)
5722 +#define pcmciaMem (pcmciaMemOffset | pcmciaBase)
5723 +#define pcmciaIo (pcmciaIoOffset | pcmciaBase)
5726 diff -urN linux.old/arch/mips/bcm963xx/include/bcmTag.h linux.dev/arch/mips/bcm963xx/include/bcmTag.h
5727 --- linux.old/arch/mips/bcm963xx/include/bcmTag.h 1970-01-01 01:00:00.000000000 +0100
5728 +++ linux.dev/arch/mips/bcm963xx/include/bcmTag.h 2006-08-25 00:39:38.000000000 +0200
5732 + Copyright 2002 Broadcom Corp. All Rights Reserved.
5734 + This program is free software; you can distribute it and/or modify it
5735 + under the terms of the GNU General Public License (Version 2) as
5736 + published by the Free Software Foundation.
5738 + This program is distributed in the hope it will be useful, but WITHOUT
5739 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5740 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5743 + You should have received a copy of the GNU General Public License along
5744 + with this program; if not, write to the Free Software Foundation, Inc.,
5745 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5748 +//**************************************************************************************
5749 +// File Name : bcmTag.h
5751 +// Description: add tag with validation system to the firmware image file to be uploaded
5754 +// Created : 02/28/2002 seanl
5755 +//**************************************************************************************
5761 +#define BCM_SIG_1 "Broadcom Corporation"
5762 +#define BCM_SIG_2 "ver. 2.0" // was "firmware version 2.0" now it is split 6 char out for chip id.
5764 +#define BCM_TAG_VER "6"
5765 +#define BCM_TAG_VER_LAST "26"
5767 +// file tag (head) structure all is in clear text except validationTokens (crc, md5, sha1, etc). Total: 128 unsigned chars
5768 +#define TAG_LEN 256
5769 +#define TAG_VER_LEN 4
5771 +#define SIG_LEN_2 14 // Original second SIG = 20 is now devided into 14 for SIG_LEN_2 and 6 for CHIP_ID
5772 +#define CHIP_ID_LEN 6
5773 +#define IMAGE_LEN 10
5774 +#define ADDRESS_LEN 12
5776 +#define TOKEN_LEN 20
5777 +#define BOARD_ID_LEN 16
5778 +#define RESERVED_LEN (TAG_LEN - TAG_VER_LEN - SIG_LEN - SIG_LEN_2 - CHIP_ID_LEN - BOARD_ID_LEN - \
5779 + (4*IMAGE_LEN) - (3*ADDRESS_LEN) - (3*FLAG_LEN) - (2*TOKEN_LEN))
5782 +// TAG for downloadable image (kernel plus file system)
5783 +typedef struct _FILE_TAG
5785 + unsigned char tagVersion[TAG_VER_LEN]; // tag version. Will be 2 here.
5786 + unsigned char signiture_1[SIG_LEN]; // text line for company info
5787 + unsigned char signiture_2[SIG_LEN_2]; // additional info (can be version number)
5788 + unsigned char chipId[CHIP_ID_LEN]; // chip id
5789 + unsigned char boardId[BOARD_ID_LEN]; // board id
5790 + unsigned char bigEndian[FLAG_LEN]; // if = 1 - big, = 0 - little endia of the host
5791 + unsigned char totalImageLen[IMAGE_LEN]; // the sum of all the following length
5792 + unsigned char cfeAddress[ADDRESS_LEN]; // if non zero, cfe starting address
5793 + unsigned char cfeLen[IMAGE_LEN]; // if non zero, cfe size in clear ASCII text.
5794 + unsigned char rootfsAddress[ADDRESS_LEN]; // if non zero, filesystem starting address
5795 + unsigned char rootfsLen[IMAGE_LEN]; // if non zero, filesystem size in clear ASCII text.
5796 + unsigned char kernelAddress[ADDRESS_LEN]; // if non zero, kernel starting address
5797 + unsigned char kernelLen[IMAGE_LEN]; // if non zero, kernel size in clear ASCII text.
5798 + unsigned char dualImage[FLAG_LEN]; // if 1, dual image
5799 + unsigned char inactiveLen[FLAG_LEN]; // if 1, the image is INACTIVE; if 0, active
5800 + unsigned char reserved[RESERVED_LEN]; // reserved for later use
5801 + unsigned char imageValidationToken[TOKEN_LEN];// image validation token - can be crc, md5, sha; for
5802 + // now will be 4 unsigned char crc
5803 + unsigned char tagValidationToken[TOKEN_LEN]; // validation token for tag(from signiture_1 to end of // mageValidationToken)
5804 +} FILE_TAG, *PFILE_TAG;
5806 +#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
5809 +// only included if for bcmTag.exe program
5810 +#ifdef BCMTAG_EXE_USE
5812 +static unsigned long Crc32_table[256] = {
5813 + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
5814 + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
5815 + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
5816 + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
5817 + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
5818 + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
5819 + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
5820 + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
5821 + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
5822 + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
5823 + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
5824 + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
5825 + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
5826 + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
5827 + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
5828 + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
5829 + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
5830 + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
5831 + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
5832 + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
5833 + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
5834 + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
5835 + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
5836 + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
5837 + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
5838 + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
5839 + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
5840 + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
5841 + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
5842 + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
5843 + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
5844 + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
5845 + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
5846 + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
5847 + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
5848 + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
5849 + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
5850 + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
5851 + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
5852 + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
5853 + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
5854 + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
5855 + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
5856 + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
5857 + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
5858 + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
5859 + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
5860 + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
5861 + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
5862 + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
5863 + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
5864 + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
5865 + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
5866 + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
5867 + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
5868 + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
5869 + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
5870 + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
5871 + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
5872 + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
5873 + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
5874 + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
5875 + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
5876 + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
5878 +#endif // BCMTAG_USE
5881 +#endif // _BCMTAG_H_
5883 diff -urN linux.old/arch/mips/bcm963xx/include/bcmtypes.h linux.dev/arch/mips/bcm963xx/include/bcmtypes.h
5884 --- linux.old/arch/mips/bcm963xx/include/bcmtypes.h 1970-01-01 01:00:00.000000000 +0100
5885 +++ linux.dev/arch/mips/bcm963xx/include/bcmtypes.h 2006-08-25 00:39:38.000000000 +0200
5889 + Copyright 2002 Broadcom Corp. All Rights Reserved.
5891 + This program is free software; you can distribute it and/or modify it
5892 + under the terms of the GNU General Public License (Version 2) as
5893 + published by the Free Software Foundation.
5895 + This program is distributed in the hope it will be useful, but WITHOUT
5896 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5897 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5900 + You should have received a copy of the GNU General Public License along
5901 + with this program; if not, write to the Free Software Foundation, Inc.,
5902 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5907 +// bcmtypes.h - misc useful typedefs
5912 +// These are also defined in typedefs.h in the application area, so I need to
5913 +// protect against re-definition.
5915 +#ifndef _TYPEDEFS_H_
5916 +typedef unsigned char uint8;
5917 +typedef unsigned short uint16;
5918 +typedef unsigned long uint32;
5919 +typedef signed char int8;
5920 +typedef signed short int16;
5921 +typedef signed long int32;
5922 +#if !defined(__cplusplus)
5927 +typedef unsigned char byte;
5928 +// typedef unsigned long sem_t;
5930 +typedef unsigned long HANDLE,*PULONG,DWORD,*PDWORD;
5931 +typedef signed long LONG,*PLONG;
5933 +typedef unsigned int *PUINT;
5934 +typedef signed int INT;
5936 +typedef unsigned short *PUSHORT;
5937 +typedef signed short SHORT,*PSHORT;
5938 +typedef unsigned short WORD,*PWORD;
5940 +typedef unsigned char *PUCHAR;
5941 +typedef signed char *PCHAR;
5943 +typedef void *PVOID;
5945 +typedef unsigned char BOOLEAN, *PBOOL, *PBOOLEAN;
5947 +typedef unsigned char BYTE,*PBYTE;
5950 +//The following has been defined in Vxworks internally: vxTypesOld.h
5951 +//redefine under vxworks will cause error
5952 +typedef signed int *PINT;
5954 +typedef signed char INT8;
5955 +typedef signed short INT16;
5956 +typedef signed long INT32;
5958 +typedef unsigned char UINT8;
5959 +typedef unsigned short UINT16;
5960 +typedef unsigned long UINT32;
5962 +typedef unsigned char UCHAR;
5963 +typedef unsigned short USHORT;
5964 +typedef unsigned int UINT;
5965 +typedef unsigned long ULONG;
5968 +typedef unsigned char BOOL;
5970 +//#endif /* __GNUC__ */
5973 +// These are also defined in typedefs.h in the application area, so I need to
5974 +// protect against re-definition.
5977 +// Maximum and minimum values for a signed 16 bit integer.
5978 +#define MAX_INT16 32767
5979 +#define MIN_INT16 -32768
5981 +// Useful for true/false return values. This uses the
5982 +// Taligent notation (k for constant).
5991 +/* macros to protect against unaligned accesses */
5994 +/* first arg is an address, second is a value */
5995 +#define PUT16( a, d ) { \
5996 + *((byte *)a) = (byte)((d)>>8); \
5997 + *(((byte *)a)+1) = (byte)(d); \
6000 +#define PUT32( a, d ) { \
6001 + *((byte *)a) = (byte)((d)>>24); \
6002 + *(((byte *)a)+1) = (byte)((d)>>16); \
6003 + *(((byte *)a)+2) = (byte)((d)>>8); \
6004 + *(((byte *)a)+3) = (byte)(d); \
6007 +/* first arg is an address, returns a value */
6008 +#define GET16( a ) ( \
6009 + (*((byte *)a) << 8) | \
6010 + (*(((byte *)a)+1)) \
6013 +#define GET32( a ) ( \
6014 + (*((byte *)a) << 24) | \
6015 + (*(((byte *)a)+1) << 16) | \
6016 + (*(((byte *)a)+2) << 8) | \
6017 + (*(((byte *)a)+3)) \
6045 +#define READ32(addr) (*(volatile UINT32 *)((ULONG)&addr))
6046 +#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr))
6047 +#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr))
6050 diff -urN linux.old/arch/mips/bcm963xx/include/board.h linux.dev/arch/mips/bcm963xx/include/board.h
6051 --- linux.old/arch/mips/bcm963xx/include/board.h 1970-01-01 01:00:00.000000000 +0100
6052 +++ linux.dev/arch/mips/bcm963xx/include/board.h 2006-08-25 01:52:34.000000000 +0200
6056 + Copyright 2002 Broadcom Corp. All Rights Reserved.
6058 + This program is free software; you can distribute it and/or modify it
6059 + under the terms of the GNU General Public License (Version 2) as
6060 + published by the Free Software Foundation.
6062 + This program is distributed in the hope it will be useful, but WITHOUT
6063 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6064 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6067 + You should have received a copy of the GNU General Public License along
6068 + with this program; if not, write to the Free Software Foundation, Inc.,
6069 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6072 +/***********************************************************************/
6074 +/* MODULE: board.h */
6075 +/* DATE: 97/02/18 */
6076 +/* PURPOSE: Board specific information. This module should include */
6077 +/* all base device addresses and board specific macros. */
6079 +/***********************************************************************/
6083 +/*****************************************************************************/
6084 +/* Misc board definitions */
6085 +/*****************************************************************************/
6087 +#define DYING_GASP_API
6089 +/*****************************************************************************/
6090 +/* Physical Memory Map */
6091 +/*****************************************************************************/
6093 +#define PHYS_DRAM_BASE 0x00000000 /* Dynamic RAM Base */
6094 +#define PHYS_FLASH_BASE 0x1FC00000 /* Flash Memory */
6096 +/*****************************************************************************/
6097 +/* Note that the addresses above are physical addresses and that programs */
6098 +/* have to use converted addresses defined below: */
6099 +/*****************************************************************************/
6100 +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
6101 +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
6102 +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
6104 +/*****************************************************************************/
6105 +/* Select the PLL value to get the desired CPU clock frequency. */
6108 +/*****************************************************************************/
6109 +#define FPERIPH 50000000
6112 +#define BLK64K (64*ONEK)
6113 +#define FLASH45_BLKS_BOOT_ROM 1
6114 +#define FLASH45_LENGTH_BOOT_ROM (FLASH45_BLKS_BOOT_ROM * BLK64K)
6115 +#define FLASH_RESERVED_AT_END (64*ONEK) /*reserved for PSI, scratch pad*/
6117 +/*****************************************************************************/
6118 +/* Note that the addresses above are physical addresses and that programs */
6119 +/* have to use converted addresses defined below: */
6120 +/*****************************************************************************/
6121 +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
6122 +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
6123 +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
6125 +/*****************************************************************************/
6126 +/* Select the PLL value to get the desired CPU clock frequency. */
6129 +/*****************************************************************************/
6130 +#define FPERIPH 50000000
6132 +#define SDRAM_TYPE_ADDRESS_OFFSET 16
6133 +#define NVRAM_DATA_OFFSET 0x0580
6134 +#define NVRAM_DATA_ID 0x0f1e2d3c
6135 +#define BOARD_SDRAM_TYPE *(unsigned long *) \
6136 + (FLASH_BASE + SDRAM_TYPE_ADDRESS_OFFSET)
6139 +#define BLK64K (64*ONEK)
6141 +// nvram and psi flash definitions for 45
6142 +#define FLASH45_LENGTH_NVRAM ONEK // 1k nvram
6143 +#define NVRAM_PSI_DEFAULT 24 // default psi in K byes
6145 +/*****************************************************************************/
6146 +/* NVRAM Offset and definition */
6147 +/*****************************************************************************/
6149 +#define NVRAM_VERSION_NUMBER 2
6150 +#define NVRAM_VERSION_NUMBER_ADDRESS 0
6152 +#define NVRAM_BOOTLINE_LEN 256
6153 +#define NVRAM_BOARD_ID_STRING_LEN 16
6154 +#define NVRAM_MAC_ADDRESS_LEN 6
6155 +#define NVRAM_MAC_COUNT_MAX 32
6157 +/*****************************************************************************/
6159 +/*****************************************************************************/
6161 +#define CFE_VERSION_OFFSET 0x0570
6162 +#define CFE_VERSION_MARK_SIZE 5
6163 +#define CFE_VERSION_SIZE 5
6167 + unsigned long ulVersion;
6168 + char szBootline[NVRAM_BOOTLINE_LEN];
6169 + char szBoardId[NVRAM_BOARD_ID_STRING_LEN];
6170 + unsigned long ulReserved1[2];
6171 + unsigned long ulNumMacAddrs;
6172 + unsigned char ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
6173 + char chReserved[2];
6174 + unsigned long ulCheckSum;
6175 +} NVRAM_DATA, *PNVRAM_DATA;
6178 +/*****************************************************************************/
6179 +/* board ioctl calls for flash, led and some other utilities */
6180 +/*****************************************************************************/
6183 +/* Defines. for board driver */
6184 +#define BOARD_IOCTL_MAGIC 'B'
6185 +#define BOARD_DRV_MAJOR 206
6187 +#define MAC_ADDRESS_ANY (unsigned long) -1
6189 +#define BOARD_IOCTL_FLASH_INIT \
6190 + _IOWR(BOARD_IOCTL_MAGIC, 0, BOARD_IOCTL_PARMS)
6192 +#define BOARD_IOCTL_FLASH_WRITE \
6193 + _IOWR(BOARD_IOCTL_MAGIC, 1, BOARD_IOCTL_PARMS)
6195 +#define BOARD_IOCTL_FLASH_READ \
6196 + _IOWR(BOARD_IOCTL_MAGIC, 2, BOARD_IOCTL_PARMS)
6198 +#define BOARD_IOCTL_GET_NR_PAGES \
6199 + _IOWR(BOARD_IOCTL_MAGIC, 3, BOARD_IOCTL_PARMS)
6201 +#define BOARD_IOCTL_DUMP_ADDR \
6202 + _IOWR(BOARD_IOCTL_MAGIC, 4, BOARD_IOCTL_PARMS)
6204 +#define BOARD_IOCTL_SET_MEMORY \
6205 + _IOWR(BOARD_IOCTL_MAGIC, 5, BOARD_IOCTL_PARMS)
6207 +#define BOARD_IOCTL_MIPS_SOFT_RESET \
6208 + _IOWR(BOARD_IOCTL_MAGIC, 6, BOARD_IOCTL_PARMS)
6210 +#define BOARD_IOCTL_LED_CTRL \
6211 + _IOWR(BOARD_IOCTL_MAGIC, 7, BOARD_IOCTL_PARMS)
6213 +#define BOARD_IOCTL_GET_ID \
6214 + _IOWR(BOARD_IOCTL_MAGIC, 8, BOARD_IOCTL_PARMS)
6216 +#define BOARD_IOCTL_GET_MAC_ADDRESS \
6217 + _IOWR(BOARD_IOCTL_MAGIC, 9, BOARD_IOCTL_PARMS)
6219 +#define BOARD_IOCTL_RELEASE_MAC_ADDRESS \
6220 + _IOWR(BOARD_IOCTL_MAGIC, 10, BOARD_IOCTL_PARMS)
6222 +#define BOARD_IOCTL_GET_PSI_SIZE \
6223 + _IOWR(BOARD_IOCTL_MAGIC, 11, BOARD_IOCTL_PARMS)
6225 +#define BOARD_IOCTL_GET_SDRAM_SIZE \
6226 + _IOWR(BOARD_IOCTL_MAGIC, 12, BOARD_IOCTL_PARMS)
6228 +#define BOARD_IOCTL_SET_MONITOR_FD \
6229 + _IOWR(BOARD_IOCTL_MAGIC, 13, BOARD_IOCTL_PARMS)
6231 +#define BOARD_IOCTL_WAKEUP_MONITOR_TASK \
6232 + _IOWR(BOARD_IOCTL_MAGIC, 14, BOARD_IOCTL_PARMS)
6234 +#define BOARD_IOCTL_GET_BOOTLINE \
6235 + _IOWR(BOARD_IOCTL_MAGIC, 15, BOARD_IOCTL_PARMS)
6237 +#define BOARD_IOCTL_SET_BOOTLINE \
6238 + _IOWR(BOARD_IOCTL_MAGIC, 16, BOARD_IOCTL_PARMS)
6240 +#define BOARD_IOCTL_GET_BASE_MAC_ADDRESS \
6241 + _IOWR(BOARD_IOCTL_MAGIC, 17, BOARD_IOCTL_PARMS)
6243 +#define BOARD_IOCTL_GET_CHIP_ID \
6244 + _IOWR(BOARD_IOCTL_MAGIC, 18, BOARD_IOCTL_PARMS)
6246 +#define BOARD_IOCTL_GET_NUM_ENET \
6247 + _IOWR(BOARD_IOCTL_MAGIC, 19, BOARD_IOCTL_PARMS)
6249 +#define BOARD_IOCTL_GET_CFE_VER \
6250 + _IOWR(BOARD_IOCTL_MAGIC, 20, BOARD_IOCTL_PARMS)
6252 +#define BOARD_IOCTL_GET_ENET_CFG \
6253 + _IOWR(BOARD_IOCTL_MAGIC, 21, BOARD_IOCTL_PARMS)
6255 +#define BOARD_IOCTL_GET_WLAN_ANT_INUSE \
6256 + _IOWR(BOARD_IOCTL_MAGIC, 22, BOARD_IOCTL_PARMS)
6258 +#define BOARD_IOCTL_SET_TRIGGER_EVENT \
6259 + _IOWR(BOARD_IOCTL_MAGIC, 23, BOARD_IOCTL_PARMS)
6261 +#define BOARD_IOCTL_GET_TRIGGER_EVENT \
6262 + _IOWR(BOARD_IOCTL_MAGIC, 24, BOARD_IOCTL_PARMS)
6264 +#define BOARD_IOCTL_UNSET_TRIGGER_EVENT \
6265 + _IOWR(BOARD_IOCTL_MAGIC, 25, BOARD_IOCTL_PARMS)
6267 +#define BOARD_IOCTL_SET_SES_LED \
6268 + _IOWR(BOARD_IOCTL_MAGIC, 26, BOARD_IOCTL_PARMS)
6270 +//<<JUNHON, 2004/09/15, get reset button status , tim hou , 05/04/12
6271 +#define RESET_BUTTON_UP 1
6272 +#define RESET_BUTTON_PRESSDOWN 0
6273 +#define BOARD_IOCTL_GET_RESETHOLD \
6274 + _IOWR(BOARD_IOCTL_MAGIC, 27, BOARD_IOCTL_PARMS)
6275 +//>>JUNHON, 2004/09/15
6277 +// for the action in BOARD_IOCTL_PARMS for flash operation
6288 +} BOARD_IOCTL_ACTION;
6291 +typedef struct boardIoctParms
6297 + BOARD_IOCTL_ACTION action; /* flash read/write: nvram, persistent, bcm image */
6299 +} BOARD_IOCTL_PARMS;
6315 + kLedEnd, // NOTE: Insert the new led name before this one. Alway stay at the end.
6320 + kLedStateOff, /* turn led off */
6321 + kLedStateOn, /* turn led on */
6322 + kLedStateFail, /* turn led on red */
6323 + kLedStateBlinkOnce, /* blink once, ~100ms and ignore the same call during the 100ms period */
6324 + kLedStateSlowBlinkContinues, /* slow blink continues at ~600ms interval */
6325 + kLedStateFastBlinkContinues, /* fast blink continues at ~200ms interval */
6329 +// virtual and physical map pair defined in board.c
6330 +typedef struct ledmappair
6332 + BOARD_LED_NAME ledName; // virtual led name
6333 + BOARD_LED_STATE ledInitState; // initial led state when the board boots.
6334 + unsigned short ledMask; // physical GPIO pin mask
6335 + unsigned short ledActiveLow; // reset bit to turn on LED
6336 + unsigned short ledMaskFail; // physical GPIO pin mask for state failure
6337 + unsigned short ledActiveLowFail;// reset bit to turn on LED
6338 +} LED_MAP_PAIR, *PLED_MAP_PAIR;
6340 +typedef void (*HANDLE_LED_FUNC)(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState);
6342 +/* Flash storage address information that is determined by the flash driver. */
6343 +typedef struct flashaddrinfo
6345 + int flash_persistent_start_blk;
6346 + int flash_persistent_number_blk;
6347 + int flash_persistent_length;
6348 + unsigned long flash_persistent_blk_offset;
6349 + int flash_scratch_pad_start_blk; // start before psi (SP_BUF_LEN)
6350 + int flash_scratch_pad_number_blk;
6351 + int flash_scratch_pad_length;
6352 + unsigned long flash_scratch_pad_blk_offset;
6353 + int flash_nvram_start_blk;
6354 + int flash_nvram_number_blk;
6355 + int flash_nvram_length;
6356 + unsigned long flash_nvram_blk_offset;
6357 +} FLASH_ADDR_INFO, *PFLASH_ADDR_INFO;
6359 +// scratch pad defines
6360 +/* SP - Persisten Scratch Pad format:
6361 + sp header : 32 bytes
6362 + tokenId-1 : 8 bytes
6363 + tokenId-1 len : 4 bytes
6366 + tokenId-n : 8 bytes
6367 + tokenId-n len : 4 bytes
6371 +#define MAGIC_NUM_LEN 8
6372 +#define MAGIC_NUMBER "gOGoBrCm"
6373 +#define TOKEN_NAME_LEN 16
6374 +#define SP_VERSION 1
6375 +#define SP_MAX_LEN 8 * 1024 // 8k buf before psi
6376 +#define SP_RESERVERD 16
6378 +typedef struct _SP_HEADER
6380 + char SPMagicNum[MAGIC_NUM_LEN]; // 8 bytes of magic number
6381 + int SPVersion; // version number
6382 + int SPUsedLen; // used sp len
6383 + char SPReserved[SP_RESERVERD]; // reservied, total 32 bytes
6384 +} SP_HEADER, *PSP_HEADER;
6386 +typedef struct _TOKEN_DEF
6388 + char tokenName[TOKEN_NAME_LEN];
6390 +} SP_TOKEN, *PSP_TOKEN;
6393 +/*****************************************************************************/
6394 +/* Function Prototypes */
6395 +/*****************************************************************************/
6396 +#if !defined(__ASM_ASM_H)
6397 +void dumpaddr( unsigned char *pAddr, int nLen );
6399 +int kerSysNvRamGet(char *string, int strLen, int offset);
6400 +int kerSysNvRamSet(char *string, int strLen, int offset);
6401 +int kerSysPersistentGet(char *string, int strLen, int offset);
6402 +int kerSysPersistentSet(char *string, int strLen, int offset);
6403 +int kerSysScratchPadGet(char *tokName, char *tokBuf, int tokLen);
6404 +int kerSysScratchPadSet(char *tokName, char *tokBuf, int tokLen);
6405 +int kerSysBcmImageSet( int flash_start_addr, char *string, int size);
6406 +int kerSysGetMacAddress( unsigned char *pucaAddr, unsigned long ulId );
6407 +int kerSysReleaseMacAddress( unsigned char *pucaAddr );
6408 +int kerSysGetSdramSize( void );
6409 +void kerSysGetBootline(char *string, int strLen);
6410 +void kerSysSetBootline(char *string, int strLen);
6411 +void kerSysMipsSoftReset(void);
6412 +void kerSysLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
6413 +void kerSysLedRegisterHwHandler( BOARD_LED_NAME, HANDLE_LED_FUNC, int );
6414 +int kerSysFlashSizeGet(void);
6415 +void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context);
6416 +void kerSysDeregisterDyingGaspHandler(char *devname);
6417 +void kerSysWakeupMonitorTask( void );
6421 +#define BOOT_REDBOOT 1
6423 +extern int boot_loader_type;
6425 +#endif /* _BOARD_H */
6427 diff -urN linux.old/arch/mips/bcm963xx/int-handler.S linux.dev/arch/mips/bcm963xx/int-handler.S
6428 --- linux.old/arch/mips/bcm963xx/int-handler.S 1970-01-01 01:00:00.000000000 +0100
6429 +++ linux.dev/arch/mips/bcm963xx/int-handler.S 2006-08-25 02:13:33.000000000 +0200
6433 + Copyright 2002 Broadcom Corp. All Rights Reserved.
6435 + This program is free software; you can distribute it and/or modify it
6436 + under the terms of the GNU General Public License (Version 2) as
6437 + published by the Free Software Foundation.
6439 + This program is distributed in the hope it will be useful, but WITHOUT
6440 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6441 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6444 + You should have received a copy of the GNU General Public License along
6445 + with this program; if not, write to the Free Software Foundation, Inc.,
6446 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6450 + * Generic interrupt handler for Broadcom MIPS boards
6453 +#include <linux/config.h>
6455 +#include <asm/asm.h>
6456 +#include <asm/mipsregs.h>
6457 +#include <asm/regdef.h>
6458 +#include <asm/stackframe.h>
6463 + * 0 Software (ignored)
6464 + * 1 Software (ignored)
6465 + * 2 Combined hardware interrupt (hw0)
6477 + NESTED(brcmIRQ, PT_SIZE, sp)
6483 + jal plat_irq_dispatch
6490 diff -urN linux.old/arch/mips/bcm963xx/irq.c linux.dev/arch/mips/bcm963xx/irq.c
6491 --- linux.old/arch/mips/bcm963xx/irq.c 1970-01-01 01:00:00.000000000 +0100
6492 +++ linux.dev/arch/mips/bcm963xx/irq.c 2006-08-25 03:54:34.000000000 +0200
6496 + Copyright 2002 Broadcom Corp. All Rights Reserved.
6498 + This program is free software; you can distribute it and/or modify it
6499 + under the terms of the GNU General Public License (Version 2) as
6500 + published by the Free Software Foundation.
6502 + This program is distributed in the hope it will be useful, but WITHOUT
6503 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6504 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6507 + You should have received a copy of the GNU General Public License along
6508 + with this program; if not, write to the Free Software Foundation, Inc.,
6509 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6513 + * Interrupt control functions for Broadcom 963xx MIPS boards
6516 +#include <asm/atomic.h>
6518 +#include <linux/delay.h>
6519 +#include <linux/init.h>
6520 +#include <linux/ioport.h>
6521 +#include <linux/irq.h>
6522 +#include <linux/interrupt.h>
6523 +#include <linux/kernel.h>
6524 +#include <linux/slab.h>
6525 +#include <linux/module.h>
6527 +#include <asm/irq.h>
6528 +#include <asm/mipsregs.h>
6529 +#include <asm/addrspace.h>
6530 +#include <asm/signal.h>
6531 +#include <bcm_map_part.h>
6532 +#include <bcm_intr.h>
6534 +static void irq_dispatch_int(struct pt_regs *regs)
6536 + unsigned int pendingIrqs;
6537 + static unsigned int irqBit;
6538 + static unsigned int isrNumber = 31;
6540 + pendingIrqs = PERF->IrqStatus & PERF->IrqMask;
6541 + if (!pendingIrqs) {
6548 + if (isrNumber == 32) {
6552 + if (pendingIrqs & irqBit) {
6553 + PERF->IrqMask &= ~irqBit; // mask
6554 + do_IRQ(isrNumber + INTERNAL_ISR_TABLE_OFFSET, regs);
6560 +static void irq_dispatch_ext(uint32 irq, struct pt_regs *regs)
6562 + if (!(PERF->ExtIrqCfg & (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)))) {
6563 + printk("**** Ext IRQ mask. Should not dispatch ****\n");
6565 + /* disable and clear interrupt in the controller */
6566 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
6567 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
6568 + do_IRQ(irq, regs);
6572 +extern void brcm_timer_interrupt(struct pt_regs *regs);
6574 +asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
6577 + while((cause = (read_c0_cause()& CAUSEF_IP))) {
6578 + if (cause & CAUSEF_IP7)
6579 + brcm_timer_interrupt(regs);
6580 + else if (cause & CAUSEF_IP2)
6581 + irq_dispatch_int(regs);
6582 + else if (cause & CAUSEF_IP3)
6583 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_0, regs);
6584 + else if (cause & CAUSEF_IP4)
6585 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_1, regs);
6586 + else if (cause & CAUSEF_IP5)
6587 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_2, regs);
6588 + else if (cause & CAUSEF_IP6)
6589 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_3, regs);
6590 + local_irq_disable();
6595 +void enable_brcm_irq(unsigned int irq)
6597 + unsigned long flags;
6599 + local_irq_save(flags);
6600 + if( irq >= INTERNAL_ISR_TABLE_OFFSET ) {
6601 + PERF->IrqMask |= (1 << (irq - INTERNAL_ISR_TABLE_OFFSET));
6603 + else if (irq >= INTERRUPT_ID_EXTERNAL_0 && irq <= INTERRUPT_ID_EXTERNAL_3) {
6604 + /* enable and clear interrupt in the controller */
6605 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
6606 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
6608 + local_irq_restore(flags);
6611 +void disable_brcm_irq(unsigned int irq)
6613 + unsigned long flags;
6615 + local_irq_save(flags);
6616 + if( irq >= INTERNAL_ISR_TABLE_OFFSET ) {
6617 + PERF->IrqMask &= ~(1 << (irq - INTERNAL_ISR_TABLE_OFFSET));
6619 + else if (irq >= INTERRUPT_ID_EXTERNAL_0 && irq <= INTERRUPT_ID_EXTERNAL_3) {
6620 + /* disable interrupt in the controller */
6621 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
6623 + local_irq_restore(flags);
6626 +void ack_brcm_irq(unsigned int irq)
6628 + /* Already done in brcm_irq_dispatch */
6631 +unsigned int startup_brcm_irq(unsigned int irq)
6633 + enable_brcm_irq(irq);
6635 + return 0; /* never anything pending */
6638 +unsigned int startup_brcm_none(unsigned int irq)
6643 +void end_brcm_irq(unsigned int irq)
6645 + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
6646 + enable_brcm_irq(irq);
6649 +void end_brcm_none(unsigned int irq)
6653 +static struct hw_interrupt_type brcm_irq_type = {
6654 + .typename = "MIPS",
6655 + .startup = startup_brcm_irq,
6656 + .shutdown = disable_brcm_irq,
6657 + .enable = enable_brcm_irq,
6658 + .disable = disable_brcm_irq,
6659 + .ack = ack_brcm_irq,
6660 + .end = end_brcm_irq,
6661 + .set_affinity = NULL
6664 +static struct hw_interrupt_type brcm_irq_no_end_type = {
6665 + .typename = "MIPS",
6666 + .startup = startup_brcm_none,
6667 + .shutdown = disable_brcm_irq,
6668 + .enable = enable_brcm_irq,
6669 + .disable = disable_brcm_irq,
6670 + .ack = ack_brcm_irq,
6671 + .end = end_brcm_none,
6672 + .set_affinity = NULL
6675 +void __init arch_init_irq(void)
6679 + clear_c0_status(ST0_BEV);
6680 + change_c0_status(ST0_IM, (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4));
6682 + for (i = 0; i < NR_IRQS; i++) {
6683 + irq_desc[i].status = IRQ_DISABLED;
6684 + irq_desc[i].action = 0;
6685 + irq_desc[i].depth = 1;
6686 + irq_desc[i].handler = &brcm_irq_type;
6690 +int request_external_irq(unsigned int irq,
6691 + FN_HANDLER handler,
6692 + unsigned long irqflags,
6693 + const char * devname,
6696 + unsigned long flags;
6698 + local_irq_save(flags);
6700 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT)); // Clear
6701 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)); // Mask
6702 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_INSENS_SHFT)); // Edge insesnsitive
6703 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_LEVEL_SHFT)); // Level triggered
6704 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_SENSE_SHFT)); // Low level
6706 + local_irq_restore(flags);
6708 + return( request_irq(irq, handler, irqflags, devname, dev_id) );
6711 +/* VxWorks compatibility function(s). */
6713 +unsigned int BcmHalMapInterrupt(FN_HANDLER pfunc, unsigned int param,
6714 + unsigned int interruptId)
6719 + devname = kmalloc(16, GFP_KERNEL);
6721 + sprintf( devname, "brcm_%d", interruptId );
6723 + /* Set the IRQ description to not automatically enable the interrupt at
6724 + * the end of an ISR. The driver that handles the interrupt must
6725 + * explicitly call BcmHalInterruptEnable or enable_brcm_irq. This behavior
6726 + * is consistent with interrupt handling on VxWorks.
6728 + irq_desc[interruptId].handler = &brcm_irq_no_end_type;
6730 + if( interruptId >= INTERNAL_ISR_TABLE_OFFSET )
6732 + nRet = request_irq( interruptId, pfunc, SA_SAMPLE_RANDOM | SA_INTERRUPT,
6733 + devname, (void *) param );
6735 + else if (interruptId >= INTERRUPT_ID_EXTERNAL_0 && interruptId <= INTERRUPT_ID_EXTERNAL_3)
6737 + nRet = request_external_irq( interruptId, pfunc, SA_SAMPLE_RANDOM | SA_INTERRUPT,
6738 + devname, (void *) param );
6745 +EXPORT_SYMBOL(enable_brcm_irq);
6746 +EXPORT_SYMBOL(disable_brcm_irq);
6747 +EXPORT_SYMBOL(request_external_irq);
6748 +EXPORT_SYMBOL(BcmHalMapInterrupt);
6750 diff -urN linux.old/arch/mips/bcm963xx/Kconfig linux.dev/arch/mips/bcm963xx/Kconfig
6751 --- linux.old/arch/mips/bcm963xx/Kconfig 1970-01-01 01:00:00.000000000 +0100
6752 +++ linux.dev/arch/mips/bcm963xx/Kconfig 2006-08-25 01:22:39.000000000 +0200
6754 +# Kernel and Driver configuration for Broadcom Commengine ADSL board
6756 + prompt "Broadcom Commengine ADSL board"
6757 + depends on MIPS_BRCM
6760 + Select different Broadcom ADSL board
6763 + bool "96338 ADSL board"
6764 + select DMA_NONCOHERENT
6768 + bool "96345 ADSL board"
6769 + select DMA_NONCOHERENT
6773 + bool "96348 ADSL board"
6774 + select DMA_NONCOHERENT
6780 + bool "Support for Broadcom Board"
6781 + depends on BCM96338 || BCM96345 || BCM96348
6784 + bool "Support for Serial Port"
6785 + depends on BCM96338 || BCM96345 || BCM96348
6788 + tristate "Support for Ethernet"
6789 + depends on BCM96338 || BCM96345 || BCM96348
6792 + tristate "Support for USB"
6793 + depends on BCM96338 || BCM96345 || BCM96348
6796 + tristate "Support for Wireless"
6797 + depends on BCM96338 || BCM96345 || BCM96348
6800 + bool "Support for PCI"
6801 + depends on BCM96338 || BCM96345 || BCM96348
6805 + tristate "Support for ATM"
6806 + depends on BCM96338 || BCM96345 || BCM96348
6809 + tristate "Support for ATM Diagnostic"
6810 + depends on BCM96338 || BCM96345 || BCM96348
6813 + tristate "Support for ADSL"
6814 + depends on BCM96338 || BCM96345 || BCM96348
6816 +config BCM_ENDPOINT
6817 + tristate "Support for VOICE"
6818 + depends on BCM96338 || BCM96345 || BCM96348
6821 + tristate "Support for PROCFS"
6822 + depends on BCM96338 || BCM96345 || BCM96348
6825 + tristate "Support for VDSL"
6826 + depends on BCM96338 || BCM96345 || BCM96348
6828 +config BCM_SECURITY
6829 + tristate "Support for SECURITY"
6830 + depends on BCM96338 || BCM96345 || BCM96348
6833 + tristate "Support for HPNA"
6834 + depends on BCM96338 || BCM96345 || BCM96348
6836 +config BCM_BOARD_IMPL
6837 + int "Implementation index for ADSL Board"
6838 + depends on BCM96338 || BCM96345 || BCM96348
6840 +config BCM_SERIAL_IMPL
6841 + int "Implementation index for Serial"
6842 + depends on BCM96338 || BCM96345 || BCM96348
6844 +config BCM_ENET_IMPL
6845 + int "Implementation index for Ethernet"
6846 + depends on BCM96338 || BCM96345 || BCM96348
6848 +config BCM_USB_IMPL
6849 + int "Implementation index for USB"
6850 + depends on BCM96338 || BCM96345 || BCM96348
6852 +config BCM_WLAN_IMPL
6853 + int "Implementation index for WIRELESS"
6854 + depends on BCM96338 || BCM96345 || BCM96348
6856 +config BCM_ATMAPI_IMPL
6857 + int "Implementation index for ATM"
6858 + depends on BCM96338 || BCM96345 || BCM96348
6860 +config BCM_ATMTEST_IMPL
6861 + int "Implementation index for ATM Diagnostic"
6862 + depends on BCM96338 || BCM96345 || BCM96348
6864 +config BCM_BLAA_IMPL
6865 + int "Implementation index for BLAA"
6866 + depends on BCM96338 || BCM96345 || BCM96348
6868 +config BCM_ADSL_IMPL
6869 + int "Implementation index for ADSL"
6870 + depends on BCM96338 || BCM96345 || BCM96348
6872 +config BCM_ENDPOINT_IMPL
6873 + int "Implementation index for VOICE"
6874 + depends on BCM96338 || BCM96345 || BCM96348
6876 +config BCM_PROCFS_IMPL
6877 + int "Implementation index for PROCFS"
6878 + depends on BCM96338 || BCM96345 || BCM96348
6880 +config BCM_VDSL_IMPL
6881 + int "Implementation index for VDSL"
6882 + depends on BCM96338 || BCM96345 || BCM96348
6884 +config BCM_SECURITY_IMPL
6885 + int "Implementation index for SECURITY"
6886 + depends on BCM96338 || BCM96345 || BCM96348
6888 +config BCM_HPNA_IMPL
6889 + int "Implementation index for HPNA"
6890 + depends on BCM96338 || BCM96345 || BCM96348
6892 diff -urN linux.old/arch/mips/bcm963xx/Makefile linux.dev/arch/mips/bcm963xx/Makefile
6893 --- linux.old/arch/mips/bcm963xx/Makefile 1970-01-01 01:00:00.000000000 +0100
6894 +++ linux.dev/arch/mips/bcm963xx/Makefile 2006-08-25 02:04:27.000000000 +0200
6897 +# Makefile for generic Broadcom MIPS boards
6899 +# Copyright (C) 2004 Broadcom Corporation
6901 +obj-y := irq.o prom.o setup.o time.o ser_init.o bcm63xx_led.o board.o boardparms.o int-handler.o
6903 +SRCBASE := $(TOPDIR)
6904 +EXTRA_CFLAGS += -I$(SRCBASE)/include
6905 +#EXTRA_CFLAGS += -I$(INC_ADSLDRV_PATH) -DDBG
6906 +EXTRA_CFLAGS += -I$(INC_ADSLDRV_PATH)
6909 +ifeq "$(ADSL)" "ANNEX_B"
6910 +EXTRA_CFLAGS += -DADSL_ANNEXB
6912 +ifeq "$(ADSL)" "SADSL"
6913 +EXTRA_CFLAGS += -DADSL_SADSL
6915 +ifeq "$(ADSL)" "ANNEX_C"
6916 +EXTRA_CFLAGS += -DADSL_ANNEXC
6919 diff -urN linux.old/arch/mips/bcm963xx/prom.c linux.dev/arch/mips/bcm963xx/prom.c
6920 --- linux.old/arch/mips/bcm963xx/prom.c 1970-01-01 01:00:00.000000000 +0100
6921 +++ linux.dev/arch/mips/bcm963xx/prom.c 2006-08-25 01:49:57.000000000 +0200
6925 + Copyright 2004 Broadcom Corp. All Rights Reserved.
6927 + This program is free software; you can distribute it and/or modify it
6928 + under the terms of the GNU General Public License (Version 2) as
6929 + published by the Free Software Foundation.
6931 + This program is distributed in the hope it will be useful, but WITHOUT
6932 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6933 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6936 + You should have received a copy of the GNU General Public License along
6937 + with this program; if not, write to the Free Software Foundation, Inc.,
6938 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6942 + * prom.c: PROM library initialization code.
6945 +#include <linux/init.h>
6946 +#include <linux/mm.h>
6947 +#include <linux/sched.h>
6948 +#include <linux/bootmem.h>
6949 +#include <linux/blkdev.h>
6950 +#include <asm/addrspace.h>
6951 +#include <asm/bootinfo.h>
6952 +#include <asm/cpu.h>
6953 +#include <asm/time.h>
6955 +#include <bcm_map_part.h>
6957 +#include "boardparms.h"
6958 +#include "softdsl/AdslCoreDefs.h"
6961 +//char arcs_cmdline[CL_SIZE] __initdata = {0};
6963 +int boot_loader_type;
6965 +extern int do_syslog(int, char *, int);
6966 +extern void serial_init(void);
6967 +extern void __init InitNvramInfo( void );
6968 +extern void kerSysFlashInit( void );
6969 +extern unsigned long get_nvram_start_addr(void);
6970 +void __init create_root_nfs_cmdline( char *cmdline );
6972 +#define MACH_BCM MACH_BCM96348
6974 +const char *get_system_type(void)
6976 + /*PNVRAM_DATA pNvramData = (PNVRAM_DATA) get_nvram_start_addr();
6978 + return( pNvramData->szBoardId );*/
6979 + return "brcm63xx";
6982 +unsigned long getMemorySize(void)
6984 + unsigned long ulSdramType = BOARD_SDRAM_TYPE;
6986 + unsigned long ulSdramSize;
6988 + switch( ulSdramType )
6990 + case BP_MEMORY_16MB_1_CHIP:
6991 + case BP_MEMORY_16MB_2_CHIP:
6992 + ulSdramSize = 16 * 1024 * 1024;
6994 + case BP_MEMORY_32MB_1_CHIP:
6995 + case BP_MEMORY_32MB_2_CHIP:
6996 + ulSdramSize = 32 * 1024 * 1024;
6998 + case BP_MEMORY_64MB_2_CHIP:
6999 + ulSdramSize = 64 * 1024 * 1024;
7002 + ulSdramSize = 8 * 1024 * 1024;
7005 + if (boot_loader_type == BOOT_CFE)
7006 + return ulSdramSize;
7008 + // assume that there is one contiguous memory map
7009 + return boot_mem_map.map[0].size;
7012 +/* --------------------------------------------------------------------------
7014 + -------------------------------------------------------------------------- */
7015 +void __init prom_init(void)
7017 + extern ulong r4k_interval;
7021 + /* Need to fixup boot loader detection code
7022 + * whithout changing prom_init prototype
7025 + do_syslog(8, NULL, 8);
7027 + printk( "%s prom init\n", get_system_type() );
7029 + PERF->IrqMask = 0;
7031 + arcs_cmdline[0] = '\0';
7033 + if (boot_loader_type == BOOT_CFE)
7034 + add_memory_region(0, (getMemorySize() - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);
7036 + add_memory_region(0, (0x01000000 - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);
7038 + mips_machgroup = MACH_GROUP_BRCM;
7039 + mips_machtype = MACH_BCM;
7042 +/* --------------------------------------------------------------------------
7043 + Name: prom_free_prom_memory
7045 + -------------------------------------------------------------------------- */
7046 +void __init prom_free_prom_memory(void)
7051 diff -urN linux.old/arch/mips/bcm963xx/ser_init.c linux.dev/arch/mips/bcm963xx/ser_init.c
7052 --- linux.old/arch/mips/bcm963xx/ser_init.c 1970-01-01 01:00:00.000000000 +0100
7053 +++ linux.dev/arch/mips/bcm963xx/ser_init.c 2006-08-25 00:39:38.000000000 +0200
7057 + Copyright 2004 Broadcom Corp. All Rights Reserved.
7059 + This program is free software; you can distribute it and/or modify it
7060 + under the terms of the GNU General Public License (Version 2) as
7061 + published by the Free Software Foundation.
7063 + This program is distributed in the hope it will be useful, but WITHOUT
7064 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7065 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7068 + You should have received a copy of the GNU General Public License along
7069 + with this program; if not, write to the Free Software Foundation, Inc.,
7070 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
7074 + * Broadcom bcm63xx serial port initialization, also prepare for printk
7075 + * by registering with console_init
7079 +#include <linux/config.h>
7080 +#include <linux/init.h>
7081 +#include <linux/interrupt.h>
7082 +#include <linux/kernel.h>
7083 +#include <linux/types.h>
7084 +#include <linux/console.h>
7085 +#include <linux/sched.h>
7087 +#include <asm/addrspace.h>
7088 +#include <asm/irq.h>
7089 +#include <asm/reboot.h>
7090 +#include <asm/gdb-stub.h>
7091 +#include <asm/mc146818rtc.h>
7093 +#include <bcm_map_part.h>
7096 +#define SER63XX_DEFAULT_BAUD 115200
7097 +#define BD_BCM63XX_TIMER_CLOCK_INPUT (FPERIPH)
7098 +#define stUart ((volatile Uart * const) UART_BASE)
7100 +// Transmit interrupts
7101 +#define TXINT (TXFIFOEMT | TXUNDERR | TXOVFERR)
7102 +// Receive interrupts
7103 +#define RXINT (RXFIFONE | RXOVFERR)
7105 +/* --------------------------------------------------------------------------
7107 + Purpose: Initalize the UART
7108 +-------------------------------------------------------------------------- */
7109 +void __init serial_init(void)
7111 + UINT32 tmpVal = SER63XX_DEFAULT_BAUD;
7112 + ULONG clockFreqHz;
7114 +#if defined(CONFIG_BCM96345)
7115 + // Make sure clock is ticking
7116 + PERF->blkEnables |= UART_CLK_EN;
7119 + /* Dissable channel's receiver and transmitter. */
7120 + stUart->control &= ~(BRGEN|TXEN|RXEN);
7122 + /*--------------------------------------------------------------------*/
7123 + /* Write the table value to the clock select register. */
7124 + /* DPullen - this is the equation to use: */
7125 + /* value = clockFreqHz / baud / 32-1; */
7126 + /* (snmod) Actually you should also take into account any necessary */
7127 + /* rounding. Divide by 16, look at lsb, if 0, divide by 2 */
7128 + /* and subtract 1. If 1, just divide by 2 */
7129 + /*--------------------------------------------------------------------*/
7130 + clockFreqHz = BD_BCM63XX_TIMER_CLOCK_INPUT;
7131 + tmpVal = (clockFreqHz / tmpVal) / 16;
7132 + if( tmpVal & 0x01 )
7133 + tmpVal /= 2; //Rounding up, so sub is already accounted for
7135 + tmpVal = (tmpVal / 2) - 1; // Rounding down so we must sub 1
7136 + stUart->baudword = tmpVal;
7138 + /* Finally, re-enable the transmitter and receiver. */
7139 + stUart->control |= (BRGEN|TXEN|RXEN);
7141 + stUart->config = (BITS8SYM | ONESTOP);
7142 + // Set the FIFO interrupt depth ... stUart->fifocfg = 0xAA;
7143 + stUart->fifoctl = RSTTXFIFOS | RSTRXFIFOS;
7144 + stUart->intMask = 0;
7145 + stUart->intMask = RXINT | TXINT;
7150 + * Output a character to the UART
7152 +void prom_putc(char c)
7154 + /* Wait for Tx uffer to empty */
7155 + while (! (READ16(stUart->intStatus) & TXFIFOEMT));
7156 + /* Send character */
7161 + * Write a string to the UART
7163 +void prom_puts(const char *s)
7174 +/* prom_getc_nowait()
7175 + * Returns a character from the UART
7176 + * Returns -1 if no characters available or corrupted
7178 +int prom_getc_nowait(void)
7183 + uStatus = READ16(stUart->intStatus);
7185 + if (uStatus & RXFIFONE) { /* Do we have a character? */
7186 + cData = READ16(stUart->Data) & 0xff; /* Read character */
7187 + if (uStatus & (RXFRAMERR | RXPARERR)) { /* If we got an error, throw it away */
7196 + * Returns a charcter from the serial port
7197 + * Will block until it receives a valid character
7199 +char prom_getc(void)
7203 + /* Loop until we get a valid character */
7204 + while(cData == -1) {
7205 + cData = prom_getc_nowait();
7207 + return (char) cData;
7211 + * Returns 0 if no characters available
7213 +int prom_testc(void)
7217 + uStatus = READ16(stUart->intStatus);
7219 + return (uStatus & RXFIFONE);
7222 +#if defined (CONFIG_REMOTE_DEBUG)
7223 +/* Prevent other code from writing to the serial port */
7224 +void _putc(char c) { }
7225 +void _puts(const char *ptr) { }
7227 +/* Low level outputs call prom routines */
7228 +void _putc(char c) {
7231 +void _puts(const char *ptr) {
7235 diff -urN linux.old/arch/mips/bcm963xx/setup.c linux.dev/arch/mips/bcm963xx/setup.c
7236 --- linux.old/arch/mips/bcm963xx/setup.c 1970-01-01 01:00:00.000000000 +0100
7237 +++ linux.dev/arch/mips/bcm963xx/setup.c 2006-08-25 02:26:58.000000000 +0200
7241 + Copyright 2002 Broadcom Corp. All Rights Reserved.
7243 + This program is free software; you can distribute it and/or modify it
7244 + under the terms of the GNU General Public License (Version 2) as
7245 + published by the Free Software Foundation.
7247 + This program is distributed in the hope it will be useful, but WITHOUT
7248 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7249 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7252 + You should have received a copy of the GNU General Public License along
7253 + with this program; if not, write to the Free Software Foundation, Inc.,
7254 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
7258 + * Generic setup routines for Broadcom 963xx MIPS boards
7261 +#include <linux/config.h>
7262 +#include <linux/init.h>
7263 +#include <linux/interrupt.h>
7264 +#include <linux/kernel.h>
7265 +#include <linux/kdev_t.h>
7266 +#include <linux/types.h>
7267 +#include <linux/console.h>
7268 +#include <linux/sched.h>
7269 +#include <linux/mm.h>
7270 +#include <linux/slab.h>
7271 +#include <linux/module.h>
7272 +#include <linux/pm.h>
7274 +#include <asm/addrspace.h>
7275 +#include <asm/bcache.h>
7276 +#include <asm/irq.h>
7277 +#include <asm/time.h>
7278 +#include <asm/reboot.h>
7279 +#include <asm/gdb-stub.h>
7281 +extern void brcm_time_init(void);
7282 +extern void brcm_timer_setup(struct irqaction *irq);
7283 +extern unsigned long getMemorySize(void);
7285 +#if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
7286 +#include <linux/pci.h>
7287 +#include <linux/delay.h>
7288 +#include <bcm_map_part.h>
7289 +#include <bcmpci.h>
7291 +static volatile MpiRegisters * mpi = (MpiRegisters *)(MPI_BASE);
7294 +/* This function should be in a board specific directory. For now,
7295 + * assume that all boards that include this file use a Broadcom chip
7296 + * with a soft reset bit in the PLL control register.
7298 +static void brcm_machine_restart(char *command)
7300 + const unsigned long ulSoftReset = 0x00000001;
7301 + unsigned long *pulPllCtrl = (unsigned long *) 0xfffe0008;
7302 + *pulPllCtrl |= ulSoftReset;
7305 +static void brcm_machine_halt(void)
7307 + printk("System halted\n");
7311 +#if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
7313 +static void mpi_SetLocalPciConfigReg(uint32 reg, uint32 value)
7315 + /* write index then value */
7316 + mpi->pcicfgcntrl = PCI_CFG_REG_WRITE_EN + reg;;
7317 + mpi->pcicfgdata = value;
7320 +static uint32 mpi_GetLocalPciConfigReg(uint32 reg)
7322 + /* write index then get value */
7323 + mpi->pcicfgcntrl = PCI_CFG_REG_WRITE_EN + reg;;
7324 + return mpi->pcicfgdata;
7328 + * mpi_ResetPcCard: Set/Reset the PcCard
7330 +static void mpi_ResetPcCard(int cardtype, BOOL bReset)
7332 + if (cardtype == MPI_CARDTYPE_NONE) {
7336 + if (cardtype == MPI_CARDTYPE_CARDBUS) {
7337 + bReset = ! bReset;
7341 + mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & ~PCCARD_CARD_RESET);
7343 + mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 | PCCARD_CARD_RESET);
7348 + * mpi_ConfigCs: Configure an MPI/EBI chip select
7350 +static void mpi_ConfigCs(uint32 cs, uint32 base, uint32 size, uint32 flags)
7352 + mpi->cs[cs].base = ((base & 0x1FFFFFFF) | size);
7353 + mpi->cs[cs].config = flags;
7357 + * mpi_InitPcmciaSpace
7359 +static void mpi_InitPcmciaSpace(void)
7361 + // ChipSelect 4 controls PCMCIA Memory accesses
7362 + mpi_ConfigCs(PCMCIA_COMMON_BASE, pcmciaMem, EBI_SIZE_1M, (EBI_WORD_WIDE|EBI_ENABLE));
7363 + // ChipSelect 5 controls PCMCIA Attribute accesses
7364 + mpi_ConfigCs(PCMCIA_ATTRIBUTE_BASE, pcmciaAttr, EBI_SIZE_1M, (EBI_WORD_WIDE|EBI_ENABLE));
7365 + // ChipSelect 6 controls PCMCIA I/O accesses
7366 + mpi_ConfigCs(PCMCIA_IO_BASE, pcmciaIo, EBI_SIZE_64K, (EBI_WORD_WIDE|EBI_ENABLE));
7368 + mpi->pcmcia_cntl2 = ((PCMCIA_ATTR_ACTIVE << RW_ACTIVE_CNT_BIT) |
7369 + (PCMCIA_ATTR_INACTIVE << INACTIVE_CNT_BIT) |
7370 + (PCMCIA_ATTR_CE_SETUP << CE_SETUP_CNT_BIT) |
7371 + (PCMCIA_ATTR_CE_HOLD << CE_HOLD_CNT_BIT));
7373 + mpi->pcmcia_cntl2 |= (PCMCIA_HALFWORD_EN | PCMCIA_BYTESWAP_DIS);
7377 + * cardtype_vcc_detect: PC Card's card detect and voltage sense connection
7379 + * CD1#/ CD2#/ VS1#/ VS2#/ Card Initial Vcc
7380 + * CCD1# CCD2# CVS1 CVS2 Type
7382 + * GND GND open open 16-bit 5 vdc
7384 + * GND GND GND open 16-bit 3.3 vdc
7386 + * GND GND open GND 16-bit x.x vdc
7388 + * GND GND GND GND 16-bit 3.3 & x.x vdc
7390 + *====================================================================
7392 + * CVS1 GND CCD1# open CardBus 3.3 vdc
7394 + * GND CVS2 open CCD2# CardBus x.x vdc
7396 + * GND CVS1 CCD2# open CardBus y.y vdc
7398 + * GND CVS2 GND CCD2# CardBus 3.3 & x.x vdc
7400 + * CVS2 GND open CCD1# CardBus x.x & y.y vdc
7402 + * GND CVS1 CCD2# open CardBus 3.3, x.x & y.y vdc
7405 +static int cardtype_vcc_detect(void)
7410 + cardtype = MPI_CARDTYPE_NONE;
7411 + mpi->pcmcia_cntl1 = 0x0000A000; // Turn on the output enables and drive
7412 + // the CVS pins to 0.
7413 + data32 = mpi->pcmcia_cntl1;
7414 + switch (data32 & 0x00000003) // Test CD1# and CD2#, see if card is plugged in.
7416 + case 0x00000003: // No Card is in the slot.
7417 + printk("mpi: No Card is in the PCMCIA slot\n");
7420 + case 0x00000002: // Partial insertion, No CD2#.
7421 + printk("mpi: Card in the PCMCIA slot partial insertion, no CD2 signal\n");
7424 + case 0x00000001: // Partial insertion, No CD1#.
7425 + printk("mpi: Card in the PCMCIA slot partial insertion, no CD1 signal\n");
7429 + mpi->pcmcia_cntl1 = 0x0000A0C0; // Turn off the CVS output enables and
7430 + // float the CVS pins.
7432 + data32 = mpi->pcmcia_cntl1;
7433 + // Read the Register.
7434 + switch (data32 & 0x0000000C) // See what is on the CVS pins.
7436 + case 0x00000000: // CVS1 and CVS2 are tied to ground, only 1 option.
7437 + printk("mpi: Detected 3.3 & x.x 16-bit PCMCIA card\n");
7438 + cardtype = MPI_CARDTYPE_PCMCIA;
7441 + case 0x00000004: // CVS1 is open or tied to CCD1/CCD2 and CVS2 is tied to ground.
7442 + // 2 valid voltage options.
7443 + switch (data32 & 0x00000003) // Test the values of CCD1 and CCD2.
7445 + case 0x00000003: // CCD1 and CCD2 are tied to 1 of the CVS pins.
7446 + // This is not a valid combination.
7447 + printk("mpi: Unknown card plugged into slot\n");
7450 + case 0x00000002: // CCD2 is tied to either CVS1 or CVS2.
7451 + mpi->pcmcia_cntl1 = 0x0000A080; // Drive CVS1 to a 0.
7453 + data32 = mpi->pcmcia_cntl1;
7454 + if (data32 & 0x00000002) { // CCD2 is tied to CVS2, not valid.
7455 + printk("mpi: Unknown card plugged into slot\n");
7456 + } else { // CCD2 is tied to CVS1.
7457 + printk("mpi: Detected 3.3, x.x and y.y Cardbus card\n");
7458 + cardtype = MPI_CARDTYPE_CARDBUS;
7462 + case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
7463 + // This is not a valid combination.
7464 + printk("mpi: Unknown card plugged into slot\n");
7467 + case 0x00000000: // CCD1 and CCD2 are tied to ground.
7468 + printk("mpi: Detected x.x vdc 16-bit PCMCIA card\n");
7469 + cardtype = MPI_CARDTYPE_PCMCIA;
7474 + case 0x00000008: // CVS2 is open or tied to CCD1/CCD2 and CVS1 is tied to ground.
7475 + // 2 valid voltage options.
7476 + switch (data32 & 0x00000003) // Test the values of CCD1 and CCD2.
7478 + case 0x00000003: // CCD1 and CCD2 are tied to 1 of the CVS pins.
7479 + // This is not a valid combination.
7480 + printk("mpi: Unknown card plugged into slot\n");
7483 + case 0x00000002: // CCD2 is tied to either CVS1 or CVS2.
7484 + mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
7486 + data32 = mpi->pcmcia_cntl1;
7487 + if (data32 & 0x00000002) { // CCD2 is tied to CVS1, not valid.
7488 + printk("mpi: Unknown card plugged into slot\n");
7489 + } else {// CCD2 is tied to CVS2.
7490 + printk("mpi: Detected 3.3 and x.x Cardbus card\n");
7491 + cardtype = MPI_CARDTYPE_CARDBUS;
7495 + case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
7496 + // This is not a valid combination.
7497 + printk("mpi: Unknown card plugged into slot\n");
7500 + case 0x00000000: // CCD1 and CCD2 are tied to ground.
7501 + cardtype = MPI_CARDTYPE_PCMCIA;
7502 + printk("mpi: Detected 3.3 vdc 16-bit PCMCIA card\n");
7507 + case 0x0000000C: // CVS1 and CVS2 are open or tied to CCD1/CCD2.
7508 + // 5 valid voltage options.
7510 + switch (data32 & 0x00000003) // Test the values of CCD1 and CCD2.
7512 + case 0x00000003: // CCD1 and CCD2 are tied to 1 of the CVS pins.
7513 + // This is not a valid combination.
7514 + printk("mpi: Unknown card plugged into slot\n");
7517 + case 0x00000002: // CCD2 is tied to either CVS1 or CVS2.
7518 + // CCD1 is tied to ground.
7519 + mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
7521 + data32 = mpi->pcmcia_cntl1;
7522 + if (data32 & 0x00000002) { // CCD2 is tied to CVS1.
7523 + printk("mpi: Detected y.y vdc Cardbus card\n");
7524 + } else { // CCD2 is tied to CVS2.
7525 + printk("mpi: Detected x.x vdc Cardbus card\n");
7527 + cardtype = MPI_CARDTYPE_CARDBUS;
7530 + case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
7531 + // CCD2 is tied to ground.
7533 + mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
7535 + data32 = mpi->pcmcia_cntl1;
7536 + if (data32 & 0x00000001) {// CCD1 is tied to CVS1.
7537 + printk("mpi: Detected 3.3 vdc Cardbus card\n");
7538 + } else { // CCD1 is tied to CVS2.
7539 + printk("mpi: Detected x.x and y.y Cardbus card\n");
7541 + cardtype = MPI_CARDTYPE_CARDBUS;
7544 + case 0x00000000: // CCD1 and CCD2 are tied to ground.
7545 + cardtype = MPI_CARDTYPE_PCMCIA;
7546 + printk("mpi: Detected 5 vdc 16-bit PCMCIA card\n");
7552 + printk("mpi: Unknown card plugged into slot\n");
7561 + * mpi_DetectPcCard: Detect the plugged in PC-Card
7562 + * Return: < 0 => Unknown card detected
7563 + * 0 => No card detected
7564 + * 1 => 16-bit card detected
7565 + * 2 => 32-bit CardBus card detected
7567 +static int mpi_DetectPcCard(void)
7571 + cardtype = cardtype_vcc_detect();
7572 + switch(cardtype) {
7573 + case MPI_CARDTYPE_PCMCIA:
7574 + mpi->pcmcia_cntl1 &= ~0x0000e000; // disable enable bits
7575 + //mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & ~PCCARD_CARD_RESET);
7576 + mpi->pcmcia_cntl1 |= (PCMCIA_ENABLE | PCMCIA_GPIO_ENABLE);
7577 + mpi_InitPcmciaSpace();
7578 + mpi_ResetPcCard(cardtype, FALSE);
7579 + // Hold card in reset for 10ms
7581 + mpi_ResetPcCard(cardtype, TRUE);
7582 + // Let card come out of reset
7585 + case MPI_CARDTYPE_CARDBUS:
7586 + // 8 => CardBus Enable
7587 + // 1 => PCI Slot Number
7588 + // C => Float VS1 & VS2
7589 + mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & 0xFFFF0000) |
7591 + (CARDBUS_SLOT << 8)|
7594 + /* access to this memory window will be to/from CardBus */
7595 + mpi->l2pmremap1 |= CARDBUS_MEM;
7597 + // Need to reset the Cardbus Card. There's no CardManager to do this,
7598 + // and we need to be ready for PCI configuration.
7599 + mpi_ResetPcCard(cardtype, FALSE);
7600 + // Hold card in reset for 10ms
7602 + mpi_ResetPcCard(cardtype, TRUE);
7603 + // Let card come out of reset
7612 +static int mpi_init(void)
7614 + unsigned long data;
7615 + unsigned int chipid;
7616 + unsigned int chiprev;
7617 + unsigned int sdramsize;
7619 + chipid = (PERF->RevID & 0xFFFF0000) >> 16;
7620 + chiprev = (PERF->RevID & 0xFF);
7621 + sdramsize = getMemorySize();
7623 + * Init the pci interface
7625 + data = GPIO->GPIOMode; // GPIO mode register
7626 + data |= GROUP2_PCI | GROUP1_MII_PCCARD; // PCI internal arbiter + Cardbus
7627 + GPIO->GPIOMode = data; // PCI internal arbiter
7630 + * In the BCM6348 CardBus support is defaulted to Slot 0
7631 + * because there is no external IDSEL for CardBus. To disable
7632 + * the CardBus and allow a standard PCI card in Slot 0
7633 + * set the cbus_idsel field to 0x1f.
7636 + uData = mpi->pcmcia_cntl1;
7637 + uData |= CARDBUS_IDSEL;
7638 + mpi->pcmcia_cntl1 = uData;
7640 + // Setup PCI I/O Window range. Give 64K to PCI I/O
7641 + mpi->l2piorange = ~(BCM_PCI_IO_SIZE_64KB-1);
7642 + // UBUS to PCI I/O base address
7643 + mpi->l2piobase = BCM_PCI_IO_BASE & BCM_PCI_ADDR_MASK;
7644 + // UBUS to PCI I/O Window remap
7645 + mpi->l2pioremap = (BCM_PCI_IO_BASE | MEM_WINDOW_EN);
7647 + // enable PCI related GPIO pins and data swap between system and PCI bus
7648 + mpi->locbuscntrl = (EN_PCI_GPIO | DIR_U2P_NOSWAP);
7650 + /* Enable 6348 BusMaster and Memory access mode */
7651 + data = mpi_GetLocalPciConfigReg(PCI_COMMAND);
7652 + data |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
7653 + mpi_SetLocalPciConfigReg(PCI_COMMAND, data);
7655 + /* Configure two 16 MByte PCI to System memory regions. */
7656 + /* These memory regions are used when PCI device is a bus master */
7657 + /* Accesses to the SDRAM from PCI bus will be "byte swapped" for this region */
7658 + mpi_SetLocalPciConfigReg(PCI_BASE_ADDRESS_3, BCM_HOST_MEM_SPACE1);
7659 + mpi->sp0remap = 0x0;
7661 + /* Accesses to the SDRAM from PCI bus will not be "byte swapped" for this region */
7662 + mpi_SetLocalPciConfigReg(PCI_BASE_ADDRESS_4, BCM_HOST_MEM_SPACE2);
7663 + mpi->sp1remap = 0x0;
7664 + mpi->pcimodesel |= (PCI_BAR2_NOSWAP | 0x40);
7666 + if ((chipid == 0x6348) && (chiprev == 0xb0)) {
7667 + mpi->sp0range = ~(sdramsize-1);
7668 + mpi->sp1range = ~(sdramsize-1);
7671 + * Change 6348 PCI Cfg Reg. offset 0x40 to PCI memory read retry count infinity
7672 + * by set 0 in bit 8~15. This resolve read Bcm4306 srom return 0xffff in
7675 + data = mpi_GetLocalPciConfigReg(BRCM_PCI_CONFIG_TIMER);
7676 + data &= ~BRCM_PCI_CONFIG_TIMER_RETRY_MASK;
7677 + data |= 0x00000080;
7678 + mpi_SetLocalPciConfigReg(BRCM_PCI_CONFIG_TIMER, data);
7680 + /* enable pci interrupt */
7681 + mpi->locintstat |= (EXT_PCI_INT << 16);
7683 + mpi_DetectPcCard();
7685 + ioport_resource.start = BCM_PCI_IO_BASE;
7686 + ioport_resource.end = BCM_PCI_IO_BASE + BCM_PCI_IO_SIZE_64KB;
7688 +#if defined(CONFIG_USB)
7689 + PERF->blkEnables |= USBH_CLK_EN;
7691 + *USBH_NON_OHCI = NON_OHCI_BYTE_SWAP;
7698 +static int __init brcm63xx_setup(void)
7700 + extern int panic_timeout;
7702 + _machine_restart = brcm_machine_restart;
7703 + _machine_halt = brcm_machine_halt;
7704 + pm_power_off = brcm_machine_halt;
7706 + board_time_init = brcm_time_init;
7707 + board_timer_setup = brcm_timer_setup;
7709 + panic_timeout = 5;
7711 +#if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
7712 + /* mpi initialization */
7718 +void plat_setup(void)
7723 +/***************************************************************************
7724 + * C++ New and delete operator functions
7725 + ***************************************************************************/
7727 +/* void *operator new(unsigned int sz) */
7728 +void *_Znwj(unsigned int sz)
7730 + return( kmalloc(sz, GFP_KERNEL) );
7733 +/* void *operator new[](unsigned int sz)*/
7734 +void *_Znaj(unsigned int sz)
7736 + return( kmalloc(sz, GFP_KERNEL) );
7739 +/* placement new operator */
7740 +/* void *operator new (unsigned int size, void *ptr) */
7741 +void *ZnwjPv(unsigned int size, void *ptr)
7746 +/* void operator delete(void *m) */
7747 +void _ZdlPv(void *m)
7752 +/* void operator delete[](void *m) */
7753 +void _ZdaPv(void *m)
7758 +EXPORT_SYMBOL(_Znwj);
7759 +EXPORT_SYMBOL(_Znaj);
7760 +EXPORT_SYMBOL(ZnwjPv);
7761 +EXPORT_SYMBOL(_ZdlPv);
7762 +EXPORT_SYMBOL(_ZdaPv);
7764 diff -urN linux.old/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h linux.dev/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h
7765 --- linux.old/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h 1970-01-01 01:00:00.000000000 +0100
7766 +++ linux.dev/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h 2006-08-25 00:39:38.000000000 +0200
7768 +#define ADSL_SDRAM_IMAGE_SIZE (384*1024)
7770 diff -urN linux.old/arch/mips/bcm963xx/time.c linux.dev/arch/mips/bcm963xx/time.c
7771 --- linux.old/arch/mips/bcm963xx/time.c 1970-01-01 01:00:00.000000000 +0100
7772 +++ linux.dev/arch/mips/bcm963xx/time.c 2006-08-25 03:58:22.000000000 +0200
7776 + Copyright 2004 Broadcom Corp. All Rights Reserved.
7778 + This program is free software; you can distribute it and/or modify it
7779 + under the terms of the GNU General Public License (Version 2) as
7780 + published by the Free Software Foundation.
7782 + This program is distributed in the hope it will be useful, but WITHOUT
7783 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7784 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7787 + You should have received a copy of the GNU General Public License along
7788 + with this program; if not, write to the Free Software Foundation, Inc.,
7789 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
7793 + * Setup time for Broadcom 963xx MIPS boards
7796 +#include <linux/config.h>
7797 +#include <linux/init.h>
7798 +#include <linux/kernel_stat.h>
7799 +#include <linux/sched.h>
7800 +#include <linux/spinlock.h>
7801 +#include <linux/interrupt.h>
7802 +#include <linux/module.h>
7803 +#include <linux/time.h>
7804 +#include <linux/timex.h>
7806 +#include <asm/mipsregs.h>
7807 +#include <asm/ptrace.h>
7808 +#include <asm/div64.h>
7809 +#include <asm/time.h>
7811 +#include <bcm_map_part.h>
7812 +#include <bcm_intr.h>
7814 +static unsigned long r4k_offset; /* Amount to increment compare reg each time */
7815 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
7817 +/* *********************************************************************
7818 + * calculateCpuSpeed()
7819 + * Calculate the BCM6348 CPU speed by reading the PLL strap register
7820 + * and applying the following formula:
7821 + * cpu_clk = (.25 * 64MHz freq) * (N1 + 1) * (N2 + 2) / (M1_CPU + 1)
7822 + * Input parameters:
7826 + ********************************************************************* */
7828 +static inline unsigned long __init calculateCpuSpeed(void)
7830 + UINT32 pllStrap = PERF->PllStrap;
7831 + int n1 = (pllStrap & PLL_N1_MASK) >> PLL_N1_SHFT;
7832 + int n2 = (pllStrap & PLL_N2_MASK) >> PLL_N2_SHFT;
7833 + int m1cpu = (pllStrap & PLL_M1_CPU_MASK) >> PLL_M1_CPU_SHFT;
7835 + return (16 * (n1 + 1) * (n2 + 2) / (m1cpu + 1)) * 1000000;
7839 +static inline unsigned long __init cal_r4koff(void)
7841 + mips_hpt_frequency = calculateCpuSpeed() / 2;
7842 + return (mips_hpt_frequency / HZ);
7847 + * There are a lot of conceptually broken versions of the MIPS timer interrupt
7848 + * handler floating around. This one is rather different, but the algorithm
7849 + * is provably more robust.
7851 +irqreturn_t brcm_timer_interrupt(struct pt_regs *regs)
7853 + int irq = MIPS_TIMER_INT;
7856 + kstat_this_cpu.irqs[irq]++;
7858 + timer_interrupt(irq, NULL, regs);
7860 + return IRQ_HANDLED;
7864 +void __init brcm_time_init(void)
7866 + unsigned int est_freq, flags;
7867 + local_irq_save(flags);
7869 + printk("calculating r4koff... ");
7870 + r4k_offset = cal_r4koff();
7871 + printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
7873 + est_freq = 2 * r4k_offset * HZ;
7874 + est_freq += 5000; /* round */
7875 + est_freq -= est_freq % 10000;
7876 + printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
7877 + (est_freq % 1000000) * 100 / 1000000);
7878 + local_irq_restore(flags);
7882 +void __init brcm_timer_setup(struct irqaction *irq)
7884 + r4k_cur = (read_c0_count() + r4k_offset);
7885 + write_c0_compare(r4k_cur);
7886 + set_c0_status(IE_IRQ5);
7888 diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
7889 --- linux.old/arch/mips/Kconfig 2006-08-25 00:43:39.000000000 +0200
7890 +++ linux.dev/arch/mips/Kconfig 2006-08-25 01:57:46.000000000 +0200
7892 prompt "System type"
7896 + bool "Support for the Broadcom boards"
7897 + select SYS_SUPPORTS_32BIT_KERNEL
7898 + select SYS_SUPPORTS_BIG_ENDIAN
7899 + select SYS_HAS_CPU_MIPS32_R1
7902 + This is a fmaily of boards based on the Broadcom MIPS32
7905 bool "4G Systems MTX-1 board"
7906 select DMA_NONCOHERENT
7911 +source "arch/mips/bcm963xx/Kconfig"
7912 source "arch/mips/ddb5xxx/Kconfig"
7913 source "arch/mips/gt64120/ev64120/Kconfig"
7914 source "arch/mips/jazz/Kconfig"
7915 diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-probe.c
7916 --- linux.old/arch/mips/kernel/cpu-probe.c 2006-08-25 00:43:39.000000000 +0200
7917 +++ linux.dev/arch/mips/kernel/cpu-probe.c 2006-08-25 00:39:38.000000000 +0200
7918 @@ -568,6 +568,25 @@
7922 +static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
7924 + decode_configs(c);
7925 + switch (c->processor_id & 0xff00) {
7926 + case PRID_IMP_BCM6338:
7927 + c->cputype = CPU_BCM6338;
7929 + case PRID_IMP_BCM6345:
7930 + c->cputype = CPU_BCM6345;
7932 + case PRID_IMP_BCM6348:
7933 + c->cputype = CPU_BCM6348;
7936 + c->cputype = CPU_UNKNOWN;
7941 static inline void cpu_probe_mips(struct cpuinfo_mips *c)
7945 case PRID_COMP_LEGACY:
7946 cpu_probe_legacy(c);
7948 + case PRID_COMP_BROADCOM:
7949 + cpu_probe_broadcom(c);
7951 case PRID_COMP_MIPS:
7954 diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c
7955 --- linux.old/arch/mips/kernel/proc.c 2006-08-25 00:43:39.000000000 +0200
7956 +++ linux.dev/arch/mips/kernel/proc.c 2006-08-25 00:39:38.000000000 +0200
7958 [CPU_VR4181A] = "NEC VR4181A",
7959 [CPU_SR71000] = "Sandcraft SR71000",
7960 [CPU_PR4450] = "Philips PR4450",
7961 + [CPU_BCM6338] = "BCM6338",
7962 + [CPU_BCM6345] = "BCM6345",
7963 + [CPU_BCM6348] = "BCM6348",
7967 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
7968 --- linux.old/arch/mips/Makefile 2006-08-25 00:43:39.000000000 +0200
7969 +++ linux.dev/arch/mips/Makefile 2006-08-25 15:39:54.000000000 +0200
7970 @@ -145,6 +145,15 @@
7976 +core-$(CONFIG_MIPS_BRCM) += arch/mips/bcm963xx/
7977 +cflags-$(CONFIG_MIPS_BRCM) += -Iinclude/asm-mips/mach-bcm963xx
7978 +cflags-$(CONFIG_MIPS_BRCM) += -Iarch/mips/bcm963xx/include
7979 +load-$(CONFIG_MIPS_BRCM) += 0xffffffff80010000
7983 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
7985 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
7986 diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
7987 --- linux.old/arch/mips/mm/c-r4k.c 2006-08-25 00:43:39.000000000 +0200
7988 +++ linux.dev/arch/mips/mm/c-r4k.c 2006-08-25 00:39:38.000000000 +0200
7989 @@ -914,6 +914,13 @@
7990 if (!(config & MIPS_CONF_M))
7991 panic("Don't know how to probe P-caches on this cpu.");
7993 + if (c->cputype == CPU_BCM6338 || c->cputype == CPU_BCM6345 || c->cputype == CPU_BCM6348)
7995 + printk("brcm mips: enabling icache and dcache...\n");
7996 + /* Enable caches */
7997 + write_c0_diag(read_c0_diag() | 0xC0000000);
8001 * So we seem to be a MIPS32 or MIPS64 CPU
8002 * So let's probe the I-cache ...
8003 diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
8004 --- linux.old/arch/mips/mm/tlbex.c 2006-08-25 00:43:39.000000000 +0200
8005 +++ linux.dev/arch/mips/mm/tlbex.c 2006-08-25 00:39:38.000000000 +0200
8016 diff -urN linux.old/arch/mips/pci/fixup-bcm96348.c linux.dev/arch/mips/pci/fixup-bcm96348.c
8017 --- linux.old/arch/mips/pci/fixup-bcm96348.c 1970-01-01 01:00:00.000000000 +0100
8018 +++ linux.dev/arch/mips/pci/fixup-bcm96348.c 2006-08-25 00:39:38.000000000 +0200
8022 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8024 + This program is free software; you can distribute it and/or modify it
8025 + under the terms of the GNU General Public License (Version 2) as
8026 + published by the Free Software Foundation.
8028 + This program is distributed in the hope it will be useful, but WITHOUT
8029 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8030 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8033 + You should have received a copy of the GNU General Public License along
8034 + with this program; if not, write to the Free Software Foundation, Inc.,
8035 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8038 +#include <linux/init.h>
8039 +#include <linux/types.h>
8040 +#include <linux/pci.h>
8042 +#include <bcmpci.h>
8043 +#include <bcm_intr.h>
8044 +#include <bcm_map_part.h>
8046 +static volatile MpiRegisters * mpi = (MpiRegisters *)(MPI_BASE);
8048 +static char irq_tab_bcm96348[] __initdata = {
8049 + [0] = INTERRUPT_ID_MPI,
8050 + [1] = INTERRUPT_ID_MPI,
8051 +#if defined(CONFIG_USB)
8052 + [USB_HOST_SLOT] = INTERRUPT_ID_USBH
8056 +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
8058 + return irq_tab_bcm96348[slot];
8061 +static void bcm96348_fixup(struct pci_dev *dev)
8066 + memaddr = pci_resource_start(dev, 0);
8067 + size = pci_resource_len(dev, 0);
8069 + switch (PCI_SLOT(dev->devfn)) {
8071 + // UBUS to PCI address range
8072 + // Memory Window 1. Mask determines which bits are decoded.
8073 + mpi->l2pmrange1 = ~(size-1);
8074 + // UBUS to PCI Memory base address. This is akin to the ChipSelect base
8076 + mpi->l2pmbase1 = memaddr & BCM_PCI_ADDR_MASK;
8077 + // UBUS to PCI Remap Address. Replaces the masked address bits in the
8078 + // range register with this setting.
8079 + // Also, enable direct I/O and direct Memory accesses
8080 + mpi->l2pmremap1 = (memaddr | MEM_WINDOW_EN);
8084 + // Memory Window 2
8085 + mpi->l2pmrange2 = ~(size-1);
8086 + // UBUS to PCI Memory base address.
8087 + mpi->l2pmbase2 = memaddr & BCM_PCI_ADDR_MASK;
8088 + // UBUS to PCI Remap Address
8089 + mpi->l2pmremap2 = (memaddr | MEM_WINDOW_EN);
8092 +#if defined(CONFIG_USB)
8093 + case USB_HOST_SLOT:
8094 + dev->resource[0].start = USB_HOST_BASE;
8095 + dev->resource[0].end = USB_HOST_BASE+USB_BAR0_MEM_SIZE-1;
8101 +struct pci_fixup pcibios_fixups[] = {
8102 + { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, bcm96348_fixup },
8105 diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile
8106 --- linux.old/arch/mips/pci/Makefile 2006-08-25 00:43:29.000000000 +0200
8107 +++ linux.dev/arch/mips/pci/Makefile 2006-08-25 00:39:38.000000000 +0200
8109 obj-$(CONFIG_MIPS_TX3927) += ops-tx3927.o
8110 obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
8111 obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o
8112 +obj-$(CONFIG_BCM_PCI) += fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
8115 # These are still pretty much in the old state, watch, go blind.
8116 diff -urN linux.old/arch/mips/pci/ops-bcm96348.c linux.dev/arch/mips/pci/ops-bcm96348.c
8117 --- linux.old/arch/mips/pci/ops-bcm96348.c 1970-01-01 01:00:00.000000000 +0100
8118 +++ linux.dev/arch/mips/pci/ops-bcm96348.c 2006-08-25 00:39:38.000000000 +0200
8122 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8124 + This program is free software; you can distribute it and/or modify it
8125 + under the terms of the GNU General Public License (Version 2) as
8126 + published by the Free Software Foundation.
8128 + This program is distributed in the hope it will be useful, but WITHOUT
8129 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8130 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8133 + You should have received a copy of the GNU General Public License along
8134 + with this program; if not, write to the Free Software Foundation, Inc.,
8135 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8138 +#include <linux/types.h>
8139 +#include <linux/pci.h>
8140 +#include <linux/kernel.h>
8141 +#include <linux/init.h>
8142 +#include <asm/addrspace.h>
8144 +#include <bcm_intr.h>
8145 +#include <bcm_map_part.h>
8146 +#include <bcmpci.h>
8148 +#include <linux/delay.h>
8150 +#if defined(CONFIG_USB)
8152 +#define DPRINT(x...) printk(x)
8154 +#define DPRINT(x...)
8158 +pci63xx_int_read(unsigned int devfn, int where, u32 * value, int size);
8160 +pci63xx_int_write(unsigned int devfn, int where, u32 * value, int size);
8162 +static bool usb_mem_size_rd = FALSE;
8163 +static uint32 usb_mem_base = 0;
8164 +static uint32 usb_cfg_space_cmd_reg = 0;
8166 +static bool pci_mem_size_rd = FALSE;
8168 +static volatile MpiRegisters * mpi = (MpiRegisters *)(MPI_BASE);
8170 +static void mpi_SetupPciConfigAccess(uint32 addr)
8172 + mpi->l2pcfgctl = (DIR_CFG_SEL | DIR_CFG_USEREG | addr) & ~CONFIG_TYPE;
8175 +static void mpi_ClearPciConfigAccess(void)
8177 + mpi->l2pcfgctl = 0x00000000;
8180 +#if defined(CONFIG_USB)
8181 +/* --------------------------------------------------------------------------
8182 + Name: pci63xx_int_write
8183 +Abstract: PCI Config write on internal device(s)
8184 + -------------------------------------------------------------------------- */
8186 +pci63xx_int_write(unsigned int devfn, int where, u32 * value, int size)
8188 + if (PCI_SLOT(devfn) != USB_HOST_SLOT) {
8189 + return PCIBIOS_SUCCESSFUL;
8194 + DPRINT("W => Slot: %d Where: %2X Len: %d Data: %02X\n",
8195 + PCI_SLOT(devfn), where, size, *value);
8198 + DPRINT("W => Slot: %d Where: %2X Len: %d Data: %04X\n",
8199 + PCI_SLOT(devfn), where, size, *value);
8202 + usb_cfg_space_cmd_reg = *value;
8209 + DPRINT("W => Slot: %d Where: %2X Len: %d Data: %08lX\n",
8210 + PCI_SLOT(devfn), where, size, *value);
8212 + case PCI_BASE_ADDRESS_0:
8213 + if (*value == 0xffffffff) {
8214 + usb_mem_size_rd = TRUE;
8216 + usb_mem_base = *value;
8227 + return PCIBIOS_SUCCESSFUL;
8230 +/* --------------------------------------------------------------------------
8231 + Name: pci63xx_int_read
8232 +Abstract: PCI Config read on internal device(s)
8233 + -------------------------------------------------------------------------- */
8235 +pci63xx_int_read(unsigned int devfn, int where, u32 * value, int size)
8237 + uint32 retValue = 0xFFFFFFFF;
8239 + if (PCI_SLOT(devfn) != USB_HOST_SLOT) {
8240 + return PCIBIOS_SUCCESSFUL;
8243 + // For now, this is specific to the USB Host controller. We can
8244 + // make it more general if we have to...
8245 + // Emulate PCI Config accesses
8247 + case PCI_VENDOR_ID:
8248 + case PCI_DEVICE_ID:
8249 + retValue = PCI_VENDOR_ID_BROADCOM | 0x63000000;
8253 + retValue = (0x0006 << 16) | usb_cfg_space_cmd_reg;
8255 + case PCI_CLASS_REVISION:
8256 + case PCI_CLASS_DEVICE:
8257 + retValue = (PCI_CLASS_SERIAL_USB << 16) | (0x10 << 8) | 0x01;
8259 + case PCI_BASE_ADDRESS_0:
8260 + if (usb_mem_size_rd) {
8261 + retValue = USB_BAR0_MEM_SIZE;
8263 + if (usb_mem_base != 0)
8264 + retValue = usb_mem_base;
8266 + retValue = USB_HOST_BASE;
8268 + usb_mem_size_rd = FALSE;
8270 + case PCI_CACHE_LINE_SIZE:
8271 + case PCI_LATENCY_TIMER:
8274 + case PCI_HEADER_TYPE:
8275 + retValue = PCI_HEADER_TYPE_NORMAL;
8277 + case PCI_SUBSYSTEM_VENDOR_ID:
8278 + retValue = PCI_VENDOR_ID_BROADCOM;
8280 + case PCI_SUBSYSTEM_ID:
8281 + retValue = 0x6300;
8283 + case PCI_INTERRUPT_LINE:
8284 + retValue = INTERRUPT_ID_USBH;
8292 + *value = (retValue >> ((where & 3) << 3)) & 0xff;
8293 + DPRINT("R <= Slot: %d Where: %2X Len: %d Data: %02X\n",
8294 + PCI_SLOT(devfn), where, size, *value);
8297 + *value = (retValue >> ((where & 3) << 3)) & 0xffff;
8298 + DPRINT("R <= Slot: %d Where: %2X Len: %d Data: %04X\n",
8299 + PCI_SLOT(devfn), where, size, *value);
8302 + *value = retValue;
8303 + DPRINT("R <= Slot: %d Where: %2X Len: %d Data: %08lX\n",
8304 + PCI_SLOT(devfn), where, size, *value);
8310 + return PCIBIOS_SUCCESSFUL;
8314 +static int bcm96348_pcibios_read(struct pci_bus *bus, unsigned int devfn,
8315 + int where, int size, u32 * val)
8317 + volatile unsigned char *ioBase = (unsigned char *)(mpi->l2piobase | KSEG1);
8320 +#if defined(CONFIG_USB)
8321 + if (PCI_SLOT(devfn) == USB_HOST_SLOT)
8322 + return pci63xx_int_read(devfn, where, val, size);
8325 + mpi_SetupPciConfigAccess(BCM_PCI_CFG(PCI_SLOT(devfn), PCI_FUNC(devfn), where));
8326 + data = *(uint32 *)ioBase;
8329 + *val = (data >> ((where & 3) << 3)) & 0xff;
8332 + *val = (data >> ((where & 3) << 3)) & 0xffff;
8336 + /* Special case for reading PCI device range */
8337 + if ((where >= PCI_BASE_ADDRESS_0) && (where <= PCI_BASE_ADDRESS_5)) {
8338 + if (pci_mem_size_rd) {
8339 + /* bcm6348 PCI memory window minimum size is 64K */
8340 + *val &= PCI_SIZE_64K;
8347 + pci_mem_size_rd = FALSE;
8348 + mpi_ClearPciConfigAccess();
8350 + return PCIBIOS_SUCCESSFUL;
8353 +static int bcm96348_pcibios_write(struct pci_bus *bus, unsigned int devfn,
8354 + int where, int size, u32 val)
8356 + volatile unsigned char *ioBase = (unsigned char *)(mpi->l2piobase | KSEG1);
8359 +#if defined(CONFIG_USB)
8360 + if (PCI_SLOT(devfn) == USB_HOST_SLOT)
8361 + return pci63xx_int_write(devfn, where, &val, size);
8363 + mpi_SetupPciConfigAccess(BCM_PCI_CFG(PCI_SLOT(devfn), PCI_FUNC(devfn), where));
8364 + data = *(uint32 *)ioBase;
8367 + data = (data & ~(0xff << ((where & 3) << 3))) |
8368 + (val << ((where & 3) << 3));
8371 + data = (data & ~(0xffff << ((where & 3) << 3))) |
8372 + (val << ((where & 3) << 3));
8376 + /* Special case for reading PCI device range */
8377 + if ((where >= PCI_BASE_ADDRESS_0) && (where <= PCI_BASE_ADDRESS_5)) {
8378 + if (val == 0xffffffff)
8379 + pci_mem_size_rd = TRUE;
8385 + *(uint32 *)ioBase = data;
8387 + mpi_ClearPciConfigAccess();
8389 + return PCIBIOS_SUCCESSFUL;
8392 +struct pci_ops bcm96348_pci_ops = {
8393 + .read = bcm96348_pcibios_read,
8394 + .write = bcm96348_pcibios_write
8396 diff -urN linux.old/arch/mips/pci/pci-bcm96348.c linux.dev/arch/mips/pci/pci-bcm96348.c
8397 --- linux.old/arch/mips/pci/pci-bcm96348.c 1970-01-01 01:00:00.000000000 +0100
8398 +++ linux.dev/arch/mips/pci/pci-bcm96348.c 2006-08-25 00:39:38.000000000 +0200
8402 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8404 + This program is free software; you can distribute it and/or modify it
8405 + under the terms of the GNU General Public License (Version 2) as
8406 + published by the Free Software Foundation.
8408 + This program is distributed in the hope it will be useful, but WITHOUT
8409 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8410 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8413 + You should have received a copy of the GNU General Public License along
8414 + with this program; if not, write to the Free Software Foundation, Inc.,
8415 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8418 +#include <linux/types.h>
8419 +#include <linux/pci.h>
8420 +#include <linux/kernel.h>
8421 +#include <linux/init.h>
8423 +#include <asm/pci_channel.h>
8424 +#include <bcmpci.h>
8426 +static struct resource bcm_pci_io_resource = {
8427 + .name = "bcm96348 pci IO space",
8428 + .start = BCM_PCI_IO_BASE,
8429 + .end = BCM_PCI_IO_BASE + BCM_PCI_IO_SIZE_64KB - 1,
8430 + .flags = IORESOURCE_IO
8433 +static struct resource bcm_pci_mem_resource = {
8434 + .name = "bcm96348 pci memory space",
8435 + .start = BCM_PCI_MEM_BASE,
8436 + .end = BCM_PCI_MEM_BASE + BCM_PCI_MEM_SIZE_16MB - 1,
8437 + .flags = IORESOURCE_MEM
8440 +extern struct pci_ops bcm96348_pci_ops;
8442 +struct pci_controller bcm96348_controller = {
8443 + .pci_ops = &bcm96348_pci_ops,
8444 + .io_resource = &bcm_pci_io_resource,
8445 + .mem_resource = &bcm_pci_mem_resource,
8448 +static void bcm96348_pci_init(void)
8450 + register_pci_controller(&bcm96348_controller);
8453 +arch_initcall(bcm96348_pci_init);
8454 diff -urN linux.old/drivers/serial/bcm63xx_cons.c linux.dev/drivers/serial/bcm63xx_cons.c
8455 --- linux.old/drivers/serial/bcm63xx_cons.c 1970-01-01 01:00:00.000000000 +0100
8456 +++ linux.dev/drivers/serial/bcm63xx_cons.c 2006-08-25 15:37:34.000000000 +0200
8460 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8462 + This program is free software; you can distribute it and/or modify it
8463 + under the terms of the GNU General Public License (Version 2) as
8464 + published by the Free Software Foundation.
8466 + This program is distributed in the hope it will be useful, but WITHOUT
8467 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8468 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8471 + You should have received a copy of the GNU General Public License along
8472 + with this program; if not, write to the Free Software Foundation, Inc.,
8473 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8477 +/* Description: Serial port driver for the BCM963XX. */
8479 +#define CARDNAME "bcm963xx_serial driver"
8480 +#define VERSION "2.0"
8481 +#define VER_STR CARDNAME " v" VERSION "\n"
8484 +#include <linux/kernel.h>
8485 +#include <linux/module.h>
8486 +#include <linux/version.h>
8487 +#include <linux/init.h>
8488 +#include <linux/slab.h>
8489 +#include <linux/interrupt.h>
8490 +#include <linux/spinlock.h>
8492 +/* for definition of struct console */
8493 +#include <linux/console.h>
8494 +#include <linux/tty.h>
8495 +#include <linux/tty_flip.h>
8496 +#include <linux/serial.h>
8497 +#include <linux/serialP.h>
8498 +#include <asm/uaccess.h>
8500 +#include <bcmtypes.h>
8502 +#include <bcm_map_part.h>
8503 +#include <bcm_intr.h>
8505 +static DEFINE_SPINLOCK(bcm963xx_serial_lock);
8507 +extern void _putc(char);
8508 +extern void _puts(const char *);
8510 +typedef struct bcm_serial {
8511 + volatile Uart * port;
8517 + unsigned short close_delay;
8518 + unsigned short closing_wait;
8519 + unsigned short line; /* port/line number */
8520 + unsigned short cflags; /* line configuration flag */
8521 + unsigned short x_char; /* xon/xoff character */
8522 + unsigned short read_status_mask; /* mask for read condition */
8523 + unsigned short ignore_status_mask; /* mask for ignore condition */
8524 + unsigned long event; /* mask used in BH */
8525 + int xmit_head; /* Position of the head */
8526 + int xmit_tail; /* Position of the tail */
8527 + int xmit_cnt; /* Count of the chars in the buffer */
8528 + int count; /* indicates how many times it has been opened */
8531 + struct async_icount icount; /* keep track of things ... */
8532 + struct tty_struct *tty; /* tty associated */
8533 + struct termios normal_termios;
8535 + wait_queue_head_t open_wait;
8536 + wait_queue_head_t close_wait;
8538 + long session; /* Session of opening process */
8539 + long pgrp; /* pgrp of opening process */
8541 + unsigned char is_initialized;
8545 +/*---------------------------------------------------------------------*/
8546 +/* Define bits in the Interrupt Enable register */
8547 +/*---------------------------------------------------------------------*/
8548 +/* Enable receive interrupt */
8549 +#define RXINT (RXFIFONE|RXOVFERR)
8551 +/* Enable transmit interrupt */
8552 +#define TXINT (TXFIFOEMT|TXUNDERR|TXOVFERR)
8554 +/* Enable receiver line status interrupt */
8555 +#define LSINT (RXBRK|RXPARERR|RXFRAMERR)
8557 +#define BCM_NUM_UARTS 1
8559 +#define BD_BCM63XX_TIMER_CLOCK_INPUT (FPERIPH)
8562 +static struct bcm_serial multi[BCM_NUM_UARTS];
8563 +static struct bcm_serial *lines[BCM_NUM_UARTS];
8564 +static struct tty_driver *serial_driver;
8565 +static struct termios *serial_termios[BCM_NUM_UARTS];
8566 +static struct termios *serial_termios_locked[BCM_NUM_UARTS];
8569 +static void bcm_stop (struct tty_struct *tty);
8570 +static void bcm_start (struct tty_struct *tty);
8571 +static inline void receive_chars (struct bcm_serial * info);
8572 +static int startup (struct bcm_serial *info);
8573 +static void shutdown (struct bcm_serial * info);
8574 +static void change_speed( volatile Uart *pUart, tcflag_t cFlag );
8575 +static void bcm63xx_cons_flush_chars (struct tty_struct *tty);
8576 +static int bcm63xx_cons_write (struct tty_struct *tty,
8577 + const unsigned char *buf, int count);
8578 +static int bcm63xx_cons_write_room (struct tty_struct *tty);
8579 +static int bcm_chars_in_buffer (struct tty_struct *tty);
8580 +static void bcm_flush_buffer (struct tty_struct *tty);
8581 +static void bcm_throttle (struct tty_struct *tty);
8582 +static void bcm_unthrottle (struct tty_struct *tty);
8583 +static void bcm_send_xchar (struct tty_struct *tty, char ch);
8584 +static int get_serial_info(struct bcm_serial *info, struct serial_struct *retinfo);
8585 +static int set_serial_info (struct bcm_serial *info, struct serial_struct *new_info);
8586 +static int get_lsr_info (struct bcm_serial *info, unsigned int *value);
8587 +static void send_break (struct bcm_serial *info, int duration);
8588 +static int bcm_ioctl (struct tty_struct * tty, struct file * file,
8589 + unsigned int cmd, unsigned long arg);
8590 +static void bcm_set_termios (struct tty_struct *tty, struct termios *old_termios);
8591 +static void bcm63xx_cons_close (struct tty_struct *tty, struct file *filp);
8592 +static void bcm_hangup (struct tty_struct *tty);
8593 +static int block_til_ready (struct tty_struct *tty, struct file *filp, struct bcm_serial *info);
8594 +static int bcm63xx_cons_open (struct tty_struct * tty, struct file * filp);
8595 +static int __init bcm63xx_serialinit(void);
8599 + * ------------------------------------------------------------
8600 + * rs_stop () and rs_start ()
8602 + * These routines are called before setting or resetting
8603 + * tty->stopped. They enable or disable transmitter interrupts,
8605 + * ------------------------------------------------------------
8607 +static void bcm_stop (struct tty_struct *tty)
8611 +static void bcm_start (struct tty_struct *tty)
8613 + _puts(CARDNAME " Start\n");
8617 + * ------------------------------------------------------------
8620 + * This routine deals with inputs from any lines.
8621 + * ------------------------------------------------------------
8623 +static inline void receive_chars (struct bcm_serial * info)
8625 + struct tty_struct *tty = 0;
8626 + struct async_icount * icount;
8628 + unsigned short status, tmp;
8630 + while ((status = info->port->intStatus) & RXINT)
8632 + char flag_char = TTY_NORMAL;
8634 + if (status & RXFIFONE)
8635 + ch = info->port->Data; // Read the character
8636 + tty = info->tty; /* now tty points to the proper dev */
8637 + icount = &info->icount;
8640 + if (!tty_buffer_request_room(tty, 1))
8643 + if (status & RXBRK)
8645 + flag_char = TTY_BREAK;
8648 + // keep track of the statistics
8649 + if (status & (RXFRAMERR | RXPARERR | RXOVFERR))
8651 + if (status & RXPARERR) /* parity error */
8654 + if (status & RXFRAMERR) /* frame error */
8656 + if (status & RXOVFERR)
8658 + // Overflow. Reset the RX FIFO
8659 + info->port->fifoctl |= RSTRXFIFOS;
8660 + icount->overrun++;
8662 + // check to see if we should ignore the character
8663 + // and mask off conditions that should be ignored
8664 + if (status & info->ignore_status_mask)
8666 + if (++ignore > 100 )
8670 + // Mask off the error conditions we want to ignore
8671 + tmp = status & info->read_status_mask;
8672 + if (tmp & RXPARERR)
8674 + flag_char = TTY_PARITY;
8677 + if (tmp & RXFRAMERR)
8679 + flag_char = TTY_FRAME;
8681 + if (tmp & RXOVFERR)
8683 + tty_insert_flip_char(tty, ch, flag_char);
8685 + flag_char = TTY_OVERRUN;
8686 + if (!tty_buffer_request_room(tty, 1))
8690 + tty_insert_flip_char(tty, ch, flag_char);
8693 + tty_flip_buffer_push(tty);
8694 + tty_schedule_flip(tty);
8700 + * ------------------------------------------------------------
8701 + * bcm_interrupt ()
8703 + * this is the main interrupt routine for the chip.
8704 + * It deals with the multiple ports.
8705 + * ------------------------------------------------------------
8707 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
8708 +static irqreturn_t bcm_interrupt (int irq, void * dev, struct pt_regs * regs)
8710 +static void bcm_interrupt (int irq, void * dev, struct pt_regs * regs)
8713 + struct bcm_serial * info = lines[0];
8716 + /* get pending interrupt flags from UART */
8718 + /* Mask with only the serial interrupts that are enabled */
8719 + intStat = info->port->intStatus & info->port->intMask;
8722 + if (intStat & RXINT)
8723 + receive_chars (info);
8725 + if (intStat & TXINT)
8726 + info->port->intStatus = TXINT;
8727 + else /* don't know what it was, so let's mask it */
8728 + info->port->intMask &= ~intStat;
8730 + intStat = info->port->intStatus & info->port->intMask;
8733 + // Clear the interrupt
8734 + BcmHalInterruptEnable (INTERRUPT_ID_UART);
8735 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
8736 + return IRQ_HANDLED;
8741 + * -------------------------------------------------------------------
8744 + * various initialization tasks
8745 + * -------------------------------------------------------------------
8747 +static int startup (struct bcm_serial *info)
8749 + // Port is already started...
8754 + * -------------------------------------------------------------------
8757 + * This routine will shutdown a serial port; interrupts are disabled, and
8758 + * DTR is dropped if the hangup on close termio flag is on.
8759 + * -------------------------------------------------------------------
8761 +static void shutdown (struct bcm_serial * info)
8763 + unsigned long flags;
8764 + if (!info->is_initialized)
8767 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
8769 + info->port->control &= ~(BRGEN|TXEN|RXEN);
8771 + set_bit (TTY_IO_ERROR, &info->tty->flags);
8772 + info->is_initialized = 0;
8774 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
8777 + * -------------------------------------------------------------------
8780 + * Set the baud rate, character size, parity and stop bits.
8781 + * -------------------------------------------------------------------
8783 +static void change_speed( volatile Uart *pUart, tcflag_t cFlag )
8785 + unsigned long ulFlags, ulBaud, ulClockFreqHz, ulTmp;
8787 + spin_lock_irqsave(&bcm963xx_serial_lock, ulFlags);
8788 + switch( cFlag & (CBAUD | CBAUDEX) )
8846 + /* Calculate buad rate. */
8847 + ulClockFreqHz = BD_BCM63XX_TIMER_CLOCK_INPUT;
8848 + ulTmp = (ulClockFreqHz / ulBaud) / 16;
8849 + if( ulTmp & 0x01 )
8850 + ulTmp /= 2; /* Rounding up, so sub is already accounted for */
8852 + ulTmp = (ulTmp / 2) - 1; /* Rounding down so we must sub 1 */
8853 + pUart->baudword = ulTmp;
8855 + /* Set character size, stop bits and parity. */
8856 + switch( cFlag & CSIZE )
8859 + ulTmp = BITS5SYM; /* select transmit 5 bit data size */
8862 + ulTmp = BITS6SYM; /* select transmit 6 bit data size */
8865 + ulTmp = BITS7SYM; /* select transmit 7 bit data size */
8868 + ulTmp = BITS8SYM; /* select transmit 8 bit data size */
8871 + if( cFlag & CSTOPB )
8872 + ulTmp |= TWOSTOP; /* select 2 stop bits */
8874 + ulTmp |= ONESTOP; /* select one stop bit */
8876 + /* Write these values into the config reg. */
8877 + pUart->config = ulTmp;
8878 + pUart->control &= ~(RXPARITYEN | TXPARITYEN | RXPARITYEVEN | TXPARITYEVEN);
8879 + switch( cFlag & (PARENB | PARODD) )
8881 + case PARENB|PARODD:
8882 + pUart->control |= RXPARITYEN | TXPARITYEN;
8885 + pUart->control |= RXPARITYEN | TXPARITYEN | RXPARITYEVEN | TXPARITYEVEN;
8888 + pUart->control |= 0;
8892 + /* Reset and flush uart */
8893 + pUart->fifoctl = RSTTXFIFOS | RSTRXFIFOS;
8894 + spin_unlock_irqrestore(&bcm963xx_serial_lock, ulFlags);
8899 + * -------------------------------------------------------------------
8900 + * bcm_flush_char ()
8902 + * Nothing to flush. Polled I/O is used.
8903 + * -------------------------------------------------------------------
8905 +static void bcm63xx_cons_flush_chars (struct tty_struct *tty)
8911 + * -------------------------------------------------------------------
8912 + * bcm63xx_cons_write ()
8914 + * Main output routine using polled I/O.
8915 + * -------------------------------------------------------------------
8917 +static int bcm63xx_cons_write (struct tty_struct *tty,
8918 + const unsigned char *buf, int count)
8922 + for (c = 0; c < count; c++)
8928 + * -------------------------------------------------------------------
8929 + * bcm63xx_cons_write_room ()
8931 + * Compute the amount of space available for writing.
8932 + * -------------------------------------------------------------------
8934 +static int bcm63xx_cons_write_room (struct tty_struct *tty)
8936 + /* Pick a number. Any number. Polled I/O is used. */
8941 + * -------------------------------------------------------------------
8942 + * bcm_chars_in_buffer ()
8944 + * compute the amount of char left to be transmitted
8945 + * -------------------------------------------------------------------
8947 +static int bcm_chars_in_buffer (struct tty_struct *tty)
8953 + * -------------------------------------------------------------------
8954 + * bcm_flush_buffer ()
8956 + * Empty the output buffer
8957 + * -------------------------------------------------------------------
8959 +static void bcm_flush_buffer (struct tty_struct *tty)
8965 + * ------------------------------------------------------------
8966 + * bcm_throttle () and bcm_unthrottle ()
8968 + * This routine is called by the upper-layer tty layer to signal that
8969 + * incoming characters should be throttled (or not).
8970 + * ------------------------------------------------------------
8972 +static void bcm_throttle (struct tty_struct *tty)
8974 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
8976 + info->x_char = STOP_CHAR(tty);
8979 +static void bcm_unthrottle (struct tty_struct *tty)
8981 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
8987 + info->x_char = START_CHAR(tty);
8991 +static void bcm_send_xchar (struct tty_struct *tty, char ch)
8993 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
8994 + info->x_char = ch;
8996 + bcm_start (info->tty);
9000 + * ------------------------------------------------------------
9001 + * rs_ioctl () and friends
9002 + * ------------------------------------------------------------
9004 +static int get_serial_info(struct bcm_serial *info, struct serial_struct *retinfo)
9006 + struct serial_struct tmp;
9011 + memset (&tmp, 0, sizeof(tmp));
9012 + tmp.type = info->type;
9013 + tmp.line = info->line;
9014 + tmp.port = (int) info->port;
9015 + tmp.irq = info->irq;
9017 + tmp.baud_base = info->baud_base;
9018 + tmp.close_delay = info->close_delay;
9019 + tmp.closing_wait = info->closing_wait;
9021 + return copy_to_user (retinfo, &tmp, sizeof(*retinfo));
9024 +static int set_serial_info (struct bcm_serial *info, struct serial_struct *new_info)
9026 + struct serial_struct new_serial;
9027 + struct bcm_serial old_info;
9033 + copy_from_user (&new_serial, new_info, sizeof(new_serial));
9036 + if (!capable(CAP_SYS_ADMIN))
9040 + if (info->count > 1)
9043 + /* OK, past this point, all the error checking has been done.
9044 + * At this point, we start making changes.....
9046 + info->baud_base = new_serial.baud_base;
9047 + info->type = new_serial.type;
9048 + info->close_delay = new_serial.close_delay;
9049 + info->closing_wait = new_serial.closing_wait;
9050 + retval = startup (info);
9055 + * get_lsr_info - get line status register info
9057 + * Purpose: Let user call ioctl() to get info when the UART physically
9058 + * is emptied. On bus types like RS485, the transmitter must
9059 + * release the bus after transmitting. This must be done when
9060 + * the transmit shift register is empty, not be done when the
9061 + * transmit holding register is empty. This functionality
9062 + * allows an RS485 driver to be written in user space.
9064 +static int get_lsr_info (struct bcm_serial *info, unsigned int *value)
9070 + * This routine sends a break character out the serial port.
9072 +static void send_break (struct bcm_serial *info, int duration)
9074 + unsigned long flags;
9079 + current->state = TASK_INTERRUPTIBLE;
9081 + /*save_flags (flags);
9083 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
9085 + info->port->control |= XMITBREAK;
9086 + schedule_timeout(duration);
9087 + info->port->control &= ~XMITBREAK;
9089 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9090 + //restore_flags (flags);
9093 +static int bcm_ioctl (struct tty_struct * tty, struct file * file,
9094 + unsigned int cmd, unsigned long arg)
9097 + struct bcm_serial * info = (struct bcm_serial *)tty->driver_data;
9100 + if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
9101 + (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
9102 + (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT))
9104 + if (tty->flags & (1 << TTY_IO_ERROR))
9110 + case TCSBRK: /* SVID version: non-zero arg --> no break */
9111 + retval = tty_check_change (tty);
9114 + tty_wait_until_sent (tty, 0);
9116 + send_break (info, HZ/4); /* 1/4 second */
9119 + case TCSBRKP: /* support for POSIX tcsendbreak() */
9120 + retval = tty_check_change (tty);
9123 + tty_wait_until_sent (tty, 0);
9124 + send_break (info, arg ? arg*(HZ/10) : HZ/4);
9127 + case TIOCGSOFTCAR:
9128 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(long));
9133 + put_user (C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
9137 + case TIOCSSOFTCAR:
9138 + error = get_user (arg, (unsigned long *)arg);
9141 + tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
9145 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(struct serial_struct));
9149 + return get_serial_info (info, (struct serial_struct *)arg);
9152 + return set_serial_info (info, (struct serial_struct *) arg);
9154 + case TIOCSERGETLSR: /* Get line status register */
9155 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(unsigned int));
9159 + return get_lsr_info (info, (unsigned int *)arg);
9161 + case TIOCSERGSTRUCT:
9162 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(struct bcm_serial));
9167 + copy_to_user((struct bcm_serial *)arg, info, sizeof(struct bcm_serial));
9172 + return -ENOIOCTLCMD;
9177 +static void bcm_set_termios (struct tty_struct *tty, struct termios *old_termios)
9179 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9181 + if( tty->termios->c_cflag != old_termios->c_cflag )
9182 + change_speed (info->port, tty->termios->c_cflag);
9186 + * ------------------------------------------------------------
9187 + * bcm63xx_cons_close()
9189 + * This routine is called when the serial port gets closed. First, we
9190 + * wait for the last remaining data to be sent. Then, we turn off
9191 + * the transmit enable and receive enable flags.
9192 + * ------------------------------------------------------------
9194 +static void bcm63xx_cons_close (struct tty_struct *tty, struct file *filp)
9196 + struct bcm_serial * info = (struct bcm_serial *)tty->driver_data;
9197 + unsigned long flags;
9202 + /*save_flags (flags);
9204 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
9206 + if (tty_hung_up_p (filp))
9208 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9209 + //restore_flags (flags);
9213 + if ((tty->count == 1) && (info->count != 1))
9216 + /* Uh, oh. tty->count is 1, which means that the tty
9217 + * structure will be freed. Info->count should always
9218 + * be one in these conditions. If it's greater than
9219 + * one, we've got real problems, since it means the
9220 + * serial port won't be shutdown.
9222 + printk("bcm63xx_cons_close: bad serial port count; tty->count is 1, "
9223 + "info->count is %d\n", info->count);
9227 + if (--info->count < 0)
9229 + printk("ds_close: bad serial port count for ttys%d: %d\n",
9230 + info->line, info->count);
9236 + //restore_flags (flags);
9237 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9241 + /* Now we wait for the transmit buffer to clear; and we notify
9242 + * the line discipline to only process XON/XOFF characters.
9246 + /* At this point we stop accepting input. To do this, we
9247 + * disable the receive line status interrupts.
9250 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
9251 + if (tty->driver->flush_buffer)
9252 + tty->driver->flush_buffer (tty);
9254 + if (tty->driver.flush_buffer)
9255 + tty->driver.flush_buffer (tty);
9257 + if (tty->ldisc.flush_buffer)
9258 + tty->ldisc.flush_buffer (tty);
9263 + if (tty->ldisc.num != tty_ldisc_get(N_TTY)->num)
9265 + if (tty->ldisc.close)
9266 + (tty->ldisc.close)(tty);
9267 + tty->ldisc = *tty_ldisc_get(N_TTY);
9268 + tty->termios->c_line = N_TTY;
9269 + if (tty->ldisc.open)
9270 + (tty->ldisc.open)(tty);
9272 + if (info->blocked_open)
9274 + if (info->close_delay)
9276 + current->state = TASK_INTERRUPTIBLE;
9277 + schedule_timeout(info->close_delay);
9279 + wake_up_interruptible (&info->open_wait);
9281 + wake_up_interruptible (&info->close_wait);
9283 + //restore_flags (flags);
9284 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9288 + * bcm_hangup () --- called by tty_hangup() when a hangup is signaled.
9290 +static void bcm_hangup (struct tty_struct *tty)
9293 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9299 + wake_up_interruptible (&info->open_wait);
9303 + * ------------------------------------------------------------
9304 + * rs_open() and friends
9305 + * ------------------------------------------------------------
9307 +static int block_til_ready (struct tty_struct *tty, struct file *filp,
9308 + struct bcm_serial *info)
9314 + * This routine is called whenever a serial port is opened. It
9315 + * enables interrupts for a serial port. It also performs the
9316 + * serial-specific initialization for the tty structure.
9318 +static int bcm63xx_cons_open (struct tty_struct * tty, struct file * filp)
9320 + struct bcm_serial *info;
9323 + // Make sure we're only opening on of the ports we support
9324 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
9325 + line = MINOR(tty->driver->cdev.dev) - tty->driver->minor_start;
9327 + line = MINOR(tty->device) - tty->driver.minor_start;
9330 + if ((line < 0) || (line >= BCM_NUM_UARTS))
9333 + info = lines[line];
9335 + tty->low_latency=1;
9336 + info->port->intMask = 0; /* Clear any pending interrupts */
9337 + info->port->intMask = RXINT; /* Enable RX */
9340 + tty->driver_data = info;
9342 + BcmHalInterruptEnable (INTERRUPT_ID_UART);
9344 + // Start up serial port
9345 + retval = startup (info);
9349 + retval = block_til_ready (tty, filp, info);
9354 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
9355 + info->pgrp = process_group(current);
9356 + info->session = current->signal->session;
9358 + info->session = current->session;
9359 + info->pgrp = current->pgrp;
9366 +static struct tty_operations rs_ops = {
9367 + .open = bcm63xx_cons_open,
9368 + .close = bcm63xx_cons_close,
9369 + .write = bcm63xx_cons_write,
9370 + .flush_chars = bcm63xx_cons_flush_chars,
9371 + .write_room = bcm63xx_cons_write_room,
9372 + .chars_in_buffer = bcm_chars_in_buffer,
9373 + .flush_buffer = bcm_flush_buffer,
9374 + .ioctl = bcm_ioctl,
9375 + .throttle = bcm_throttle,
9376 + .unthrottle = bcm_unthrottle,
9377 + .send_xchar = bcm_send_xchar,
9378 + .set_termios = bcm_set_termios,
9380 + .start = bcm_start,
9381 + .hangup = bcm_hangup,
9384 +/* --------------------------------------------------------------------------
9385 + Name: bcm63xx_serialinit
9386 + Purpose: Initialize our BCM63xx serial driver
9387 +-------------------------------------------------------------------------- */
9388 +static int __init bcm63xx_serialinit(void)
9391 + struct bcm_serial * info;
9393 + // Print the driver version information
9395 + serial_driver = alloc_tty_driver(BCM_NUM_UARTS);
9396 + if (!serial_driver)
9399 + serial_driver->owner = THIS_MODULE;
9400 + serial_driver->devfs_name = "tts/";
9401 +// serial_driver.magic = TTY_DRIVER_MAGIC;
9402 + serial_driver->name = "ttyS";
9403 + serial_driver->major = TTY_MAJOR;
9404 + serial_driver->minor_start = 64;
9405 +// serial_driver.num = BCM_NUM_UARTS;
9406 + serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
9407 + serial_driver->subtype = SERIAL_TYPE_NORMAL;
9408 + serial_driver->init_termios = tty_std_termios;
9409 + serial_driver->init_termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
9410 + serial_driver->flags = TTY_DRIVER_REAL_RAW;
9412 + serial_driver->termios = serial_termios;
9413 + serial_driver->termios_locked = serial_termios_locked;
9415 + tty_set_operations(serial_driver, &rs_ops);
9417 + if (tty_register_driver (serial_driver))
9418 + panic("Couldn't register serial driver\n");
9420 + //save_flags(flags); cli();
9421 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
9423 + for (i = 0; i < BCM_NUM_UARTS; i++)
9427 + info->magic = SERIAL_MAGIC;
9428 + info->port = (Uart *) ((char *)UART_BASE + (i * 0x20));
9430 + info->irq = (2 - i) + 8;
9432 + info->close_delay = 50;
9433 + info->closing_wait = 3000;
9437 + info->blocked_open = 0;
9438 + info->normal_termios = serial_driver->init_termios;
9439 + init_waitqueue_head(&info->open_wait);
9440 + init_waitqueue_head(&info->close_wait);
9442 + /* If we are pointing to address zero then punt - not correctly
9443 + * set up in setup.c to handle this.
9447 + BcmHalMapInterrupt(bcm_interrupt, 0, INTERRUPT_ID_UART);
9450 + /* order matters here... the trick is that flags
9451 + * is updated... in request_irq - to immediatedly obliterate
9454 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9458 +module_init(bcm63xx_serialinit);
9460 +/* --------------------------------------------------------------------------
9461 + Name: bcm_console_print
9462 + Purpose: bcm_console_print is registered for printk.
9463 + The console_lock must be held when we get here.
9464 +-------------------------------------------------------------------------- */
9465 +static void bcm_console_print (struct console * cons, const char * str,
9466 + unsigned int count)
9470 + for(i=0; i<count; i++, str++)
9480 +static struct tty_driver * bcm_console_device(struct console * c, int *index)
9482 + *index = c->index;
9483 + return serial_driver;
9486 +static int __init bcm_console_setup(struct console * co, char * options)
9491 +static struct console bcm_sercons = {
9493 + .write = bcm_console_print,
9494 + .device = bcm_console_device,
9495 + .setup = bcm_console_setup,
9496 + .flags = CON_PRINTBUFFER,
9500 +static int __init bcm63xx_console_init(void)
9502 + register_console(&bcm_sercons);
9506 +console_initcall(bcm63xx_console_init);
9507 diff -urN linux.old/drivers/serial/Makefile linux.dev/drivers/serial/Makefile
9508 --- linux.old/drivers/serial/Makefile 2006-06-18 03:49:35.000000000 +0200
9509 +++ linux.dev/drivers/serial/Makefile 2006-08-25 15:38:44.000000000 +0200
9511 obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o
9512 obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
9513 obj-$(CONFIG_SERIAL_AT91) += at91_serial.o
9514 +obj-$(CONFIG_BCM_SERIAL) += bcm63xx_cons.o
9515 diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h
9516 --- linux.old/include/asm-mips/bootinfo.h 2006-08-25 00:43:22.000000000 +0200
9517 +++ linux.dev/include/asm-mips/bootinfo.h 2006-08-25 00:39:38.000000000 +0200
9518 @@ -218,6 +218,14 @@
9519 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
9520 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
9523 + * Valid machtype for group BRCM
9525 +#define MACH_GROUP_BRCM 23 /* Broadcom boards */
9526 +#define MACH_BCM96338 0
9527 +#define MACH_BCM96345 1
9528 +#define MACH_BCM96348 2
9530 #define CL_SIZE COMMAND_LINE_SIZE
9532 const char *get_system_type(void);
9533 diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
9534 --- linux.old/include/asm-mips/cpu.h 2006-08-25 00:43:22.000000000 +0200
9535 +++ linux.dev/include/asm-mips/cpu.h 2006-08-25 00:39:38.000000000 +0200
9536 @@ -103,6 +103,13 @@
9538 #define PRID_IMP_SR71000 0x0400
9540 +/* These are the PRID's for when 23:16 == PRID_COMP_BROADCOM
9543 +#define PRID_IMP_BCM6338 0x9000
9544 +#define PRID_IMP_BCM6345 0x8000
9545 +#define PRID_IMP_BCM6348 0x9100
9548 * Definitions for 7:0 on legacy processors
9550 @@ -200,7 +207,10 @@
9553 #define CPU_R14000 64
9554 -#define CPU_LAST 64
9555 +#define CPU_BCM6338 65
9556 +#define CPU_BCM6345 66
9557 +#define CPU_BCM6348 67
9558 +#define CPU_LAST 67
9561 * ISA Level encodings
9562 diff -urN linux.old/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h linux.dev/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h
9563 --- linux.old/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h 1970-01-01 01:00:00.000000000 +0100
9564 +++ linux.dev/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h 2006-08-25 11:27:40.000000000 +0200
9566 +#ifndef __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H
9567 +#define __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H
9569 +#define cpu_has_tlb 1
9570 +#define cpu_has_4kex 4
9571 +#define cpu_has_4ktlb 8
9572 +#define cpu_has_fpu 0
9573 +#define cpu_has_32fpr 0
9574 +#define cpu_has_counter 0x40
9575 +#define cpu_has_watch 0
9576 +#define cpu_has_mips16 0
9577 +#define cpu_has_divec 0x200
9578 +#define cpu_has_vce 0
9579 +#define cpu_has_cache_cdex_p 0
9580 +#define cpu_has_cache_cdex_s 0
9581 +#define cpu_has_prefetch 0x40000
9582 +#define cpu_has_mcheck 0x2000
9583 +#define cpu_has_ejtag 0x4000
9584 +#define cpu_has_llsc 0x10000
9585 +#define cpu_has_vtag_icache 0
9586 +#define cpu_has_dc_aliases 0
9587 +#define cpu_has_ic_fills_f_dc 0
9589 +#define cpu_has_nofpuex 0
9590 +#define cpu_has_64bits 0
9591 +#define cpu_has_64bit_zero_reg 0
9592 +#define cpu_has_64bit_gp_regs 0
9593 +#define cpu_has_64bit_addresses 0
9595 +#define cpu_has_subset_pcaches 0
9597 +#define cpu_dcache_line_size() 16
9598 +#define cpu_icache_line_size() 16
9599 +#define cpu_scache_line_size() 0
9601 +#endif /* __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H */
9602 diff -urN linux.old/include/asm-mips/mach-generic/param.h linux.dev/include/asm-mips/mach-generic/param.h
9603 --- linux.old/include/asm-mips/mach-generic/param.h 2006-08-25 00:43:22.000000000 +0200
9604 +++ linux.dev/include/asm-mips/mach-generic/param.h 2006-08-25 00:39:38.000000000 +0200
9606 #ifndef __ASM_MACH_GENERIC_PARAM_H
9607 #define __ASM_MACH_GENERIC_PARAM_H
9609 -#define HZ 1000 /* Internal kernel timer frequency */
9610 +#define HZ 200 /* Internal kernel timer frequency */
9612 #endif /* __ASM_MACH_GENERIC_PARAM_H */
9613 diff -urN linux.old/include/asm-mips/module.h linux.dev/include/asm-mips/module.h
9614 --- linux.old/include/asm-mips/module.h 2006-08-25 00:43:22.000000000 +0200
9615 +++ linux.dev/include/asm-mips/module.h 2006-08-25 00:39:38.000000000 +0200
9616 @@ -113,6 +113,12 @@
9617 #define MODULE_PROC_FAMILY "RM9000 "
9618 #elif defined CONFIG_CPU_SB1
9619 #define MODULE_PROC_FAMILY "SB1 "
9620 +#elif defined CONFIG_CPU_BCM6338
9621 +#define MODULE_PROC_FAMILY "BCM6338 "
9622 +#elif defined CONFIG_CPU_BCM6345
9623 +#define MODULE_PROC_FAMILY "BCM6345 "
9624 +#elif defined CONFIG_CPU_BCM6348
9625 +#define MODULE_PROC_FAMILY "BCM6348 "
9627 #error MODULE_PROC_FAMILY undefined for your processor configuration