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-27 21:02:04.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);
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 */
764 + if (boot_loader_type == BOOT_CFE)
765 + memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,
766 + NVRAM_MAC_ADDRESS_LEN );
769 + pucaMacAddr[0] = 0x00;
770 + pucaMacAddr[1] = 0x07;
771 + pucaMacAddr[2] = 0x3A;
772 + pucaMacAddr[3] = 0xFF;
773 + pucaMacAddr[4] = 0xFF;
774 + pucaMacAddr[5] = 0xFF;
780 +} /* kerSysGetMacAddr */
782 +int kerSysReleaseMacAddress( unsigned char *pucaMacAddr )
784 + int nRet = -EINVAL;
785 + unsigned long ulIdx = 0;
786 + int idx = (pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] -
787 + g_pNvramInfo->ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET]);
789 + // if overflow 255 (negitive), add 256 to have the correct index
792 + ulIdx = (unsigned long) (idx >> SHIFT_BITS);
794 + if( ulIdx < g_pNvramInfo->ulNumMacAddrs )
796 + PMAC_ADDR_INFO pMai = &g_pNvramInfo->MacAddrs[ulIdx];
797 + if( pMai->chInUse == 1 )
805 +} /* kerSysReleaseMacAddr */
807 +int kerSysGetSdramSize( void )
809 + if (boot_loader_type == BOOT_CFE) {
810 + return( (int) g_pNvramInfo->ulSdramSize );
813 + printk("kerSysGetSdramSize : 0x%08X\n", (int)getMemorySize() + 0x00040000);
814 + return((int)getMemorySize() + 0x00040000);
816 +} /* kerSysGetSdramSize */
819 +void kerSysLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
821 + if (g_ledInitialized)
822 + boardLedCtrl(ledName, ledState);
825 +unsigned int kerSysMonitorPollHook( struct file *f, struct poll_table_struct *t)
827 + int mask = (*g_orig_fop_poll) (f, t);
829 + if( g_wakeup_monitor == 1 && g_monitor_file == f )
831 + /* If g_wakeup_monitor is non-0, the user mode application needs to
832 + * return from a blocking select function. Return POLLPRI which will
833 + * cause the select to return with the exception descriptor set.
836 + g_wakeup_monitor = 0;
842 +/* Put the user mode application that monitors link state on a run queue. */
843 +void kerSysWakeupMonitorTask( void )
845 + g_wakeup_monitor = 1;
846 + if( g_monitor_task )
847 + wake_up_process( g_monitor_task );
850 +//<<JUNHON, 2004/09/15, get reset button status , tim hou , 05/04/12
851 +int kerSysGetResetHold(void)
853 + unsigned short gpio;
855 + if( BpGetPressAndHoldResetGpio( &gpio ) == BP_SUCCESS )
857 + unsigned long gpio_mask = GPIO_NUM_TO_MASK(gpio);
858 + volatile unsigned long *gpio_reg = &GPIO->GPIOio;
860 + if( (gpio & ~BP_ACTIVE_MASK) >= 32 )
862 + gpio_mask = GPIO_NUM_TO_MASK_HIGH(gpio);
863 + gpio_reg = &GPIO->GPIOio_high;
865 + //printk("gpio=%04x,gpio_mask=%04x,gpio_reg=%04x\n",gpio,gpio_mask,*gpio_reg);
866 + if(*gpio_reg & gpio_mask) //press down
867 + return RESET_BUTTON_UP;
869 + return RESET_BUTTON_PRESSDOWN;
871 +//<<JUNHON, 2004/09/15
873 +/***************************************************************************
874 + * Dying gasp ISR and functions.
875 + ***************************************************************************/
876 +#define KERSYS_DBG printk
878 +#if defined(CONFIG_BCM96345)
879 +#define CYCLE_PER_US 70
880 +#elif defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
881 +/* The BCM6348 cycles per microsecond is really variable since the BCM6348
882 + * MIPS speed can vary depending on the PLL settings. However, an appoximate
883 + * value of 120 will still work OK for the test being done.
885 +#define CYCLE_PER_US 120
887 +#define DG_GLITCH_TO (100*CYCLE_PER_US)
889 +static void __init kerSysDyingGaspMapIntr()
891 + unsigned long ulIntr;
893 +#if defined(CONFIG_BCM96348) || defined(_BCM96348_) || defined(CONFIG_BCM96338) || defined(_BCM96338_)
894 + if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
895 + BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, INTERRUPT_ID_DG);
896 + BcmHalInterruptEnable( INTERRUPT_ID_DG );
898 +#elif defined(CONFIG_BCM96345) || defined(_BCM96345_)
899 + if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
900 + ulIntr += INTERRUPT_ID_EXTERNAL_0;
901 + BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, ulIntr);
902 + BcmHalInterruptEnable( ulIntr );
908 +void kerSysSetWdTimer(ulong timeUs)
910 + TIMER->WatchDogDefCount = timeUs * (FPERIPH/1000000);
911 + TIMER->WatchDogCtl = 0xFF00;
912 + TIMER->WatchDogCtl = 0x00FF;
915 +ulong kerSysGetCycleCount(void)
921 + __asm volatile("mfc0 %0, $9":"=d"(cnt));
926 +static Bool kerSysDyingGaspCheckPowerLoss(void)
932 + clk0 = kerSysGetCycleCount();
938 +#if defined(CONFIG_BCM96345)
939 + BpGetAdslDyingGaspExtIntr( &ulIntr );
944 + clk1 = kerSysGetCycleCount(); /* time cleared */
945 + /* wait a little to get new reading */
946 + while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
948 + } while ((0 == (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT)))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
950 + if (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT))) { /* power glitch */
951 + BcmHalInterruptEnable( ulIntr + INTERRUPT_ID_EXTERNAL_0);
952 + KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
955 +#elif (defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)) && !defined(VXWORKS)
959 + clk1 = kerSysGetCycleCount(); /* time cleared */
960 + /* wait a little to get new reading */
961 + while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
963 + } while ((PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
965 + if (!(PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET)))) {
966 + BcmHalInterruptEnable( INTERRUPT_ID_DG );
967 + KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
974 +static void kerSysDyingGaspShutdown( void )
976 + kerSysSetWdTimer(1000000);
977 +#if defined(CONFIG_BCM96345)
978 + PERF->blkEnables &= ~(EMAC_CLK_EN | USB_CLK_EN | CPU_CLK_EN);
979 +#elif defined(CONFIG_BCM96348)
980 + PERF->blkEnables &= ~(EMAC_CLK_EN | USBS_CLK_EN | USBH_CLK_EN | SAR_CLK_EN);
984 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
985 +static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id)
987 +static unsigned int kerSysDyingGaspIsr(void)
990 + struct list_head *pos;
991 + CB_DGASP_LIST *tmp, *dsl = NULL;
993 + if (kerSysDyingGaspCheckPowerLoss()) {
995 + /* first to turn off everything other than dsl */
996 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
997 + tmp = list_entry(pos, CB_DGASP_LIST, list);
998 + if(strncmp(tmp->name, "dsl", 3)) {
999 + (tmp->cb_dgasp_fn)(tmp->context);
1005 + /* now send dgasp */
1007 + (dsl->cb_dgasp_fn)(dsl->context);
1009 + /* reset and shutdown system */
1010 + kerSysDyingGaspShutdown();
1012 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
1013 +return( IRQ_HANDLED );
1019 +static void __init kerSysInitDyingGaspHandler( void )
1021 + CB_DGASP_LIST *new_node;
1023 + if( g_cb_dgasp_list_head != NULL) {
1024 + printk("Error: kerSysInitDyingGaspHandler: list head is not null\n");
1027 + new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
1028 + memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
1029 + INIT_LIST_HEAD(&new_node->list);
1030 + g_cb_dgasp_list_head = new_node;
1032 +} /* kerSysInitDyingGaspHandler */
1034 +static void __exit kerSysDeinitDyingGaspHandler( void )
1036 + struct list_head *pos;
1037 + CB_DGASP_LIST *tmp;
1039 + if(g_cb_dgasp_list_head == NULL)
1042 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
1043 + tmp = list_entry(pos, CB_DGASP_LIST, list);
1048 + kfree(g_cb_dgasp_list_head);
1049 + g_cb_dgasp_list_head = NULL;
1051 +} /* kerSysDeinitDyingGaspHandler */
1053 +void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context)
1055 + CB_DGASP_LIST *new_node;
1057 + if( g_cb_dgasp_list_head == NULL) {
1058 + printk("Error: kerSysRegisterDyingGaspHandler: list head is null\n");
1062 + if( devname == NULL || cbfn == NULL ) {
1063 + printk("Error: kerSysRegisterDyingGaspHandler: register info not enough (%s,%x,%x)\n", devname, (unsigned int)cbfn, (unsigned int)context);
1067 + new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
1068 + memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
1069 + INIT_LIST_HEAD(&new_node->list);
1070 + strncpy(new_node->name, devname, IFNAMSIZ);
1071 + new_node->cb_dgasp_fn = (cb_dgasp_t)cbfn;
1072 + new_node->context = context;
1073 + list_add(&new_node->list, &g_cb_dgasp_list_head->list);
1075 + printk("dgasp: kerSysRegisterDyingGaspHandler: %s registered \n", devname);
1077 +} /* kerSysRegisterDyingGaspHandler */
1079 +void kerSysDeregisterDyingGaspHandler(char *devname)
1081 + struct list_head *pos;
1082 + CB_DGASP_LIST *tmp;
1084 + if(g_cb_dgasp_list_head == NULL) {
1085 + printk("Error: kerSysDeregisterDyingGaspHandler: list head is null\n");
1089 + if(devname == NULL) {
1090 + printk("Error: kerSysDeregisterDyingGaspHandler: devname is null\n");
1094 + printk("kerSysDeregisterDyingGaspHandler: %s is deregistering\n", devname);
1096 + list_for_each(pos, &g_cb_dgasp_list_head->list) {
1097 + tmp = list_entry(pos, CB_DGASP_LIST, list);
1098 + if(!strcmp(tmp->name, devname)) {
1101 + printk("kerSysDeregisterDyingGaspHandler: %s is deregistered\n", devname);
1105 + printk("kerSysDeregisterDyingGaspHandler: %s not (de)registered\n", devname);
1107 +} /* kerSysDeregisterDyingGaspHandler */
1109 +//EXPORT_SYMBOL(kerSysNvRamGet);
1110 +EXPORT_SYMBOL(kerSysGetMacAddress);
1111 +EXPORT_SYMBOL(kerSysReleaseMacAddress);
1112 +EXPORT_SYMBOL(kerSysGetSdramSize);
1113 +EXPORT_SYMBOL(kerSysLedCtrl);
1114 +EXPORT_SYMBOL(kerSysGetResetHold);
1115 +EXPORT_SYMBOL(kerSysLedRegisterHwHandler);
1116 +EXPORT_SYMBOL(BpGetBoardIds);
1117 +EXPORT_SYMBOL(BpGetSdramSize);
1118 +EXPORT_SYMBOL(BpGetPsiSize);
1119 +EXPORT_SYMBOL(BpGetEthernetMacInfo);
1120 +EXPORT_SYMBOL(BpGetRj11InnerOuterPairGpios);
1121 +EXPORT_SYMBOL(BpGetPressAndHoldResetGpio);
1122 +EXPORT_SYMBOL(BpGetVoipResetGpio);
1123 +EXPORT_SYMBOL(BpGetVoipIntrGpio);
1124 +EXPORT_SYMBOL(BpGetPcmciaResetGpio);
1125 +EXPORT_SYMBOL(BpGetRtsCtsUartGpios);
1126 +EXPORT_SYMBOL(BpGetAdslLedGpio);
1127 +EXPORT_SYMBOL(BpGetAdslFailLedGpio);
1128 +EXPORT_SYMBOL(BpGetWirelessLedGpio);
1129 +EXPORT_SYMBOL(BpGetUsbLedGpio);
1130 +EXPORT_SYMBOL(BpGetHpnaLedGpio);
1131 +EXPORT_SYMBOL(BpGetWanDataLedGpio);
1132 +EXPORT_SYMBOL(BpGetPppLedGpio);
1133 +EXPORT_SYMBOL(BpGetPppFailLedGpio);
1134 +EXPORT_SYMBOL(BpGetVoipLedGpio);
1135 +EXPORT_SYMBOL(BpGetWirelessExtIntr);
1136 +EXPORT_SYMBOL(BpGetAdslDyingGaspExtIntr);
1137 +EXPORT_SYMBOL(BpGetVoipExtIntr);
1138 +EXPORT_SYMBOL(BpGetHpnaExtIntr);
1139 +EXPORT_SYMBOL(BpGetHpnaChipSelect);
1140 +EXPORT_SYMBOL(BpGetVoipChipSelect);
1141 +EXPORT_SYMBOL(BpGetWirelessSesBtnGpio);
1142 +EXPORT_SYMBOL(BpGetWirelessSesExtIntr);
1143 +EXPORT_SYMBOL(BpGetWirelessSesLedGpio);
1144 +EXPORT_SYMBOL(kerSysRegisterDyingGaspHandler);
1145 +EXPORT_SYMBOL(kerSysDeregisterDyingGaspHandler);
1146 +EXPORT_SYMBOL(kerSysGetCycleCount);
1147 +EXPORT_SYMBOL(kerSysSetWdTimer);
1148 +EXPORT_SYMBOL(kerSysWakeupMonitorTask);
1150 diff -urN linux.old/arch/mips/bcm963xx/boardparms.c linux.dev/arch/mips/bcm963xx/boardparms.c
1151 --- linux.old/arch/mips/bcm963xx/boardparms.c 1970-01-01 01:00:00.000000000 +0100
1152 +++ linux.dev/arch/mips/bcm963xx/boardparms.c 2006-08-25 00:39:38.000000000 +0200
1157 + Copyright 2003 Broadcom Corp. All Rights Reserved.
1159 + This program is free software; you can distribute it and/or modify it
1160 + under the terms of the GNU General Public License (Version 2) as
1161 + published by the Free Software Foundation.
1163 + This program is distributed in the hope it will be useful, but WITHOUT
1164 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1165 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1168 + You should have received a copy of the GNU General Public License along
1169 + with this program; if not, write to the Free Software Foundation, Inc.,
1170 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
1174 +/**************************************************************************
1175 + * File Name : boardparms.c
1177 + * Description: This file contains the implementation for the BCM63xx board
1178 + * parameter access functions.
1180 + * Updates : 07/14/2003 Created.
1181 + ***************************************************************************/
1184 +#include "boardparms.h"
1188 +/* Default psi size in K bytes */
1189 +#define BP_PSI_DEFAULT_SIZE 24
1192 +typedef struct boardparameters
1194 + char szBoardId[BP_BOARD_ID_LEN]; /* board id string */
1195 + ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS];
1196 + VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP];
1197 + unsigned short usSdramSize; /* SDRAM size and type */
1198 + unsigned short usPsiSize; /* persistent storage in K bytes */
1199 + unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */
1200 + unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */
1201 + unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */
1202 + unsigned short usGpioPcmciaReset; /* GPIO pin or not defined */
1203 + unsigned short usGpioUartRts; /* GPIO pin or not defined */
1204 + unsigned short usGpioUartCts; /* GPIO pin or not defined */
1205 + unsigned short usGpioLedAdsl; /* GPIO pin or not defined */
1206 + unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */
1207 + unsigned short usGpioLedWireless; /* GPIO pin or not defined */
1208 + unsigned short usGpioLedUsb; /* GPIO pin or not defined */
1209 + unsigned short usGpioLedHpna; /* GPIO pin or not defined */
1210 + unsigned short usGpioLedWanData; /* GPIO pin or not defined */
1211 + unsigned short usGpioLedPpp; /* GPIO pin or not defined */
1212 + unsigned short usGpioLedPppFail; /* GPIO pin or not defined */
1213 + unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */
1214 + unsigned short usGpioLedBlAlarm; /* GPIO pin or not defined */
1215 + unsigned short usGpioLedBlResetCfg; /* GPIO pin or not defined */
1216 + unsigned short usGpioLedBlStop; /* GPIO pin or not defined */
1217 + unsigned short usExtIntrWireless; /* ext intr or not defined */
1218 + unsigned short usExtIntrAdslDyingGasp; /* ext intr or not defined */
1219 + unsigned short usExtIntrHpna; /* ext intr or not defined */
1220 + unsigned short usCsHpna; /* chip select not defined */
1221 + unsigned short usAntInUseWireless; /* antenna in use or not defined */
1222 + unsigned short usGpioSesBtnWireless; /* GPIO pin or not defined */
1223 + unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */
1224 + unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */
1225 +} BOARD_PARAMETERS, *PBOARD_PARAMETERS;
1228 +#if defined(_BCM96338_) || defined(CONFIG_BCM96338)
1229 +static BOARD_PARAMETERS g_bcm96338sv =
1231 + "96338SV", /* szBoardId */
1232 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1233 + 0x01, /* ucPhyAddress */
1234 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1235 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1236 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1237 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1238 + BP_NOT_DEFINED, /* usGpioPhyReset */
1239 + 0x01, /* numSwitchPorts */
1240 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1241 + BP_NOT_DEFINED}, /* usReverseMii */
1242 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1243 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1244 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1245 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1246 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1247 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1248 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1249 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1250 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1251 + BP_NOT_DEFINED, /* usGpioUartRts */
1252 + BP_NOT_DEFINED, /* usGpioUartCts */
1253 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1254 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1255 + BP_NOT_DEFINED, /* usGpioLedWireless */
1256 + BP_NOT_DEFINED, /* usGpioLedUsb */
1257 + BP_NOT_DEFINED, /* usGpioLedHpna */
1258 + BP_NOT_DEFINED, /* usGpioLedWanData */
1259 + BP_NOT_DEFINED, /* usGpioLedPpp */
1260 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1261 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1262 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1263 + BP_NOT_DEFINED, /* usGpioLedBlResetCfg */
1264 + BP_NOT_DEFINED, /* usGpioLedBlStop */
1265 + BP_NOT_DEFINED, /* usExtIntrWireless */
1266 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1267 + BP_NOT_DEFINED, /* usExtIntrHpna */
1268 + BP_NOT_DEFINED, /* usCsHpna */
1269 + BP_NOT_DEFINED, /* usAntInUseWireless */
1270 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1271 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1272 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1274 +static BOARD_PARAMETERS g_bcm96338l2m8m =
1276 + "96338L-2M-8M", /* szBoardId */
1277 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1278 + 0x01, /* ucPhyAddress */
1279 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1280 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1281 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1282 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1283 + BP_NOT_DEFINED, /* usGpioPhyReset */
1284 + 0x01, /* numSwitchPorts */
1285 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1286 + BP_NOT_DEFINED}, /* usReverseMii */
1287 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1288 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1289 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1290 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1291 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1292 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1293 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1294 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1295 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1296 + BP_NOT_DEFINED, /* usGpioUartRts */
1297 + BP_NOT_DEFINED, /* usGpioUartCts */
1298 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1299 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1300 + BP_NOT_DEFINED, /* usGpioLedWireless */
1301 + BP_NOT_DEFINED, /* usGpioLedUsb */
1302 + BP_NOT_DEFINED, /* usGpioLedHpna */
1303 + BP_GPIO_3_AL, /* usGpioLedWanData */
1304 + BP_GPIO_3_AL, /* usGpioLedPpp */
1305 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1306 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1307 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1308 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1309 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1310 + BP_NOT_DEFINED, /* usExtIntrWireless */
1311 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1312 + BP_NOT_DEFINED, /* usExtIntrHpna */
1313 + BP_NOT_DEFINED, /* usCsHpna */
1314 + BP_NOT_DEFINED, /* usAntInUseWireless */
1315 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1316 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1317 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1319 +static PBOARD_PARAMETERS g_BoardParms[] =
1320 + {&g_bcm96338sv, &g_bcm96338l2m8m, 0};
1323 +#if defined(_BCM96345_) || defined(CONFIG_BCM96345)
1324 +static BOARD_PARAMETERS g_bcm96345r =
1326 + "96345R", /* szBoardId */
1327 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1328 + 0x01, /* ucPhyAddress */
1329 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1330 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1331 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1332 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1333 + BP_NOT_DEFINED, /* usGpioPhyReset */
1334 + 0x01, /* numSwitchPorts */
1335 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1336 + BP_NOT_DEFINED}, /* usReverseMii */
1337 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1338 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1339 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1340 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1341 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1342 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1343 + BP_GPIO_12_AH, /* usGpioRj11OuterPair */
1344 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1345 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1346 + BP_NOT_DEFINED, /* usGpioUartRts */
1347 + BP_NOT_DEFINED, /* usGpioUartCts */
1348 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1349 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1350 + BP_NOT_DEFINED, /* usGpioLedWireless */
1351 + BP_NOT_DEFINED, /* usGpioLedUsb */
1352 + BP_NOT_DEFINED, /* usGpioLedHpna */
1353 + BP_GPIO_8_AH, /* usGpioLedWanData */
1354 + BP_GPIO_9_AH, /* usGpioLedPpp */
1355 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1356 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1357 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1358 + BP_GPIO_9_AH, /* usGpioLedBlResetCfg */
1359 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1360 + BP_NOT_DEFINED, /* usExtIntrWireless */
1361 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1362 + BP_NOT_DEFINED, /* usExtIntrHpna */
1363 + BP_NOT_DEFINED, /* usCsHpna */
1364 + BP_NOT_DEFINED, /* usAntInUseWireless */
1365 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1366 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1367 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1370 +static BOARD_PARAMETERS g_bcm96345gw2 =
1372 + /* A hardware jumper determines whether GPIO 13 is used for Press and Hold
1375 + "96345GW2", /* szBoardId */
1376 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1377 + 0x00, /* ucPhyAddress */
1378 + BP_GPIO_0_AH, /* usGpioPhySpiSck */
1379 + BP_GPIO_4_AH, /* usGpioPhySpiSs */
1380 + BP_GPIO_12_AH, /* usGpioPhySpiMosi */
1381 + BP_GPIO_11_AH, /* usGpioPhySpiMiso */
1382 + BP_NOT_DEFINED, /* usGpioPhyReset */
1383 + 0x04, /* numSwitchPorts */
1384 + BP_ENET_CONFIG_GPIO, /* usConfigType */
1385 + BP_ENET_REVERSE_MII}, /* usReverseMii */
1386 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1387 + {{BP_VOIP_DSP, /* ucDspType */
1388 + 0x00, /* ucDspAddress */
1389 + BP_EXT_INTR_1, /* usExtIntrVoip */
1390 + BP_GPIO_6_AH, /* usGpioVoipReset */
1391 + BP_GPIO_15_AH, /* usGpioVoipIntr */
1392 + BP_NOT_DEFINED, /* usGpioLedVoip */
1393 + BP_CS_2}, /* usCsVoip */
1394 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1395 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1396 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1397 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1398 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1399 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1400 + BP_GPIO_2_AH, /* usGpioPcmciaReset */
1401 + BP_GPIO_13_AH, /* usGpioUartRts */
1402 + BP_GPIO_9_AH, /* usGpioUartCts */
1403 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1404 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1405 + BP_NOT_DEFINED, /* usGpioLedWireless */
1406 + BP_GPIO_7_AH, /* usGpioLedUsb */
1407 + BP_NOT_DEFINED, /* usGpioLedHpna */
1408 + BP_GPIO_8_AH, /* usGpioLedWanData */
1409 + BP_NOT_DEFINED, /* usGpioLedPpp */
1410 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1411 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1412 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1413 + BP_GPIO_7_AH, /* usGpioLedBlResetCfg */
1414 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1415 + BP_EXT_INTR_2, /* usExtIntrWireless */
1416 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1417 + BP_NOT_DEFINED, /* usExtIntrHpna */
1418 + BP_NOT_DEFINED, /* usCsHpna */
1419 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1420 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1421 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1422 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1425 +static BOARD_PARAMETERS g_bcm96345gw =
1427 + "96345GW", /* szBoardId */
1428 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1429 + 0x00, /* ucPhyAddress */
1430 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1431 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1432 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1433 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1434 + BP_NOT_DEFINED, /* usGpioPhyReset */
1435 + 0x04, /* numSwitchPorts */
1436 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1437 + BP_ENET_NO_REVERSE_MII}, /* usReverseMii */
1438 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1439 + {{BP_VOIP_DSP, /* ucDspType */
1440 + 0x00, /* ucDspAddress */
1441 + BP_EXT_INTR_1, /* usExtIntrVoip */
1442 + BP_GPIO_6_AH, /* usGpioVoipReset */
1443 + BP_GPIO_15_AH, /* usGpioVoipIntr */
1444 + BP_NOT_DEFINED, /* usGpioLedVoip */
1445 + BP_CS_2}, /* usCsVoip */
1446 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1447 + BP_MEMORY_16MB_1_CHIP, /* usSdramSize */
1448 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1449 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1450 + BP_GPIO_1_AH, /* usGpioRj11OuterPair */
1451 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1452 + BP_GPIO_2_AH, /* usGpioPcmciaReset */
1453 + BP_NOT_DEFINED, /* usGpioUartRts */
1454 + BP_NOT_DEFINED, /* usGpioUartCts */
1455 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1456 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1457 + BP_GPIO_10_AH, /* usGpioLedWireless */
1458 + BP_GPIO_7_AH, /* usGpioLedUsb */
1459 + BP_NOT_DEFINED, /* usGpioLedHpna */
1460 + BP_GPIO_8_AH, /* usGpioLedWanData */
1461 + BP_NOT_DEFINED, /* usGpioLedPpp */
1462 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1463 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1464 + BP_GPIO_9_AH, /* usGpioLedBlAlarm */
1465 + BP_GPIO_10_AH, /* usGpioLedBlResetCfg */
1466 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1467 + BP_EXT_INTR_2, /* usExtIntrWireless */
1468 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1469 + BP_EXT_INTR_3, /* usExtIntrHpna */
1470 + BP_CS_1, /* usCsHpna */
1471 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1472 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1473 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1474 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1477 +static BOARD_PARAMETERS g_bcm96335r =
1479 + "96335R", /* szBoardId */
1480 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1481 + 0x01, /* ucPhyAddress */
1482 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1483 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1484 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1485 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1486 + BP_NOT_DEFINED, /* usGpioPhyReset */
1487 + 0x01, /* numSwitchPorts */
1488 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1489 + BP_NOT_DEFINED}, /* usReverseMii */
1490 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1491 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1492 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1493 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1494 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1495 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1496 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1497 + BP_GPIO_14_AH, /* usGpioPressAndHoldReset */
1498 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1499 + BP_NOT_DEFINED, /* usGpioUartRts */
1500 + BP_NOT_DEFINED, /* usGpioUartCts */
1501 + BP_GPIO_9_AH, /* usGpioLedAdsl */
1502 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1503 + BP_NOT_DEFINED, /* usGpioLedWireless */
1504 + BP_NOT_DEFINED, /* usGpioLedUsb */
1505 + BP_NOT_DEFINED, /* usGpioLedHpna */
1506 + BP_GPIO_9_AH, /* usGpioLedWanData */
1507 + BP_GPIO_8_AH, /* usGpioLedPpp */
1508 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1509 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1510 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1511 + BP_GPIO_8_AH, /* usGpioLedBlResetCfg */
1512 + BP_GPIO_9_AH, /* usGpioLedBlStop */
1513 + BP_NOT_DEFINED, /* usExtIntrWireless */
1514 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1515 + BP_NOT_DEFINED, /* usExtIntrHpna */
1516 + BP_NOT_DEFINED, /* usCsHpna */
1517 + BP_NOT_DEFINED, /* usAntInUseWireless */
1518 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1519 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1520 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1523 +static BOARD_PARAMETERS g_bcm96345r0 =
1525 + "96345R0", /* szBoardId */
1526 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1527 + 0x01, /* ucPhyAddress */
1528 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1529 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1530 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1531 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1532 + BP_NOT_DEFINED, /* usGpioPhyReset */
1533 + 0x01, /* numSwitchPorts */
1534 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1535 + BP_NOT_DEFINED}, /* usReverseMii */
1536 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1537 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1538 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1539 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1540 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1541 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1542 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1543 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1544 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1545 + BP_NOT_DEFINED, /* usGpioUartRts */
1546 + BP_NOT_DEFINED, /* usGpioUartCts */
1547 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1548 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1549 + BP_NOT_DEFINED, /* usGpioLedWireless */
1550 + BP_NOT_DEFINED, /* usGpioLedUsb */
1551 + BP_NOT_DEFINED, /* usGpioLedHpna */
1552 + BP_GPIO_9_AH, /* usGpioLedWanData */
1553 + BP_GPIO_9_AH, /* usGpioLedPpp */
1554 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1555 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1556 + BP_GPIO_9_AH, /* usGpioLedBlAlarm */
1557 + BP_GPIO_8_AH, /* usGpioLedBlResetCfg */
1558 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1559 + BP_NOT_DEFINED, /* usExtIntrWireless */
1560 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1561 + BP_NOT_DEFINED, /* usExtIntrHpna */
1562 + BP_NOT_DEFINED, /* usCsHpna */
1563 + BP_NOT_DEFINED, /* usAntInUseWireless */
1564 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1565 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1566 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1569 +static BOARD_PARAMETERS g_bcm96345rs =
1571 + "96345RS", /* szBoardId */
1572 + {{BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1573 + 0x00, /* ucPhyAddress */
1574 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1575 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1576 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1577 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1578 + BP_NOT_DEFINED, /* usGpioPhyReset */
1579 + 0x01, /* numSwitchPorts */
1580 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1581 + BP_ENET_NO_REVERSE_MII}, /* usReverseMii */
1582 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1583 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1584 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1585 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1586 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1587 + BP_GPIO_11_AH, /* usGpioRj11InnerPair */
1588 + BP_GPIO_12_AH, /* usGpioRj11OuterPair */
1589 + BP_GPIO_13_AH, /* usGpioPressAndHoldReset */
1590 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1591 + BP_NOT_DEFINED, /* usGpioUartRts */
1592 + BP_NOT_DEFINED, /* usGpioUartCts */
1593 + BP_GPIO_8_AH, /* usGpioLedAdsl */
1594 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1595 + BP_NOT_DEFINED, /* usGpioLedWireless */
1596 + BP_NOT_DEFINED, /* usGpioLedUsb */
1597 + BP_NOT_DEFINED, /* usGpioLedHpna */
1598 + BP_GPIO_8_AH, /* usGpioLedWanData */
1599 + BP_GPIO_9_AH, /* usGpioLedPpp */
1600 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1601 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1602 + BP_GPIO_10_AH, /* usGpioLedBlAlarm */
1603 + BP_GPIO_9_AH, /* usGpioLedBlResetCfg */
1604 + BP_GPIO_8_AH, /* usGpioLedBlStop */
1605 + BP_NOT_DEFINED, /* usExtIntrWireless */
1606 + BP_EXT_INTR_0, /* usExtIntrAdslDyingGasp */
1607 + BP_NOT_DEFINED, /* usExtIntrHpna */
1608 + BP_NOT_DEFINED, /* usCsHpna */
1609 + BP_NOT_DEFINED, /* usAntInUseWireless */
1610 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1611 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1612 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1615 +static PBOARD_PARAMETERS g_BoardParms[] =
1616 + {&g_bcm96345r, &g_bcm96345gw2, &g_bcm96345gw, &g_bcm96335r, &g_bcm96345r0,
1617 + &g_bcm96345rs, 0};
1620 +#if defined(_BCM96348_) || defined(CONFIG_BCM96348)
1622 +static BOARD_PARAMETERS g_bcm96348r =
1624 + "96348R", /* szBoardId */
1625 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1626 + 0x01, /* ucPhyAddress */
1627 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1628 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1629 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1630 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1631 + BP_NOT_DEFINED, /* usGpioPhyReset */
1632 + 0x01, /* numSwitchPorts */
1633 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1634 + BP_NOT_DEFINED}, /* usReverseMii */
1635 + {BP_ENET_NO_PHY}}, /* ucPhyType */
1636 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1637 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1638 + BP_MEMORY_8MB_1_CHIP, /* usSdramSize */
1639 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1640 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1641 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1642 + BP_GPIO_7_AH, /* usGpioPressAndHoldReset */
1643 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1644 + BP_NOT_DEFINED, /* usGpioUartRts */
1645 + BP_NOT_DEFINED, /* usGpioUartCts */
1646 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1647 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1648 + BP_NOT_DEFINED, /* usGpioLedWireless */
1649 + BP_NOT_DEFINED, /* usGpioLedUsb */
1650 + BP_NOT_DEFINED, /* usGpioLedHpna */
1651 + BP_GPIO_3_AL, /* usGpioLedWanData */
1652 + BP_GPIO_3_AL, /* usGpioLedPpp */
1653 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1654 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1655 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1656 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1657 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1658 + BP_NOT_DEFINED, /* usExtIntrWireless */
1659 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1660 + BP_NOT_DEFINED, /* usExtIntrHpna */
1661 + BP_NOT_DEFINED, /* usCsHpna */
1662 + BP_NOT_DEFINED, /* usAntInUseWireless */
1663 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1664 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1665 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1668 +static BOARD_PARAMETERS g_bcm96348lv =
1670 + "96348LV", /* szBoardId */
1671 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1672 + 0x01, /* ucPhyAddress */
1673 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1674 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1675 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1676 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1677 + BP_NOT_DEFINED, /* usGpioPhyReset */
1678 + 0x01, /* numSwitchPorts */
1679 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1680 + BP_NOT_DEFINED}, /* usReverseMii */
1681 + {BP_ENET_EXTERNAL_PHY, /* ucPhyType */
1682 + 0x02, /* ucPhyAddress */
1683 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1684 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1685 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1686 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1687 + BP_GPIO_5_AL, /* usGpioPhyReset */
1688 + 0x01, /* numSwitchPorts */
1689 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1690 + BP_NOT_DEFINED}}, /* usReverseMii */
1691 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1692 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1693 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1694 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1695 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1696 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1697 + BP_GPIO_7_AH, /* usGpioPressAndHoldReset */
1698 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1699 + BP_NOT_DEFINED, /* usGpioUartRts */
1700 + BP_NOT_DEFINED, /* usGpioUartCts */
1701 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1702 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1703 + BP_NOT_DEFINED, /* usGpioLedWireless */
1704 + BP_NOT_DEFINED, /* usGpioLedUsb */
1705 + BP_NOT_DEFINED, /* usGpioLedHpna */
1706 + BP_GPIO_3_AL, /* usGpioLedWanData */
1707 + BP_GPIO_3_AL, /* usGpioLedPpp */
1708 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1709 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1710 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1711 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1712 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1713 + BP_NOT_DEFINED, /* usExtIntrWireless */
1714 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
1715 + BP_NOT_DEFINED, /* usExtIntrHpna */
1716 + BP_NOT_DEFINED, /* usCsHpna */
1717 + BP_NOT_DEFINED, /* usAntInUseWireless */
1718 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1719 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1720 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1723 +static BOARD_PARAMETERS g_bcm96348gw =
1725 + "96348GW", /* szBoardId */
1726 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1727 + 0x01, /* ucPhyAddress */
1728 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1729 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1730 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1731 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1732 + BP_NOT_DEFINED, /* usGpioPhyReset */
1733 + 0x01, /* numSwitchPorts */
1734 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1735 + BP_NOT_DEFINED}, /* usReverseMii */
1736 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1737 + 0x00, /* ucPhyAddress */
1738 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1739 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1740 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1741 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1742 + BP_NOT_DEFINED, /* usGpioPhyReset */
1743 + 0x03, /* numSwitchPorts */
1744 + BP_ENET_CONFIG_SPI_SSB_0, /* usConfigType */
1745 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1746 + {{BP_VOIP_DSP, /* ucDspType */
1747 + 0x00, /* ucDspAddress */
1748 + BP_EXT_INTR_2, /* usExtIntrVoip */
1749 + BP_GPIO_6_AH, /* usGpioVoipReset */
1750 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1751 + BP_NOT_DEFINED, /* usGpioLedVoip */
1752 + BP_CS_2}, /* usCsVoip */
1753 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1754 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1755 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1756 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1757 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1758 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1759 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1760 + BP_NOT_DEFINED, /* usGpioUartRts */
1761 + BP_NOT_DEFINED, /* usGpioUartCts */
1762 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1763 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1764 + BP_NOT_DEFINED, /* usGpioLedWireless */
1765 + BP_NOT_DEFINED, /* usGpioLedUsb */
1766 + BP_NOT_DEFINED, /* usGpioLedHpna */
1767 + BP_GPIO_3_AL, /* usGpioLedWanData */
1768 + BP_GPIO_3_AL, /* usGpioLedPpp */
1769 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1770 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1771 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1772 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1773 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1774 + BP_NOT_DEFINED, /* usExtIntrWireless */
1775 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1776 + BP_NOT_DEFINED, /* usExtIntrHpna */
1777 + BP_NOT_DEFINED, /* usCsHpna */
1778 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1779 + BP_NOT_DEFINED, /* BP_GPIO_35_AH, */ /* usGpioSesBtnWireless */
1780 + BP_NOT_DEFINED, /* BP_EXT_INTR_3, */ /* usExtIntrSesBtnWireless */
1781 + BP_NOT_DEFINED /* BP_GPIO_0_AL */ /* usGpioLedSesWireless */
1785 +static BOARD_PARAMETERS g_bcm96348gw_10 =
1787 + "96348GW-10", /* szBoardId */
1788 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1789 + 0x01, /* ucPhyAddress */
1790 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1791 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1792 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1793 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1794 + BP_NOT_DEFINED, /* usGpioPhyReset */
1795 + 0x01, /* numSwitchPorts */
1796 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1797 + BP_NOT_DEFINED}, /* usReverseMii */
1798 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1799 + 0x00, /* ucPhyAddress */
1800 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1801 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1802 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1803 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1804 + BP_NOT_DEFINED, /* usGpioPhyReset */
1805 + 0x03, /* numSwitchPorts */
1806 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1807 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1808 + {{BP_VOIP_DSP, /* ucDspType */
1809 + 0x00, /* ucDspAddress */
1810 + BP_EXT_INTR_2, /* usExtIntrVoip */
1811 + BP_GPIO_6_AH, /* usGpioVoipReset */
1812 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1813 + BP_NOT_DEFINED, /* usGpioLedVoip */
1814 + BP_CS_2}, /* usCsVoip */
1815 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1816 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1817 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1818 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1819 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1820 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1821 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1822 + BP_NOT_DEFINED, /* usGpioUartRts */
1823 + BP_NOT_DEFINED, /* usGpioUartCts */
1824 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1825 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1826 + BP_NOT_DEFINED, /* usGpioLedWireless */
1827 + BP_NOT_DEFINED, /* usGpioLedUsb */
1828 + BP_NOT_DEFINED, /* usGpioLedHpna */
1829 + BP_GPIO_3_AL, /* usGpioLedWanData */
1830 + BP_GPIO_3_AL, /* usGpioLedPpp */
1831 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1832 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1833 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1834 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1835 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1836 + BP_NOT_DEFINED, /* usExtIntrWireless */
1837 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1838 + BP_NOT_DEFINED, /* usExtIntrHpna */
1839 + BP_NOT_DEFINED, /* usCsHpna */
1840 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
1841 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1842 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1843 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1846 +static BOARD_PARAMETERS g_bcm96348gw_11 =
1848 + "96348GW-11", /* szBoardId */
1849 + {{BP_ENET_NO_PHY}, /* ucPhyType */
1850 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1851 + 0x00, /* ucPhyAddress */
1852 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1853 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1854 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1855 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1856 + BP_NOT_DEFINED, /* usGpioPhyReset */
1857 + 0x04, /* numSwitchPorts */
1858 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1859 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1860 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1861 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1862 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1863 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1864 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1865 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1866 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1867 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1868 + BP_NOT_DEFINED, /* usGpioUartRts */
1869 + BP_NOT_DEFINED, /* usGpioUartCts */
1870 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1871 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1872 + BP_NOT_DEFINED, /* usGpioLedWireless */
1873 + BP_NOT_DEFINED, /* usGpioLedUsb */
1874 + BP_NOT_DEFINED, /* usGpioLedHpna */
1875 + BP_GPIO_3_AL, /* usGpioLedWanData */
1876 + BP_GPIO_3_AL, /* usGpioLedPpp */
1877 + BP_GPIO_4_AL, /* usGpioLedPppFail */
1878 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
1879 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1880 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
1881 + BP_GPIO_1_AL, /* usGpioLedBlStop */
1882 + BP_NOT_DEFINED, /* usExtIntrWireless */
1883 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1884 + BP_NOT_DEFINED, /* usExtIntrHpna */
1885 + BP_NOT_DEFINED, /* usCsHpna */
1886 + BP_NOT_DEFINED, /* usAntInUseWireless */
1887 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1888 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1889 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1892 +static BOARD_PARAMETERS g_bcm96348sv =
1894 + "96348SV", /* szBoardId */
1895 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1896 + 0x01, /* ucPhyAddress */
1897 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1898 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1899 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1900 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1901 + BP_NOT_DEFINED, /* usGpioPhyReset */
1902 + 0x01, /* numSwitchPorts */
1903 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1904 + BP_NOT_DEFINED}, /* usReverseMii */
1905 + {BP_ENET_EXTERNAL_PHY, /* ucPhyType */
1906 + 0x1f, /* ucPhyAddress */
1907 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1908 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1909 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1910 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1911 + BP_NOT_DEFINED, /* usGpioPhyReset */
1912 + 0x01, /* numSwitchPorts */
1913 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1914 + BP_NOT_DEFINED}}, /* usReverseMii */
1915 + {{BP_VOIP_NO_DSP}, /* ucDspType */
1916 + {BP_VOIP_NO_DSP}}, /* ucDspType */
1917 + BP_MEMORY_32MB_2_CHIP, /* usSdramSize */
1918 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1919 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1920 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1921 + BP_NOT_DEFINED, /* usGpioPressAndHoldReset */
1922 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1923 + BP_NOT_DEFINED, /* usGpioUartRts */
1924 + BP_NOT_DEFINED, /* usGpioUartCts */
1925 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1926 + BP_NOT_DEFINED, /* usGpioLedAdslFail */
1927 + BP_NOT_DEFINED, /* usGpioLedWireless */
1928 + BP_NOT_DEFINED, /* usGpioLedUsb */
1929 + BP_NOT_DEFINED, /* usGpioLedHpna */
1930 + BP_NOT_DEFINED, /* usGpioLedWanData */
1931 + BP_NOT_DEFINED, /* usGpioLedPpp */
1932 + BP_NOT_DEFINED, /* usGpioLedPppFail */
1933 + BP_NOT_DEFINED, /* usGpioLedBlPowerOn */
1934 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
1935 + BP_NOT_DEFINED, /* usGpioLedBlResetCfg */
1936 + BP_NOT_DEFINED, /* usGpioLedBlStop */
1937 + BP_NOT_DEFINED, /* usExtIntrWireless */
1938 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
1939 + BP_NOT_DEFINED, /* usExtIntrHpna */
1940 + BP_NOT_DEFINED, /* usCsHpna */
1941 + BP_NOT_DEFINED, /* usAntInUseWireless */
1942 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
1943 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
1944 + BP_NOT_DEFINED /* usGpioLedSesWireless */
1948 +static BOARD_PARAMETERS g_bcm96348gw_dualDsp =
1950 + "96348GW-DualDSP", /* szBoardId */
1951 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
1952 + 0x01, /* ucPhyAddress */
1953 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1954 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1955 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1956 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1957 + BP_NOT_DEFINED, /* usGpioPhyReset */
1958 + 0x01, /* numSwitchPorts */
1959 + BP_ENET_CONFIG_MDIO, /* usConfigType */
1960 + BP_NOT_DEFINED}, /* usReverseMii */
1961 + {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */
1962 + 0x00, /* ucPhyAddress */
1963 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
1964 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
1965 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
1966 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
1967 + BP_NOT_DEFINED, /* usGpioPhyReset */
1968 + 0x03, /* numSwitchPorts */
1969 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
1970 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
1971 + {{BP_VOIP_DSP, /* ucDspType */
1972 + 0x00, /* ucDspAddress */
1973 + BP_EXT_INTR_2, /* usExtIntrVoip */
1974 + BP_UNEQUIPPED, /* usGpioVoipReset */
1975 + BP_GPIO_34_AH, /* usGpioVoipIntr */
1976 + BP_NOT_DEFINED, /* usGpioLedVoip */
1977 + BP_CS_2}, /* usCsVoip */
1978 + {BP_VOIP_DSP, /* ucDspType */
1979 + 0x01, /* ucDspAddress */
1980 + BP_EXT_INTR_3, /* usExtIntrVoip */
1981 + BP_UNEQUIPPED , /* usGpioVoipReset */
1982 + BP_GPIO_35_AH, /* usGpioVoipIntr */
1983 + BP_NOT_DEFINED, /* usGpioLedVoip */
1984 + BP_CS_3}}, /* usCsVoip */
1985 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
1986 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
1987 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
1988 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
1989 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
1990 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
1991 + BP_NOT_DEFINED, /* usGpioUartRts */
1992 + BP_NOT_DEFINED, /* usGpioUartCts */
1993 + BP_NOT_DEFINED, /* usGpioLedAdsl */
1994 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
1995 + BP_NOT_DEFINED, /* usGpioLedWireless */
1996 + BP_NOT_DEFINED, /* usGpioLedUsb */
1997 + BP_NOT_DEFINED, /* usGpioLedHpna */
1998 + BP_GPIO_3_AL, /* usGpioLedWanData */
1999 + BP_GPIO_3_AL, /* usGpioLedPpp */
2000 + BP_GPIO_4_AL, /* usGpioLedPppFail */
2001 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
2002 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
2003 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
2004 + BP_GPIO_1_AL, /* usGpioLedBlStop */
2005 + BP_NOT_DEFINED, /* usExtIntrWireless */
2006 + BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */
2007 + BP_NOT_DEFINED, /* usExtIntrHpna */
2008 + BP_NOT_DEFINED, /* usCsHpna */
2009 + BP_WLAN_ANT_MAIN, /* usAntInUseWireless */
2010 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
2011 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
2012 + BP_NOT_DEFINED /* usGpioLedSesWireless */
2016 +static BOARD_PARAMETERS g_bcmCustom_01 =
2018 + "BCMCUST_01", /* szBoardId */
2019 + {{BP_ENET_INTERNAL_PHY, /* ucPhyType */
2020 + 0x01, /* ucPhyAddress */
2021 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
2022 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
2023 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
2024 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
2025 + BP_NOT_DEFINED, /* usGpioPhyReset */
2026 + 0x01, /* numSwitchPorts */
2027 + BP_ENET_CONFIG_MDIO, /* usConfigType */
2028 + BP_NOT_DEFINED}, /* usReverseMii */
2029 + {BP_ENET_NO_PHY, /* ucPhyType */
2030 + 0x00, /* ucPhyAddress */
2031 + BP_NOT_DEFINED, /* usGpioPhySpiSck */
2032 + BP_NOT_DEFINED, /* usGpioPhySpiSs */
2033 + BP_NOT_DEFINED, /* usGpioPhySpiMosi */
2034 + BP_NOT_DEFINED, /* usGpioPhySpiMiso */
2035 + BP_NOT_DEFINED, /* usGpioPhyReset */
2036 + 0x01, /* numSwitchPorts */
2037 + BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */
2038 + BP_ENET_REVERSE_MII}}, /* usReverseMii */
2039 + {{BP_VOIP_DSP, /* ucDspType */
2040 + 0x00, /* ucDspAddress */
2041 + BP_EXT_INTR_2, /* usExtIntrVoip */
2042 + BP_GPIO_36_AH, /* usGpioVoipReset */
2043 + BP_GPIO_34_AL, /* usGpioVoipIntr */
2044 + BP_NOT_DEFINED, /* usGpioLedVoip */
2045 + BP_CS_2}, /* usCsVoip */
2046 + {BP_VOIP_NO_DSP}}, /* ucDspType */
2047 + BP_MEMORY_16MB_2_CHIP, /* usSdramSize */
2048 + BP_PSI_DEFAULT_SIZE, /* usPsiSize */
2049 + BP_NOT_DEFINED, /* usGpioRj11InnerPair */
2050 + BP_NOT_DEFINED, /* usGpioRj11OuterPair */
2051 + BP_GPIO_33_AL, /* usGpioPressAndHoldReset */
2052 + BP_NOT_DEFINED, /* usGpioPcmciaReset */
2053 + BP_NOT_DEFINED, /* usGpioUartRts */
2054 + BP_NOT_DEFINED, /* usGpioUartCts */
2055 + BP_NOT_DEFINED, /* usGpioLedAdsl */
2056 + BP_GPIO_2_AL, /* usGpioLedAdslFail */
2057 + BP_NOT_DEFINED, /* usGpioLedWireless */
2058 + BP_NOT_DEFINED, /* usGpioLedUsb */
2059 + BP_NOT_DEFINED, /* usGpioLedHpna */
2060 + BP_GPIO_3_AL, /* usGpioLedWanData */
2061 + BP_GPIO_3_AL, /* usGpioLedPpp */
2062 + BP_GPIO_4_AL, /* usGpioLedPppFail */
2063 + BP_GPIO_0_AL, /* usGpioLedBlPowerOn */
2064 + BP_NOT_DEFINED, /* usGpioLedBlAlarm */
2065 + BP_GPIO_3_AL, /* usGpioLedBlResetCfg */
2066 + BP_GPIO_1_AL, /* usGpioLedBlStop */
2067 + BP_NOT_DEFINED, /* usExtIntrWireless */
2068 + BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */
2069 + BP_NOT_DEFINED, /* usExtIntrHpna */
2070 + BP_NOT_DEFINED, /* usCsHpna */
2071 + BP_NOT_DEFINED, /* usAntInUseWireless */
2072 + BP_NOT_DEFINED, /* usGpioSesBtnWireless */
2073 + BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */
2074 + BP_NOT_DEFINED /* usGpioLedSesWireless */
2077 +static PBOARD_PARAMETERS g_BoardParms[] =
2078 + {&g_bcm96348r, &g_bcm96348lv, &g_bcm96348gw, &g_bcm96348gw_10,
2079 + &g_bcm96348gw_11, &g_bcm96348sv, &g_bcm96348gw_dualDsp,
2080 + &g_bcmCustom_01, 0};
2083 +static PBOARD_PARAMETERS g_pCurrentBp = 0;
2085 +/**************************************************************************
2088 + * Description: String compare for this file so it does not depend on an OS.
2089 + * (Linux kernel and CFE share this source file.)
2091 + * Parameters : [IN] dest - destination string
2092 + * [IN] src - source string
2094 + * Returns : -1 - dest < src, 1 - dest > src, 0 dest == src
2095 + ***************************************************************************/
2096 +static int bpstrcmp(const char *dest,const char *src);
2097 +static int bpstrcmp(const char *dest,const char *src)
2099 + while (*src && *dest)
2101 + if (*dest < *src) return -1;
2102 + if (*dest > *src) return 1;
2107 + if (*dest && !*src) return 1;
2108 + if (!*dest && *src) return -1;
2112 +/**************************************************************************
2113 + * Name : BpGetVoipDspConfig
2115 + * Description: Gets the DSP configuration from the board parameter
2116 + * structure for a given DSP index.
2118 + * Parameters : [IN] dspNum - DSP index (number)
2120 + * Returns : Pointer to DSP configuration block if found/valid, NULL
2122 + ***************************************************************************/
2123 +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum );
2124 +VOIP_DSP_INFO *BpGetVoipDspConfig( unsigned char dspNum )
2126 + VOIP_DSP_INFO *pDspConfig = 0;
2129 + if( g_pCurrentBp )
2131 + for( i = 0 ; i < BP_MAX_VOIP_DSP ; i++ )
2133 + if( g_pCurrentBp->VoIPDspInfo[i].ucDspType != BP_VOIP_NO_DSP &&
2134 + g_pCurrentBp->VoIPDspInfo[i].ucDspAddress == dspNum )
2136 + pDspConfig = &g_pCurrentBp->VoIPDspInfo[i];
2142 + return pDspConfig;
2146 +/**************************************************************************
2147 + * Name : BpSetBoardId
2149 + * Description: This function find the BOARD_PARAMETERS structure for the
2150 + * specified board id string and assigns it to a global, static
2153 + * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
2155 + * Returns : BP_SUCCESS - Success, value is returned.
2156 + * BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
2157 + * have a board parameters configuration record.
2158 + ***************************************************************************/
2159 +int BpSetBoardId( char *pszBoardId )
2161 + int nRet = BP_BOARD_ID_NOT_FOUND;
2162 + PBOARD_PARAMETERS *ppBp;
2164 + for( ppBp = g_BoardParms; *ppBp; ppBp++ )
2166 + if( !bpstrcmp((*ppBp)->szBoardId, pszBoardId) )
2168 + g_pCurrentBp = *ppBp;
2169 + nRet = BP_SUCCESS;
2175 +} /* BpSetBoardId */
2177 +/**************************************************************************
2178 + * Name : BpGetBoardIds
2180 + * Description: This function returns all of the supported board id strings.
2182 + * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
2183 + * strings are returned in. Each id starts at BP_BOARD_ID_LEN
2185 + * [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
2186 + * were allocated in pszBoardIds.
2188 + * Returns : Number of board id strings returned.
2189 + ***************************************************************************/
2190 +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize )
2192 + PBOARD_PARAMETERS *ppBp;
2197 + for( i = 0, ppBp = g_BoardParms; *ppBp && nBoardIdsSize;
2198 + i++, ppBp++, nBoardIdsSize--, pszBoardIds += BP_BOARD_ID_LEN )
2200 + dest = pszBoardIds;
2201 + src = (*ppBp)->szBoardId;
2208 +} /* BpGetBoardIds */
2210 +/**************************************************************************
2211 + * Name : BpGetEthernetMacInfo
2213 + * Description: This function returns all of the supported board id strings.
2215 + * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
2217 + * [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
2218 + * are pointed to by pEnetInfos.
2220 + * Returns : BP_SUCCESS - Success, value is returned.
2221 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2222 + ***************************************************************************/
2223 +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos )
2227 + if( g_pCurrentBp )
2229 + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
2231 + if( i < BP_MAX_ENET_MACS )
2233 + unsigned char *src = (unsigned char *)
2234 + &g_pCurrentBp->EnetMacInfos[i];
2235 + unsigned char *dest = (unsigned char *) pEnetInfos;
2236 + int len = sizeof(ETHERNET_MAC_INFO);
2241 + pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
2244 + nRet = BP_SUCCESS;
2248 + for( i = 0; i < nNumEnetInfos; i++, pEnetInfos++ )
2249 + pEnetInfos->ucPhyType = BP_ENET_NO_PHY;
2251 + nRet = BP_BOARD_ID_NOT_SET;
2255 +} /* BpGetEthernetMacInfo */
2257 +/**************************************************************************
2258 + * Name : BpGetSdramSize
2260 + * Description: This function returns a constant that describees the board's
2261 + * SDRAM type and size.
2263 + * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
2266 + * Returns : BP_SUCCESS - Success, value is returned.
2267 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2268 + ***************************************************************************/
2269 +int BpGetSdramSize( unsigned long *pulSdramSize )
2273 + if( g_pCurrentBp )
2275 + *pulSdramSize = g_pCurrentBp->usSdramSize;
2276 + nRet = BP_SUCCESS;
2280 + *pulSdramSize = BP_NOT_DEFINED;
2281 + nRet = BP_BOARD_ID_NOT_SET;
2285 +} /* BpGetSdramSize */
2287 +/**************************************************************************
2288 + * Name : BpGetPsiSize
2290 + * Description: This function returns the persistent storage size in K bytes.
2292 + * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
2293 + * storage size is returned in.
2295 + * Returns : BP_SUCCESS - Success, value is returned.
2296 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2297 + ***************************************************************************/
2298 +int BpGetPsiSize( unsigned long *pulPsiSize )
2302 + if( g_pCurrentBp )
2304 + *pulPsiSize = g_pCurrentBp->usPsiSize;
2305 + nRet = BP_SUCCESS;
2309 + *pulPsiSize = BP_NOT_DEFINED;
2310 + nRet = BP_BOARD_ID_NOT_SET;
2314 +} /* BpGetPsiSize */
2316 +/**************************************************************************
2317 + * Name : BpGetRj11InnerOuterPairGpios
2319 + * Description: This function returns the GPIO pin assignments for changing
2320 + * between the RJ11 inner pair and RJ11 outer pair.
2322 + * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
2323 + * GPIO pin is returned in.
2324 + * [OUT] pusOuter - Address of short word that the RJ11 outer pair
2325 + * GPIO pin is returned in.
2327 + * Returns : BP_SUCCESS - Success, values are returned.
2328 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2329 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2331 + ***************************************************************************/
2332 +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
2333 + unsigned short *pusOuter )
2337 + if( g_pCurrentBp )
2339 + *pusInner = g_pCurrentBp->usGpioRj11InnerPair;
2340 + *pusOuter = g_pCurrentBp->usGpioRj11OuterPair;
2342 + if( g_pCurrentBp->usGpioRj11InnerPair != BP_NOT_DEFINED &&
2343 + g_pCurrentBp->usGpioRj11OuterPair != BP_NOT_DEFINED )
2345 + nRet = BP_SUCCESS;
2349 + nRet = BP_VALUE_NOT_DEFINED;
2354 + *pusInner = *pusOuter = BP_NOT_DEFINED;
2355 + nRet = BP_BOARD_ID_NOT_SET;
2359 +} /* BpGetRj11InnerOuterPairGpios */
2361 +/**************************************************************************
2362 + * Name : BpGetPressAndHoldResetGpio
2364 + * Description: This function returns the GPIO pin assignment for the press
2365 + * and hold reset button.
2367 + * Parameters : [OUT] pusValue - Address of short word that the press and hold
2368 + * reset button GPIO pin is returned in.
2370 + * Returns : BP_SUCCESS - Success, value is returned.
2371 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2372 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2374 + ***************************************************************************/
2375 +int BpGetPressAndHoldResetGpio( unsigned short *pusValue )
2379 + if( g_pCurrentBp )
2381 + *pusValue = g_pCurrentBp->usGpioPressAndHoldReset;
2383 + if( g_pCurrentBp->usGpioPressAndHoldReset != BP_NOT_DEFINED )
2385 + nRet = BP_SUCCESS;
2389 + nRet = BP_VALUE_NOT_DEFINED;
2394 + *pusValue = BP_NOT_DEFINED;
2395 + nRet = BP_BOARD_ID_NOT_SET;
2399 +} /* BpGetPressAndHoldResetGpio */
2401 +/**************************************************************************
2402 + * Name : BpGetVoipResetGpio
2404 + * Description: This function returns the GPIO pin assignment for the VOIP
2405 + * Reset operation.
2407 + * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
2408 + * GPIO pin is returned in.
2409 + * [IN] dspNum - Address of the DSP to query.
2411 + * Returns : BP_SUCCESS - Success, value is returned.
2412 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2413 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2415 + ***************************************************************************/
2416 +int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue )
2420 + if( g_pCurrentBp )
2422 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2426 + *pusValue = pDspInfo->usGpioVoipReset;
2428 + if( *pusValue != BP_NOT_DEFINED ||
2429 + *pusValue == BP_UNEQUIPPED )
2431 + nRet = BP_SUCCESS;
2435 + nRet = BP_VALUE_NOT_DEFINED;
2440 + *pusValue = BP_NOT_DEFINED;
2441 + nRet = BP_BOARD_ID_NOT_FOUND;
2446 + *pusValue = BP_NOT_DEFINED;
2447 + nRet = BP_BOARD_ID_NOT_SET;
2451 +} /* BpGetVoipResetGpio */
2453 +/**************************************************************************
2454 + * Name : BpGetVoipIntrGpio
2456 + * Description: This function returns the GPIO pin assignment for VoIP interrupt.
2458 + * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
2459 + * GPIO pin is returned in.
2460 + * [IN] dspNum - Address of the DSP to query.
2462 + * Returns : BP_SUCCESS - Success, value is returned.
2463 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2464 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2466 + ***************************************************************************/
2467 +int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue )
2471 + if( g_pCurrentBp )
2473 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
2477 + *pusValue = pDspInfo->usGpioVoipIntr;
2479 + if( *pusValue != BP_NOT_DEFINED )
2481 + nRet = BP_SUCCESS;
2485 + nRet = BP_VALUE_NOT_DEFINED;
2490 + *pusValue = BP_NOT_DEFINED;
2491 + nRet = BP_BOARD_ID_NOT_FOUND;
2496 + *pusValue = BP_NOT_DEFINED;
2497 + nRet = BP_BOARD_ID_NOT_SET;
2501 +} /* BpGetVoipIntrGpio */
2503 +/**************************************************************************
2504 + * Name : BpGetPcmciaResetGpio
2506 + * Description: This function returns the GPIO pin assignment for the PCMCIA
2507 + * Reset operation.
2509 + * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
2510 + * GPIO pin is returned in.
2512 + * Returns : BP_SUCCESS - Success, value is returned.
2513 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2514 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2516 + ***************************************************************************/
2517 +int BpGetPcmciaResetGpio( unsigned short *pusValue )
2521 + if( g_pCurrentBp )
2523 + *pusValue = g_pCurrentBp->usGpioPcmciaReset;
2525 + if( g_pCurrentBp->usGpioPcmciaReset != BP_NOT_DEFINED )
2527 + nRet = BP_SUCCESS;
2531 + nRet = BP_VALUE_NOT_DEFINED;
2536 + *pusValue = BP_NOT_DEFINED;
2537 + nRet = BP_BOARD_ID_NOT_SET;
2541 +} /* BpGetPcmciaResetGpio */
2543 +/**************************************************************************
2544 + * Name : BpGetUartRtsCtsGpios
2546 + * Description: This function returns the GPIO pin assignments for RTS and CTS
2549 + * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
2550 + * pin is returned in.
2551 + * [OUT] pusCts - Address of short word that the UART CTS GPIO
2552 + * pin is returned in.
2554 + * Returns : BP_SUCCESS - Success, values are returned.
2555 + * BP_BOARD_ID_NOT_SET - Error, board id input string does not
2556 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2558 + ***************************************************************************/
2559 +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts )
2563 + if( g_pCurrentBp )
2565 + *pusRts = g_pCurrentBp->usGpioUartRts;
2566 + *pusCts = g_pCurrentBp->usGpioUartCts;
2568 + if( g_pCurrentBp->usGpioUartRts != BP_NOT_DEFINED &&
2569 + g_pCurrentBp->usGpioUartCts != BP_NOT_DEFINED )
2571 + nRet = BP_SUCCESS;
2575 + nRet = BP_VALUE_NOT_DEFINED;
2580 + *pusRts = *pusCts = BP_NOT_DEFINED;
2581 + nRet = BP_BOARD_ID_NOT_SET;
2585 +} /* BpGetUartRtsCtsGpios */
2587 +/**************************************************************************
2588 + * Name : BpGetAdslLedGpio
2590 + * Description: This function returns the GPIO pin assignment for the ADSL
2593 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
2594 + * GPIO pin is returned in.
2596 + * Returns : BP_SUCCESS - Success, value is returned.
2597 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2598 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2600 + ***************************************************************************/
2601 +int BpGetAdslLedGpio( unsigned short *pusValue )
2605 + if( g_pCurrentBp )
2607 + *pusValue = g_pCurrentBp->usGpioLedAdsl;
2609 + if( g_pCurrentBp->usGpioLedAdsl != BP_NOT_DEFINED )
2611 + nRet = BP_SUCCESS;
2615 + nRet = BP_VALUE_NOT_DEFINED;
2620 + *pusValue = BP_NOT_DEFINED;
2621 + nRet = BP_BOARD_ID_NOT_SET;
2625 +} /* BpGetAdslLedGpio */
2627 +/**************************************************************************
2628 + * Name : BpGetAdslFailLedGpio
2630 + * Description: This function returns the GPIO pin assignment for the ADSL
2631 + * LED that is used when there is a DSL connection failure.
2633 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
2634 + * GPIO pin is returned in.
2636 + * Returns : BP_SUCCESS - Success, value is returned.
2637 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2638 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2640 + ***************************************************************************/
2641 +int BpGetAdslFailLedGpio( unsigned short *pusValue )
2645 + if( g_pCurrentBp )
2647 + *pusValue = g_pCurrentBp->usGpioLedAdslFail;
2649 + if( g_pCurrentBp->usGpioLedAdslFail != BP_NOT_DEFINED )
2651 + nRet = BP_SUCCESS;
2655 + nRet = BP_VALUE_NOT_DEFINED;
2660 + *pusValue = BP_NOT_DEFINED;
2661 + nRet = BP_BOARD_ID_NOT_SET;
2665 +} /* BpGetAdslFailLedGpio */
2667 +/**************************************************************************
2668 + * Name : BpGetWirelessLedGpio
2670 + * Description: This function returns the GPIO pin assignment for the Wireless
2673 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
2674 + * GPIO pin is returned in.
2676 + * Returns : BP_SUCCESS - Success, value is returned.
2677 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2678 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2680 + ***************************************************************************/
2681 +int BpGetWirelessLedGpio( unsigned short *pusValue )
2685 + if( g_pCurrentBp )
2687 + *pusValue = g_pCurrentBp->usGpioLedWireless;
2689 + if( g_pCurrentBp->usGpioLedWireless != BP_NOT_DEFINED )
2691 + nRet = BP_SUCCESS;
2695 + nRet = BP_VALUE_NOT_DEFINED;
2700 + *pusValue = BP_NOT_DEFINED;
2701 + nRet = BP_BOARD_ID_NOT_SET;
2705 +} /* BpGetWirelessLedGpio */
2707 +/**************************************************************************
2708 + * Name : BpGetWirelessAntInUse
2710 + * Description: This function returns the antennas in use for wireless
2712 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
2715 + * Returns : BP_SUCCESS - Success, value is returned.
2716 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2717 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2719 + ***************************************************************************/
2720 +int BpGetWirelessAntInUse( unsigned short *pusValue )
2724 + if( g_pCurrentBp )
2726 + *pusValue = g_pCurrentBp->usAntInUseWireless;
2728 + if( g_pCurrentBp->usAntInUseWireless != BP_NOT_DEFINED )
2730 + nRet = BP_SUCCESS;
2734 + nRet = BP_VALUE_NOT_DEFINED;
2739 + *pusValue = BP_NOT_DEFINED;
2740 + nRet = BP_BOARD_ID_NOT_SET;
2744 +} /* BpGetWirelessAntInUse */
2746 +/**************************************************************************
2747 + * Name : BpGetWirelessSesBtnGpio
2749 + * Description: This function returns the GPIO pin assignment for the Wireless
2752 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
2753 + * GPIO pin is returned in.
2755 + * Returns : BP_SUCCESS - Success, value is returned.
2756 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2757 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2759 + ***************************************************************************/
2760 +int BpGetWirelessSesBtnGpio( unsigned short *pusValue )
2764 + if( g_pCurrentBp )
2766 + *pusValue = g_pCurrentBp->usGpioSesBtnWireless;
2768 + if( g_pCurrentBp->usGpioSesBtnWireless != BP_NOT_DEFINED )
2770 + nRet = BP_SUCCESS;
2774 + nRet = BP_VALUE_NOT_DEFINED;
2779 + *pusValue = BP_NOT_DEFINED;
2780 + nRet = BP_BOARD_ID_NOT_SET;
2784 +} /* BpGetWirelessSesBtnGpio */
2786 +/**************************************************************************
2787 + * Name : BpGetWirelessSesExtIntr
2789 + * Description: This function returns the external interrupt number for the
2790 + * Wireless Ses Button.
2792 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
2793 + * external interrup is returned in.
2795 + * Returns : BP_SUCCESS - Success, value is returned.
2796 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2797 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2799 + ***************************************************************************/
2800 +int BpGetWirelessSesExtIntr( unsigned short *pusValue )
2804 + if( g_pCurrentBp )
2806 + *pusValue = g_pCurrentBp->usExtIntrSesBtnWireless;
2808 + if( g_pCurrentBp->usExtIntrSesBtnWireless != BP_NOT_DEFINED )
2810 + nRet = BP_SUCCESS;
2814 + nRet = BP_VALUE_NOT_DEFINED;
2819 + *pusValue = BP_NOT_DEFINED;
2820 + nRet = BP_BOARD_ID_NOT_SET;
2825 +} /* BpGetWirelessSesExtIntr */
2827 +/**************************************************************************
2828 + * Name : BpGetWirelessSesLedGpio
2830 + * Description: This function returns the GPIO pin assignment for the Wireless
2833 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
2834 + * Led GPIO pin is returned in.
2836 + * Returns : BP_SUCCESS - Success, value is returned.
2837 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2838 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2840 + ***************************************************************************/
2841 +int BpGetWirelessSesLedGpio( unsigned short *pusValue )
2845 + if( g_pCurrentBp )
2847 + *pusValue = g_pCurrentBp->usGpioLedSesWireless;
2849 + if( g_pCurrentBp->usGpioLedSesWireless != BP_NOT_DEFINED )
2851 + nRet = BP_SUCCESS;
2855 + nRet = BP_VALUE_NOT_DEFINED;
2860 + *pusValue = BP_NOT_DEFINED;
2861 + nRet = BP_BOARD_ID_NOT_SET;
2866 +} /* BpGetWirelessSesLedGpio */
2868 +/**************************************************************************
2869 + * Name : BpGetUsbLedGpio
2871 + * Description: This function returns the GPIO pin assignment for the USB
2874 + * Parameters : [OUT] pusValue - Address of short word that the USB LED
2875 + * GPIO pin is returned in.
2877 + * Returns : BP_SUCCESS - Success, value is returned.
2878 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2879 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2881 + ***************************************************************************/
2882 +int BpGetUsbLedGpio( unsigned short *pusValue )
2886 + if( g_pCurrentBp )
2888 + *pusValue = g_pCurrentBp->usGpioLedUsb;
2890 + if( g_pCurrentBp->usGpioLedUsb != BP_NOT_DEFINED )
2892 + nRet = BP_SUCCESS;
2896 + nRet = BP_VALUE_NOT_DEFINED;
2901 + *pusValue = BP_NOT_DEFINED;
2902 + nRet = BP_BOARD_ID_NOT_SET;
2906 +} /* BpGetUsbLedGpio */
2908 +/**************************************************************************
2909 + * Name : BpGetHpnaLedGpio
2911 + * Description: This function returns the GPIO pin assignment for the HPNA
2914 + * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
2915 + * GPIO pin is returned in.
2917 + * Returns : BP_SUCCESS - Success, value is returned.
2918 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2919 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2921 + ***************************************************************************/
2922 +int BpGetHpnaLedGpio( unsigned short *pusValue )
2926 + if( g_pCurrentBp )
2928 + *pusValue = g_pCurrentBp->usGpioLedHpna;
2930 + if( g_pCurrentBp->usGpioLedHpna != BP_NOT_DEFINED )
2932 + nRet = BP_SUCCESS;
2936 + nRet = BP_VALUE_NOT_DEFINED;
2941 + *pusValue = BP_NOT_DEFINED;
2942 + nRet = BP_BOARD_ID_NOT_SET;
2946 +} /* BpGetHpnaLedGpio */
2948 +/**************************************************************************
2949 + * Name : BpGetWanDataLedGpio
2951 + * Description: This function returns the GPIO pin assignment for the WAN Data
2954 + * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
2955 + * GPIO pin is returned in.
2957 + * Returns : BP_SUCCESS - Success, value is returned.
2958 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2959 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
2961 + ***************************************************************************/
2962 +int BpGetWanDataLedGpio( unsigned short *pusValue )
2966 + if( g_pCurrentBp )
2968 + *pusValue = g_pCurrentBp->usGpioLedWanData;
2970 + if( g_pCurrentBp->usGpioLedWanData != BP_NOT_DEFINED )
2972 + nRet = BP_SUCCESS;
2976 + nRet = BP_VALUE_NOT_DEFINED;
2981 + *pusValue = BP_NOT_DEFINED;
2982 + nRet = BP_BOARD_ID_NOT_SET;
2986 +} /* BpGetWanDataLedGpio */
2988 +/**************************************************************************
2989 + * Name : BpGetPppLedGpio
2991 + * Description: This function returns the GPIO pin assignment for the PPP
2994 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
2995 + * GPIO pin is returned in.
2997 + * Returns : BP_SUCCESS - Success, value is returned.
2998 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
2999 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3001 + ***************************************************************************/
3002 +int BpGetPppLedGpio( unsigned short *pusValue )
3006 + if( g_pCurrentBp )
3008 + *pusValue = g_pCurrentBp->usGpioLedPpp;
3010 + if( g_pCurrentBp->usGpioLedPpp != BP_NOT_DEFINED )
3012 + nRet = BP_SUCCESS;
3016 + nRet = BP_VALUE_NOT_DEFINED;
3021 + *pusValue = BP_NOT_DEFINED;
3022 + nRet = BP_BOARD_ID_NOT_SET;
3026 +} /* BpGetPppLedGpio */
3028 +/**************************************************************************
3029 + * Name : BpGetPppFailLedGpio
3031 + * Description: This function returns the GPIO pin assignment for the PPP
3032 + * LED that is used when there is a PPP connection failure.
3034 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
3035 + * GPIO pin is returned in.
3037 + * Returns : BP_SUCCESS - Success, value is returned.
3038 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3039 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3041 + ***************************************************************************/
3042 +int BpGetPppFailLedGpio( unsigned short *pusValue )
3046 + if( g_pCurrentBp )
3048 + *pusValue = g_pCurrentBp->usGpioLedPppFail;
3050 + if( g_pCurrentBp->usGpioLedPppFail != BP_NOT_DEFINED )
3052 + nRet = BP_SUCCESS;
3056 + nRet = BP_VALUE_NOT_DEFINED;
3061 + *pusValue = BP_NOT_DEFINED;
3062 + nRet = BP_BOARD_ID_NOT_SET;
3066 +} /* BpGetPppFailLedGpio */
3068 +/**************************************************************************
3069 + * Name : BpGetBootloaderPowerOnLedGpio
3071 + * Description: This function returns the GPIO pin assignment for the power
3072 + * on LED that is set by the bootloader.
3074 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
3075 + * GPIO pin is returned in.
3077 + * Returns : BP_SUCCESS - Success, value is returned.
3078 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3079 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3081 + ***************************************************************************/
3082 +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue )
3086 + if( g_pCurrentBp )
3088 + *pusValue = g_pCurrentBp->usGpioLedBlPowerOn;
3090 + if( g_pCurrentBp->usGpioLedBlPowerOn != BP_NOT_DEFINED )
3092 + nRet = BP_SUCCESS;
3096 + nRet = BP_VALUE_NOT_DEFINED;
3101 + *pusValue = BP_NOT_DEFINED;
3102 + nRet = BP_BOARD_ID_NOT_SET;
3106 +} /* BpGetBootloaderPowerOn */
3108 +/**************************************************************************
3109 + * Name : BpGetBootloaderAlarmLedGpio
3111 + * Description: This function returns the GPIO pin assignment for the alarm
3112 + * LED that is set by the bootloader.
3114 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
3115 + * GPIO pin is returned in.
3117 + * Returns : BP_SUCCESS - Success, value is returned.
3118 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3119 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3121 + ***************************************************************************/
3122 +int BpGetBootloaderAlarmLedGpio( unsigned short *pusValue )
3126 + if( g_pCurrentBp )
3128 + *pusValue = g_pCurrentBp->usGpioLedBlAlarm;
3130 + if( g_pCurrentBp->usGpioLedBlAlarm != BP_NOT_DEFINED )
3132 + nRet = BP_SUCCESS;
3136 + nRet = BP_VALUE_NOT_DEFINED;
3141 + *pusValue = BP_NOT_DEFINED;
3142 + nRet = BP_BOARD_ID_NOT_SET;
3146 +} /* BpGetBootloaderAlarmLedGpio */
3148 +/**************************************************************************
3149 + * Name : BpGetBootloaderResetCfgLedGpio
3151 + * Description: This function returns the GPIO pin assignment for the reset
3152 + * configuration LED that is set by the bootloader.
3154 + * Parameters : [OUT] pusValue - Address of short word that the reset
3155 + * configuration LED GPIO pin is returned in.
3157 + * Returns : BP_SUCCESS - Success, value is returned.
3158 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3159 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3161 + ***************************************************************************/
3162 +int BpGetBootloaderResetCfgLedGpio( unsigned short *pusValue )
3166 + if( g_pCurrentBp )
3168 + *pusValue = g_pCurrentBp->usGpioLedBlResetCfg;
3170 + if( g_pCurrentBp->usGpioLedBlResetCfg != BP_NOT_DEFINED )
3172 + nRet = BP_SUCCESS;
3176 + nRet = BP_VALUE_NOT_DEFINED;
3181 + *pusValue = BP_NOT_DEFINED;
3182 + nRet = BP_BOARD_ID_NOT_SET;
3186 +} /* BpGetBootloaderResetCfgLedGpio */
3188 +/**************************************************************************
3189 + * Name : BpGetBootloaderStopLedGpio
3191 + * Description: This function returns the GPIO pin assignment for the break
3192 + * into bootloader LED that is set by the bootloader.
3194 + * Parameters : [OUT] pusValue - Address of short word that the break into
3195 + * bootloader LED GPIO pin is returned in.
3197 + * Returns : BP_SUCCESS - Success, value is returned.
3198 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3199 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3201 + ***************************************************************************/
3202 +int BpGetBootloaderStopLedGpio( unsigned short *pusValue )
3206 + if( g_pCurrentBp )
3208 + *pusValue = g_pCurrentBp->usGpioLedBlStop;
3210 + if( g_pCurrentBp->usGpioLedBlStop != BP_NOT_DEFINED )
3212 + nRet = BP_SUCCESS;
3216 + nRet = BP_VALUE_NOT_DEFINED;
3221 + *pusValue = BP_NOT_DEFINED;
3222 + nRet = BP_BOARD_ID_NOT_SET;
3226 +} /* BpGetBootloaderStopLedGpio */
3228 +/**************************************************************************
3229 + * Name : BpGetVoipLedGpio
3231 + * Description: This function returns the GPIO pin assignment for the VOIP
3234 + * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
3235 + * GPIO pin is returned in.
3237 + * Returns : BP_SUCCESS - Success, value is returned.
3238 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3239 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3242 + * Note : The VoIP structure would allow for having one LED per DSP
3243 + * however, the board initialization function assumes only one
3244 + * LED per functionality (ie one LED for VoIP). Therefore in
3245 + * order to keep this tidy and simple we do not make usage of the
3246 + * one-LED-per-DSP function. Instead, we assume that the LED for
3247 + * VoIP is unique and associated with DSP 0 (always present on
3248 + * any VoIP platform). If changing this to a LED-per-DSP function
3249 + * then one need to update the board initialization driver in
3250 + * bcmdrivers\opensource\char\board\bcm963xx\impl1
3251 + ***************************************************************************/
3252 +int BpGetVoipLedGpio( unsigned short *pusValue )
3256 + if( g_pCurrentBp )
3258 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( 0 );
3262 + *pusValue = pDspInfo->usGpioLedVoip;
3264 + if( *pusValue != BP_NOT_DEFINED )
3266 + nRet = BP_SUCCESS;
3270 + nRet = BP_VALUE_NOT_DEFINED;
3275 + *pusValue = BP_NOT_DEFINED;
3276 + nRet = BP_BOARD_ID_NOT_FOUND;
3281 + *pusValue = BP_NOT_DEFINED;
3282 + nRet = BP_BOARD_ID_NOT_SET;
3286 +} /* BpGetVoipLedGpio */
3288 +/**************************************************************************
3289 + * Name : BpGetWirelessExtIntr
3291 + * Description: This function returns the Wireless external interrupt number.
3293 + * Parameters : [OUT] pulValue - Address of short word that the wireless
3294 + * external interrupt number is returned in.
3296 + * Returns : BP_SUCCESS - Success, value is returned.
3297 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3298 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3300 + ***************************************************************************/
3301 +int BpGetWirelessExtIntr( unsigned long *pulValue )
3305 + if( g_pCurrentBp )
3307 + *pulValue = g_pCurrentBp->usExtIntrWireless;
3309 + if( g_pCurrentBp->usExtIntrWireless != BP_NOT_DEFINED )
3311 + nRet = BP_SUCCESS;
3315 + nRet = BP_VALUE_NOT_DEFINED;
3320 + *pulValue = BP_NOT_DEFINED;
3321 + nRet = BP_BOARD_ID_NOT_SET;
3325 +} /* BpGetWirelessExtIntr */
3327 +/**************************************************************************
3328 + * Name : BpGetAdslDyingGaspExtIntr
3330 + * Description: This function returns the ADSL Dying Gasp external interrupt
3333 + * Parameters : [OUT] pulValue - Address of short word that the ADSL Dying Gasp
3334 + * external interrupt number is returned in.
3336 + * Returns : BP_SUCCESS - Success, value is returned.
3337 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3338 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3340 + ***************************************************************************/
3341 +int BpGetAdslDyingGaspExtIntr( unsigned long *pulValue )
3345 + if( g_pCurrentBp )
3347 + *pulValue = g_pCurrentBp->usExtIntrAdslDyingGasp;
3349 + if( g_pCurrentBp->usExtIntrAdslDyingGasp != BP_NOT_DEFINED )
3351 + nRet = BP_SUCCESS;
3355 + nRet = BP_VALUE_NOT_DEFINED;
3360 + *pulValue = BP_NOT_DEFINED;
3361 + nRet = BP_BOARD_ID_NOT_SET;
3365 +} /* BpGetAdslDyingGaspExtIntr */
3367 +/**************************************************************************
3368 + * Name : BpGetVoipExtIntr
3370 + * Description: This function returns the VOIP external interrupt number.
3372 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
3373 + * external interrupt number is returned in.
3374 + * [IN] dspNum - Address of the DSP to query.
3376 + * Returns : BP_SUCCESS - Success, value is returned.
3377 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3378 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3380 + ***************************************************************************/
3381 +int BpGetVoipExtIntr( unsigned char dspNum, unsigned long *pulValue )
3385 + if( g_pCurrentBp )
3387 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
3391 + *pulValue = pDspInfo->usExtIntrVoip;
3393 + if( *pulValue != BP_NOT_DEFINED )
3395 + nRet = BP_SUCCESS;
3399 + nRet = BP_VALUE_NOT_DEFINED;
3404 + *pulValue = BP_NOT_DEFINED;
3405 + nRet = BP_BOARD_ID_NOT_FOUND;
3410 + *pulValue = BP_NOT_DEFINED;
3411 + nRet = BP_BOARD_ID_NOT_SET;
3415 +} /* BpGetVoipExtIntr */
3417 +/**************************************************************************
3418 + * Name : BpGetHpnaExtIntr
3420 + * Description: This function returns the HPNA external interrupt number.
3422 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
3423 + * external interrupt number is returned in.
3425 + * Returns : BP_SUCCESS - Success, value is returned.
3426 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3427 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3429 + ***************************************************************************/
3430 +int BpGetHpnaExtIntr( unsigned long *pulValue )
3434 + if( g_pCurrentBp )
3436 + *pulValue = g_pCurrentBp->usExtIntrHpna;
3438 + if( g_pCurrentBp->usExtIntrHpna != BP_NOT_DEFINED )
3440 + nRet = BP_SUCCESS;
3444 + nRet = BP_VALUE_NOT_DEFINED;
3449 + *pulValue = BP_NOT_DEFINED;
3450 + nRet = BP_BOARD_ID_NOT_SET;
3454 +} /* BpGetHpnaExtIntr */
3456 +/**************************************************************************
3457 + * Name : BpGetHpnaChipSelect
3459 + * Description: This function returns the HPNA chip select number.
3461 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
3462 + * chip select number is returned in.
3464 + * Returns : BP_SUCCESS - Success, value is returned.
3465 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3466 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3468 + ***************************************************************************/
3469 +int BpGetHpnaChipSelect( unsigned long *pulValue )
3473 + if( g_pCurrentBp )
3475 + *pulValue = g_pCurrentBp->usCsHpna;
3477 + if( g_pCurrentBp->usCsHpna != BP_NOT_DEFINED )
3479 + nRet = BP_SUCCESS;
3483 + nRet = BP_VALUE_NOT_DEFINED;
3488 + *pulValue = BP_NOT_DEFINED;
3489 + nRet = BP_BOARD_ID_NOT_SET;
3493 +} /* BpGetHpnaChipSelect */
3495 +/**************************************************************************
3496 + * Name : BpGetVoipChipSelect
3498 + * Description: This function returns the VOIP chip select number.
3500 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
3501 + * chip select number is returned in.
3502 + * [IN] dspNum - Address of the DSP to query.
3504 + * Returns : BP_SUCCESS - Success, value is returned.
3505 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3506 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3508 + ***************************************************************************/
3509 +int BpGetVoipChipSelect( unsigned char dspNum, unsigned long *pulValue )
3513 + if( g_pCurrentBp )
3515 + VOIP_DSP_INFO *pDspInfo = BpGetVoipDspConfig( dspNum );
3519 + *pulValue = pDspInfo->usCsVoip;
3521 + if( *pulValue != BP_NOT_DEFINED )
3523 + nRet = BP_SUCCESS;
3527 + nRet = BP_VALUE_NOT_DEFINED;
3532 + *pulValue = BP_NOT_DEFINED;
3533 + nRet = BP_BOARD_ID_NOT_FOUND;
3538 + *pulValue = BP_NOT_DEFINED;
3539 + nRet = BP_BOARD_ID_NOT_SET;
3543 +} /* BpGetVoipChipSelect */
3545 diff -urN linux.old/arch/mips/bcm963xx/boardparms.h linux.dev/arch/mips/bcm963xx/boardparms.h
3546 --- linux.old/arch/mips/bcm963xx/boardparms.h 1970-01-01 01:00:00.000000000 +0100
3547 +++ linux.dev/arch/mips/bcm963xx/boardparms.h 2006-08-25 00:39:38.000000000 +0200
3552 + Copyright 2003 Broadcom Corp. All Rights Reserved.
3554 + This program is free software; you can distribute it and/or modify it
3555 + under the terms of the GNU General Public License (Version 2) as
3556 + published by the Free Software Foundation.
3558 + This program is distributed in the hope it will be useful, but WITHOUT
3559 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3560 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3563 + You should have received a copy of the GNU General Public License along
3564 + with this program; if not, write to the Free Software Foundation, Inc.,
3565 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
3569 +/**************************************************************************
3570 + * File Name : boardparms.h
3572 + * Description: This file contains definitions and function prototypes for
3573 + * the BCM63xx board parameter access functions.
3575 + * Updates : 07/14/2003 Created.
3576 + ***************************************************************************/
3578 +#if !defined(_BOARDPARMS_H)
3579 +#define _BOARDPARMS_H
3581 +/* Return codes. */
3582 +#define BP_SUCCESS 0
3583 +#define BP_BOARD_ID_NOT_FOUND 1
3584 +#define BP_VALUE_NOT_DEFINED 2
3585 +#define BP_BOARD_ID_NOT_SET 3
3587 +/* Values for BpGetSdramSize. */
3588 +#define BP_MEMORY_8MB_1_CHIP 0
3589 +#define BP_MEMORY_16MB_1_CHIP 1
3590 +#define BP_MEMORY_32MB_1_CHIP 2
3591 +#define BP_MEMORY_64MB_2_CHIP 3
3592 +#define BP_MEMORY_32MB_2_CHIP 4
3593 +#define BP_MEMORY_16MB_2_CHIP 5
3595 +/* Values for EthernetMacInfo PhyType. */
3596 +#define BP_ENET_NO_PHY 0
3597 +#define BP_ENET_INTERNAL_PHY 1
3598 +#define BP_ENET_EXTERNAL_PHY 2
3599 +#define BP_ENET_EXTERNAL_SWITCH 3
3601 +/* Values for EthernetMacInfo Configuration type. */
3602 +#define BP_ENET_CONFIG_MDIO 0 /* Internal PHY, External PHY, Switch+(no GPIO, no SPI, no MDIO Pseudo phy */
3603 +#define BP_ENET_CONFIG_GPIO 1 /* Bcm96345GW board + Bcm5325M/E */
3604 +#define BP_ENET_CONFIG_MDIO_PSEUDO_PHY 2 /* Bcm96348GW board + Bcm5325E */
3605 +#define BP_ENET_CONFIG_SPI_SSB_0 3 /* Bcm96348GW board + Bcm5325M/E */
3606 +#define BP_ENET_CONFIG_SPI_SSB_1 4 /* Bcm96348GW board + Bcm5325M/E */
3607 +#define BP_ENET_CONFIG_SPI_SSB_2 5 /* Bcm96348GW board + Bcm5325M/E */
3608 +#define BP_ENET_CONFIG_SPI_SSB_3 6 /* Bcm96348GW board + Bcm5325M/E */
3610 +/* Values for EthernetMacInfo Reverse MII. */
3611 +#define BP_ENET_NO_REVERSE_MII 0
3612 +#define BP_ENET_REVERSE_MII 1
3614 +/* Values for VoIPDSPInfo DSPType. */
3615 +#define BP_VOIP_NO_DSP 0
3616 +#define BP_VOIP_DSP 1
3619 +/* Values for GPIO pin assignments (AH = Active High, AL = Active Low). */
3620 +#define BP_ACTIVE_MASK 0x8000
3621 +#define BP_ACTIVE_HIGH 0x0000
3622 +#define BP_ACTIVE_LOW 0x8000
3623 +#define BP_GPIO_0_AH (0 | BP_ACTIVE_HIGH)
3624 +#define BP_GPIO_0_AL (0 | BP_ACTIVE_LOW)
3625 +#define BP_GPIO_1_AH (1 | BP_ACTIVE_HIGH)
3626 +#define BP_GPIO_1_AL (1 | BP_ACTIVE_LOW)
3627 +#define BP_GPIO_2_AH (2 | BP_ACTIVE_HIGH)
3628 +#define BP_GPIO_2_AL (2 | BP_ACTIVE_LOW)
3629 +#define BP_GPIO_3_AH (3 | BP_ACTIVE_HIGH)
3630 +#define BP_GPIO_3_AL (3 | BP_ACTIVE_LOW)
3631 +#define BP_GPIO_4_AH (4 | BP_ACTIVE_HIGH)
3632 +#define BP_GPIO_4_AL (4 | BP_ACTIVE_LOW)
3633 +#define BP_GPIO_5_AH (5 | BP_ACTIVE_HIGH)
3634 +#define BP_GPIO_5_AL (5 | BP_ACTIVE_LOW)
3635 +#define BP_GPIO_6_AH (6 | BP_ACTIVE_HIGH)
3636 +#define BP_GPIO_6_AL (6 | BP_ACTIVE_LOW)
3637 +#define BP_GPIO_7_AH (7 | BP_ACTIVE_HIGH)
3638 +#define BP_GPIO_7_AL (7 | BP_ACTIVE_LOW)
3639 +#define BP_GPIO_8_AH (8 | BP_ACTIVE_HIGH)
3640 +#define BP_GPIO_8_AL (8 | BP_ACTIVE_LOW)
3641 +#define BP_GPIO_9_AH (9 | BP_ACTIVE_HIGH)
3642 +#define BP_GPIO_9_AL (9 | BP_ACTIVE_LOW)
3643 +#define BP_GPIO_10_AH (10 | BP_ACTIVE_HIGH)
3644 +#define BP_GPIO_10_AL (10 | BP_ACTIVE_LOW)
3645 +#define BP_GPIO_11_AH (11 | BP_ACTIVE_HIGH)
3646 +#define BP_GPIO_11_AL (11 | BP_ACTIVE_LOW)
3647 +#define BP_GPIO_12_AH (12 | BP_ACTIVE_HIGH)
3648 +#define BP_GPIO_12_AL (12 | BP_ACTIVE_LOW)
3649 +#define BP_GPIO_13_AH (13 | BP_ACTIVE_HIGH)
3650 +#define BP_GPIO_13_AL (13 | BP_ACTIVE_LOW)
3651 +#define BP_GPIO_14_AH (14 | BP_ACTIVE_HIGH)
3652 +#define BP_GPIO_14_AL (14 | BP_ACTIVE_LOW)
3653 +#define BP_GPIO_15_AH (15 | BP_ACTIVE_HIGH)
3654 +#define BP_GPIO_15_AL (15 | BP_ACTIVE_LOW)
3655 +#define BP_GPIO_16_AH (16 | BP_ACTIVE_HIGH)
3656 +#define BP_GPIO_16_AL (16 | BP_ACTIVE_LOW)
3657 +#define BP_GPIO_17_AH (17 | BP_ACTIVE_HIGH)
3658 +#define BP_GPIO_17_AL (17 | BP_ACTIVE_LOW)
3659 +#define BP_GPIO_18_AH (18 | BP_ACTIVE_HIGH)
3660 +#define BP_GPIO_18_AL (18 | BP_ACTIVE_LOW)
3661 +#define BP_GPIO_19_AH (19 | BP_ACTIVE_HIGH)
3662 +#define BP_GPIO_19_AL (19 | BP_ACTIVE_LOW)
3663 +#define BP_GPIO_20_AH (20 | BP_ACTIVE_HIGH)
3664 +#define BP_GPIO_20_AL (20 | BP_ACTIVE_LOW)
3665 +#define BP_GPIO_21_AH (21 | BP_ACTIVE_HIGH)
3666 +#define BP_GPIO_21_AL (21 | BP_ACTIVE_LOW)
3667 +#define BP_GPIO_22_AH (22 | BP_ACTIVE_HIGH)
3668 +#define BP_GPIO_22_AL (22 | BP_ACTIVE_LOW)
3669 +#define BP_GPIO_23_AH (23 | BP_ACTIVE_HIGH)
3670 +#define BP_GPIO_23_AL (23 | BP_ACTIVE_LOW)
3671 +#define BP_GPIO_24_AH (24 | BP_ACTIVE_HIGH)
3672 +#define BP_GPIO_24_AL (24 | BP_ACTIVE_LOW)
3673 +#define BP_GPIO_25_AH (25 | BP_ACTIVE_HIGH)
3674 +#define BP_GPIO_25_AL (25 | BP_ACTIVE_LOW)
3675 +#define BP_GPIO_26_AH (26 | BP_ACTIVE_HIGH)
3676 +#define BP_GPIO_26_AL (26 | BP_ACTIVE_LOW)
3677 +#define BP_GPIO_27_AH (27 | BP_ACTIVE_HIGH)
3678 +#define BP_GPIO_27_AL (27 | BP_ACTIVE_LOW)
3679 +#define BP_GPIO_28_AH (28 | BP_ACTIVE_HIGH)
3680 +#define BP_GPIO_28_AL (28 | BP_ACTIVE_LOW)
3681 +#define BP_GPIO_29_AH (29 | BP_ACTIVE_HIGH)
3682 +#define BP_GPIO_29_AL (29 | BP_ACTIVE_LOW)
3683 +#define BP_GPIO_30_AH (30 | BP_ACTIVE_HIGH)
3684 +#define BP_GPIO_30_AL (30 | BP_ACTIVE_LOW)
3685 +#define BP_GPIO_31_AH (31 | BP_ACTIVE_HIGH)
3686 +#define BP_GPIO_31_AL (31 | BP_ACTIVE_LOW)
3687 +#define BP_GPIO_32_AH (32 | BP_ACTIVE_HIGH)
3688 +#define BP_GPIO_32_AL (32 | BP_ACTIVE_LOW)
3689 +#define BP_GPIO_33_AH (33 | BP_ACTIVE_HIGH)
3690 +#define BP_GPIO_33_AL (33 | BP_ACTIVE_LOW)
3691 +#define BP_GPIO_34_AH (34 | BP_ACTIVE_HIGH)
3692 +#define BP_GPIO_34_AL (34 | BP_ACTIVE_LOW)
3693 +#define BP_GPIO_35_AH (35 | BP_ACTIVE_HIGH)
3694 +#define BP_GPIO_35_AL (35 | BP_ACTIVE_LOW)
3695 +#define BP_GPIO_36_AH (36 | BP_ACTIVE_HIGH)
3696 +#define BP_GPIO_36_AL (36 | BP_ACTIVE_LOW)
3698 +/* Values for external interrupt assignments. */
3699 +#define BP_EXT_INTR_0 0
3700 +#define BP_EXT_INTR_1 1
3701 +#define BP_EXT_INTR_2 2
3702 +#define BP_EXT_INTR_3 3
3704 +/* Values for chip select assignments. */
3710 +/* Value for GPIO and external interrupt fields that are not used. */
3711 +#define BP_NOT_DEFINED 0xffff
3712 +#define BP_HW_DEFINED 0xfff0
3713 +#define BP_UNEQUIPPED 0xfff1
3715 +/* Maximum size of the board id string. */
3716 +#define BP_BOARD_ID_LEN 16
3718 +/* Maximum number of Ethernet MACs. */
3719 +#define BP_MAX_ENET_MACS 2
3721 +/* Maximum number of VoIP DSPs. */
3722 +#define BP_MAX_VOIP_DSP 2
3724 +/* Wireless Antenna Settings. */
3725 +#define BP_WLAN_ANT_MAIN 0
3726 +#define BP_WLAN_ANT_AUX 1
3727 +#define BP_WLAN_ANT_BOTH 3
3729 +#if !defined(__ASSEMBLER__)
3731 +/* Information about an Ethernet MAC. If ucPhyType is BP_ENET_NO_PHY,
3732 + * then the other fields are not valid.
3734 +typedef struct EthernetMacInfo
3736 + unsigned char ucPhyType; /* BP_ENET_xxx */
3737 + unsigned char ucPhyAddress; /* 0 to 31 */
3738 + unsigned short usGpioPhySpiSck; /* GPIO pin or not defined */
3739 + unsigned short usGpioPhySpiSs; /* GPIO pin or not defined */
3740 + unsigned short usGpioPhySpiMosi; /* GPIO pin or not defined */
3741 + unsigned short usGpioPhySpiMiso; /* GPIO pin or not defined */
3742 + unsigned short usGpioPhyReset; /* GPIO pin or not defined (96348LV) */
3743 + unsigned short numSwitchPorts; /* Number of PHY ports */
3744 + unsigned short usConfigType; /* Configuration type */
3745 + unsigned short usReverseMii; /* Reverse MII */
3746 +} ETHERNET_MAC_INFO, *PETHERNET_MAC_INFO;
3749 +/* Information about VoIP DSPs. If ucDspType is BP_VOIP_NO_DSP,
3750 + * then the other fields are not valid.
3752 +typedef struct VoIPDspInfo
3754 + unsigned char ucDspType;
3755 + unsigned char ucDspAddress;
3756 + unsigned short usExtIntrVoip;
3757 + unsigned short usGpioVoipReset;
3758 + unsigned short usGpioVoipIntr;
3759 + unsigned short usGpioLedVoip;
3760 + unsigned short usCsVoip;
3765 +/**************************************************************************
3766 + * Name : BpSetBoardId
3768 + * Description: This function find the BOARD_PARAMETERS structure for the
3769 + * specified board id string and assigns it to a global, static
3772 + * Parameters : [IN] pszBoardId - Board id string that is saved into NVRAM.
3774 + * Returns : BP_SUCCESS - Success, value is returned.
3775 + * BP_BOARD_ID_NOT_FOUND - Error, board id input string does not
3776 + * have a board parameters configuration record.
3777 + ***************************************************************************/
3778 +int BpSetBoardId( char *pszBoardId );
3780 +/**************************************************************************
3781 + * Name : BpGetBoardIds
3783 + * Description: This function returns all of the supported board id strings.
3785 + * Parameters : [OUT] pszBoardIds - Address of a buffer that the board id
3786 + * strings are returned in. Each id starts at BP_BOARD_ID_LEN
3788 + * [IN] nBoardIdsSize - Number of BP_BOARD_ID_LEN elements that
3789 + * were allocated in pszBoardIds.
3791 + * Returns : Number of board id strings returned.
3792 + ***************************************************************************/
3793 +int BpGetBoardIds( char *pszBoardIds, int nBoardIdsSize );
3795 +/**************************************************************************
3796 + * Name : BpGetEthernetMacInfo
3798 + * Description: This function returns all of the supported board id strings.
3800 + * Parameters : [OUT] pEnetInfos - Address of an array of ETHERNET_MAC_INFO
3802 + * [IN] nNumEnetInfos - Number of ETHERNET_MAC_INFO elements that
3803 + * are pointed to by pEnetInfos.
3805 + * Returns : BP_SUCCESS - Success, value is returned.
3806 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3807 + ***************************************************************************/
3808 +int BpGetEthernetMacInfo( PETHERNET_MAC_INFO pEnetInfos, int nNumEnetInfos );
3810 +/**************************************************************************
3811 + * Name : BpGetSdramSize
3813 + * Description: This function returns a constant that describees the board's
3814 + * SDRAM type and size.
3816 + * Parameters : [OUT] pulSdramSize - Address of short word that the SDRAM size
3819 + * Returns : BP_SUCCESS - Success, value is returned.
3820 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3821 + ***************************************************************************/
3822 +int BpGetSdramSize( unsigned long *pulSdramSize );
3824 +/**************************************************************************
3825 + * Name : BpGetPsiSize
3827 + * Description: This function returns the persistent storage size in K bytes.
3829 + * Parameters : [OUT] pulPsiSize - Address of short word that the persistent
3830 + * storage size is returned in.
3832 + * Returns : BP_SUCCESS - Success, value is returned.
3833 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3834 + ***************************************************************************/
3835 +int BpGetPsiSize( unsigned long *pulPsiSize );
3837 +/**************************************************************************
3838 + * Name : BpGetRj11InnerOuterPairGpios
3840 + * Description: This function returns the GPIO pin assignments for changing
3841 + * between the RJ11 inner pair and RJ11 outer pair.
3843 + * Parameters : [OUT] pusInner - Address of short word that the RJ11 inner pair
3844 + * GPIO pin is returned in.
3845 + * [OUT] pusOuter - Address of short word that the RJ11 outer pair
3846 + * GPIO pin is returned in.
3848 + * Returns : BP_SUCCESS - Success, values are returned.
3849 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3850 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3852 + ***************************************************************************/
3853 +int BpGetRj11InnerOuterPairGpios( unsigned short *pusInner,
3854 + unsigned short *pusOuter );
3856 +/**************************************************************************
3857 + * Name : BpGetPressAndHoldResetGpio
3859 + * Description: This function returns the GPIO pin assignment for the press
3860 + * and hold reset button.
3862 + * Parameters : [OUT] pusValue - Address of short word that the press and hold
3863 + * reset button GPIO pin is returned in.
3865 + * Returns : BP_SUCCESS - Success, value is returned.
3866 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3867 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3869 + ***************************************************************************/
3870 +int BpGetPressAndHoldResetGpio( unsigned short *pusValue );
3872 +/**************************************************************************
3873 + * Name : BpGetVoipResetGpio
3875 + * Description: This function returns the GPIO pin assignment for the VOIP
3876 + * Reset operation.
3878 + * Parameters : [OUT] pusValue - Address of short word that the VOIP reset
3879 + * GPIO pin is returned in.
3880 + * [IN] dspNum - Address of the DSP to query.
3882 + * Returns : BP_SUCCESS - Success, value is returned.
3883 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3884 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3886 + ***************************************************************************/
3887 +int BpGetVoipResetGpio( unsigned char dspNum, unsigned short *pusValue );
3889 +/**************************************************************************
3890 + * Name : BpGetVoipIntrGpio
3892 + * Description: This function returns the GPIO pin assignment for VoIP interrupt.
3894 + * Parameters : [OUT] pusValue - Address of short word that the VOIP interrupt
3895 + * GPIO pin is returned in.
3896 + * [IN] dspNum - Address of the DSP to query.
3898 + * Returns : BP_SUCCESS - Success, value is returned.
3899 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3900 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3902 + ***************************************************************************/
3903 +int BpGetVoipIntrGpio( unsigned char dspNum, unsigned short *pusValue );
3905 +/**************************************************************************
3906 + * Name : BpGetPcmciaResetGpio
3908 + * Description: This function returns the GPIO pin assignment for the PCMCIA
3909 + * Reset operation.
3911 + * Parameters : [OUT] pusValue - Address of short word that the PCMCIA reset
3912 + * GPIO pin is returned in.
3914 + * Returns : BP_SUCCESS - Success, value is returned.
3915 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3916 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3918 + ***************************************************************************/
3919 +int BpGetPcmciaResetGpio( unsigned short *pusValue );
3921 +/**************************************************************************
3922 + * Name : BpGetUartRtsCtsGpios
3924 + * Description: This function returns the GPIO pin assignments for RTS and CTS
3927 + * Parameters : [OUT] pusRts - Address of short word that the UART RTS GPIO
3928 + * pin is returned in.
3929 + * [OUT] pusCts - Address of short word that the UART CTS GPIO
3930 + * pin is returned in.
3932 + * Returns : BP_SUCCESS - Success, values are returned.
3933 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3934 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3936 + ***************************************************************************/
3937 +int BpGetRtsCtsUartGpios( unsigned short *pusRts, unsigned short *pusCts );
3939 +/**************************************************************************
3940 + * Name : BpGetAdslLedGpio
3942 + * Description: This function returns the GPIO pin assignment for the ADSL
3945 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
3946 + * GPIO pin is returned in.
3948 + * Returns : BP_SUCCESS - Success, value is returned.
3949 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3950 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3952 + ***************************************************************************/
3953 +int BpGetAdslLedGpio( unsigned short *pusValue );
3955 +/**************************************************************************
3956 + * Name : BpGetAdslFailLedGpio
3958 + * Description: This function returns the GPIO pin assignment for the ADSL
3959 + * LED that is used when there is a DSL connection failure.
3961 + * Parameters : [OUT] pusValue - Address of short word that the ADSL LED
3962 + * GPIO pin is returned in.
3964 + * Returns : BP_SUCCESS - Success, value is returned.
3965 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3966 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3968 + ***************************************************************************/
3969 +int BpGetAdslFailLedGpio( unsigned short *pusValue );
3971 +/**************************************************************************
3972 + * Name : BpGetWirelessLedGpio
3974 + * Description: This function returns the GPIO pin assignment for the Wireless
3977 + * Parameters : [OUT] pusValue - Address of short word that the Wireless LED
3978 + * GPIO pin is returned in.
3980 + * Returns : BP_SUCCESS - Success, value is returned.
3981 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3982 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3984 + ***************************************************************************/
3985 +int BpGetWirelessLedGpio( unsigned short *pusValue );
3987 +/**************************************************************************
3988 + * Name : BpGetWirelessAntInUse
3990 + * Description: This function returns the antennas in use for wireless
3992 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Antenna
3995 + * Returns : BP_SUCCESS - Success, value is returned.
3996 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
3997 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
3999 + ***************************************************************************/
4000 +int BpGetWirelessAntInUse( unsigned short *pusValue );
4002 +/**************************************************************************
4003 + * Name : BpGetWirelessSesBtnGpio
4005 + * Description: This function returns the GPIO pin assignment for the Wireless
4008 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4009 + * Button GPIO pin is returned in.
4011 + * Returns : BP_SUCCESS - Success, value is returned.
4012 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4013 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4015 + ***************************************************************************/
4016 +int BpGetWirelessSesBtnGpio( unsigned short *pusValue );
4018 +/**************************************************************************
4019 + * Name : BpGetWirelessSesExtIntr
4021 + * Description: This function returns the external interrupt number for the
4022 + * Wireless Ses Button.
4024 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4025 + * external interrup is returned in.
4027 + * Returns : BP_SUCCESS - Success, value is returned.
4028 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4029 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4031 + ***************************************************************************/
4032 +int BpGetWirelessSesExtIntr( unsigned short *pusValue );
4034 +/**************************************************************************
4035 + * Name : BpGetWirelessSesLedGpio
4037 + * Description: This function returns the GPIO pin assignment for the Wireless
4040 + * Parameters : [OUT] pusValue - Address of short word that the Wireless Ses
4041 + * Led GPIO pin is returned in.
4043 + * Returns : BP_SUCCESS - Success, value is returned.
4044 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4045 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4047 + ***************************************************************************/
4048 +int BpGetWirelessSesLedGpio( unsigned short *pusValue );
4050 +/**************************************************************************
4051 + * Name : BpGetUsbLedGpio
4053 + * Description: This function returns the GPIO pin assignment for the USB
4056 + * Parameters : [OUT] pusValue - Address of short word that the USB LED
4057 + * GPIO pin is returned in.
4059 + * Returns : BP_SUCCESS - Success, value is returned.
4060 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4061 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4063 + ***************************************************************************/
4064 +int BpGetUsbLedGpio( unsigned short *pusValue );
4066 +/**************************************************************************
4067 + * Name : BpGetHpnaLedGpio
4069 + * Description: This function returns the GPIO pin assignment for the HPNA
4072 + * Parameters : [OUT] pusValue - Address of short word that the HPNA LED
4073 + * GPIO pin is returned in.
4075 + * Returns : BP_SUCCESS - Success, value is returned.
4076 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4077 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4079 + ***************************************************************************/
4080 +int BpGetHpnaLedGpio( unsigned short *pusValue );
4082 +/**************************************************************************
4083 + * Name : BpGetWanDataLedGpio
4085 + * Description: This function returns the GPIO pin assignment for the WAN Data
4088 + * Parameters : [OUT] pusValue - Address of short word that the WAN Data LED
4089 + * GPIO pin is returned in.
4091 + * Returns : BP_SUCCESS - Success, value is returned.
4092 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4093 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4095 + ***************************************************************************/
4096 +int BpGetWanDataLedGpio( unsigned short *pusValue );
4098 +/**************************************************************************
4099 + * Name : BpGetPppLedGpio
4101 + * Description: This function returns the GPIO pin assignment for the PPP
4104 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
4105 + * GPIO pin is returned in.
4107 + * Returns : BP_SUCCESS - Success, value is returned.
4108 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4109 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4111 + ***************************************************************************/
4112 +int BpGetPppLedGpio( unsigned short *pusValue );
4114 +/**************************************************************************
4115 + * Name : BpGetPppFailLedGpio
4117 + * Description: This function returns the GPIO pin assignment for the PPP
4118 + * LED that is used when there is a PPP connection failure.
4120 + * Parameters : [OUT] pusValue - Address of short word that the PPP LED
4121 + * GPIO pin is returned in.
4123 + * Returns : BP_SUCCESS - Success, value is returned.
4124 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4125 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4127 + ***************************************************************************/
4128 +int BpGetPppFailLedGpio( unsigned short *pusValue );
4130 +/**************************************************************************
4131 + * Name : BpGetVoipLedGpio
4133 + * Description: This function returns the GPIO pin assignment for the VOIP
4136 + * Parameters : [OUT] pusValue - Address of short word that the VOIP LED
4137 + * GPIO pin is returned in.
4139 + * Returns : BP_SUCCESS - Success, value is returned.
4140 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4141 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4143 + ***************************************************************************/
4144 +int BpGetVoipLedGpio( unsigned short *pusValue );
4146 +/**************************************************************************
4147 + * Name : BpGetBootloaderPowerOnLedGpio
4149 + * Description: This function returns the GPIO pin assignment for the power
4150 + * on LED that is set by the bootloader.
4152 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
4153 + * GPIO pin is returned in.
4155 + * Returns : BP_SUCCESS - Success, value is returned.
4156 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4157 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4159 + ***************************************************************************/
4160 +int BpGetBootloaderPowerOnLedGpio( unsigned short *pusValue );
4162 +/**************************************************************************
4163 + * Name : BpGetBootloaderAlarmLedGpio
4165 + * Description: This function returns the GPIO pin assignment for the alarm
4166 + * LED that is set by the bootloader.
4168 + * Parameters : [OUT] pusValue - Address of short word that the alarm LED
4169 + * GPIO pin is returned in.
4171 + * Returns : BP_SUCCESS - Success, value is returned.
4172 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4173 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4175 + ***************************************************************************/
4176 +int BpGetBootloaderAlarmLedGpio( unsigned short *pusValue );
4178 +/**************************************************************************
4179 + * Name : BpGetBootloaderResetCfgLedGpio
4181 + * Description: This function returns the GPIO pin assignment for the reset
4182 + * configuration LED that is set by the bootloader.
4184 + * Parameters : [OUT] pusValue - Address of short word that the reset
4185 + * configuration LED GPIO pin is returned in.
4187 + * Returns : BP_SUCCESS - Success, value is returned.
4188 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4189 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4191 + ***************************************************************************/
4192 +int BpGetBootloaderResetCfgLedGpio( unsigned short *pusValue );
4194 +/**************************************************************************
4195 + * Name : BpGetBootloaderStopLedGpio
4197 + * Description: This function returns the GPIO pin assignment for the break
4198 + * into bootloader LED that is set by the bootloader.
4200 + * Parameters : [OUT] pusValue - Address of short word that the break into
4201 + * bootloader LED GPIO pin is returned in.
4203 + * Returns : BP_SUCCESS - Success, value is returned.
4204 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4205 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4207 + ***************************************************************************/
4208 +int BpGetBootloaderStopLedGpio( unsigned short *pusValue );
4210 +/**************************************************************************
4211 + * Name : BpGetWirelessExtIntr
4213 + * Description: This function returns the Wireless external interrupt number.
4215 + * Parameters : [OUT] pulValue - Address of short word that the wireless
4216 + * external interrupt number is returned in.
4218 + * Returns : BP_SUCCESS - Success, value is returned.
4219 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4220 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4222 + ***************************************************************************/
4223 +int BpGetWirelessExtIntr( unsigned long *pulValue );
4225 +/**************************************************************************
4226 + * Name : BpGetAdslDyingGaspExtIntr
4228 + * Description: This function returns the ADSL Dying Gasp external interrupt
4231 + * Parameters : [OUT] pulValue - Address of short word that the ADSL Dying Gasp
4232 + * external interrupt number is returned in.
4234 + * Returns : BP_SUCCESS - Success, value is returned.
4235 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4236 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4238 + ***************************************************************************/
4239 +int BpGetAdslDyingGaspExtIntr( unsigned long *pulValue );
4241 +/**************************************************************************
4242 + * Name : BpGetVoipExtIntr
4244 + * Description: This function returns the VOIP external interrupt number.
4246 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
4247 + * external interrupt number is returned in.
4248 + * [IN] dspNum - Address of the DSP to query.
4250 + * Returns : BP_SUCCESS - Success, value is returned.
4251 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4252 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4254 + ***************************************************************************/
4255 +int BpGetVoipExtIntr( unsigned char dspNum, unsigned long *pulValue );
4257 +/**************************************************************************
4258 + * Name : BpGetHpnaExtIntr
4260 + * Description: This function returns the HPNA external interrupt number.
4262 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
4263 + * external interrupt number is returned in.
4265 + * Returns : BP_SUCCESS - Success, value is returned.
4266 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4267 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4269 + ***************************************************************************/
4270 +int BpGetHpnaExtIntr( unsigned long *pulValue );
4272 +/**************************************************************************
4273 + * Name : BpGetHpnaChipSelect
4275 + * Description: This function returns the HPNA chip select number.
4277 + * Parameters : [OUT] pulValue - Address of short word that the HPNA
4278 + * chip select number is returned in.
4280 + * Returns : BP_SUCCESS - Success, value is returned.
4281 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4282 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4284 + ***************************************************************************/
4285 +int BpGetHpnaChipSelect( unsigned long *pulValue );
4287 +/**************************************************************************
4288 + * Name : BpGetVoipChipSelect
4290 + * Description: This function returns the VOIP chip select number.
4292 + * Parameters : [OUT] pulValue - Address of short word that the VOIP
4293 + * chip select number is returned in.
4294 + * [IN] dspNum - Address of the DSP to query.
4296 + * Returns : BP_SUCCESS - Success, value is returned.
4297 + * BP_BOARD_ID_NOT_SET - Error, BpSetBoardId has not been called.
4298 + * BP_VALUE_NOT_DEFINED - At least one return value is not defined
4300 + ***************************************************************************/
4301 +int BpGetVoipChipSelect( unsigned char dspNum, unsigned long *pulValue );
4303 +#endif /* __ASSEMBLER__ */
4305 +#endif /* _BOARDPARMS_H */
4307 diff -urN linux.old/arch/mips/bcm963xx/include/6338_intr.h linux.dev/arch/mips/bcm963xx/include/6338_intr.h
4308 --- linux.old/arch/mips/bcm963xx/include/6338_intr.h 1970-01-01 01:00:00.000000000 +0100
4309 +++ linux.dev/arch/mips/bcm963xx/include/6338_intr.h 2006-08-25 00:39:38.000000000 +0200
4313 + Copyright 2003 Broadcom Corp. All Rights Reserved.
4315 + This program is free software; you can distribute it and/or modify it
4316 + under the terms of the GNU General Public License (Version 2) as
4317 + published by the Free Software Foundation.
4319 + This program is distributed in the hope it will be useful, but WITHOUT
4320 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4321 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4324 + You should have received a copy of the GNU General Public License along
4325 + with this program; if not, write to the Free Software Foundation, Inc.,
4326 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4330 +#ifndef __6338_INTR_H
4331 +#define __6338_INTR_H
4333 +/*=====================================================================*/
4334 +/* BCM6338 External Interrupt Level Assignments */
4335 +/*=====================================================================*/
4336 +#define INTERRUPT_ID_EXTERNAL_0 3
4337 +#define INTERRUPT_ID_EXTERNAL_1 4
4338 +#define INTERRUPT_ID_EXTERNAL_2 5
4339 +#define INTERRUPT_ID_EXTERNAL_3 6
4341 +/*=====================================================================*/
4342 +/* BCM6338 Timer Interrupt Level Assignments */
4343 +/*=====================================================================*/
4344 +#define MIPS_TIMER_INT 7
4346 +/*=====================================================================*/
4347 +/* Peripheral ISR Table Offset */
4348 +/*=====================================================================*/
4349 +#define INTERNAL_ISR_TABLE_OFFSET 8
4351 +/*=====================================================================*/
4352 +/* Logical Peripheral Interrupt IDs */
4353 +/*=====================================================================*/
4355 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
4356 +#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
4357 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
4358 +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 4)
4359 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 5)
4360 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 6)
4361 +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 7)
4362 +#define INTERRUPT_ID_EMAC1 (INTERNAL_ISR_TABLE_OFFSET + 8)
4363 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 9)
4364 +#define INTERRUPT_ID_SDRAM (INTERNAL_ISR_TABLE_OFFSET + 10)
4365 +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 11)
4366 +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 12)
4367 +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 13)
4368 +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 14)
4369 +#define INTERRUPT_ID_EMAC1_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 15)
4370 +#define INTERRUPT_ID_EMAC1_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 16)
4371 +#define INTERRUPT_ID_SDIO (INTERNAL_ISR_TABLE_OFFSET + 17)
4373 +#endif /* __BCM6338_H */
4375 diff -urN linux.old/arch/mips/bcm963xx/include/6338_map_part.h linux.dev/arch/mips/bcm963xx/include/6338_map_part.h
4376 --- linux.old/arch/mips/bcm963xx/include/6338_map_part.h 1970-01-01 01:00:00.000000000 +0100
4377 +++ linux.dev/arch/mips/bcm963xx/include/6338_map_part.h 2006-08-25 00:39:38.000000000 +0200
4381 + Copyright 2004 Broadcom Corp. All Rights Reserved.
4383 + This program is free software; you can distribute it and/or modify it
4384 + under the terms of the GNU General Public License (Version 2) as
4385 + published by the Free Software Foundation.
4387 + This program is distributed in the hope it will be useful, but WITHOUT
4388 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4389 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4392 + You should have received a copy of the GNU General Public License along
4393 + with this program; if not, write to the Free Software Foundation, Inc.,
4394 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4398 +#ifndef __BCM6338_MAP_H
4399 +#define __BCM6338_MAP_H
4401 +#include "bcmtypes.h"
4403 +#define PERF_BASE 0xfffe0000
4404 +#define TIMR_BASE 0xfffe0200
4405 +#define UART_BASE 0xfffe0300
4406 +#define GPIO_BASE 0xfffe0400
4407 +#define SPI_BASE 0xfffe0c00
4409 +typedef struct PerfControl {
4411 + uint16 testControl;
4412 + uint16 blkEnables;
4413 +#define EMAC_CLK_EN 0x0010
4414 +#define USBS_CLK_EN 0x0010
4415 +#define SAR_CLK_EN 0x0020
4417 +#define SPI_CLK_EN 0x0200
4419 + uint32 pll_control;
4420 +#define SOFT_RESET 0x00000001
4426 +#define EI_SENSE_SHFT 0
4427 +#define EI_STATUS_SHFT 5
4428 +#define EI_CLEAR_SHFT 10
4429 +#define EI_MASK_SHFT 15
4430 +#define EI_INSENS_SHFT 20
4431 +#define EI_LEVEL_SHFT 25
4433 + uint32 unused[4]; /* (18) */
4434 + uint32 BlockSoftReset; /* (28) */
4435 +#define BSR_SPI 0x00000001
4436 +#define BSR_EMAC 0x00000004
4437 +#define BSR_USBH 0x00000008
4438 +#define BSR_USBS 0x00000010
4439 +#define BSR_ADSL 0x00000020
4440 +#define BSR_DMAMEM 0x00000040
4441 +#define BSR_SAR 0x00000080
4442 +#define BSR_ACLC 0x00000100
4443 +#define BSR_ADSL_MIPS_PLL 0x00000400
4444 +#define BSR_ALL_BLOCKS \
4445 + (BSR_SPI | BSR_EMAC | BSR_USBH | BSR_USBS | BSR_ADSL | BSR_DMAMEM | \
4446 + BSR_SAR | BSR_ACLC | BSR_ADSL_MIPS_PLL)
4449 +#define PERF ((volatile PerfControl * const) PERF_BASE)
4452 +typedef struct Timer {
4455 +#define TIMER0EN 0x01
4456 +#define TIMER1EN 0x02
4457 +#define TIMER2EN 0x04
4459 +#define TIMER0 0x01
4460 +#define TIMER1 0x02
4461 +#define TIMER2 0x04
4462 +#define WATCHDOG 0x08
4466 +#define TIMERENABLE 0x80000000
4467 +#define RSTCNTCLR 0x40000000
4471 + uint32 WatchDogDefCount;
4473 + /* Write 0xff00 0x00ff to Start timer
4474 + * Write 0xee00 0x00ee to Stop and re-load default count
4475 + * Read from this register returns current watch dog count
4477 + uint32 WatchDogCtl;
4479 + /* Number of 40-MHz ticks for WD Reset pulse to last */
4480 + uint32 WDResetCount;
4483 +#define TIMER ((volatile Timer * const) TIMR_BASE)
4484 +typedef struct UartChannel {
4487 +#define BRGEN 0x80 /* Control register bit defs */
4490 +#define LOOPBK 0x10
4491 +#define TXPARITYEN 0x08
4492 +#define TXPARITYEVEN 0x04
4493 +#define RXPARITYEN 0x02
4494 +#define RXPARITYEVEN 0x01
4497 +#define XMITBREAK 0x40
4498 +#define BITS5SYM 0x00
4499 +#define BITS6SYM 0x10
4500 +#define BITS7SYM 0x20
4501 +#define BITS8SYM 0x30
4502 +#define ONESTOP 0x07
4503 +#define TWOSTOP 0x0f
4504 + /* 4-LSBS represent STOP bits/char
4505 + * in 1/8 bit-time intervals. Zero
4506 + * represents 1/8 stop bit interval.
4507 + * Fifteen represents 2 stop bits.
4510 +#define RSTTXFIFOS 0x80
4511 +#define RSTRXFIFOS 0x40
4512 + /* 5-bit TimeoutCnt is in low bits of this register.
4513 + * This count represents the number of characters
4514 + * idle times before setting receive Irq when below threshold
4517 + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
4520 + byte txf_levl; /* Read-only fifo depth */
4521 + byte rxf_levl; /* Read-only fifo depth */
4522 + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
4523 + * RxThreshold. Irq can be asserted
4524 + * when rx fifo> thresh, txfifo<thresh
4526 + byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
4527 + * if these bits are also enabled to GPIO_o
4533 + byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
4534 + * detect irq on rising AND falling
4535 + * edges for corresponding GPIO_i
4536 + * if enabled (edge insensitive)
4538 + byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
4539 + * 0 for negedge sense if
4540 + * not configured for edge
4541 + * insensitive (see above)
4542 + * Lower 4 bits: Mask to enable change
4543 + * detection IRQ for corresponding
4546 + byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
4547 + * have changed (may set IRQ).
4548 + * read automatically clears bit
4549 + * Lower 4 bits are actual status
4552 + uint16 intMask; /* Same Bit defs for Mask and status */
4554 +#define DELTAIP 0x0001
4555 +#define TXUNDERR 0x0002
4556 +#define TXOVFERR 0x0004
4557 +#define TXFIFOTHOLD 0x0008
4558 +#define TXREADLATCH 0x0010
4559 +#define TXFIFOEMT 0x0020
4560 +#define RXUNDERR 0x0040
4561 +#define RXOVFERR 0x0080
4562 +#define RXTIMEOUT 0x0100
4563 +#define RXFIFOFULL 0x0200
4564 +#define RXFIFOTHOLD 0x0400
4565 +#define RXFIFONE 0x0800
4566 +#define RXFRAMERR 0x1000
4567 +#define RXPARERR 0x2000
4568 +#define RXBRK 0x4000
4571 + uint16 Data; /* Write to TX, Read from RX */
4572 + /* bits 11:8 are BRK,PAR,FRM errors */
4578 +#define UART ((volatile Uart * const) UART_BASE)
4580 +typedef struct GpioControl {
4582 + uint32 GPIODir; /* bits 7:0 */
4584 + uint32 GPIOio; /* bits 7:0 */
4586 +#define LED3_STROBE 0x08000000
4587 +#define LED2_STROBE 0x04000000
4588 +#define LED1_STROBE 0x02000000
4589 +#define LED0_STROBE 0x01000000
4590 +#define LED_TEST 0x00010000
4591 +#define LED3_DISABLE_LINK_ACT 0x00008000
4592 +#define LED2_DISABLE_LINK_ACT 0x00004000
4593 +#define LED1_DISABLE_LINK_ACT 0x00002000
4594 +#define LED0_DISABLE_LINK_ACT 0x00001000
4595 +#define LED_INTERVAL_SET_MASK 0x00000f00
4596 +#define LED_INTERVAL_SET_320MS 0x00000500
4597 +#define LED_INTERVAL_SET_160MS 0x00000400
4598 +#define LED_INTERVAL_SET_80MS 0x00000300
4599 +#define LED_INTERVAL_SET_40MS 0x00000200
4600 +#define LED_INTERVAL_SET_20MS 0x00000100
4601 +#define LED3_ON 0x00000080
4602 +#define LED2_ON 0x00000040
4603 +#define LED1_ON 0x00000020
4604 +#define LED0_ON 0x00000010
4605 +#define LED3_ENABLE 0x00000008
4606 +#define LED2_ENABLE 0x00000004
4607 +#define LED1_ENABLE 0x00000002
4608 +#define LED0_ENABLE 0x00000001
4609 + uint32 SpiSlaveCfg;
4610 +#define SPI_SLAVE_RESET 0x00010000
4611 +#define SPI_RESTRICT 0x00000400
4612 +#define SPI_DELAY_DISABLE 0x00000200
4613 +#define SPI_PROBE_MUX_SEL_MASK 0x000001e0
4614 +#define SPI_SER_ADDR_CFG_MASK 0x0000000c
4615 +#define SPI_MODE 0x00000001
4616 + uint32 vRegConfig;
4619 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
4621 +/* Number to mask conversion macro used for GPIODir and GPIOio */
4622 +#define GPIO_NUM_MAX_BITS_MASK 0x0f
4623 +#define GPIO_NUM_TO_MASK(X) (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
4629 +typedef struct SpiControl {
4630 + uint16 spiCmd; /* (0x0): SPI command */
4631 +#define SPI_CMD_START_IMMEDIATE 3
4633 +#define SPI_CMD_COMMAND_SHIFT 0
4634 +#define SPI_CMD_DEVICE_ID_SHIFT 4
4635 +#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT 8
4637 + byte spiIntStatus; /* (0x2): SPI interrupt status */
4638 + byte spiMaskIntStatus; /* (0x3): SPI masked interrupt status */
4640 + byte spiIntMask; /* (0x4): SPI interrupt mask */
4641 +#define SPI_INTR_CMD_DONE 0x01
4642 +#define SPI_INTR_CLEAR_ALL 0x1f
4644 + byte spiStatus; /* (0x5): SPI status */
4646 + byte spiClkCfg; /* (0x6): SPI clock configuration */
4648 + byte spiFillByte; /* (0x7): SPI fill byte */
4651 + byte spiMsgTail; /* (0x9): msgtail */
4653 + byte spiRxTail; /* (0xB): rxtail */
4655 + uint32 unused2[13]; /* (0x0c - 0x3c) reserved */
4657 + byte spiMsgCtl; /* (0x40) control byte */
4658 +#define HALF_DUPLEX_W 1
4659 +#define HALF_DUPLEX_R 2
4660 +#define SPI_MSG_TYPE_SHIFT 6
4661 +#define SPI_BYTE_CNT_SHIFT 0
4662 + byte spiMsgData[63]; /* (0x41 - 0x7f) msg data */
4663 + byte spiRxDataFifo[64]; /* (0x80 - 0xbf) rx data */
4664 + byte unused3[64]; /* (0xc0 - 0xff) reserved */
4667 +#define SPI ((volatile SpiControl * const) SPI_BASE)
4670 +** External Bus Interface
4672 +typedef struct EbiChipSelect {
4673 + uint32 base; /* base address in upper 24 bits */
4674 +#define EBI_SIZE_8K 0
4675 +#define EBI_SIZE_16K 1
4676 +#define EBI_SIZE_32K 2
4677 +#define EBI_SIZE_64K 3
4678 +#define EBI_SIZE_128K 4
4679 +#define EBI_SIZE_256K 5
4680 +#define EBI_SIZE_512K 6
4681 +#define EBI_SIZE_1M 7
4682 +#define EBI_SIZE_2M 8
4683 +#define EBI_SIZE_4M 9
4684 +#define EBI_SIZE_8M 10
4685 +#define EBI_SIZE_16M 11
4686 +#define EBI_SIZE_32M 12
4687 +#define EBI_SIZE_64M 13
4688 +#define EBI_SIZE_128M 14
4689 +#define EBI_SIZE_256M 15
4691 +#define EBI_ENABLE 0x00000001 /* .. enable this range */
4692 +#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
4693 +#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
4694 +#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
4695 +#define EBI_WREN 0x00000020 /* enable posted writes */
4696 +#define EBI_POLARITY 0x00000040 /* .. set to invert something,
4697 + ** don't know what yet */
4698 +#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
4699 +#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
4700 +#define EBI_FIFO 0x00000200 /* .. use fifo */
4701 +#define EBI_RE 0x00000400 /* .. Reverse Endian */
4704 +typedef struct MpiRegisters {
4705 + EbiChipSelect cs[1]; /* size chip select configuration */
4708 +#define MPI ((volatile MpiRegisters * const) MPI_BASE)
4713 diff -urN linux.old/arch/mips/bcm963xx/include/6345_intr.h linux.dev/arch/mips/bcm963xx/include/6345_intr.h
4714 --- linux.old/arch/mips/bcm963xx/include/6345_intr.h 1970-01-01 01:00:00.000000000 +0100
4715 +++ linux.dev/arch/mips/bcm963xx/include/6345_intr.h 2006-08-25 00:39:38.000000000 +0200
4719 + Copyright 2002 Broadcom Corp. All Rights Reserved.
4721 + This program is free software; you can distribute it and/or modify it
4722 + under the terms of the GNU General Public License (Version 2) as
4723 + published by the Free Software Foundation.
4725 + This program is distributed in the hope it will be useful, but WITHOUT
4726 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4727 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4730 + You should have received a copy of the GNU General Public License along
4731 + with this program; if not, write to the Free Software Foundation, Inc.,
4732 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4736 +#ifndef __6345_INTR_H
4737 +#define __6345_INTR_H
4740 +/*=====================================================================*/
4741 +/* BCM6345 External Interrupt Level Assignments */
4742 +/*=====================================================================*/
4743 +#define INTERRUPT_ID_EXTERNAL_0 3
4744 +#define INTERRUPT_ID_EXTERNAL_1 4
4745 +#define INTERRUPT_ID_EXTERNAL_2 5
4746 +#define INTERRUPT_ID_EXTERNAL_3 6
4748 +/*=====================================================================*/
4749 +/* BCM6345 Timer Interrupt Level Assignments */
4750 +/*=====================================================================*/
4751 +#define MIPS_TIMER_INT 7
4753 +/*=====================================================================*/
4754 +/* Peripheral ISR Table Offset */
4755 +/*=====================================================================*/
4756 +#define INTERNAL_ISR_TABLE_OFFSET 8
4757 +#define DMA_ISR_TABLE_OFFSET (INTERNAL_ISR_TABLE_OFFSET + 13)
4759 +/*=====================================================================*/
4760 +/* Logical Peripheral Interrupt IDs */
4761 +/*=====================================================================*/
4763 +/* Internal peripheral interrupt IDs */
4764 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
4765 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
4766 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 3)
4767 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 4)
4768 +#define INTERRUPT_ID_USB (INTERNAL_ISR_TABLE_OFFSET + 5)
4769 +#define INTERRUPT_ID_EMAC (INTERNAL_ISR_TABLE_OFFSET + 8)
4770 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 12)
4772 +/* DMA channel interrupt IDs */
4773 +#define INTERRUPT_ID_EMAC_RX_CHAN (DMA_ISR_TABLE_OFFSET + EMAC_RX_CHAN)
4774 +#define INTERRUPT_ID_EMAC_TX_CHAN (DMA_ISR_TABLE_OFFSET + EMAC_TX_CHAN)
4775 +#define INTERRUPT_ID_EBI_RX_CHAN (DMA_ISR_TABLE_OFFSET + EBI_RX_CHAN)
4776 +#define INTERRUPT_ID_EBI_TX_CHAN (DMA_ISR_TABLE_OFFSET + EBI_TX_CHAN)
4777 +#define INTERRUPT_ID_RESERVED_RX_CHAN (DMA_ISR_TABLE_OFFSET + RESERVED_RX_CHAN)
4778 +#define INTERRUPT_ID_RESERVED_TX_CHAN (DMA_ISR_TABLE_OFFSET + RESERVED_TX_CHAN)
4779 +#define INTERRUPT_ID_USB_BULK_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_BULK_RX_CHAN)
4780 +#define INTERRUPT_ID_USB_BULK_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_BULK_TX_CHAN)
4781 +#define INTERRUPT_ID_USB_CNTL_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_CNTL_RX_CHAN)
4782 +#define INTERRUPT_ID_USB_CNTL_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_CNTL_TX_CHAN)
4783 +#define INTERRUPT_ID_USB_ISO_RX_CHAN (DMA_ISR_TABLE_OFFSET + USB_ISO_RX_CHAN)
4784 +#define INTERRUPT_ID_USB_ISO_TX_CHAN (DMA_ISR_TABLE_OFFSET + USB_ISO_TX_CHAN)
4787 +#endif /* __BCM6345_H */
4789 diff -urN linux.old/arch/mips/bcm963xx/include/6345_map_part.h linux.dev/arch/mips/bcm963xx/include/6345_map_part.h
4790 --- linux.old/arch/mips/bcm963xx/include/6345_map_part.h 1970-01-01 01:00:00.000000000 +0100
4791 +++ linux.dev/arch/mips/bcm963xx/include/6345_map_part.h 2006-08-25 00:39:38.000000000 +0200
4795 + Copyright 2002 Broadcom Corp. All Rights Reserved.
4797 + This program is free software; you can distribute it and/or modify it
4798 + under the terms of the GNU General Public License (Version 2) as
4799 + published by the Free Software Foundation.
4801 + This program is distributed in the hope it will be useful, but WITHOUT
4802 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4803 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4806 + You should have received a copy of the GNU General Public License along
4807 + with this program; if not, write to the Free Software Foundation, Inc.,
4808 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4812 +#ifndef __BCM6345_MAP_H
4813 +#define __BCM6345_MAP_H
4816 +#include "bcmtypes.h"
4817 +#include "6345_intr.h"
4819 +typedef struct IntControl {
4821 + uint16 testControl;
4822 + uint16 blkEnables;
4823 +#define USB_CLK_EN 0x0100
4824 +#define EMAC_CLK_EN 0x0080
4825 +#define UART_CLK_EN 0x0008
4826 +#define CPU_CLK_EN 0x0001
4828 + uint32 pll_control;
4829 +#define SOFT_RESET 0x00000001
4835 +#define EI_SENSE_SHFT 0
4836 +#define EI_STATUS_SHFT 4
4837 +#define EI_CLEAR_SHFT 8
4838 +#define EI_MASK_SHFT 12
4839 +#define EI_INSENS_SHFT 16
4840 +#define EI_LEVEL_SHFT 20
4843 +#define INTC_BASE 0xfffe0000
4844 +#define PERF ((volatile IntControl * const) INTC_BASE)
4846 +#define TIMR_BASE 0xfffe0200
4847 +typedef struct Timer {
4850 +#define TIMER0EN 0x01
4851 +#define TIMER1EN 0x02
4852 +#define TIMER2EN 0x04
4854 +#define TIMER0 0x01
4855 +#define TIMER1 0x02
4856 +#define TIMER2 0x04
4857 +#define WATCHDOG 0x08
4861 +#define TIMERENABLE 0x80000000
4862 +#define RSTCNTCLR 0x40000000
4866 + uint32 WatchDogDefCount;
4868 + /* Write 0xff00 0x00ff to Start timer
4869 + * Write 0xee00 0x00ee to Stop and re-load default count
4870 + * Read from this register returns current watch dog count
4872 + uint32 WatchDogCtl;
4874 + /* Number of 40-MHz ticks for WD Reset pulse to last */
4875 + uint32 WDResetCount;
4878 +#define TIMER ((volatile Timer * const) TIMR_BASE)
4880 +typedef struct UartChannel {
4883 +#define BRGEN 0x80 /* Control register bit defs */
4886 +#define TXPARITYEN 0x08
4887 +#define TXPARITYEVEN 0x04
4888 +#define RXPARITYEN 0x02
4889 +#define RXPARITYEVEN 0x01
4891 +#define BITS5SYM 0x00
4892 +#define BITS6SYM 0x10
4893 +#define BITS7SYM 0x20
4894 +#define BITS8SYM 0x30
4895 +#define XMITBREAK 0x40
4896 +#define ONESTOP 0x07
4897 +#define TWOSTOP 0x0f
4900 +#define RSTTXFIFOS 0x80
4901 +#define RSTRXFIFOS 0x40
4910 + byte DeltaIPEdgeNoSense;
4911 + byte DeltaIPConfig_Mask;
4912 + byte DeltaIP_SyncIP;
4915 +#define TXUNDERR 0x0002
4916 +#define TXOVFERR 0x0004
4917 +#define TXFIFOEMT 0x0020
4918 +#define RXOVFERR 0x0080
4919 +#define RXFIFONE 0x0800
4920 +#define RXFRAMERR 0x1000
4921 +#define RXPARERR 0x2000
4922 +#define RXBRK 0x4000
4930 +#define UART_BASE 0xfffe0300
4931 +#define UART ((volatile Uart * const) UART_BASE)
4933 +typedef struct GpioControl {
4947 +#define GPIO_BASE 0xfffe0400
4948 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
4950 +#define GPIO_NUM_MAX_BITS_MASK 0x0f
4951 +#define GPIO_NUM_TO_MASK(X) (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
4956 diff -urN linux.old/arch/mips/bcm963xx/include/6348_intr.h linux.dev/arch/mips/bcm963xx/include/6348_intr.h
4957 --- linux.old/arch/mips/bcm963xx/include/6348_intr.h 1970-01-01 01:00:00.000000000 +0100
4958 +++ linux.dev/arch/mips/bcm963xx/include/6348_intr.h 2006-08-25 00:39:38.000000000 +0200
4962 + Copyright 2003 Broadcom Corp. All Rights Reserved.
4964 + This program is free software; you can distribute it and/or modify it
4965 + under the terms of the GNU General Public License (Version 2) as
4966 + published by the Free Software Foundation.
4968 + This program is distributed in the hope it will be useful, but WITHOUT
4969 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4970 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4973 + You should have received a copy of the GNU General Public License along
4974 + with this program; if not, write to the Free Software Foundation, Inc.,
4975 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
4979 +#ifndef __6348_INTR_H
4980 +#define __6348_INTR_H
4983 +/*=====================================================================*/
4984 +/* BCM6348 External Interrupt Level Assignments */
4985 +/*=====================================================================*/
4986 +#define INTERRUPT_ID_EXTERNAL_0 3
4987 +#define INTERRUPT_ID_EXTERNAL_1 4
4988 +#define INTERRUPT_ID_EXTERNAL_2 5
4989 +#define INTERRUPT_ID_EXTERNAL_3 6
4991 +/*=====================================================================*/
4992 +/* BCM6348 Timer Interrupt Level Assignments */
4993 +/*=====================================================================*/
4994 +#define MIPS_TIMER_INT 7
4996 +/*=====================================================================*/
4997 +/* Peripheral ISR Table Offset */
4998 +/*=====================================================================*/
4999 +#define INTERNAL_ISR_TABLE_OFFSET 8
5001 +/*=====================================================================*/
5002 +/* Logical Peripheral Interrupt IDs */
5003 +/*=====================================================================*/
5005 +#define INTERRUPT_ID_TIMER (INTERNAL_ISR_TABLE_OFFSET + 0)
5006 +#define INTERRUPT_ID_SPI (INTERNAL_ISR_TABLE_OFFSET + 1)
5007 +#define INTERRUPT_ID_UART (INTERNAL_ISR_TABLE_OFFSET + 2)
5008 +#define INTERRUPT_ID_ADSL (INTERNAL_ISR_TABLE_OFFSET + 4)
5009 +#define INTERRUPT_ID_ATM (INTERNAL_ISR_TABLE_OFFSET + 5)
5010 +#define INTERRUPT_ID_USBS (INTERNAL_ISR_TABLE_OFFSET + 6)
5011 +#define INTERRUPT_ID_EMAC2 (INTERNAL_ISR_TABLE_OFFSET + 7)
5012 +#define INTERRUPT_ID_EMAC1 (INTERNAL_ISR_TABLE_OFFSET + 8)
5013 +#define INTERRUPT_ID_EPHY (INTERNAL_ISR_TABLE_OFFSET + 9)
5014 +#define INTERRUPT_ID_M2M (INTERNAL_ISR_TABLE_OFFSET + 10)
5015 +#define INTERRUPT_ID_ACLC (INTERNAL_ISR_TABLE_OFFSET + 11)
5016 +#define INTERRUPT_ID_USBH (INTERNAL_ISR_TABLE_OFFSET + 12)
5017 +#define INTERRUPT_ID_SDRAM (INTERNAL_ISR_TABLE_OFFSET + 13)
5018 +#define INTERRUPT_ID_USB_CNTL_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 14)
5019 +#define INTERRUPT_ID_USB_CNTL_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 15)
5020 +#define INTERRUPT_ID_USB_BULK_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 16)
5021 +#define INTERRUPT_ID_USB_BULK_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 17)
5022 +#define INTERRUPT_ID_USB_ISO_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 18)
5023 +#define INTERRUPT_ID_USB_ISO_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 19)
5024 +#define INTERRUPT_ID_EMAC1_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 20)
5025 +#define INTERRUPT_ID_EMAC1_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 21)
5026 +#define INTERRUPT_ID_EMAC2_RX_DMA (INTERNAL_ISR_TABLE_OFFSET + 22)
5027 +#define INTERRUPT_ID_EMAC2_TX_DMA (INTERNAL_ISR_TABLE_OFFSET + 23)
5028 +#define INTERRUPT_ID_MPI (INTERNAL_ISR_TABLE_OFFSET + 24)
5029 +#define INTERRUPT_ID_DG (INTERNAL_ISR_TABLE_OFFSET + 25)
5032 +#endif /* __BCM6348_H */
5034 diff -urN linux.old/arch/mips/bcm963xx/include/6348_map_part.h linux.dev/arch/mips/bcm963xx/include/6348_map_part.h
5035 --- linux.old/arch/mips/bcm963xx/include/6348_map_part.h 1970-01-01 01:00:00.000000000 +0100
5036 +++ linux.dev/arch/mips/bcm963xx/include/6348_map_part.h 2006-08-25 00:39:38.000000000 +0200
5040 + Copyright 2002 Broadcom Corp. All Rights Reserved.
5042 + This program is free software; you can distribute it and/or modify it
5043 + under the terms of the GNU General Public License (Version 2) as
5044 + published by the Free Software Foundation.
5046 + This program is distributed in the hope it will be useful, but WITHOUT
5047 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5048 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5051 + You should have received a copy of the GNU General Public License along
5052 + with this program; if not, write to the Free Software Foundation, Inc.,
5053 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5057 +#ifndef __BCM6348_MAP_H
5058 +#define __BCM6348_MAP_H
5060 +#include "bcmtypes.h"
5062 +#define PERF_BASE 0xfffe0000
5063 +#define TIMR_BASE 0xfffe0200
5064 +#define UART_BASE 0xfffe0300
5065 +#define GPIO_BASE 0xfffe0400
5066 +#define MPI_BASE 0xfffe2000 /* MPI control registers */
5067 +#define USB_HOST_BASE 0xfffe1b00 /* USB host registers */
5068 +#define USB_HOST_NON_OHCI 0xfffe1c00 /* USB host non-OHCI registers */
5070 +typedef struct PerfControl {
5072 + uint16 testControl;
5073 + uint16 blkEnables;
5074 +#define EMAC_CLK_EN 0x0010
5075 +#define SAR_CLK_EN 0x0020
5076 +#define USBS_CLK_EN 0x0040
5077 +#define USBH_CLK_EN 0x0100
5079 + uint32 pll_control;
5080 +#define SOFT_RESET 0x00000001
5086 +#define EI_SENSE_SHFT 0
5087 +#define EI_STATUS_SHFT 5
5088 +#define EI_CLEAR_SHFT 10
5089 +#define EI_MASK_SHFT 15
5090 +#define EI_INSENS_SHFT 20
5091 +#define EI_LEVEL_SHFT 25
5093 + uint32 unused[4]; /* (18) */
5094 + uint32 BlockSoftReset; /* (28) */
5095 +#define BSR_SPI 0x00000001
5096 +#define BSR_EMAC 0x00000004
5097 +#define BSR_USBH 0x00000008
5098 +#define BSR_USBS 0x00000010
5099 +#define BSR_ADSL 0x00000020
5100 +#define BSR_DMAMEM 0x00000040
5101 +#define BSR_SAR 0x00000080
5102 +#define BSR_ACLC 0x00000100
5103 +#define BSR_ADSL_MIPS_PLL 0x00000400
5104 +#define BSR_ALL_BLOCKS \
5105 + (BSR_SPI | BSR_EMAC | BSR_USBH | BSR_USBS | BSR_ADSL | BSR_DMAMEM | \
5106 + BSR_SAR | BSR_ACLC | BSR_ADSL_MIPS_PLL)
5107 + uint32 unused2[2]; /* (2c) */
5108 + uint32 PllStrap; /* (34) */
5109 +#define PLL_N1_SHFT 20
5110 +#define PLL_N1_MASK (7<<PLL_N1_SHFT)
5111 +#define PLL_N2_SHFT 15
5112 +#define PLL_N2_MASK (0x1f<<PLL_N2_SHFT)
5113 +#define PLL_M1_REF_SHFT 12
5114 +#define PLL_M1_REF_MASK (7<<PLL_M1_REF_SHFT)
5115 +#define PLL_M2_REF_SHFT 9
5116 +#define PLL_M2_REF_MASK (7<<PLL_M2_REF_SHFT)
5117 +#define PLL_M1_CPU_SHFT 6
5118 +#define PLL_M1_CPU_MASK (7<<PLL_M1_CPU_SHFT)
5119 +#define PLL_M1_BUS_SHFT 3
5120 +#define PLL_M1_BUS_MASK (7<<PLL_M1_BUS_SHFT)
5121 +#define PLL_M2_BUS_SHFT 0
5122 +#define PLL_M2_BUS_MASK (7<<PLL_M2_BUS_SHFT)
5125 +#define PERF ((volatile PerfControl * const) PERF_BASE)
5127 +typedef struct Timer {
5130 +#define TIMER0EN 0x01
5131 +#define TIMER1EN 0x02
5132 +#define TIMER2EN 0x04
5134 +#define TIMER0 0x01
5135 +#define TIMER1 0x02
5136 +#define TIMER2 0x04
5137 +#define WATCHDOG 0x08
5141 +#define TIMERENABLE 0x80000000
5142 +#define RSTCNTCLR 0x40000000
5146 + uint32 WatchDogDefCount;
5148 + /* Write 0xff00 0x00ff to Start timer
5149 + * Write 0xee00 0x00ee to Stop and re-load default count
5150 + * Read from this register returns current watch dog count
5152 + uint32 WatchDogCtl;
5154 + /* Number of 40-MHz ticks for WD Reset pulse to last */
5155 + uint32 WDResetCount;
5158 +#define TIMER ((volatile Timer * const) TIMR_BASE)
5160 +typedef struct UartChannel {
5163 +#define BRGEN 0x80 /* Control register bit defs */
5166 +#define LOOPBK 0x10
5167 +#define TXPARITYEN 0x08
5168 +#define TXPARITYEVEN 0x04
5169 +#define RXPARITYEN 0x02
5170 +#define RXPARITYEVEN 0x01
5173 +#define XMITBREAK 0x40
5174 +#define BITS5SYM 0x00
5175 +#define BITS6SYM 0x10
5176 +#define BITS7SYM 0x20
5177 +#define BITS8SYM 0x30
5178 +#define ONESTOP 0x07
5179 +#define TWOSTOP 0x0f
5180 + /* 4-LSBS represent STOP bits/char
5181 + * in 1/8 bit-time intervals. Zero
5182 + * represents 1/8 stop bit interval.
5183 + * Fifteen represents 2 stop bits.
5186 +#define RSTTXFIFOS 0x80
5187 +#define RSTRXFIFOS 0x40
5188 + /* 5-bit TimeoutCnt is in low bits of this register.
5189 + * This count represents the number of characters
5190 + * idle times before setting receive Irq when below threshold
5193 + /* When divide SysClk/2/(1+baudword) we should get 32*bit-rate
5196 + byte txf_levl; /* Read-only fifo depth */
5197 + byte rxf_levl; /* Read-only fifo depth */
5198 + byte fifocfg; /* Upper 4-bits are TxThresh, Lower are
5199 + * RxThreshold. Irq can be asserted
5200 + * when rx fifo> thresh, txfifo<thresh
5202 + byte prog_out; /* Set value of DTR (Bit0), RTS (Bit1)
5203 + * if these bits are also enabled to GPIO_o
5209 + byte DeltaIPEdgeNoSense; /* Low 4-bits, set corr bit to 1 to
5210 + * detect irq on rising AND falling
5211 + * edges for corresponding GPIO_i
5212 + * if enabled (edge insensitive)
5214 + byte DeltaIPConfig_Mask; /* Upper 4 bits: 1 for posedge sense
5215 + * 0 for negedge sense if
5216 + * not configured for edge
5217 + * insensitive (see above)
5218 + * Lower 4 bits: Mask to enable change
5219 + * detection IRQ for corresponding
5222 + byte DeltaIP_SyncIP; /* Upper 4 bits show which bits
5223 + * have changed (may set IRQ).
5224 + * read automatically clears bit
5225 + * Lower 4 bits are actual status
5228 + uint16 intMask; /* Same Bit defs for Mask and status */
5230 +#define DELTAIP 0x0001
5231 +#define TXUNDERR 0x0002
5232 +#define TXOVFERR 0x0004
5233 +#define TXFIFOTHOLD 0x0008
5234 +#define TXREADLATCH 0x0010
5235 +#define TXFIFOEMT 0x0020
5236 +#define RXUNDERR 0x0040
5237 +#define RXOVFERR 0x0080
5238 +#define RXTIMEOUT 0x0100
5239 +#define RXFIFOFULL 0x0200
5240 +#define RXFIFOTHOLD 0x0400
5241 +#define RXFIFONE 0x0800
5242 +#define RXFRAMERR 0x1000
5243 +#define RXPARERR 0x2000
5244 +#define RXBRK 0x4000
5247 + uint16 Data; /* Write to TX, Read from RX */
5248 + /* bits 11:8 are BRK,PAR,FRM errors */
5254 +#define UART ((volatile Uart * const) UART_BASE)
5256 +typedef struct GpioControl {
5257 + uint32 GPIODir_high; /* bits 36:32 */
5258 + uint32 GPIODir; /* bits 31:00 */
5259 + uint32 GPIOio_high; /* bits 36:32 */
5260 + uint32 GPIOio; /* bits 31:00 */
5262 +#define LED3_STROBE 0x08000000
5263 +#define LED2_STROBE 0x04000000
5264 +#define LED1_STROBE 0x02000000
5265 +#define LED0_STROBE 0x01000000
5266 +#define LED_TEST 0x00010000
5267 +#define LED3_DISABLE_LINK_ACT 0x00008000
5268 +#define LED2_DISABLE_LINK_ACT 0x00004000
5269 +#define LED1_DISABLE_LINK_ACT 0x00002000
5270 +#define LED0_DISABLE_LINK_ACT 0x00001000
5271 +#define LED_INTERVAL_SET_MASK 0x00000f00
5272 +#define LED_INTERVAL_SET_320MS 0x00000500
5273 +#define LED_INTERVAL_SET_160MS 0x00000400
5274 +#define LED_INTERVAL_SET_80MS 0x00000300
5275 +#define LED_INTERVAL_SET_40MS 0x00000200
5276 +#define LED_INTERVAL_SET_20MS 0x00000100
5277 +#define LED3_ON 0x00000080
5278 +#define LED2_ON 0x00000040
5279 +#define LED1_ON 0x00000020
5280 +#define LED0_ON 0x00000010
5281 +#define LED3_ENABLE 0x00000008
5282 +#define LED2_ENABLE 0x00000004
5283 +#define LED1_ENABLE 0x00000002
5284 +#define LED0_ENABLE 0x00000001
5285 + uint32 SpiSlaveCfg;
5286 +#define SPI_SLAVE_RESET 0x00010000
5287 +#define SPI_RESTRICT 0x00000400
5288 +#define SPI_DELAY_DISABLE 0x00000200
5289 +#define SPI_PROBE_MUX_SEL_MASK 0x000001e0
5290 +#define SPI_SER_ADDR_CFG_MASK 0x0000000c
5291 +#define SPI_MODE 0x00000001
5293 +#define GROUP4_DIAG 0x00090000
5294 +#define GROUP4_UTOPIA 0x00080000
5295 +#define GROUP4_LEGACY_LED 0x00030000
5296 +#define GROUP4_MII_SNOOP 0x00020000
5297 +#define GROUP4_EXT_EPHY 0x00010000
5298 +#define GROUP3_DIAG 0x00009000
5299 +#define GROUP3_UTOPIA 0x00008000
5300 +#define GROUP3_EXT_MII 0x00007000
5301 +#define GROUP2_DIAG 0x00000900
5302 +#define GROUP2_PCI 0x00000500
5303 +#define GROUP1_DIAG 0x00000090
5304 +#define GROUP1_UTOPIA 0x00000080
5305 +#define GROUP1_SPI_UART 0x00000060
5306 +#define GROUP1_SPI_MASTER 0x00000060
5307 +#define GROUP1_MII_PCCARD 0x00000040
5308 +#define GROUP1_MII_SNOOP 0x00000020
5309 +#define GROUP1_EXT_EPHY 0x00000010
5310 +#define GROUP0_DIAG 0x00000009
5311 +#define GROUP0_EXT_MII 0x00000007
5315 +#define GPIO ((volatile GpioControl * const) GPIO_BASE)
5317 +/* Number to mask conversion macro used for GPIODir and GPIOio */
5318 +#define GPIO_NUM_TOTAL_BITS_MASK 0x3f
5319 +#define GPIO_NUM_MAX_BITS_MASK 0x1f
5320 +#define GPIO_NUM_TO_MASK(X) ( (((X) & GPIO_NUM_TOTAL_BITS_MASK) < 32) ? (1 << ((X) & GPIO_NUM_MAX_BITS_MASK)) : (0) )
5322 +/* Number to mask conversion macro used for GPIODir_high and GPIOio_high */
5323 +#define GPIO_NUM_MAX_BITS_MASK_HIGH 0x07
5324 +#define GPIO_NUM_TO_MASK_HIGH(X) ( (((X) & GPIO_NUM_TOTAL_BITS_MASK) >= 32) ? (1 << ((X-32) & GPIO_NUM_MAX_BITS_MASK_HIGH)) : (0) )
5328 +** External Bus Interface
5330 +typedef struct EbiChipSelect {
5331 + uint32 base; /* base address in upper 24 bits */
5332 +#define EBI_SIZE_8K 0
5333 +#define EBI_SIZE_16K 1
5334 +#define EBI_SIZE_32K 2
5335 +#define EBI_SIZE_64K 3
5336 +#define EBI_SIZE_128K 4
5337 +#define EBI_SIZE_256K 5
5338 +#define EBI_SIZE_512K 6
5339 +#define EBI_SIZE_1M 7
5340 +#define EBI_SIZE_2M 8
5341 +#define EBI_SIZE_4M 9
5342 +#define EBI_SIZE_8M 10
5343 +#define EBI_SIZE_16M 11
5344 +#define EBI_SIZE_32M 12
5345 +#define EBI_SIZE_64M 13
5346 +#define EBI_SIZE_128M 14
5347 +#define EBI_SIZE_256M 15
5349 +#define EBI_ENABLE 0x00000001 /* .. enable this range */
5350 +#define EBI_WAIT_STATES 0x0000000e /* .. mask for wait states */
5351 +#define EBI_WTST_SHIFT 1 /* .. for shifting wait states */
5352 +#define EBI_WORD_WIDE 0x00000010 /* .. 16-bit peripheral, else 8 */
5353 +#define EBI_WREN 0x00000020 /* enable posted writes */
5354 +#define EBI_POLARITY 0x00000040 /* .. set to invert something,
5355 + ** don't know what yet */
5356 +#define EBI_TS_TA_MODE 0x00000080 /* .. use TS/TA mode */
5357 +#define EBI_TS_SEL 0x00000100 /* .. drive tsize, not bs_b */
5358 +#define EBI_FIFO 0x00000200 /* .. use fifo */
5359 +#define EBI_RE 0x00000400 /* .. Reverse Endian */
5362 +typedef struct MpiRegisters {
5363 + EbiChipSelect cs[7]; /* size chip select configuration */
5364 +#define EBI_CS0_BASE 0
5365 +#define EBI_CS1_BASE 1
5366 +#define EBI_CS2_BASE 2
5367 +#define EBI_CS3_BASE 3
5368 +#define PCMCIA_COMMON_BASE 4
5369 +#define PCMCIA_ATTRIBUTE_BASE 5
5370 +#define PCMCIA_IO_BASE 6
5371 + uint32 unused0[2]; /* reserved */
5372 + uint32 ebi_control; /* ebi control */
5373 + uint32 unused1[4]; /* reserved */
5374 +#define EBI_ACCESS_TIMEOUT 0x000007FF
5375 + uint32 pcmcia_cntl1; /* pcmcia control 1 */
5376 +#define PCCARD_CARD_RESET 0x00040000
5377 +#define CARDBUS_ENABLE 0x00008000
5378 +#define PCMCIA_ENABLE 0x00004000
5379 +#define PCMCIA_GPIO_ENABLE 0x00002000
5380 +#define CARDBUS_IDSEL 0x00001F00
5381 +#define VS2_OEN 0x00000080
5382 +#define VS1_OEN 0x00000040
5383 +#define VS2_OUT 0x00000020
5384 +#define VS1_OUT 0x00000010
5385 +#define VS2_IN 0x00000008
5386 +#define VS1_IN 0x00000004
5387 +#define CD2_IN 0x00000002
5388 +#define CD1_IN 0x00000001
5389 +#define VS_MASK 0x0000000C
5390 +#define CD_MASK 0x00000003
5391 + uint32 unused2; /* reserved */
5392 + uint32 pcmcia_cntl2; /* pcmcia control 2 */
5393 +#define PCMCIA_BYTESWAP_DIS 0x00000002
5394 +#define PCMCIA_HALFWORD_EN 0x00000001
5395 +#define RW_ACTIVE_CNT_BIT 2
5396 +#define INACTIVE_CNT_BIT 8
5397 +#define CE_SETUP_CNT_BIT 16
5398 +#define CE_HOLD_CNT_BIT 24
5399 + uint32 unused3[40]; /* reserved */
5401 + uint32 sp0range; /* PCI to internal system bus address space */
5410 + uint32 l2pcfgctl; /* internal system bus to PCI IO/Cfg control */
5411 +#define DIR_CFG_SEL 0x80000000 /* change from PCI I/O access to PCI config access */
5412 +#define DIR_CFG_USEREG 0x40000000 /* use this register info for PCI configuration access */
5413 +#define DEVICE_NUMBER 0x00007C00 /* device number for the PCI configuration access */
5414 +#define FUNC_NUMBER 0x00000300 /* function number for the PCI configuration access */
5415 +#define REG_NUMBER 0x000000FC /* register number for the PCI configuration access */
5416 +#define CONFIG_TYPE 0x00000003 /* configuration type for the PCI configuration access */
5418 + uint32 l2pmrange1; /* internal system bus to PCI memory space */
5419 +#define PCI_SIZE_64K 0xFFFF0000
5420 +#define PCI_SIZE_128K 0xFFFE0000
5421 +#define PCI_SIZE_256K 0xFFFC0000
5422 +#define PCI_SIZE_512K 0xFFF80000
5423 +#define PCI_SIZE_1M 0xFFF00000
5424 +#define PCI_SIZE_2M 0xFFE00000
5425 +#define PCI_SIZE_4M 0xFFC00000
5426 +#define PCI_SIZE_8M 0xFF800000
5427 +#define PCI_SIZE_16M 0xFF000000
5428 +#define PCI_SIZE_32M 0xFE000000
5429 + uint32 l2pmbase1; /* kseg0 or kseg1 address & 0x1FFFFFFF */
5430 + uint32 l2pmremap1;
5431 +#define CARDBUS_MEM 0x00000004
5432 +#define MEM_WINDOW_EN 0x00000001
5433 + uint32 l2pmrange2;
5435 + uint32 l2pmremap2;
5436 + uint32 l2piorange; /* internal system bus to PCI I/O space */
5438 + uint32 l2pioremap;
5440 + uint32 pcimodesel;
5441 +#define PCI2_INT_BUS_RD_PREFECH 0x000000F0
5442 +#define PCI_BAR2_NOSWAP 0x00000002 /* BAR at offset 0x20 */
5443 +#define PCI_BAR1_NOSWAP 0x00000001 /* BAR at affset 0x1c */
5445 + uint32 pciintstat; /* PCI interrupt mask/status */
5446 +#define MAILBOX1_SENT 0x08
5447 +#define MAILBOX0_SENT 0x04
5448 +#define MAILBOX1_MSG_RCV 0x02
5449 +#define MAILBOX0_MSG_RCV 0x01
5450 + uint32 locbuscntrl; /* internal system bus control */
5451 +#define DIR_U2P_NOSWAP 0x00000002
5452 +#define EN_PCI_GPIO 0x00000001
5453 + uint32 locintstat; /* internal system bus interrupt mask/status */
5454 +#define CSERR 0x0200
5455 +#define SERR 0x0100
5456 +#define EXT_PCI_INT 0x0080
5457 +#define DIR_FAILED 0x0040
5458 +#define DIR_COMPLETE 0x0020
5459 +#define PCI_CFG 0x0010
5460 + uint32 unused5[7];
5465 + uint32 pcicfgcntrl; /* internal system bus PCI configuration control */
5466 +#define PCI_CFG_REG_WRITE_EN 0x00000080
5467 +#define PCI_CFG_ADDR 0x0000003C
5468 + uint32 pcicfgdata; /* internal system bus PCI configuration data */
5470 + uint32 locch2ctl; /* PCI to interrnal system bus DMA (downstream) local control */
5471 +#define MPI_DMA_HALT 0x00000008 /* idle after finish current memory burst */
5472 +#define MPI_DMA_PKT_HALT 0x00000004 /* idle after an EOP flag is detected */
5473 +#define MPI_DMA_STALL 0x00000002 /* idle after an EOP flag is detected */
5474 +#define MPI_DMA_ENABLE 0x00000001 /* set to enable channel */
5475 + uint32 locch2intStat;
5476 +#define MPI_DMA_NO_DESC 0x00000004 /* no valid descriptors */
5477 +#define MPI_DMA_DONE 0x00000002 /* packet xfer complete */
5478 +#define MPI_DMA_BUFF_DONE 0x00000001 /* buffer done */
5479 + uint32 locch2intMask;
5481 + uint32 locch2descaddr;
5482 + uint32 locch2status1;
5483 +#define LOCAL_DESC_STATE 0xE0000000
5484 +#define PCI_DESC_STATE 0x1C000000
5485 +#define BYTE_DONE 0x03FFC000
5486 +#define RING_ADDR 0x00003FFF
5487 + uint32 locch2status2;
5488 +#define BUFPTR_OFFSET 0x1FFF0000
5489 +#define PCI_MASTER_STATE 0x000000C0
5490 +#define LOC_MASTER_STATE 0x00000038
5491 +#define CONTROL_STATE 0x00000007
5494 + uint32 locch1Ctl; /*internal system bus to PCI DMA (upstream) local control */
5495 +#define DMA_U2P_LE 0x00000200 /* local bus is little endian */
5496 +#define DMA_U2P_NOSWAP 0x00000100 /* lccal bus is little endian but no data swapped */
5497 + uint32 locch1intstat;
5498 + uint32 locch1intmask;
5500 + uint32 locch1descaddr;
5501 + uint32 locch1status1;
5502 + uint32 locch1status2;
5505 + uint32 pcich1ctl; /* internal system bus to PCI DMA PCI control */
5506 + uint32 pcich1intstat;
5507 + uint32 pcich1intmask;
5508 + uint32 pcich1descaddr;
5509 + uint32 pcich1status1;
5510 + uint32 pcich1status2;
5512 + uint32 pcich2Ctl; /* PCI to internal system bus DMA PCI control */
5513 + uint32 pcich2intstat;
5514 + uint32 pcich2intmask;
5515 + uint32 pcich2descaddr;
5516 + uint32 pcich2status1;
5517 + uint32 pcich2status2;
5519 + uint32 perm_id; /* permanent device and vendor id */
5520 + uint32 perm_rev; /* permanent revision id */
5523 +#define MPI ((volatile MpiRegisters * const) MPI_BASE)
5525 +/* PCI configuration address space start offset 0x40 */
5526 +#define BRCM_PCI_CONFIG_TIMER 0x40
5527 +#define BRCM_PCI_CONFIG_TIMER_RETRY_MASK 0x0000FF00
5528 +#define BRCM_PCI_CONFIG_TIMER_TRDY_MASK 0x000000FF
5530 +/* USB host non-Open HCI register, USB_HOST_NON_OHCI, bit definitions. */
5531 +#define NON_OHCI_ENABLE_PORT1 0x00000001 /* Use USB port 1 for host, not dev */
5532 +#define NON_OHCI_BYTE_SWAP 0x00000008 /* Swap USB host registers */
5534 +#define USBH_NON_OHCI ((volatile unsigned long * const) USB_HOST_NON_OHCI)
5538 diff -urN linux.old/arch/mips/bcm963xx/include/bcm_intr.h linux.dev/arch/mips/bcm963xx/include/bcm_intr.h
5539 --- linux.old/arch/mips/bcm963xx/include/bcm_intr.h 1970-01-01 01:00:00.000000000 +0100
5540 +++ linux.dev/arch/mips/bcm963xx/include/bcm_intr.h 2006-08-25 00:39:38.000000000 +0200
5544 + Copyright 2003 Broadcom Corp. All Rights Reserved.
5546 + This program is free software; you can distribute it and/or modify it
5547 + under the terms of the GNU General Public License (Version 2) as
5548 + published by the Free Software Foundation.
5550 + This program is distributed in the hope it will be useful, but WITHOUT
5551 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5552 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5555 + You should have received a copy of the GNU General Public License along
5556 + with this program; if not, write to the Free Software Foundation, Inc.,
5557 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5561 +#ifndef __BCM_INTR_H
5562 +#define __BCM_INTR_H
5568 +#if defined(CONFIG_BCM96338)
5569 +#include <6338_intr.h>
5571 +#if defined(CONFIG_BCM96345)
5572 +#include <6345_intr.h>
5574 +#if defined(CONFIG_BCM96348)
5575 +#include <6348_intr.h>
5580 +typedef int (*FN_HANDLER) (int, void *);
5583 +extern void enable_brcm_irq(unsigned int irq);
5584 +extern void disable_brcm_irq(unsigned int irq);
5585 +extern int request_external_irq(unsigned int irq,
5586 + FN_HANDLER handler, unsigned long irqflags,
5587 + const char * devname, void *dev_id);
5588 +extern unsigned int BcmHalMapInterrupt(FN_HANDLER isr, unsigned int param,
5589 + unsigned int interruptId);
5590 +extern void dump_intr_regs(void);
5592 +/* compatibility definitions */
5593 +#define BcmHalInterruptEnable(irq) enable_brcm_irq( irq )
5594 +#define BcmHalInterruptDisable(irq) disable_brcm_irq( irq )
5601 diff -urN linux.old/arch/mips/bcm963xx/include/bcm_map_part.h linux.dev/arch/mips/bcm963xx/include/bcm_map_part.h
5602 --- linux.old/arch/mips/bcm963xx/include/bcm_map_part.h 1970-01-01 01:00:00.000000000 +0100
5603 +++ linux.dev/arch/mips/bcm963xx/include/bcm_map_part.h 2006-08-25 00:39:38.000000000 +0200
5607 + Copyright 2004 Broadcom Corp. All Rights Reserved.
5609 + This program is free software; you can distribute it and/or modify it
5610 + under the terms of the GNU General Public License (Version 2) as
5611 + published by the Free Software Foundation.
5613 + This program is distributed in the hope it will be useful, but WITHOUT
5614 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5615 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5618 + You should have received a copy of the GNU General Public License along
5619 + with this program; if not, write to the Free Software Foundation, Inc.,
5620 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5624 +#ifndef __BCM_MAP_PART_H
5625 +#define __BCM_MAP_PART_H
5627 +#if defined(CONFIG_BCM96338)
5628 +#include <6338_map_part.h>
5630 +#if defined(CONFIG_BCM96345)
5631 +#include <6345_map_part.h>
5633 +#if defined(CONFIG_BCM96348)
5634 +#include <6348_map_part.h>
5639 diff -urN linux.old/arch/mips/bcm963xx/include/bcmpci.h linux.dev/arch/mips/bcm963xx/include/bcmpci.h
5640 --- linux.old/arch/mips/bcm963xx/include/bcmpci.h 1970-01-01 01:00:00.000000000 +0100
5641 +++ linux.dev/arch/mips/bcm963xx/include/bcmpci.h 2006-08-25 00:39:38.000000000 +0200
5645 + Copyright 2004 Broadcom Corp. All Rights Reserved.
5647 + This program is free software; you can distribute it and/or modify it
5648 + under the terms of the GNU General Public License (Version 2) as
5649 + published by the Free Software Foundation.
5651 + This program is distributed in the hope it will be useful, but WITHOUT
5652 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5653 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5656 + You should have received a copy of the GNU General Public License along
5657 + with this program; if not, write to the Free Software Foundation, Inc.,
5658 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5663 +// bcmpci.h - bcm96348 PCI, Cardbus, and PCMCIA definition
5668 +/* Memory window in internal system bus address space */
5669 +#define BCM_PCI_MEM_BASE 0x08000000
5670 +/* IO window in internal system bus address space */
5671 +#define BCM_PCI_IO_BASE 0x0C000000
5673 +#define BCM_PCI_ADDR_MASK 0x1fffffff
5675 +/* Memory window size (range) */
5676 +#define BCM_PCI_MEM_SIZE_16MB 0x01000000
5677 +/* IO window size (range) */
5678 +#define BCM_PCI_IO_SIZE_64KB 0x00010000
5680 +/* PCI Configuration and I/O space acesss */
5681 +#define BCM_PCI_CFG(d, f, o) ( (d << 11) | (f << 8) | (o/4 << 2) )
5683 +/* fake USB PCI slot */
5684 +#define USB_HOST_SLOT 9
5685 +#define USB_BAR0_MEM_SIZE 0x0800
5687 +#define BCM_HOST_MEM_SPACE1 0x10000000
5688 +#define BCM_HOST_MEM_SPACE2 0x00000000
5691 + * EBI bus clock is 33MHz and share with PCI bus
5692 + * each clock cycle is 30ns.
5694 +/* attribute memory access wait cnt for 4306 */
5695 +#define PCMCIA_ATTR_CE_HOLD 3 // data hold time 70ns
5696 +#define PCMCIA_ATTR_CE_SETUP 3 // data setup time 50ns
5697 +#define PCMCIA_ATTR_INACTIVE 6 // time between read/write cycles 180ns. For the total cycle time 600ns (cnt1+cnt2+cnt3+cnt4)
5698 +#define PCMCIA_ATTR_ACTIVE 10 // OE/WE pulse width 300ns
5700 +/* common memory access wait cnt for 4306 */
5701 +#define PCMCIA_MEM_CE_HOLD 1 // data hold time 30ns
5702 +#define PCMCIA_MEM_CE_SETUP 1 // data setup time 30ns
5703 +#define PCMCIA_MEM_INACTIVE 2 // time between read/write cycles 40ns. For the total cycle time 250ns (cnt1+cnt2+cnt3+cnt4)
5704 +#define PCMCIA_MEM_ACTIVE 5 // OE/WE pulse width 150ns
5706 +#define PCCARD_VCC_MASK 0x00070000 // Mask Reset also
5707 +#define PCCARD_VCC_33V 0x00010000
5708 +#define PCCARD_VCC_50V 0x00020000
5711 + MPI_CARDTYPE_NONE, // No Card in slot
5712 + MPI_CARDTYPE_PCMCIA, // 16-bit PCMCIA card in slot
5713 + MPI_CARDTYPE_CARDBUS, // 32-bit CardBus card in slot
5716 +#define CARDBUS_SLOT 0 // Slot 0 is default for CardBus
5718 +#define pcmciaAttrOffset 0x00200000
5719 +#define pcmciaMemOffset 0x00000000
5720 +// Needs to be right above PCI I/O space. Give 0x8000 (32K) to PCMCIA.
5721 +#define pcmciaIoOffset (BCM_PCI_IO_BASE + 0x80000)
5722 +// Base Address is that mapped into the MPI ChipSelect registers.
5723 +// UBUS bridge MemoryWindow 0 outputs a 0x00 for the base.
5724 +#define pcmciaBase 0xbf000000
5725 +#define pcmciaAttr (pcmciaAttrOffset | pcmciaBase)
5726 +#define pcmciaMem (pcmciaMemOffset | pcmciaBase)
5727 +#define pcmciaIo (pcmciaIoOffset | pcmciaBase)
5730 diff -urN linux.old/arch/mips/bcm963xx/include/bcmTag.h linux.dev/arch/mips/bcm963xx/include/bcmTag.h
5731 --- linux.old/arch/mips/bcm963xx/include/bcmTag.h 1970-01-01 01:00:00.000000000 +0100
5732 +++ linux.dev/arch/mips/bcm963xx/include/bcmTag.h 2006-08-25 00:39:38.000000000 +0200
5736 + Copyright 2002 Broadcom Corp. All Rights Reserved.
5738 + This program is free software; you can distribute it and/or modify it
5739 + under the terms of the GNU General Public License (Version 2) as
5740 + published by the Free Software Foundation.
5742 + This program is distributed in the hope it will be useful, but WITHOUT
5743 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5744 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5747 + You should have received a copy of the GNU General Public License along
5748 + with this program; if not, write to the Free Software Foundation, Inc.,
5749 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5752 +//**************************************************************************************
5753 +// File Name : bcmTag.h
5755 +// Description: add tag with validation system to the firmware image file to be uploaded
5758 +// Created : 02/28/2002 seanl
5759 +//**************************************************************************************
5765 +#define BCM_SIG_1 "Broadcom Corporation"
5766 +#define BCM_SIG_2 "ver. 2.0" // was "firmware version 2.0" now it is split 6 char out for chip id.
5768 +#define BCM_TAG_VER "6"
5769 +#define BCM_TAG_VER_LAST "26"
5771 +// file tag (head) structure all is in clear text except validationTokens (crc, md5, sha1, etc). Total: 128 unsigned chars
5772 +#define TAG_LEN 256
5773 +#define TAG_VER_LEN 4
5775 +#define SIG_LEN_2 14 // Original second SIG = 20 is now devided into 14 for SIG_LEN_2 and 6 for CHIP_ID
5776 +#define CHIP_ID_LEN 6
5777 +#define IMAGE_LEN 10
5778 +#define ADDRESS_LEN 12
5780 +#define TOKEN_LEN 20
5781 +#define BOARD_ID_LEN 16
5782 +#define RESERVED_LEN (TAG_LEN - TAG_VER_LEN - SIG_LEN - SIG_LEN_2 - CHIP_ID_LEN - BOARD_ID_LEN - \
5783 + (4*IMAGE_LEN) - (3*ADDRESS_LEN) - (3*FLAG_LEN) - (2*TOKEN_LEN))
5786 +// TAG for downloadable image (kernel plus file system)
5787 +typedef struct _FILE_TAG
5789 + unsigned char tagVersion[TAG_VER_LEN]; // tag version. Will be 2 here.
5790 + unsigned char signiture_1[SIG_LEN]; // text line for company info
5791 + unsigned char signiture_2[SIG_LEN_2]; // additional info (can be version number)
5792 + unsigned char chipId[CHIP_ID_LEN]; // chip id
5793 + unsigned char boardId[BOARD_ID_LEN]; // board id
5794 + unsigned char bigEndian[FLAG_LEN]; // if = 1 - big, = 0 - little endia of the host
5795 + unsigned char totalImageLen[IMAGE_LEN]; // the sum of all the following length
5796 + unsigned char cfeAddress[ADDRESS_LEN]; // if non zero, cfe starting address
5797 + unsigned char cfeLen[IMAGE_LEN]; // if non zero, cfe size in clear ASCII text.
5798 + unsigned char rootfsAddress[ADDRESS_LEN]; // if non zero, filesystem starting address
5799 + unsigned char rootfsLen[IMAGE_LEN]; // if non zero, filesystem size in clear ASCII text.
5800 + unsigned char kernelAddress[ADDRESS_LEN]; // if non zero, kernel starting address
5801 + unsigned char kernelLen[IMAGE_LEN]; // if non zero, kernel size in clear ASCII text.
5802 + unsigned char dualImage[FLAG_LEN]; // if 1, dual image
5803 + unsigned char inactiveLen[FLAG_LEN]; // if 1, the image is INACTIVE; if 0, active
5804 + unsigned char reserved[RESERVED_LEN]; // reserved for later use
5805 + unsigned char imageValidationToken[TOKEN_LEN];// image validation token - can be crc, md5, sha; for
5806 + // now will be 4 unsigned char crc
5807 + unsigned char tagValidationToken[TOKEN_LEN]; // validation token for tag(from signiture_1 to end of // mageValidationToken)
5808 +} FILE_TAG, *PFILE_TAG;
5810 +#define CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
5813 +// only included if for bcmTag.exe program
5814 +#ifdef BCMTAG_EXE_USE
5816 +static unsigned long Crc32_table[256] = {
5817 + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
5818 + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
5819 + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
5820 + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
5821 + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
5822 + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
5823 + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
5824 + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
5825 + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
5826 + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
5827 + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
5828 + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
5829 + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
5830 + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
5831 + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
5832 + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
5833 + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
5834 + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
5835 + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
5836 + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
5837 + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
5838 + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
5839 + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
5840 + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
5841 + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
5842 + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
5843 + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
5844 + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
5845 + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
5846 + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
5847 + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
5848 + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
5849 + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
5850 + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
5851 + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
5852 + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
5853 + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
5854 + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
5855 + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
5856 + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
5857 + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
5858 + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
5859 + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
5860 + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
5861 + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
5862 + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
5863 + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
5864 + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
5865 + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
5866 + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
5867 + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
5868 + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
5869 + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
5870 + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
5871 + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
5872 + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
5873 + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
5874 + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
5875 + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
5876 + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
5877 + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
5878 + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
5879 + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
5880 + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
5882 +#endif // BCMTAG_USE
5885 +#endif // _BCMTAG_H_
5887 diff -urN linux.old/arch/mips/bcm963xx/include/bcmtypes.h linux.dev/arch/mips/bcm963xx/include/bcmtypes.h
5888 --- linux.old/arch/mips/bcm963xx/include/bcmtypes.h 1970-01-01 01:00:00.000000000 +0100
5889 +++ linux.dev/arch/mips/bcm963xx/include/bcmtypes.h 2006-08-25 00:39:38.000000000 +0200
5893 + Copyright 2002 Broadcom Corp. All Rights Reserved.
5895 + This program is free software; you can distribute it and/or modify it
5896 + under the terms of the GNU General Public License (Version 2) as
5897 + published by the Free Software Foundation.
5899 + This program is distributed in the hope it will be useful, but WITHOUT
5900 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5901 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5904 + You should have received a copy of the GNU General Public License along
5905 + with this program; if not, write to the Free Software Foundation, Inc.,
5906 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
5911 +// bcmtypes.h - misc useful typedefs
5916 +// These are also defined in typedefs.h in the application area, so I need to
5917 +// protect against re-definition.
5919 +#ifndef _TYPEDEFS_H_
5920 +typedef unsigned char uint8;
5921 +typedef unsigned short uint16;
5922 +typedef unsigned long uint32;
5923 +typedef signed char int8;
5924 +typedef signed short int16;
5925 +typedef signed long int32;
5926 +#if !defined(__cplusplus)
5931 +typedef unsigned char byte;
5932 +// typedef unsigned long sem_t;
5934 +typedef unsigned long HANDLE,*PULONG,DWORD,*PDWORD;
5935 +typedef signed long LONG,*PLONG;
5937 +typedef unsigned int *PUINT;
5938 +typedef signed int INT;
5940 +typedef unsigned short *PUSHORT;
5941 +typedef signed short SHORT,*PSHORT;
5942 +typedef unsigned short WORD,*PWORD;
5944 +typedef unsigned char *PUCHAR;
5945 +typedef signed char *PCHAR;
5947 +typedef void *PVOID;
5949 +typedef unsigned char BOOLEAN, *PBOOL, *PBOOLEAN;
5951 +typedef unsigned char BYTE,*PBYTE;
5954 +//The following has been defined in Vxworks internally: vxTypesOld.h
5955 +//redefine under vxworks will cause error
5956 +typedef signed int *PINT;
5958 +typedef signed char INT8;
5959 +typedef signed short INT16;
5960 +typedef signed long INT32;
5962 +typedef unsigned char UINT8;
5963 +typedef unsigned short UINT16;
5964 +typedef unsigned long UINT32;
5966 +typedef unsigned char UCHAR;
5967 +typedef unsigned short USHORT;
5968 +typedef unsigned int UINT;
5969 +typedef unsigned long ULONG;
5972 +typedef unsigned char BOOL;
5974 +//#endif /* __GNUC__ */
5977 +// These are also defined in typedefs.h in the application area, so I need to
5978 +// protect against re-definition.
5981 +// Maximum and minimum values for a signed 16 bit integer.
5982 +#define MAX_INT16 32767
5983 +#define MIN_INT16 -32768
5985 +// Useful for true/false return values. This uses the
5986 +// Taligent notation (k for constant).
5995 +/* macros to protect against unaligned accesses */
5998 +/* first arg is an address, second is a value */
5999 +#define PUT16( a, d ) { \
6000 + *((byte *)a) = (byte)((d)>>8); \
6001 + *(((byte *)a)+1) = (byte)(d); \
6004 +#define PUT32( a, d ) { \
6005 + *((byte *)a) = (byte)((d)>>24); \
6006 + *(((byte *)a)+1) = (byte)((d)>>16); \
6007 + *(((byte *)a)+2) = (byte)((d)>>8); \
6008 + *(((byte *)a)+3) = (byte)(d); \
6011 +/* first arg is an address, returns a value */
6012 +#define GET16( a ) ( \
6013 + (*((byte *)a) << 8) | \
6014 + (*(((byte *)a)+1)) \
6017 +#define GET32( a ) ( \
6018 + (*((byte *)a) << 24) | \
6019 + (*(((byte *)a)+1) << 16) | \
6020 + (*(((byte *)a)+2) << 8) | \
6021 + (*(((byte *)a)+3)) \
6049 +#define READ32(addr) (*(volatile UINT32 *)((ULONG)&addr))
6050 +#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr))
6051 +#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr))
6054 diff -urN linux.old/arch/mips/bcm963xx/include/board.h linux.dev/arch/mips/bcm963xx/include/board.h
6055 --- linux.old/arch/mips/bcm963xx/include/board.h 1970-01-01 01:00:00.000000000 +0100
6056 +++ linux.dev/arch/mips/bcm963xx/include/board.h 2006-08-25 01:52:34.000000000 +0200
6060 + Copyright 2002 Broadcom Corp. All Rights Reserved.
6062 + This program is free software; you can distribute it and/or modify it
6063 + under the terms of the GNU General Public License (Version 2) as
6064 + published by the Free Software Foundation.
6066 + This program is distributed in the hope it will be useful, but WITHOUT
6067 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6068 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6071 + You should have received a copy of the GNU General Public License along
6072 + with this program; if not, write to the Free Software Foundation, Inc.,
6073 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6076 +/***********************************************************************/
6078 +/* MODULE: board.h */
6079 +/* DATE: 97/02/18 */
6080 +/* PURPOSE: Board specific information. This module should include */
6081 +/* all base device addresses and board specific macros. */
6083 +/***********************************************************************/
6087 +/*****************************************************************************/
6088 +/* Misc board definitions */
6089 +/*****************************************************************************/
6091 +#define DYING_GASP_API
6093 +/*****************************************************************************/
6094 +/* Physical Memory Map */
6095 +/*****************************************************************************/
6097 +#define PHYS_DRAM_BASE 0x00000000 /* Dynamic RAM Base */
6098 +#define PHYS_FLASH_BASE 0x1FC00000 /* Flash Memory */
6100 +/*****************************************************************************/
6101 +/* Note that the addresses above are physical addresses and that programs */
6102 +/* have to use converted addresses defined below: */
6103 +/*****************************************************************************/
6104 +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
6105 +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
6106 +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
6108 +/*****************************************************************************/
6109 +/* Select the PLL value to get the desired CPU clock frequency. */
6112 +/*****************************************************************************/
6113 +#define FPERIPH 50000000
6116 +#define BLK64K (64*ONEK)
6117 +#define FLASH45_BLKS_BOOT_ROM 1
6118 +#define FLASH45_LENGTH_BOOT_ROM (FLASH45_BLKS_BOOT_ROM * BLK64K)
6119 +#define FLASH_RESERVED_AT_END (64*ONEK) /*reserved for PSI, scratch pad*/
6121 +/*****************************************************************************/
6122 +/* Note that the addresses above are physical addresses and that programs */
6123 +/* have to use converted addresses defined below: */
6124 +/*****************************************************************************/
6125 +#define DRAM_BASE (0x80000000 | PHYS_DRAM_BASE) /* cached DRAM */
6126 +#define DRAM_BASE_NOCACHE (0xA0000000 | PHYS_DRAM_BASE) /* uncached DRAM */
6127 +#define FLASH_BASE (0xA0000000 | PHYS_FLASH_BASE) /* uncached Flash */
6129 +/*****************************************************************************/
6130 +/* Select the PLL value to get the desired CPU clock frequency. */
6133 +/*****************************************************************************/
6134 +#define FPERIPH 50000000
6136 +#define SDRAM_TYPE_ADDRESS_OFFSET 16
6137 +#define NVRAM_DATA_OFFSET 0x0580
6138 +#define NVRAM_DATA_ID 0x0f1e2d3c
6139 +#define BOARD_SDRAM_TYPE *(unsigned long *) \
6140 + (FLASH_BASE + SDRAM_TYPE_ADDRESS_OFFSET)
6143 +#define BLK64K (64*ONEK)
6145 +// nvram and psi flash definitions for 45
6146 +#define FLASH45_LENGTH_NVRAM ONEK // 1k nvram
6147 +#define NVRAM_PSI_DEFAULT 24 // default psi in K byes
6149 +/*****************************************************************************/
6150 +/* NVRAM Offset and definition */
6151 +/*****************************************************************************/
6153 +#define NVRAM_VERSION_NUMBER 2
6154 +#define NVRAM_VERSION_NUMBER_ADDRESS 0
6156 +#define NVRAM_BOOTLINE_LEN 256
6157 +#define NVRAM_BOARD_ID_STRING_LEN 16
6158 +#define NVRAM_MAC_ADDRESS_LEN 6
6159 +#define NVRAM_MAC_COUNT_MAX 32
6161 +/*****************************************************************************/
6163 +/*****************************************************************************/
6165 +#define CFE_VERSION_OFFSET 0x0570
6166 +#define CFE_VERSION_MARK_SIZE 5
6167 +#define CFE_VERSION_SIZE 5
6171 + unsigned long ulVersion;
6172 + char szBootline[NVRAM_BOOTLINE_LEN];
6173 + char szBoardId[NVRAM_BOARD_ID_STRING_LEN];
6174 + unsigned long ulReserved1[2];
6175 + unsigned long ulNumMacAddrs;
6176 + unsigned char ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
6177 + char chReserved[2];
6178 + unsigned long ulCheckSum;
6179 +} NVRAM_DATA, *PNVRAM_DATA;
6182 +/*****************************************************************************/
6183 +/* board ioctl calls for flash, led and some other utilities */
6184 +/*****************************************************************************/
6187 +/* Defines. for board driver */
6188 +#define BOARD_IOCTL_MAGIC 'B'
6189 +#define BOARD_DRV_MAJOR 206
6191 +#define MAC_ADDRESS_ANY (unsigned long) -1
6193 +#define BOARD_IOCTL_FLASH_INIT \
6194 + _IOWR(BOARD_IOCTL_MAGIC, 0, BOARD_IOCTL_PARMS)
6196 +#define BOARD_IOCTL_FLASH_WRITE \
6197 + _IOWR(BOARD_IOCTL_MAGIC, 1, BOARD_IOCTL_PARMS)
6199 +#define BOARD_IOCTL_FLASH_READ \
6200 + _IOWR(BOARD_IOCTL_MAGIC, 2, BOARD_IOCTL_PARMS)
6202 +#define BOARD_IOCTL_GET_NR_PAGES \
6203 + _IOWR(BOARD_IOCTL_MAGIC, 3, BOARD_IOCTL_PARMS)
6205 +#define BOARD_IOCTL_DUMP_ADDR \
6206 + _IOWR(BOARD_IOCTL_MAGIC, 4, BOARD_IOCTL_PARMS)
6208 +#define BOARD_IOCTL_SET_MEMORY \
6209 + _IOWR(BOARD_IOCTL_MAGIC, 5, BOARD_IOCTL_PARMS)
6211 +#define BOARD_IOCTL_MIPS_SOFT_RESET \
6212 + _IOWR(BOARD_IOCTL_MAGIC, 6, BOARD_IOCTL_PARMS)
6214 +#define BOARD_IOCTL_LED_CTRL \
6215 + _IOWR(BOARD_IOCTL_MAGIC, 7, BOARD_IOCTL_PARMS)
6217 +#define BOARD_IOCTL_GET_ID \
6218 + _IOWR(BOARD_IOCTL_MAGIC, 8, BOARD_IOCTL_PARMS)
6220 +#define BOARD_IOCTL_GET_MAC_ADDRESS \
6221 + _IOWR(BOARD_IOCTL_MAGIC, 9, BOARD_IOCTL_PARMS)
6223 +#define BOARD_IOCTL_RELEASE_MAC_ADDRESS \
6224 + _IOWR(BOARD_IOCTL_MAGIC, 10, BOARD_IOCTL_PARMS)
6226 +#define BOARD_IOCTL_GET_PSI_SIZE \
6227 + _IOWR(BOARD_IOCTL_MAGIC, 11, BOARD_IOCTL_PARMS)
6229 +#define BOARD_IOCTL_GET_SDRAM_SIZE \
6230 + _IOWR(BOARD_IOCTL_MAGIC, 12, BOARD_IOCTL_PARMS)
6232 +#define BOARD_IOCTL_SET_MONITOR_FD \
6233 + _IOWR(BOARD_IOCTL_MAGIC, 13, BOARD_IOCTL_PARMS)
6235 +#define BOARD_IOCTL_WAKEUP_MONITOR_TASK \
6236 + _IOWR(BOARD_IOCTL_MAGIC, 14, BOARD_IOCTL_PARMS)
6238 +#define BOARD_IOCTL_GET_BOOTLINE \
6239 + _IOWR(BOARD_IOCTL_MAGIC, 15, BOARD_IOCTL_PARMS)
6241 +#define BOARD_IOCTL_SET_BOOTLINE \
6242 + _IOWR(BOARD_IOCTL_MAGIC, 16, BOARD_IOCTL_PARMS)
6244 +#define BOARD_IOCTL_GET_BASE_MAC_ADDRESS \
6245 + _IOWR(BOARD_IOCTL_MAGIC, 17, BOARD_IOCTL_PARMS)
6247 +#define BOARD_IOCTL_GET_CHIP_ID \
6248 + _IOWR(BOARD_IOCTL_MAGIC, 18, BOARD_IOCTL_PARMS)
6250 +#define BOARD_IOCTL_GET_NUM_ENET \
6251 + _IOWR(BOARD_IOCTL_MAGIC, 19, BOARD_IOCTL_PARMS)
6253 +#define BOARD_IOCTL_GET_CFE_VER \
6254 + _IOWR(BOARD_IOCTL_MAGIC, 20, BOARD_IOCTL_PARMS)
6256 +#define BOARD_IOCTL_GET_ENET_CFG \
6257 + _IOWR(BOARD_IOCTL_MAGIC, 21, BOARD_IOCTL_PARMS)
6259 +#define BOARD_IOCTL_GET_WLAN_ANT_INUSE \
6260 + _IOWR(BOARD_IOCTL_MAGIC, 22, BOARD_IOCTL_PARMS)
6262 +#define BOARD_IOCTL_SET_TRIGGER_EVENT \
6263 + _IOWR(BOARD_IOCTL_MAGIC, 23, BOARD_IOCTL_PARMS)
6265 +#define BOARD_IOCTL_GET_TRIGGER_EVENT \
6266 + _IOWR(BOARD_IOCTL_MAGIC, 24, BOARD_IOCTL_PARMS)
6268 +#define BOARD_IOCTL_UNSET_TRIGGER_EVENT \
6269 + _IOWR(BOARD_IOCTL_MAGIC, 25, BOARD_IOCTL_PARMS)
6271 +#define BOARD_IOCTL_SET_SES_LED \
6272 + _IOWR(BOARD_IOCTL_MAGIC, 26, BOARD_IOCTL_PARMS)
6274 +//<<JUNHON, 2004/09/15, get reset button status , tim hou , 05/04/12
6275 +#define RESET_BUTTON_UP 1
6276 +#define RESET_BUTTON_PRESSDOWN 0
6277 +#define BOARD_IOCTL_GET_RESETHOLD \
6278 + _IOWR(BOARD_IOCTL_MAGIC, 27, BOARD_IOCTL_PARMS)
6279 +//>>JUNHON, 2004/09/15
6281 +// for the action in BOARD_IOCTL_PARMS for flash operation
6292 +} BOARD_IOCTL_ACTION;
6295 +typedef struct boardIoctParms
6301 + BOARD_IOCTL_ACTION action; /* flash read/write: nvram, persistent, bcm image */
6303 +} BOARD_IOCTL_PARMS;
6319 + kLedEnd, // NOTE: Insert the new led name before this one. Alway stay at the end.
6324 + kLedStateOff, /* turn led off */
6325 + kLedStateOn, /* turn led on */
6326 + kLedStateFail, /* turn led on red */
6327 + kLedStateBlinkOnce, /* blink once, ~100ms and ignore the same call during the 100ms period */
6328 + kLedStateSlowBlinkContinues, /* slow blink continues at ~600ms interval */
6329 + kLedStateFastBlinkContinues, /* fast blink continues at ~200ms interval */
6333 +// virtual and physical map pair defined in board.c
6334 +typedef struct ledmappair
6336 + BOARD_LED_NAME ledName; // virtual led name
6337 + BOARD_LED_STATE ledInitState; // initial led state when the board boots.
6338 + unsigned short ledMask; // physical GPIO pin mask
6339 + unsigned short ledActiveLow; // reset bit to turn on LED
6340 + unsigned short ledMaskFail; // physical GPIO pin mask for state failure
6341 + unsigned short ledActiveLowFail;// reset bit to turn on LED
6342 +} LED_MAP_PAIR, *PLED_MAP_PAIR;
6344 +typedef void (*HANDLE_LED_FUNC)(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState);
6346 +/* Flash storage address information that is determined by the flash driver. */
6347 +typedef struct flashaddrinfo
6349 + int flash_persistent_start_blk;
6350 + int flash_persistent_number_blk;
6351 + int flash_persistent_length;
6352 + unsigned long flash_persistent_blk_offset;
6353 + int flash_scratch_pad_start_blk; // start before psi (SP_BUF_LEN)
6354 + int flash_scratch_pad_number_blk;
6355 + int flash_scratch_pad_length;
6356 + unsigned long flash_scratch_pad_blk_offset;
6357 + int flash_nvram_start_blk;
6358 + int flash_nvram_number_blk;
6359 + int flash_nvram_length;
6360 + unsigned long flash_nvram_blk_offset;
6361 +} FLASH_ADDR_INFO, *PFLASH_ADDR_INFO;
6363 +// scratch pad defines
6364 +/* SP - Persisten Scratch Pad format:
6365 + sp header : 32 bytes
6366 + tokenId-1 : 8 bytes
6367 + tokenId-1 len : 4 bytes
6370 + tokenId-n : 8 bytes
6371 + tokenId-n len : 4 bytes
6375 +#define MAGIC_NUM_LEN 8
6376 +#define MAGIC_NUMBER "gOGoBrCm"
6377 +#define TOKEN_NAME_LEN 16
6378 +#define SP_VERSION 1
6379 +#define SP_MAX_LEN 8 * 1024 // 8k buf before psi
6380 +#define SP_RESERVERD 16
6382 +typedef struct _SP_HEADER
6384 + char SPMagicNum[MAGIC_NUM_LEN]; // 8 bytes of magic number
6385 + int SPVersion; // version number
6386 + int SPUsedLen; // used sp len
6387 + char SPReserved[SP_RESERVERD]; // reservied, total 32 bytes
6388 +} SP_HEADER, *PSP_HEADER;
6390 +typedef struct _TOKEN_DEF
6392 + char tokenName[TOKEN_NAME_LEN];
6394 +} SP_TOKEN, *PSP_TOKEN;
6397 +/*****************************************************************************/
6398 +/* Function Prototypes */
6399 +/*****************************************************************************/
6400 +#if !defined(__ASM_ASM_H)
6401 +void dumpaddr( unsigned char *pAddr, int nLen );
6403 +int kerSysNvRamGet(char *string, int strLen, int offset);
6404 +int kerSysNvRamSet(char *string, int strLen, int offset);
6405 +int kerSysPersistentGet(char *string, int strLen, int offset);
6406 +int kerSysPersistentSet(char *string, int strLen, int offset);
6407 +int kerSysScratchPadGet(char *tokName, char *tokBuf, int tokLen);
6408 +int kerSysScratchPadSet(char *tokName, char *tokBuf, int tokLen);
6409 +int kerSysBcmImageSet( int flash_start_addr, char *string, int size);
6410 +int kerSysGetMacAddress( unsigned char *pucaAddr, unsigned long ulId );
6411 +int kerSysReleaseMacAddress( unsigned char *pucaAddr );
6412 +int kerSysGetSdramSize( void );
6413 +void kerSysGetBootline(char *string, int strLen);
6414 +void kerSysSetBootline(char *string, int strLen);
6415 +void kerSysMipsSoftReset(void);
6416 +void kerSysLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
6417 +void kerSysLedRegisterHwHandler( BOARD_LED_NAME, HANDLE_LED_FUNC, int );
6418 +int kerSysFlashSizeGet(void);
6419 +void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context);
6420 +void kerSysDeregisterDyingGaspHandler(char *devname);
6421 +void kerSysWakeupMonitorTask( void );
6425 +#define BOOT_REDBOOT 1
6427 +extern int boot_loader_type;
6429 +#endif /* _BOARD_H */
6431 diff -urN linux.old/arch/mips/bcm963xx/int-handler.S linux.dev/arch/mips/bcm963xx/int-handler.S
6432 --- linux.old/arch/mips/bcm963xx/int-handler.S 1970-01-01 01:00:00.000000000 +0100
6433 +++ linux.dev/arch/mips/bcm963xx/int-handler.S 2006-08-25 02:13:33.000000000 +0200
6437 + Copyright 2002 Broadcom Corp. All Rights Reserved.
6439 + This program is free software; you can distribute it and/or modify it
6440 + under the terms of the GNU General Public License (Version 2) as
6441 + published by the Free Software Foundation.
6443 + This program is distributed in the hope it will be useful, but WITHOUT
6444 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6445 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6448 + You should have received a copy of the GNU General Public License along
6449 + with this program; if not, write to the Free Software Foundation, Inc.,
6450 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6454 + * Generic interrupt handler for Broadcom MIPS boards
6457 +#include <linux/autoconf.h>
6459 +#include <asm/asm.h>
6460 +#include <asm/mipsregs.h>
6461 +#include <asm/regdef.h>
6462 +#include <asm/stackframe.h>
6467 + * 0 Software (ignored)
6468 + * 1 Software (ignored)
6469 + * 2 Combined hardware interrupt (hw0)
6481 + NESTED(brcmIRQ, PT_SIZE, sp)
6487 + jal plat_irq_dispatch
6494 diff -urN linux.old/arch/mips/bcm963xx/irq.c linux.dev/arch/mips/bcm963xx/irq.c
6495 --- linux.old/arch/mips/bcm963xx/irq.c 1970-01-01 01:00:00.000000000 +0100
6496 +++ linux.dev/arch/mips/bcm963xx/irq.c 2006-08-25 03:54:34.000000000 +0200
6500 + Copyright 2002 Broadcom Corp. All Rights Reserved.
6502 + This program is free software; you can distribute it and/or modify it
6503 + under the terms of the GNU General Public License (Version 2) as
6504 + published by the Free Software Foundation.
6506 + This program is distributed in the hope it will be useful, but WITHOUT
6507 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6508 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6511 + You should have received a copy of the GNU General Public License along
6512 + with this program; if not, write to the Free Software Foundation, Inc.,
6513 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6517 + * Interrupt control functions for Broadcom 963xx MIPS boards
6520 +#include <asm/atomic.h>
6522 +#include <linux/delay.h>
6523 +#include <linux/init.h>
6524 +#include <linux/ioport.h>
6525 +#include <linux/irq.h>
6526 +#include <linux/interrupt.h>
6527 +#include <linux/kernel.h>
6528 +#include <linux/slab.h>
6529 +#include <linux/module.h>
6531 +#include <asm/irq.h>
6532 +#include <asm/mipsregs.h>
6533 +#include <asm/addrspace.h>
6534 +#include <asm/signal.h>
6535 +#include <bcm_map_part.h>
6536 +#include <bcm_intr.h>
6538 +static void irq_dispatch_int(struct pt_regs *regs)
6540 + unsigned int pendingIrqs;
6541 + static unsigned int irqBit;
6542 + static unsigned int isrNumber = 31;
6544 + pendingIrqs = PERF->IrqStatus & PERF->IrqMask;
6545 + if (!pendingIrqs) {
6552 + if (isrNumber == 32) {
6556 + if (pendingIrqs & irqBit) {
6557 + PERF->IrqMask &= ~irqBit; // mask
6558 + do_IRQ(isrNumber + INTERNAL_ISR_TABLE_OFFSET);
6564 +static void irq_dispatch_ext(uint32 irq)
6566 + if (!(PERF->ExtIrqCfg & (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)))) {
6567 + printk("**** Ext IRQ mask. Should not dispatch ****\n");
6569 + /* disable and clear interrupt in the controller */
6570 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
6571 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
6576 +extern void brcm_timer_interrupt(struct pt_regs *regs);
6578 +asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
6581 + while((cause = (read_c0_cause()& CAUSEF_IP))) {
6582 + if (cause & CAUSEF_IP7)
6583 + brcm_timer_interrupt(regs);
6584 + else if (cause & CAUSEF_IP2)
6585 + irq_dispatch_int(regs);
6586 + else if (cause & CAUSEF_IP3)
6587 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_0);
6588 + else if (cause & CAUSEF_IP4)
6589 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_1);
6590 + else if (cause & CAUSEF_IP5)
6591 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_2);
6592 + else if (cause & CAUSEF_IP6)
6593 + irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_3);
6594 + local_irq_disable();
6599 +void enable_brcm_irq(unsigned int irq)
6601 + unsigned long flags;
6603 + local_irq_save(flags);
6604 + if( irq >= INTERNAL_ISR_TABLE_OFFSET ) {
6605 + PERF->IrqMask |= (1 << (irq - INTERNAL_ISR_TABLE_OFFSET));
6607 + else if (irq >= INTERRUPT_ID_EXTERNAL_0 && irq <= INTERRUPT_ID_EXTERNAL_3) {
6608 + /* enable and clear interrupt in the controller */
6609 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
6610 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
6612 + local_irq_restore(flags);
6615 +void disable_brcm_irq(unsigned int irq)
6617 + unsigned long flags;
6619 + local_irq_save(flags);
6620 + if( irq >= INTERNAL_ISR_TABLE_OFFSET ) {
6621 + PERF->IrqMask &= ~(1 << (irq - INTERNAL_ISR_TABLE_OFFSET));
6623 + else if (irq >= INTERRUPT_ID_EXTERNAL_0 && irq <= INTERRUPT_ID_EXTERNAL_3) {
6624 + /* disable interrupt in the controller */
6625 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
6627 + local_irq_restore(flags);
6630 +void ack_brcm_irq(unsigned int irq)
6632 + /* Already done in brcm_irq_dispatch */
6635 +unsigned int startup_brcm_irq(unsigned int irq)
6637 + enable_brcm_irq(irq);
6639 + return 0; /* never anything pending */
6642 +unsigned int startup_brcm_none(unsigned int irq)
6647 +void end_brcm_irq(unsigned int irq)
6649 + if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
6650 + enable_brcm_irq(irq);
6653 +void end_brcm_none(unsigned int irq)
6657 +static struct hw_interrupt_type brcm_irq_type = {
6658 + .typename = "MIPS",
6659 + .startup = startup_brcm_irq,
6660 + .shutdown = disable_brcm_irq,
6661 + .enable = enable_brcm_irq,
6662 + .disable = disable_brcm_irq,
6663 + .ack = ack_brcm_irq,
6664 + .end = end_brcm_irq,
6665 + .set_affinity = NULL
6668 +static struct hw_interrupt_type brcm_irq_no_end_type = {
6669 + .typename = "MIPS",
6670 + .startup = startup_brcm_none,
6671 + .shutdown = disable_brcm_irq,
6672 + .enable = enable_brcm_irq,
6673 + .disable = disable_brcm_irq,
6674 + .ack = ack_brcm_irq,
6675 + .end = end_brcm_none,
6676 + .set_affinity = NULL
6679 +void __init arch_init_irq(void)
6683 + clear_c0_status(ST0_BEV);
6684 + change_c0_status(ST0_IM, (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4));
6686 + for (i = 0; i < NR_IRQS; i++) {
6687 + irq_desc[i].status = IRQ_DISABLED;
6688 + irq_desc[i].action = 0;
6689 + irq_desc[i].depth = 1;
6690 + irq_desc[i].handler = &brcm_irq_type;
6694 +int request_external_irq(unsigned int irq,
6695 + FN_HANDLER handler,
6696 + unsigned long irqflags,
6697 + const char * devname,
6700 + unsigned long flags;
6702 + local_irq_save(flags);
6704 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT)); // Clear
6705 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)); // Mask
6706 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_INSENS_SHFT)); // Edge insesnsitive
6707 + PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_LEVEL_SHFT)); // Level triggered
6708 + PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_SENSE_SHFT)); // Low level
6710 + local_irq_restore(flags);
6712 + return( request_irq(irq, handler, irqflags, devname, dev_id) );
6715 +/* VxWorks compatibility function(s). */
6717 +unsigned int BcmHalMapInterrupt(FN_HANDLER pfunc, unsigned int param,
6718 + unsigned int interruptId)
6723 + devname = kmalloc(16, GFP_KERNEL);
6725 + sprintf( devname, "brcm_%d", interruptId );
6727 + /* Set the IRQ description to not automatically enable the interrupt at
6728 + * the end of an ISR. The driver that handles the interrupt must
6729 + * explicitly call BcmHalInterruptEnable or enable_brcm_irq. This behavior
6730 + * is consistent with interrupt handling on VxWorks.
6732 + irq_desc[interruptId].handler = &brcm_irq_no_end_type;
6734 + if( interruptId >= INTERNAL_ISR_TABLE_OFFSET )
6736 + nRet = request_irq( interruptId, pfunc, SA_SAMPLE_RANDOM | SA_INTERRUPT,
6737 + devname, (void *) param );
6739 + else if (interruptId >= INTERRUPT_ID_EXTERNAL_0 && interruptId <= INTERRUPT_ID_EXTERNAL_3)
6741 + nRet = request_external_irq( interruptId, pfunc, SA_SAMPLE_RANDOM | SA_INTERRUPT,
6742 + devname, (void *) param );
6749 +EXPORT_SYMBOL(enable_brcm_irq);
6750 +EXPORT_SYMBOL(disable_brcm_irq);
6751 +EXPORT_SYMBOL(request_external_irq);
6752 +EXPORT_SYMBOL(BcmHalMapInterrupt);
6754 diff -urN linux.old/arch/mips/bcm963xx/Kconfig linux.dev/arch/mips/bcm963xx/Kconfig
6755 --- linux.old/arch/mips/bcm963xx/Kconfig 1970-01-01 01:00:00.000000000 +0100
6756 +++ linux.dev/arch/mips/bcm963xx/Kconfig 2006-08-25 01:22:39.000000000 +0200
6758 +# Kernel and Driver configuration for Broadcom Commengine ADSL board
6760 + prompt "Broadcom Commengine ADSL board"
6761 + depends on BCM963XX
6764 + Select different Broadcom ADSL board
6767 + bool "96338 ADSL board"
6768 + select DMA_NONCOHERENT
6772 + bool "96345 ADSL board"
6773 + select DMA_NONCOHERENT
6777 + bool "96348 ADSL board"
6778 + select DMA_NONCOHERENT
6784 + bool "Support for Broadcom Board"
6785 + depends on BCM96338 || BCM96345 || BCM96348
6788 + bool "Support for Serial Port"
6789 + depends on BCM96338 || BCM96345 || BCM96348
6792 + tristate "Support for Ethernet"
6793 + depends on BCM96338 || BCM96345 || BCM96348
6796 + tristate "Support for USB"
6797 + depends on BCM96338 || BCM96345 || BCM96348
6800 + tristate "Support for Wireless"
6801 + depends on BCM96338 || BCM96345 || BCM96348
6804 + bool "Support for PCI"
6805 + depends on BCM96338 || BCM96345 || BCM96348
6809 + tristate "Support for ATM"
6810 + depends on BCM96338 || BCM96345 || BCM96348
6813 + tristate "Support for ATM Diagnostic"
6814 + depends on BCM96338 || BCM96345 || BCM96348
6817 + tristate "Support for ADSL"
6818 + depends on BCM96338 || BCM96345 || BCM96348
6820 +config BCM_ENDPOINT
6821 + tristate "Support for VOICE"
6822 + depends on BCM96338 || BCM96345 || BCM96348
6825 + tristate "Support for PROCFS"
6826 + depends on BCM96338 || BCM96345 || BCM96348
6829 + tristate "Support for VDSL"
6830 + depends on BCM96338 || BCM96345 || BCM96348
6832 +config BCM_SECURITY
6833 + tristate "Support for SECURITY"
6834 + depends on BCM96338 || BCM96345 || BCM96348
6837 + tristate "Support for HPNA"
6838 + depends on BCM96338 || BCM96345 || BCM96348
6840 +config BCM_BOARD_IMPL
6841 + int "Implementation index for ADSL Board"
6842 + depends on BCM96338 || BCM96345 || BCM96348
6844 +config BCM_SERIAL_IMPL
6845 + int "Implementation index for Serial"
6846 + depends on BCM96338 || BCM96345 || BCM96348
6848 +config BCM_ENET_IMPL
6849 + int "Implementation index for Ethernet"
6850 + depends on BCM96338 || BCM96345 || BCM96348
6852 +config BCM_USB_IMPL
6853 + int "Implementation index for USB"
6854 + depends on BCM96338 || BCM96345 || BCM96348
6856 +config BCM_WLAN_IMPL
6857 + int "Implementation index for WIRELESS"
6858 + depends on BCM96338 || BCM96345 || BCM96348
6860 +config BCM_ATMAPI_IMPL
6861 + int "Implementation index for ATM"
6862 + depends on BCM96338 || BCM96345 || BCM96348
6864 +config BCM_ATMTEST_IMPL
6865 + int "Implementation index for ATM Diagnostic"
6866 + depends on BCM96338 || BCM96345 || BCM96348
6868 +config BCM_BLAA_IMPL
6869 + int "Implementation index for BLAA"
6870 + depends on BCM96338 || BCM96345 || BCM96348
6872 +config BCM_ADSL_IMPL
6873 + int "Implementation index for ADSL"
6874 + depends on BCM96338 || BCM96345 || BCM96348
6876 +config BCM_ENDPOINT_IMPL
6877 + int "Implementation index for VOICE"
6878 + depends on BCM96338 || BCM96345 || BCM96348
6880 +config BCM_PROCFS_IMPL
6881 + int "Implementation index for PROCFS"
6882 + depends on BCM96338 || BCM96345 || BCM96348
6884 +config BCM_VDSL_IMPL
6885 + int "Implementation index for VDSL"
6886 + depends on BCM96338 || BCM96345 || BCM96348
6888 +config BCM_SECURITY_IMPL
6889 + int "Implementation index for SECURITY"
6890 + depends on BCM96338 || BCM96345 || BCM96348
6892 +config BCM_HPNA_IMPL
6893 + int "Implementation index for HPNA"
6894 + depends on BCM96338 || BCM96345 || BCM96348
6896 diff -urN linux.old/arch/mips/bcm963xx/Makefile linux.dev/arch/mips/bcm963xx/Makefile
6897 --- linux.old/arch/mips/bcm963xx/Makefile 1970-01-01 01:00:00.000000000 +0100
6898 +++ linux.dev/arch/mips/bcm963xx/Makefile 2006-08-25 02:04:27.000000000 +0200
6901 +# Makefile for generic Broadcom MIPS boards
6903 +# Copyright (C) 2004 Broadcom Corporation
6905 +obj-y := irq.o prom.o setup.o time.o ser_init.o bcm63xx_led.o board.o boardparms.o int-handler.o
6907 +SRCBASE := $(TOPDIR)
6908 +EXTRA_CFLAGS += -I$(SRCBASE)/include
6909 +#EXTRA_CFLAGS += -I$(INC_ADSLDRV_PATH) -DDBG
6910 +EXTRA_CFLAGS += -I$(INC_ADSLDRV_PATH)
6913 +ifeq "$(ADSL)" "ANNEX_B"
6914 +EXTRA_CFLAGS += -DADSL_ANNEXB
6916 +ifeq "$(ADSL)" "SADSL"
6917 +EXTRA_CFLAGS += -DADSL_SADSL
6919 +ifeq "$(ADSL)" "ANNEX_C"
6920 +EXTRA_CFLAGS += -DADSL_ANNEXC
6923 diff -urN linux-2.6.17/arch/mips/bcm963xx/prom.c linux-2.6.17-brcm63xx/arch/mips/bcm963xx/prom.c
6924 --- linux-2.6.17/arch/mips/bcm963xx/prom.c 1970-01-01 01:00:00.000000000 +0100
6925 +++ linux-2.6.17-brcm63xx/arch/mips/bcm963xx/prom.c 2006-08-29 07:10:10.000000000 +0200
6929 + Copyright 2004 Broadcom Corp. All Rights Reserved.
6931 + This program is free software; you can distribute it and/or modify it
6932 + under the terms of the GNU General Public License (Version 2) as
6933 + published by the Free Software Foundation.
6935 + This program is distributed in the hope it will be useful, but WITHOUT
6936 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6937 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6940 + You should have received a copy of the GNU General Public License along
6941 + with this program; if not, write to the Free Software Foundation, Inc.,
6942 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
6946 + * prom.c: PROM library initialization code.
6949 +#include <linux/init.h>
6950 +#include <linux/mm.h>
6951 +#include <linux/sched.h>
6952 +#include <linux/bootmem.h>
6953 +#include <linux/blkdev.h>
6954 +#include <asm/addrspace.h>
6955 +#include <asm/bootinfo.h>
6956 +#include <asm/cpu.h>
6957 +#include <asm/time.h>
6959 +#include <bcm_map_part.h>
6961 +#include "boardparms.h"
6962 +#include "softdsl/AdslCoreDefs.h"
6965 +//char arcs_cmdline[CL_SIZE] __initdata = {0};
6967 +int boot_loader_type;
6969 +char **prom_argv, **prom_envp;
6971 +extern int do_syslog(int, char *, int);
6972 +extern void serial_init(void);
6973 +extern void __init InitNvramInfo( void );
6974 +extern void kerSysFlashInit( void );
6975 +extern unsigned long get_nvram_start_addr(void);
6976 +void __init create_root_nfs_cmdline( char *cmdline );
6978 +#define MACH_BCM MACH_BCM96348
6980 +const char *get_system_type(void)
6982 + /*PNVRAM_DATA pNvramData = (PNVRAM_DATA) get_nvram_start_addr();
6984 + return( pNvramData->szBoardId );*/
6985 + return "brcm63xx";
6988 +unsigned long getMemorySize(void)
6990 + unsigned long ulSdramType = BOARD_SDRAM_TYPE;
6992 + unsigned long ulSdramSize;
6994 + switch( ulSdramType )
6996 + case BP_MEMORY_16MB_1_CHIP:
6997 + case BP_MEMORY_16MB_2_CHIP:
6998 + ulSdramSize = 16 * 1024 * 1024;
7000 + case BP_MEMORY_32MB_1_CHIP:
7001 + case BP_MEMORY_32MB_2_CHIP:
7002 + ulSdramSize = 32 * 1024 * 1024;
7004 + case BP_MEMORY_64MB_2_CHIP:
7005 + ulSdramSize = 64 * 1024 * 1024;
7008 + ulSdramSize = 8 * 1024 * 1024;
7011 + if (boot_loader_type == BOOT_CFE)
7012 + return ulSdramSize;
7014 + // assume that there is one contiguous memory map
7015 + return boot_mem_map.map[0].size;
7018 +/* --------------------------------------------------------------------------
7020 + -------------------------------------------------------------------------- */
7021 +void __init prom_init(void)
7023 + extern ulong r4k_interval;
7027 + prom_argc = fw_arg0;
7028 + prom_argv = (char **) fw_arg1;
7029 + prom_envp = (char **) fw_arg2;
7031 + if ((prom_argv > 0x80000000) && (prom_argv < 0x82000000)) {
7032 + strncpy(arcs_cmdline, prom_argv[1], CL_SIZE);
7035 + if (strncmp(arcs_cmdline, "boot_loader=RedBoot", 19) != 0) {
7036 + boot_loader_type = BOOT_CFE;
7039 + boot_loader_type = BOOT_REDBOOT;
7042 + do_syslog(8, NULL, 8);
7044 + printk( "%s prom init\n", get_system_type() );
7046 + PERF->IrqMask = 0;
7048 + arcs_cmdline[0] = '\0';
7050 + if (boot_loader_type == BOOT_CFE)
7051 + add_memory_region(0, (getMemorySize() - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);
7053 + add_memory_region(0, (0x01000000 - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);
7055 + mips_machgroup = MACH_GROUP_BRCM;
7056 + mips_machtype = MACH_BCM;
7058 + BpSetBoardId("96348GW-10");
7061 +/* --------------------------------------------------------------------------
7062 + Name: prom_free_prom_memory
7064 + -------------------------------------------------------------------------- */
7065 +void __init prom_free_prom_memory(void)
7070 diff -urN linux.old/arch/mips/bcm963xx/ser_init.c linux.dev/arch/mips/bcm963xx/ser_init.c
7071 --- linux.old/arch/mips/bcm963xx/ser_init.c 1970-01-01 01:00:00.000000000 +0100
7072 +++ linux.dev/arch/mips/bcm963xx/ser_init.c 2006-08-25 00:39:38.000000000 +0200
7076 + Copyright 2004 Broadcom Corp. All Rights Reserved.
7078 + This program is free software; you can distribute it and/or modify it
7079 + under the terms of the GNU General Public License (Version 2) as
7080 + published by the Free Software Foundation.
7082 + This program is distributed in the hope it will be useful, but WITHOUT
7083 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7084 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7087 + You should have received a copy of the GNU General Public License along
7088 + with this program; if not, write to the Free Software Foundation, Inc.,
7089 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
7093 + * Broadcom bcm63xx serial port initialization, also prepare for printk
7094 + * by registering with console_init
7098 +#include <linux/autoconf.h>
7099 +#include <linux/init.h>
7100 +#include <linux/interrupt.h>
7101 +#include <linux/kernel.h>
7102 +#include <linux/types.h>
7103 +#include <linux/console.h>
7104 +#include <linux/sched.h>
7106 +#include <asm/addrspace.h>
7107 +#include <asm/irq.h>
7108 +#include <asm/reboot.h>
7109 +#include <asm/gdb-stub.h>
7110 +#include <asm/mc146818rtc.h>
7112 +#include <bcm_map_part.h>
7115 +#define SER63XX_DEFAULT_BAUD 115200
7116 +#define BD_BCM63XX_TIMER_CLOCK_INPUT (FPERIPH)
7117 +#define stUart ((volatile Uart * const) UART_BASE)
7119 +// Transmit interrupts
7120 +#define TXINT (TXFIFOEMT | TXUNDERR | TXOVFERR)
7121 +// Receive interrupts
7122 +#define RXINT (RXFIFONE | RXOVFERR)
7124 +/* --------------------------------------------------------------------------
7126 + Purpose: Initalize the UART
7127 +-------------------------------------------------------------------------- */
7128 +void __init serial_init(void)
7130 + UINT32 tmpVal = SER63XX_DEFAULT_BAUD;
7131 + ULONG clockFreqHz;
7133 +#if defined(CONFIG_BCM96345)
7134 + // Make sure clock is ticking
7135 + PERF->blkEnables |= UART_CLK_EN;
7138 + /* Dissable channel's receiver and transmitter. */
7139 + stUart->control &= ~(BRGEN|TXEN|RXEN);
7141 + /*--------------------------------------------------------------------*/
7142 + /* Write the table value to the clock select register. */
7143 + /* DPullen - this is the equation to use: */
7144 + /* value = clockFreqHz / baud / 32-1; */
7145 + /* (snmod) Actually you should also take into account any necessary */
7146 + /* rounding. Divide by 16, look at lsb, if 0, divide by 2 */
7147 + /* and subtract 1. If 1, just divide by 2 */
7148 + /*--------------------------------------------------------------------*/
7149 + clockFreqHz = BD_BCM63XX_TIMER_CLOCK_INPUT;
7150 + tmpVal = (clockFreqHz / tmpVal) / 16;
7151 + if( tmpVal & 0x01 )
7152 + tmpVal /= 2; //Rounding up, so sub is already accounted for
7154 + tmpVal = (tmpVal / 2) - 1; // Rounding down so we must sub 1
7155 + stUart->baudword = tmpVal;
7157 + /* Finally, re-enable the transmitter and receiver. */
7158 + stUart->control |= (BRGEN|TXEN|RXEN);
7160 + stUart->config = (BITS8SYM | ONESTOP);
7161 + // Set the FIFO interrupt depth ... stUart->fifocfg = 0xAA;
7162 + stUart->fifoctl = RSTTXFIFOS | RSTRXFIFOS;
7163 + stUart->intMask = 0;
7164 + stUart->intMask = RXINT | TXINT;
7169 + * Output a character to the UART
7171 +void prom_putc(char c)
7173 + /* Wait for Tx uffer to empty */
7174 + while (! (READ16(stUart->intStatus) & TXFIFOEMT));
7175 + /* Send character */
7180 + * Write a string to the UART
7182 +void prom_puts(const char *s)
7193 +/* prom_getc_nowait()
7194 + * Returns a character from the UART
7195 + * Returns -1 if no characters available or corrupted
7197 +int prom_getc_nowait(void)
7202 + uStatus = READ16(stUart->intStatus);
7204 + if (uStatus & RXFIFONE) { /* Do we have a character? */
7205 + cData = READ16(stUart->Data) & 0xff; /* Read character */
7206 + if (uStatus & (RXFRAMERR | RXPARERR)) { /* If we got an error, throw it away */
7215 + * Returns a charcter from the serial port
7216 + * Will block until it receives a valid character
7218 +char prom_getc(void)
7222 + /* Loop until we get a valid character */
7223 + while(cData == -1) {
7224 + cData = prom_getc_nowait();
7226 + return (char) cData;
7230 + * Returns 0 if no characters available
7232 +int prom_testc(void)
7236 + uStatus = READ16(stUart->intStatus);
7238 + return (uStatus & RXFIFONE);
7241 +#if defined (CONFIG_REMOTE_DEBUG)
7242 +/* Prevent other code from writing to the serial port */
7243 +void _putc(char c) { }
7244 +void _puts(const char *ptr) { }
7246 +/* Low level outputs call prom routines */
7247 +void _putc(char c) {
7250 +void _puts(const char *ptr) {
7254 diff -urN linux.old/arch/mips/bcm963xx/setup.c linux.dev/arch/mips/bcm963xx/setup.c
7255 --- linux.old/arch/mips/bcm963xx/setup.c 1970-01-01 01:00:00.000000000 +0100
7256 +++ linux.dev/arch/mips/bcm963xx/setup.c 2006-08-25 02:26:58.000000000 +0200
7260 + Copyright 2002 Broadcom Corp. All Rights Reserved.
7262 + This program is free software; you can distribute it and/or modify it
7263 + under the terms of the GNU General Public License (Version 2) as
7264 + published by the Free Software Foundation.
7266 + This program is distributed in the hope it will be useful, but WITHOUT
7267 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7268 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7271 + You should have received a copy of the GNU General Public License along
7272 + with this program; if not, write to the Free Software Foundation, Inc.,
7273 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
7277 + * Generic setup routines for Broadcom 963xx MIPS boards
7280 +#include <linux/autoconf.h>
7281 +#include <linux/init.h>
7282 +#include <linux/interrupt.h>
7283 +#include <linux/kernel.h>
7284 +#include <linux/kdev_t.h>
7285 +#include <linux/types.h>
7286 +#include <linux/console.h>
7287 +#include <linux/sched.h>
7288 +#include <linux/mm.h>
7289 +#include <linux/slab.h>
7290 +#include <linux/module.h>
7291 +#include <linux/pm.h>
7293 +#include <asm/addrspace.h>
7294 +#include <asm/bcache.h>
7295 +#include <asm/irq.h>
7296 +#include <asm/time.h>
7297 +#include <asm/reboot.h>
7298 +#include <asm/gdb-stub.h>
7300 +extern void brcm_time_init(void);
7301 +extern void brcm_timer_setup(struct irqaction *irq);
7302 +extern unsigned long getMemorySize(void);
7304 +#if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
7305 +#include <linux/pci.h>
7306 +#include <linux/delay.h>
7307 +#include <bcm_map_part.h>
7308 +#include <bcmpci.h>
7310 +static volatile MpiRegisters * mpi = (MpiRegisters *)(MPI_BASE);
7313 +/* This function should be in a board specific directory. For now,
7314 + * assume that all boards that include this file use a Broadcom chip
7315 + * with a soft reset bit in the PLL control register.
7317 +static void brcm_machine_restart(char *command)
7319 + const unsigned long ulSoftReset = 0x00000001;
7320 + unsigned long *pulPllCtrl = (unsigned long *) 0xfffe0008;
7321 + *pulPllCtrl |= ulSoftReset;
7324 +static void brcm_machine_halt(void)
7326 + printk("System halted\n");
7330 +#if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
7332 +static void mpi_SetLocalPciConfigReg(uint32 reg, uint32 value)
7334 + /* write index then value */
7335 + mpi->pcicfgcntrl = PCI_CFG_REG_WRITE_EN + reg;;
7336 + mpi->pcicfgdata = value;
7339 +static uint32 mpi_GetLocalPciConfigReg(uint32 reg)
7341 + /* write index then get value */
7342 + mpi->pcicfgcntrl = PCI_CFG_REG_WRITE_EN + reg;;
7343 + return mpi->pcicfgdata;
7347 + * mpi_ResetPcCard: Set/Reset the PcCard
7349 +static void mpi_ResetPcCard(int cardtype, BOOL bReset)
7351 + if (cardtype == MPI_CARDTYPE_NONE) {
7355 + if (cardtype == MPI_CARDTYPE_CARDBUS) {
7356 + bReset = ! bReset;
7360 + mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & ~PCCARD_CARD_RESET);
7362 + mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 | PCCARD_CARD_RESET);
7367 + * mpi_ConfigCs: Configure an MPI/EBI chip select
7369 +static void mpi_ConfigCs(uint32 cs, uint32 base, uint32 size, uint32 flags)
7371 + mpi->cs[cs].base = ((base & 0x1FFFFFFF) | size);
7372 + mpi->cs[cs].config = flags;
7376 + * mpi_InitPcmciaSpace
7378 +static void mpi_InitPcmciaSpace(void)
7380 + // ChipSelect 4 controls PCMCIA Memory accesses
7381 + mpi_ConfigCs(PCMCIA_COMMON_BASE, pcmciaMem, EBI_SIZE_1M, (EBI_WORD_WIDE|EBI_ENABLE));
7382 + // ChipSelect 5 controls PCMCIA Attribute accesses
7383 + mpi_ConfigCs(PCMCIA_ATTRIBUTE_BASE, pcmciaAttr, EBI_SIZE_1M, (EBI_WORD_WIDE|EBI_ENABLE));
7384 + // ChipSelect 6 controls PCMCIA I/O accesses
7385 + mpi_ConfigCs(PCMCIA_IO_BASE, pcmciaIo, EBI_SIZE_64K, (EBI_WORD_WIDE|EBI_ENABLE));
7387 + mpi->pcmcia_cntl2 = ((PCMCIA_ATTR_ACTIVE << RW_ACTIVE_CNT_BIT) |
7388 + (PCMCIA_ATTR_INACTIVE << INACTIVE_CNT_BIT) |
7389 + (PCMCIA_ATTR_CE_SETUP << CE_SETUP_CNT_BIT) |
7390 + (PCMCIA_ATTR_CE_HOLD << CE_HOLD_CNT_BIT));
7392 + mpi->pcmcia_cntl2 |= (PCMCIA_HALFWORD_EN | PCMCIA_BYTESWAP_DIS);
7396 + * cardtype_vcc_detect: PC Card's card detect and voltage sense connection
7398 + * CD1#/ CD2#/ VS1#/ VS2#/ Card Initial Vcc
7399 + * CCD1# CCD2# CVS1 CVS2 Type
7401 + * GND GND open open 16-bit 5 vdc
7403 + * GND GND GND open 16-bit 3.3 vdc
7405 + * GND GND open GND 16-bit x.x vdc
7407 + * GND GND GND GND 16-bit 3.3 & x.x vdc
7409 + *====================================================================
7411 + * CVS1 GND CCD1# open CardBus 3.3 vdc
7413 + * GND CVS2 open CCD2# CardBus x.x vdc
7415 + * GND CVS1 CCD2# open CardBus y.y vdc
7417 + * GND CVS2 GND CCD2# CardBus 3.3 & x.x vdc
7419 + * CVS2 GND open CCD1# CardBus x.x & y.y vdc
7421 + * GND CVS1 CCD2# open CardBus 3.3, x.x & y.y vdc
7424 +static int cardtype_vcc_detect(void)
7429 + cardtype = MPI_CARDTYPE_NONE;
7430 + mpi->pcmcia_cntl1 = 0x0000A000; // Turn on the output enables and drive
7431 + // the CVS pins to 0.
7432 + data32 = mpi->pcmcia_cntl1;
7433 + switch (data32 & 0x00000003) // Test CD1# and CD2#, see if card is plugged in.
7435 + case 0x00000003: // No Card is in the slot.
7436 + printk("mpi: No Card is in the PCMCIA slot\n");
7439 + case 0x00000002: // Partial insertion, No CD2#.
7440 + printk("mpi: Card in the PCMCIA slot partial insertion, no CD2 signal\n");
7443 + case 0x00000001: // Partial insertion, No CD1#.
7444 + printk("mpi: Card in the PCMCIA slot partial insertion, no CD1 signal\n");
7448 + mpi->pcmcia_cntl1 = 0x0000A0C0; // Turn off the CVS output enables and
7449 + // float the CVS pins.
7451 + data32 = mpi->pcmcia_cntl1;
7452 + // Read the Register.
7453 + switch (data32 & 0x0000000C) // See what is on the CVS pins.
7455 + case 0x00000000: // CVS1 and CVS2 are tied to ground, only 1 option.
7456 + printk("mpi: Detected 3.3 & x.x 16-bit PCMCIA card\n");
7457 + cardtype = MPI_CARDTYPE_PCMCIA;
7460 + case 0x00000004: // CVS1 is open or tied to CCD1/CCD2 and CVS2 is tied to ground.
7461 + // 2 valid voltage options.
7462 + switch (data32 & 0x00000003) // Test the values of CCD1 and CCD2.
7464 + case 0x00000003: // CCD1 and CCD2 are tied to 1 of the CVS pins.
7465 + // This is not a valid combination.
7466 + printk("mpi: Unknown card plugged into slot\n");
7469 + case 0x00000002: // CCD2 is tied to either CVS1 or CVS2.
7470 + mpi->pcmcia_cntl1 = 0x0000A080; // Drive CVS1 to a 0.
7472 + data32 = mpi->pcmcia_cntl1;
7473 + if (data32 & 0x00000002) { // CCD2 is tied to CVS2, not valid.
7474 + printk("mpi: Unknown card plugged into slot\n");
7475 + } else { // CCD2 is tied to CVS1.
7476 + printk("mpi: Detected 3.3, x.x and y.y Cardbus card\n");
7477 + cardtype = MPI_CARDTYPE_CARDBUS;
7481 + case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
7482 + // This is not a valid combination.
7483 + printk("mpi: Unknown card plugged into slot\n");
7486 + case 0x00000000: // CCD1 and CCD2 are tied to ground.
7487 + printk("mpi: Detected x.x vdc 16-bit PCMCIA card\n");
7488 + cardtype = MPI_CARDTYPE_PCMCIA;
7493 + case 0x00000008: // CVS2 is open or tied to CCD1/CCD2 and CVS1 is tied to ground.
7494 + // 2 valid voltage options.
7495 + switch (data32 & 0x00000003) // Test the values of CCD1 and CCD2.
7497 + case 0x00000003: // CCD1 and CCD2 are tied to 1 of the CVS pins.
7498 + // This is not a valid combination.
7499 + printk("mpi: Unknown card plugged into slot\n");
7502 + case 0x00000002: // CCD2 is tied to either CVS1 or CVS2.
7503 + mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
7505 + data32 = mpi->pcmcia_cntl1;
7506 + if (data32 & 0x00000002) { // CCD2 is tied to CVS1, not valid.
7507 + printk("mpi: Unknown card plugged into slot\n");
7508 + } else {// CCD2 is tied to CVS2.
7509 + printk("mpi: Detected 3.3 and x.x Cardbus card\n");
7510 + cardtype = MPI_CARDTYPE_CARDBUS;
7514 + case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
7515 + // This is not a valid combination.
7516 + printk("mpi: Unknown card plugged into slot\n");
7519 + case 0x00000000: // CCD1 and CCD2 are tied to ground.
7520 + cardtype = MPI_CARDTYPE_PCMCIA;
7521 + printk("mpi: Detected 3.3 vdc 16-bit PCMCIA card\n");
7526 + case 0x0000000C: // CVS1 and CVS2 are open or tied to CCD1/CCD2.
7527 + // 5 valid voltage options.
7529 + switch (data32 & 0x00000003) // Test the values of CCD1 and CCD2.
7531 + case 0x00000003: // CCD1 and CCD2 are tied to 1 of the CVS pins.
7532 + // This is not a valid combination.
7533 + printk("mpi: Unknown card plugged into slot\n");
7536 + case 0x00000002: // CCD2 is tied to either CVS1 or CVS2.
7537 + // CCD1 is tied to ground.
7538 + mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
7540 + data32 = mpi->pcmcia_cntl1;
7541 + if (data32 & 0x00000002) { // CCD2 is tied to CVS1.
7542 + printk("mpi: Detected y.y vdc Cardbus card\n");
7543 + } else { // CCD2 is tied to CVS2.
7544 + printk("mpi: Detected x.x vdc Cardbus card\n");
7546 + cardtype = MPI_CARDTYPE_CARDBUS;
7549 + case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
7550 + // CCD2 is tied to ground.
7552 + mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
7554 + data32 = mpi->pcmcia_cntl1;
7555 + if (data32 & 0x00000001) {// CCD1 is tied to CVS1.
7556 + printk("mpi: Detected 3.3 vdc Cardbus card\n");
7557 + } else { // CCD1 is tied to CVS2.
7558 + printk("mpi: Detected x.x and y.y Cardbus card\n");
7560 + cardtype = MPI_CARDTYPE_CARDBUS;
7563 + case 0x00000000: // CCD1 and CCD2 are tied to ground.
7564 + cardtype = MPI_CARDTYPE_PCMCIA;
7565 + printk("mpi: Detected 5 vdc 16-bit PCMCIA card\n");
7571 + printk("mpi: Unknown card plugged into slot\n");
7580 + * mpi_DetectPcCard: Detect the plugged in PC-Card
7581 + * Return: < 0 => Unknown card detected
7582 + * 0 => No card detected
7583 + * 1 => 16-bit card detected
7584 + * 2 => 32-bit CardBus card detected
7586 +static int mpi_DetectPcCard(void)
7590 + cardtype = cardtype_vcc_detect();
7591 + switch(cardtype) {
7592 + case MPI_CARDTYPE_PCMCIA:
7593 + mpi->pcmcia_cntl1 &= ~0x0000e000; // disable enable bits
7594 + //mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & ~PCCARD_CARD_RESET);
7595 + mpi->pcmcia_cntl1 |= (PCMCIA_ENABLE | PCMCIA_GPIO_ENABLE);
7596 + mpi_InitPcmciaSpace();
7597 + mpi_ResetPcCard(cardtype, FALSE);
7598 + // Hold card in reset for 10ms
7600 + mpi_ResetPcCard(cardtype, TRUE);
7601 + // Let card come out of reset
7604 + case MPI_CARDTYPE_CARDBUS:
7605 + // 8 => CardBus Enable
7606 + // 1 => PCI Slot Number
7607 + // C => Float VS1 & VS2
7608 + mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & 0xFFFF0000) |
7610 + (CARDBUS_SLOT << 8)|
7613 + /* access to this memory window will be to/from CardBus */
7614 + mpi->l2pmremap1 |= CARDBUS_MEM;
7616 + // Need to reset the Cardbus Card. There's no CardManager to do this,
7617 + // and we need to be ready for PCI configuration.
7618 + mpi_ResetPcCard(cardtype, FALSE);
7619 + // Hold card in reset for 10ms
7621 + mpi_ResetPcCard(cardtype, TRUE);
7622 + // Let card come out of reset
7631 +static int mpi_init(void)
7633 + unsigned long data;
7634 + unsigned int chipid;
7635 + unsigned int chiprev;
7636 + unsigned int sdramsize;
7638 + chipid = (PERF->RevID & 0xFFFF0000) >> 16;
7639 + chiprev = (PERF->RevID & 0xFF);
7640 + sdramsize = getMemorySize();
7642 + * Init the pci interface
7644 + data = GPIO->GPIOMode; // GPIO mode register
7645 + data |= GROUP2_PCI | GROUP1_MII_PCCARD; // PCI internal arbiter + Cardbus
7646 + GPIO->GPIOMode = data; // PCI internal arbiter
7649 + * In the BCM6348 CardBus support is defaulted to Slot 0
7650 + * because there is no external IDSEL for CardBus. To disable
7651 + * the CardBus and allow a standard PCI card in Slot 0
7652 + * set the cbus_idsel field to 0x1f.
7655 + uData = mpi->pcmcia_cntl1;
7656 + uData |= CARDBUS_IDSEL;
7657 + mpi->pcmcia_cntl1 = uData;
7659 + // Setup PCI I/O Window range. Give 64K to PCI I/O
7660 + mpi->l2piorange = ~(BCM_PCI_IO_SIZE_64KB-1);
7661 + // UBUS to PCI I/O base address
7662 + mpi->l2piobase = BCM_PCI_IO_BASE & BCM_PCI_ADDR_MASK;
7663 + // UBUS to PCI I/O Window remap
7664 + mpi->l2pioremap = (BCM_PCI_IO_BASE | MEM_WINDOW_EN);
7666 + // enable PCI related GPIO pins and data swap between system and PCI bus
7667 + mpi->locbuscntrl = (EN_PCI_GPIO | DIR_U2P_NOSWAP);
7669 + /* Enable 6348 BusMaster and Memory access mode */
7670 + data = mpi_GetLocalPciConfigReg(PCI_COMMAND);
7671 + data |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
7672 + mpi_SetLocalPciConfigReg(PCI_COMMAND, data);
7674 + /* Configure two 16 MByte PCI to System memory regions. */
7675 + /* These memory regions are used when PCI device is a bus master */
7676 + /* Accesses to the SDRAM from PCI bus will be "byte swapped" for this region */
7677 + mpi_SetLocalPciConfigReg(PCI_BASE_ADDRESS_3, BCM_HOST_MEM_SPACE1);
7678 + mpi->sp0remap = 0x0;
7680 + /* Accesses to the SDRAM from PCI bus will not be "byte swapped" for this region */
7681 + mpi_SetLocalPciConfigReg(PCI_BASE_ADDRESS_4, BCM_HOST_MEM_SPACE2);
7682 + mpi->sp1remap = 0x0;
7683 + mpi->pcimodesel |= (PCI_BAR2_NOSWAP | 0x40);
7685 + if ((chipid == 0x6348) && (chiprev == 0xb0)) {
7686 + mpi->sp0range = ~(sdramsize-1);
7687 + mpi->sp1range = ~(sdramsize-1);
7690 + * Change 6348 PCI Cfg Reg. offset 0x40 to PCI memory read retry count infinity
7691 + * by set 0 in bit 8~15. This resolve read Bcm4306 srom return 0xffff in
7694 + data = mpi_GetLocalPciConfigReg(BRCM_PCI_CONFIG_TIMER);
7695 + data &= ~BRCM_PCI_CONFIG_TIMER_RETRY_MASK;
7696 + data |= 0x00000080;
7697 + mpi_SetLocalPciConfigReg(BRCM_PCI_CONFIG_TIMER, data);
7699 + /* enable pci interrupt */
7700 + mpi->locintstat |= (EXT_PCI_INT << 16);
7702 + mpi_DetectPcCard();
7704 + ioport_resource.start = BCM_PCI_IO_BASE;
7705 + ioport_resource.end = BCM_PCI_IO_BASE + BCM_PCI_IO_SIZE_64KB;
7707 +#if defined(CONFIG_USB)
7708 + PERF->blkEnables |= USBH_CLK_EN;
7710 + *USBH_NON_OHCI = NON_OHCI_BYTE_SWAP;
7717 +static int __init brcm63xx_setup(void)
7719 + extern int panic_timeout;
7721 + _machine_restart = brcm_machine_restart;
7722 + _machine_halt = brcm_machine_halt;
7723 + pm_power_off = brcm_machine_halt;
7725 + board_time_init = brcm_time_init;
7726 + board_timer_setup = brcm_timer_setup;
7728 + panic_timeout = 5;
7730 +#if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
7731 + /* mpi initialization */
7737 +void plat_setup(void)
7742 +/***************************************************************************
7743 + * C++ New and delete operator functions
7744 + ***************************************************************************/
7746 +/* void *operator new(unsigned int sz) */
7747 +void *_Znwj(unsigned int sz)
7749 + return( kmalloc(sz, GFP_KERNEL) );
7752 +/* void *operator new[](unsigned int sz)*/
7753 +void *_Znaj(unsigned int sz)
7755 + return( kmalloc(sz, GFP_KERNEL) );
7758 +/* placement new operator */
7759 +/* void *operator new (unsigned int size, void *ptr) */
7760 +void *ZnwjPv(unsigned int size, void *ptr)
7765 +/* void operator delete(void *m) */
7766 +void _ZdlPv(void *m)
7771 +/* void operator delete[](void *m) */
7772 +void _ZdaPv(void *m)
7777 +EXPORT_SYMBOL(_Znwj);
7778 +EXPORT_SYMBOL(_Znaj);
7779 +EXPORT_SYMBOL(ZnwjPv);
7780 +EXPORT_SYMBOL(_ZdlPv);
7781 +EXPORT_SYMBOL(_ZdaPv);
7783 diff -urN linux.old/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h linux.dev/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h
7784 --- linux.old/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h 1970-01-01 01:00:00.000000000 +0100
7785 +++ linux.dev/arch/mips/bcm963xx/softdsl/AdslCoreDefs.h 2006-08-25 00:39:38.000000000 +0200
7787 +#define ADSL_SDRAM_IMAGE_SIZE (384*1024)
7789 diff -urN linux.old/arch/mips/bcm963xx/time.c linux.dev/arch/mips/bcm963xx/time.c
7790 --- linux.old/arch/mips/bcm963xx/time.c 1970-01-01 01:00:00.000000000 +0100
7791 +++ linux.dev/arch/mips/bcm963xx/time.c 2006-08-25 03:58:22.000000000 +0200
7795 + Copyright 2004 Broadcom Corp. All Rights Reserved.
7797 + This program is free software; you can distribute it and/or modify it
7798 + under the terms of the GNU General Public License (Version 2) as
7799 + published by the Free Software Foundation.
7801 + This program is distributed in the hope it will be useful, but WITHOUT
7802 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7803 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7806 + You should have received a copy of the GNU General Public License along
7807 + with this program; if not, write to the Free Software Foundation, Inc.,
7808 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
7812 + * Setup time for Broadcom 963xx MIPS boards
7815 +#include <linux/autoconf.h>
7816 +#include <linux/init.h>
7817 +#include <linux/kernel_stat.h>
7818 +#include <linux/sched.h>
7819 +#include <linux/spinlock.h>
7820 +#include <linux/interrupt.h>
7821 +#include <linux/module.h>
7822 +#include <linux/time.h>
7823 +#include <linux/timex.h>
7825 +#include <asm/mipsregs.h>
7826 +#include <asm/ptrace.h>
7827 +#include <asm/div64.h>
7828 +#include <asm/time.h>
7830 +#include <bcm_map_part.h>
7831 +#include <bcm_intr.h>
7833 +static unsigned long r4k_offset; /* Amount to increment compare reg each time */
7834 +static unsigned long r4k_cur; /* What counter should be at next timer irq */
7836 +/* *********************************************************************
7837 + * calculateCpuSpeed()
7838 + * Calculate the BCM6348 CPU speed by reading the PLL strap register
7839 + * and applying the following formula:
7840 + * cpu_clk = (.25 * 64MHz freq) * (N1 + 1) * (N2 + 2) / (M1_CPU + 1)
7841 + * Input parameters:
7845 + ********************************************************************* */
7847 +static inline unsigned long __init calculateCpuSpeed(void)
7849 + UINT32 pllStrap = PERF->PllStrap;
7850 + int n1 = (pllStrap & PLL_N1_MASK) >> PLL_N1_SHFT;
7851 + int n2 = (pllStrap & PLL_N2_MASK) >> PLL_N2_SHFT;
7852 + int m1cpu = (pllStrap & PLL_M1_CPU_MASK) >> PLL_M1_CPU_SHFT;
7854 + return (16 * (n1 + 1) * (n2 + 2) / (m1cpu + 1)) * 1000000;
7858 +static inline unsigned long __init cal_r4koff(void)
7860 + mips_hpt_frequency = calculateCpuSpeed() / 2;
7861 + return (mips_hpt_frequency / HZ);
7866 + * There are a lot of conceptually broken versions of the MIPS timer interrupt
7867 + * handler floating around. This one is rather different, but the algorithm
7868 + * is provably more robust.
7870 +irqreturn_t brcm_timer_interrupt(struct pt_regs *regs)
7872 + int irq = MIPS_TIMER_INT;
7875 + kstat_this_cpu.irqs[irq]++;
7877 + timer_interrupt(irq, NULL, regs);
7879 + return IRQ_HANDLED;
7883 +void __init brcm_time_init(void)
7885 + unsigned int est_freq, flags;
7886 + local_irq_save(flags);
7888 + printk("calculating r4koff... ");
7889 + r4k_offset = cal_r4koff();
7890 + printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
7892 + est_freq = 2 * r4k_offset * HZ;
7893 + est_freq += 5000; /* round */
7894 + est_freq -= est_freq % 10000;
7895 + printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
7896 + (est_freq % 1000000) * 100 / 1000000);
7897 + local_irq_restore(flags);
7901 +void __init brcm_timer_setup(struct irqaction *irq)
7903 + r4k_cur = (read_c0_count() + r4k_offset);
7904 + write_c0_compare(r4k_cur);
7905 + set_c0_status(IE_IRQ5);
7907 diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
7908 --- linux.old/arch/mips/Kconfig 2006-08-25 00:43:39.000000000 +0200
7909 +++ linux.dev/arch/mips/Kconfig 2006-08-25 01:57:46.000000000 +0200
7911 prompt "System type"
7915 + bool "Support for the Broadcom boards"
7916 + select SYS_SUPPORTS_32BIT_KERNEL
7917 + select SYS_SUPPORTS_BIG_ENDIAN
7918 + select SYS_HAS_CPU_MIPS32_R1
7921 + This is a fmaily of boards based on the Broadcom MIPS32
7924 bool "4G Systems MTX-1 board"
7925 select DMA_NONCOHERENT
7930 +source "arch/mips/bcm963xx/Kconfig"
7931 source "arch/mips/ddb5xxx/Kconfig"
7932 source "arch/mips/gt64120/ev64120/Kconfig"
7933 source "arch/mips/jazz/Kconfig"
7934 diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-probe.c
7935 --- linux.old/arch/mips/kernel/cpu-probe.c 2006-08-25 00:43:39.000000000 +0200
7936 +++ linux.dev/arch/mips/kernel/cpu-probe.c 2006-08-25 00:39:38.000000000 +0200
7937 @@ -568,6 +568,25 @@
7941 +static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
7943 + decode_configs(c);
7944 + switch (c->processor_id & 0xff00) {
7945 + case PRID_IMP_BCM6338:
7946 + c->cputype = CPU_BCM6338;
7948 + case PRID_IMP_BCM6345:
7949 + c->cputype = CPU_BCM6345;
7951 + case PRID_IMP_BCM6348:
7952 + c->cputype = CPU_BCM6348;
7955 + c->cputype = CPU_UNKNOWN;
7960 static inline void cpu_probe_mips(struct cpuinfo_mips *c)
7964 case PRID_COMP_LEGACY:
7965 cpu_probe_legacy(c);
7967 + case PRID_COMP_BROADCOM:
7968 + cpu_probe_broadcom(c);
7970 case PRID_COMP_MIPS:
7973 diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c
7974 --- linux.old/arch/mips/kernel/proc.c 2006-08-25 00:43:39.000000000 +0200
7975 +++ linux.dev/arch/mips/kernel/proc.c 2006-08-25 00:39:38.000000000 +0200
7977 [CPU_VR4181A] = "NEC VR4181A",
7978 [CPU_SR71000] = "Sandcraft SR71000",
7979 [CPU_PR4450] = "Philips PR4450",
7980 + [CPU_BCM6338] = "BCM6338",
7981 + [CPU_BCM6345] = "BCM6345",
7982 + [CPU_BCM6348] = "BCM6348",
7986 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
7987 --- linux.old/arch/mips/Makefile 2006-08-25 00:43:39.000000000 +0200
7988 +++ linux.dev/arch/mips/Makefile 2006-08-25 15:39:54.000000000 +0200
7989 @@ -145,6 +145,15 @@
7995 +core-$(CONFIG_BCM963XX) += arch/mips/bcm963xx/
7996 +cflags-$(CONFIG_BCM963XX) += -Iinclude/asm-mips/mach-bcm963xx
7997 +cflags-$(CONFIG_BCM963XX) += -Iarch/mips/bcm963xx/include
7998 +load-$(CONFIG_BCM963XX) += 0xffffffff80010000
8002 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
8004 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
8005 diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
8006 --- linux.old/arch/mips/mm/c-r4k.c 2006-08-25 00:43:39.000000000 +0200
8007 +++ linux.dev/arch/mips/mm/c-r4k.c 2006-08-25 00:39:38.000000000 +0200
8008 @@ -914,6 +914,13 @@
8009 if (!(config & MIPS_CONF_M))
8010 panic("Don't know how to probe P-caches on this cpu.");
8012 + if (c->cputype == CPU_BCM6338 || c->cputype == CPU_BCM6345 || c->cputype == CPU_BCM6348)
8014 + printk("brcm mips: enabling icache and dcache...\n");
8015 + /* Enable caches */
8016 + write_c0_diag(read_c0_diag() | 0xC0000000);
8020 * So we seem to be a MIPS32 or MIPS64 CPU
8021 * So let's probe the I-cache ...
8022 diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
8023 --- linux.old/arch/mips/mm/tlbex.c 2006-08-25 00:43:39.000000000 +0200
8024 +++ linux.dev/arch/mips/mm/tlbex.c 2006-08-25 00:39:38.000000000 +0200
8035 diff -urN linux-2.6.17/arch/mips/pci/fixup-bcm96348.c linux-2.6.17-brcm63xx/arch/mips/pci/fixup-bcm96348.c
8036 --- linux-2.6.17/arch/mips/pci/fixup-bcm96348.c 1970-01-01 01:00:00.000000000 +0100
8037 +++ linux-2.6.17-brcm63xx/arch/mips/pci/fixup-bcm96348.c 2006-08-29 10:25:22.000000000 +0200
8041 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8043 + This program is free software; you can distribute it and/or modify it
8044 + under the terms of the GNU General Public License (Version 2) as
8045 + published by the Free Software Foundation.
8047 + This program is distributed in the hope it will be useful, but WITHOUT
8048 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8049 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8052 + You should have received a copy of the GNU General Public License along
8053 + with this program; if not, write to the Free Software Foundation, Inc.,
8054 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8057 +#include <linux/init.h>
8058 +#include <linux/types.h>
8059 +#include <linux/pci.h>
8061 +#include <bcmpci.h>
8062 +#include <bcm_intr.h>
8063 +#include <bcm_map_part.h>
8065 +static volatile MpiRegisters * mpi = (MpiRegisters *)(MPI_BASE);
8067 +static char irq_tab_bcm96348[] __initdata = {
8068 + [0] = INTERRUPT_ID_MPI,
8069 + [1] = INTERRUPT_ID_MPI,
8070 +#if defined(CONFIG_USB)
8071 + [USB_HOST_SLOT] = INTERRUPT_ID_USBH
8075 +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
8077 + return irq_tab_bcm96348[slot];
8080 +static void bcm96348_fixup(struct pci_dev *dev)
8085 + memaddr = pci_resource_start(dev, 0);
8086 + size = pci_resource_len(dev, 0);
8088 + switch (PCI_SLOT(dev->devfn)) {
8090 + // UBUS to PCI address range
8091 + // Memory Window 1. Mask determines which bits are decoded.
8092 + mpi->l2pmrange1 = ~(size-1);
8093 + // UBUS to PCI Memory base address. This is akin to the ChipSelect base
8095 + mpi->l2pmbase1 = memaddr & BCM_PCI_ADDR_MASK;
8096 + // UBUS to PCI Remap Address. Replaces the masked address bits in the
8097 + // range register with this setting.
8098 + // Also, enable direct I/O and direct Memory accesses
8099 + mpi->l2pmremap1 = (memaddr | MEM_WINDOW_EN);
8103 + // Memory Window 2
8104 + mpi->l2pmrange2 = ~(size-1);
8105 + // UBUS to PCI Memory base address.
8106 + mpi->l2pmbase2 = memaddr & BCM_PCI_ADDR_MASK;
8107 + // UBUS to PCI Remap Address
8108 + mpi->l2pmremap2 = (memaddr | MEM_WINDOW_EN);
8111 +#if defined(CONFIG_USB)
8112 + case USB_HOST_SLOT:
8113 + dev->resource[0].start = USB_HOST_BASE;
8114 + dev->resource[0].end = USB_HOST_BASE+USB_BAR0_MEM_SIZE-1;
8120 +int pcibios_plat_dev_init(struct pci_dev *dev)
8125 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_ANY_ID,
8128 +/*struct pci_fixup pcibios_fixups[] = {
8129 + { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, bcm96348_fixup },
8132 diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile
8133 --- linux.old/arch/mips/pci/Makefile 2006-08-25 00:43:29.000000000 +0200
8134 +++ linux.dev/arch/mips/pci/Makefile 2006-08-25 00:39:38.000000000 +0200
8136 obj-$(CONFIG_MIPS_TX3927) += ops-tx3927.o
8137 obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
8138 obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o
8139 +obj-$(CONFIG_BCM_PCI) += fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
8142 # These are still pretty much in the old state, watch, go blind.
8143 diff -urN linux.old/arch/mips/pci/ops-bcm96348.c linux.dev/arch/mips/pci/ops-bcm96348.c
8144 --- linux.old/arch/mips/pci/ops-bcm96348.c 1970-01-01 01:00:00.000000000 +0100
8145 +++ linux.dev/arch/mips/pci/ops-bcm96348.c 2006-08-25 00:39:38.000000000 +0200
8149 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8151 + This program is free software; you can distribute it and/or modify it
8152 + under the terms of the GNU General Public License (Version 2) as
8153 + published by the Free Software Foundation.
8155 + This program is distributed in the hope it will be useful, but WITHOUT
8156 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8157 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8160 + You should have received a copy of the GNU General Public License along
8161 + with this program; if not, write to the Free Software Foundation, Inc.,
8162 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8165 +#include <linux/types.h>
8166 +#include <linux/pci.h>
8167 +#include <linux/kernel.h>
8168 +#include <linux/init.h>
8169 +#include <asm/addrspace.h>
8171 +#include <bcm_intr.h>
8172 +#include <bcm_map_part.h>
8173 +#include <bcmpci.h>
8175 +#include <linux/delay.h>
8177 +#if defined(CONFIG_USB)
8179 +#define DPRINT(x...) printk(x)
8181 +#define DPRINT(x...)
8185 +pci63xx_int_read(unsigned int devfn, int where, u32 * value, int size);
8187 +pci63xx_int_write(unsigned int devfn, int where, u32 * value, int size);
8189 +static bool usb_mem_size_rd = FALSE;
8190 +static uint32 usb_mem_base = 0;
8191 +static uint32 usb_cfg_space_cmd_reg = 0;
8193 +static bool pci_mem_size_rd = FALSE;
8195 +static volatile MpiRegisters * mpi = (MpiRegisters *)(MPI_BASE);
8197 +static void mpi_SetupPciConfigAccess(uint32 addr)
8199 + mpi->l2pcfgctl = (DIR_CFG_SEL | DIR_CFG_USEREG | addr) & ~CONFIG_TYPE;
8202 +static void mpi_ClearPciConfigAccess(void)
8204 + mpi->l2pcfgctl = 0x00000000;
8207 +#if defined(CONFIG_USB)
8208 +/* --------------------------------------------------------------------------
8209 + Name: pci63xx_int_write
8210 +Abstract: PCI Config write on internal device(s)
8211 + -------------------------------------------------------------------------- */
8213 +pci63xx_int_write(unsigned int devfn, int where, u32 * value, int size)
8215 + if (PCI_SLOT(devfn) != USB_HOST_SLOT) {
8216 + return PCIBIOS_SUCCESSFUL;
8221 + DPRINT("W => Slot: %d Where: %2X Len: %d Data: %02X\n",
8222 + PCI_SLOT(devfn), where, size, *value);
8225 + DPRINT("W => Slot: %d Where: %2X Len: %d Data: %04X\n",
8226 + PCI_SLOT(devfn), where, size, *value);
8229 + usb_cfg_space_cmd_reg = *value;
8236 + DPRINT("W => Slot: %d Where: %2X Len: %d Data: %08lX\n",
8237 + PCI_SLOT(devfn), where, size, *value);
8239 + case PCI_BASE_ADDRESS_0:
8240 + if (*value == 0xffffffff) {
8241 + usb_mem_size_rd = TRUE;
8243 + usb_mem_base = *value;
8254 + return PCIBIOS_SUCCESSFUL;
8257 +/* --------------------------------------------------------------------------
8258 + Name: pci63xx_int_read
8259 +Abstract: PCI Config read on internal device(s)
8260 + -------------------------------------------------------------------------- */
8262 +pci63xx_int_read(unsigned int devfn, int where, u32 * value, int size)
8264 + uint32 retValue = 0xFFFFFFFF;
8266 + if (PCI_SLOT(devfn) != USB_HOST_SLOT) {
8267 + return PCIBIOS_SUCCESSFUL;
8270 + // For now, this is specific to the USB Host controller. We can
8271 + // make it more general if we have to...
8272 + // Emulate PCI Config accesses
8274 + case PCI_VENDOR_ID:
8275 + case PCI_DEVICE_ID:
8276 + retValue = PCI_VENDOR_ID_BROADCOM | 0x63000000;
8280 + retValue = (0x0006 << 16) | usb_cfg_space_cmd_reg;
8282 + case PCI_CLASS_REVISION:
8283 + case PCI_CLASS_DEVICE:
8284 + retValue = (PCI_CLASS_SERIAL_USB << 16) | (0x10 << 8) | 0x01;
8286 + case PCI_BASE_ADDRESS_0:
8287 + if (usb_mem_size_rd) {
8288 + retValue = USB_BAR0_MEM_SIZE;
8290 + if (usb_mem_base != 0)
8291 + retValue = usb_mem_base;
8293 + retValue = USB_HOST_BASE;
8295 + usb_mem_size_rd = FALSE;
8297 + case PCI_CACHE_LINE_SIZE:
8298 + case PCI_LATENCY_TIMER:
8301 + case PCI_HEADER_TYPE:
8302 + retValue = PCI_HEADER_TYPE_NORMAL;
8304 + case PCI_SUBSYSTEM_VENDOR_ID:
8305 + retValue = PCI_VENDOR_ID_BROADCOM;
8307 + case PCI_SUBSYSTEM_ID:
8308 + retValue = 0x6300;
8310 + case PCI_INTERRUPT_LINE:
8311 + retValue = INTERRUPT_ID_USBH;
8319 + *value = (retValue >> ((where & 3) << 3)) & 0xff;
8320 + DPRINT("R <= Slot: %d Where: %2X Len: %d Data: %02X\n",
8321 + PCI_SLOT(devfn), where, size, *value);
8324 + *value = (retValue >> ((where & 3) << 3)) & 0xffff;
8325 + DPRINT("R <= Slot: %d Where: %2X Len: %d Data: %04X\n",
8326 + PCI_SLOT(devfn), where, size, *value);
8329 + *value = retValue;
8330 + DPRINT("R <= Slot: %d Where: %2X Len: %d Data: %08lX\n",
8331 + PCI_SLOT(devfn), where, size, *value);
8337 + return PCIBIOS_SUCCESSFUL;
8341 +static int bcm96348_pcibios_read(struct pci_bus *bus, unsigned int devfn,
8342 + int where, int size, u32 * val)
8344 + volatile unsigned char *ioBase = (unsigned char *)(mpi->l2piobase | KSEG1);
8347 +#if defined(CONFIG_USB)
8348 + if (PCI_SLOT(devfn) == USB_HOST_SLOT)
8349 + return pci63xx_int_read(devfn, where, val, size);
8352 + mpi_SetupPciConfigAccess(BCM_PCI_CFG(PCI_SLOT(devfn), PCI_FUNC(devfn), where));
8353 + data = *(uint32 *)ioBase;
8356 + *val = (data >> ((where & 3) << 3)) & 0xff;
8359 + *val = (data >> ((where & 3) << 3)) & 0xffff;
8363 + /* Special case for reading PCI device range */
8364 + if ((where >= PCI_BASE_ADDRESS_0) && (where <= PCI_BASE_ADDRESS_5)) {
8365 + if (pci_mem_size_rd) {
8366 + /* bcm6348 PCI memory window minimum size is 64K */
8367 + *val &= PCI_SIZE_64K;
8374 + pci_mem_size_rd = FALSE;
8375 + mpi_ClearPciConfigAccess();
8377 + return PCIBIOS_SUCCESSFUL;
8380 +static int bcm96348_pcibios_write(struct pci_bus *bus, unsigned int devfn,
8381 + int where, int size, u32 val)
8383 + volatile unsigned char *ioBase = (unsigned char *)(mpi->l2piobase | KSEG1);
8386 +#if defined(CONFIG_USB)
8387 + if (PCI_SLOT(devfn) == USB_HOST_SLOT)
8388 + return pci63xx_int_write(devfn, where, &val, size);
8390 + mpi_SetupPciConfigAccess(BCM_PCI_CFG(PCI_SLOT(devfn), PCI_FUNC(devfn), where));
8391 + data = *(uint32 *)ioBase;
8394 + data = (data & ~(0xff << ((where & 3) << 3))) |
8395 + (val << ((where & 3) << 3));
8398 + data = (data & ~(0xffff << ((where & 3) << 3))) |
8399 + (val << ((where & 3) << 3));
8403 + /* Special case for reading PCI device range */
8404 + if ((where >= PCI_BASE_ADDRESS_0) && (where <= PCI_BASE_ADDRESS_5)) {
8405 + if (val == 0xffffffff)
8406 + pci_mem_size_rd = TRUE;
8412 + *(uint32 *)ioBase = data;
8414 + mpi_ClearPciConfigAccess();
8416 + return PCIBIOS_SUCCESSFUL;
8419 +struct pci_ops bcm96348_pci_ops = {
8420 + .read = bcm96348_pcibios_read,
8421 + .write = bcm96348_pcibios_write
8423 diff -urN linux-2.6.17/arch/mips/pci/pci-bcm96348.c linux-2.6.17-brcm63xx/arch/mips/pci/pci-bcm96348.c
8424 --- linux-2.6.17/arch/mips/pci/pci-bcm96348.c 1970-01-01 01:00:00.000000000 +0100
8425 +++ linux-2.6.17-brcm63xx/arch/mips/pci/pci-bcm96348.c 2006-08-29 10:25:13.000000000 +0200
8429 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8431 + This program is free software; you can distribute it and/or modify it
8432 + under the terms of the GNU General Public License (Version 2) as
8433 + published by the Free Software Foundation.
8435 + This program is distributed in the hope it will be useful, but WITHOUT
8436 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8437 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8440 + You should have received a copy of the GNU General Public License along
8441 + with this program; if not, write to the Free Software Foundation, Inc.,
8442 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8445 +#include <linux/types.h>
8446 +#include <linux/pci.h>
8447 +#include <linux/kernel.h>
8448 +#include <linux/init.h>
8450 +//#include <asm/pci_channel.h>
8451 +#include <bcmpci.h>
8453 +static struct resource bcm_pci_io_resource = {
8454 + .name = "bcm96348 pci IO space",
8455 + .start = BCM_PCI_IO_BASE,
8456 + .end = BCM_PCI_IO_BASE + BCM_PCI_IO_SIZE_64KB - 1,
8457 + .flags = IORESOURCE_IO
8460 +static struct resource bcm_pci_mem_resource = {
8461 + .name = "bcm96348 pci memory space",
8462 + .start = BCM_PCI_MEM_BASE,
8463 + .end = BCM_PCI_MEM_BASE + BCM_PCI_MEM_SIZE_16MB - 1,
8464 + .flags = IORESOURCE_MEM
8467 +extern struct pci_ops bcm96348_pci_ops;
8469 +struct pci_controller bcm96348_controller = {
8470 + .pci_ops = &bcm96348_pci_ops,
8471 + .io_resource = &bcm_pci_io_resource,
8472 + .mem_resource = &bcm_pci_mem_resource,
8475 +static void bcm96348_pci_init(void)
8477 + register_pci_controller(&bcm96348_controller);
8480 +arch_initcall(bcm96348_pci_init);
8481 diff -urN linux.old/drivers/serial/bcm63xx_cons.c linux.dev/drivers/serial/bcm63xx_cons.c
8482 --- linux.old/drivers/serial/bcm63xx_cons.c 1970-01-01 01:00:00.000000000 +0100
8483 +++ linux.dev/drivers/serial/bcm63xx_cons.c 2006-08-25 15:37:34.000000000 +0200
8487 + Copyright 2002 Broadcom Corp. All Rights Reserved.
8489 + This program is free software; you can distribute it and/or modify it
8490 + under the terms of the GNU General Public License (Version 2) as
8491 + published by the Free Software Foundation.
8493 + This program is distributed in the hope it will be useful, but WITHOUT
8494 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8495 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8498 + You should have received a copy of the GNU General Public License along
8499 + with this program; if not, write to the Free Software Foundation, Inc.,
8500 + 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
8504 +/* Description: Serial port driver for the BCM963XX. */
8506 +#define CARDNAME "bcm963xx_serial driver"
8507 +#define VERSION "2.0"
8508 +#define VER_STR CARDNAME " v" VERSION "\n"
8511 +#include <linux/kernel.h>
8512 +#include <linux/module.h>
8513 +#include <linux/version.h>
8514 +#include <linux/init.h>
8515 +#include <linux/slab.h>
8516 +#include <linux/interrupt.h>
8517 +#include <linux/spinlock.h>
8519 +/* for definition of struct console */
8520 +#include <linux/console.h>
8521 +#include <linux/tty.h>
8522 +#include <linux/tty_flip.h>
8523 +#include <linux/serial.h>
8524 +#include <linux/serialP.h>
8525 +#include <asm/uaccess.h>
8527 +#include <bcmtypes.h>
8529 +#include <bcm_map_part.h>
8530 +#include <bcm_intr.h>
8532 +static DEFINE_SPINLOCK(bcm963xx_serial_lock);
8534 +extern void _putc(char);
8535 +extern void _puts(const char *);
8537 +typedef struct bcm_serial {
8538 + volatile Uart * port;
8544 + unsigned short close_delay;
8545 + unsigned short closing_wait;
8546 + unsigned short line; /* port/line number */
8547 + unsigned short cflags; /* line configuration flag */
8548 + unsigned short x_char; /* xon/xoff character */
8549 + unsigned short read_status_mask; /* mask for read condition */
8550 + unsigned short ignore_status_mask; /* mask for ignore condition */
8551 + unsigned long event; /* mask used in BH */
8552 + int xmit_head; /* Position of the head */
8553 + int xmit_tail; /* Position of the tail */
8554 + int xmit_cnt; /* Count of the chars in the buffer */
8555 + int count; /* indicates how many times it has been opened */
8558 + struct async_icount icount; /* keep track of things ... */
8559 + struct tty_struct *tty; /* tty associated */
8560 + struct termios normal_termios;
8562 + wait_queue_head_t open_wait;
8563 + wait_queue_head_t close_wait;
8565 + long session; /* Session of opening process */
8566 + long pgrp; /* pgrp of opening process */
8568 + unsigned char is_initialized;
8572 +/*---------------------------------------------------------------------*/
8573 +/* Define bits in the Interrupt Enable register */
8574 +/*---------------------------------------------------------------------*/
8575 +/* Enable receive interrupt */
8576 +#define RXINT (RXFIFONE|RXOVFERR)
8578 +/* Enable transmit interrupt */
8579 +#define TXINT (TXFIFOEMT|TXUNDERR|TXOVFERR)
8581 +/* Enable receiver line status interrupt */
8582 +#define LSINT (RXBRK|RXPARERR|RXFRAMERR)
8584 +#define BCM_NUM_UARTS 1
8586 +#define BD_BCM63XX_TIMER_CLOCK_INPUT (FPERIPH)
8589 +static struct bcm_serial multi[BCM_NUM_UARTS];
8590 +static struct bcm_serial *lines[BCM_NUM_UARTS];
8591 +static struct tty_driver *serial_driver;
8592 +static struct termios *serial_termios[BCM_NUM_UARTS];
8593 +static struct termios *serial_termios_locked[BCM_NUM_UARTS];
8596 +static void bcm_stop (struct tty_struct *tty);
8597 +static void bcm_start (struct tty_struct *tty);
8598 +static inline void receive_chars (struct bcm_serial * info);
8599 +static int startup (struct bcm_serial *info);
8600 +static void shutdown (struct bcm_serial * info);
8601 +static void change_speed( volatile Uart *pUart, tcflag_t cFlag );
8602 +static void bcm63xx_cons_flush_chars (struct tty_struct *tty);
8603 +static int bcm63xx_cons_write (struct tty_struct *tty,
8604 + const unsigned char *buf, int count);
8605 +static int bcm63xx_cons_write_room (struct tty_struct *tty);
8606 +static int bcm_chars_in_buffer (struct tty_struct *tty);
8607 +static void bcm_flush_buffer (struct tty_struct *tty);
8608 +static void bcm_throttle (struct tty_struct *tty);
8609 +static void bcm_unthrottle (struct tty_struct *tty);
8610 +static void bcm_send_xchar (struct tty_struct *tty, char ch);
8611 +static int get_serial_info(struct bcm_serial *info, struct serial_struct *retinfo);
8612 +static int set_serial_info (struct bcm_serial *info, struct serial_struct *new_info);
8613 +static int get_lsr_info (struct bcm_serial *info, unsigned int *value);
8614 +static void send_break (struct bcm_serial *info, int duration);
8615 +static int bcm_ioctl (struct tty_struct * tty, struct file * file,
8616 + unsigned int cmd, unsigned long arg);
8617 +static void bcm_set_termios (struct tty_struct *tty, struct termios *old_termios);
8618 +static void bcm63xx_cons_close (struct tty_struct *tty, struct file *filp);
8619 +static void bcm_hangup (struct tty_struct *tty);
8620 +static int block_til_ready (struct tty_struct *tty, struct file *filp, struct bcm_serial *info);
8621 +static int bcm63xx_cons_open (struct tty_struct * tty, struct file * filp);
8622 +static int __init bcm63xx_serialinit(void);
8626 + * ------------------------------------------------------------
8627 + * rs_stop () and rs_start ()
8629 + * These routines are called before setting or resetting
8630 + * tty->stopped. They enable or disable transmitter interrupts,
8632 + * ------------------------------------------------------------
8634 +static void bcm_stop (struct tty_struct *tty)
8638 +static void bcm_start (struct tty_struct *tty)
8640 + _puts(CARDNAME " Start\n");
8644 + * ------------------------------------------------------------
8647 + * This routine deals with inputs from any lines.
8648 + * ------------------------------------------------------------
8650 +static inline void receive_chars (struct bcm_serial * info)
8652 + struct tty_struct *tty = 0;
8653 + struct async_icount * icount;
8655 + unsigned short status, tmp;
8657 + while ((status = info->port->intStatus) & RXINT)
8659 + char flag_char = TTY_NORMAL;
8661 + if (status & RXFIFONE)
8662 + ch = info->port->Data; // Read the character
8663 + tty = info->tty; /* now tty points to the proper dev */
8664 + icount = &info->icount;
8667 + if (!tty_buffer_request_room(tty, 1))
8670 + if (status & RXBRK)
8672 + flag_char = TTY_BREAK;
8675 + // keep track of the statistics
8676 + if (status & (RXFRAMERR | RXPARERR | RXOVFERR))
8678 + if (status & RXPARERR) /* parity error */
8681 + if (status & RXFRAMERR) /* frame error */
8683 + if (status & RXOVFERR)
8685 + // Overflow. Reset the RX FIFO
8686 + info->port->fifoctl |= RSTRXFIFOS;
8687 + icount->overrun++;
8689 + // check to see if we should ignore the character
8690 + // and mask off conditions that should be ignored
8691 + if (status & info->ignore_status_mask)
8693 + if (++ignore > 100 )
8697 + // Mask off the error conditions we want to ignore
8698 + tmp = status & info->read_status_mask;
8699 + if (tmp & RXPARERR)
8701 + flag_char = TTY_PARITY;
8704 + if (tmp & RXFRAMERR)
8706 + flag_char = TTY_FRAME;
8708 + if (tmp & RXOVFERR)
8710 + tty_insert_flip_char(tty, ch, flag_char);
8712 + flag_char = TTY_OVERRUN;
8713 + if (!tty_buffer_request_room(tty, 1))
8717 + tty_insert_flip_char(tty, ch, flag_char);
8720 + tty_flip_buffer_push(tty);
8721 + tty_schedule_flip(tty);
8727 + * ------------------------------------------------------------
8728 + * bcm_interrupt ()
8730 + * this is the main interrupt routine for the chip.
8731 + * It deals with the multiple ports.
8732 + * ------------------------------------------------------------
8734 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
8735 +static irqreturn_t bcm_interrupt (int irq, void * dev)
8737 +static void bcm_interrupt (int irq, void * dev, struct pt_regs * regs)
8740 + struct bcm_serial * info = lines[0];
8743 + /* get pending interrupt flags from UART */
8745 + /* Mask with only the serial interrupts that are enabled */
8746 + intStat = info->port->intStatus & info->port->intMask;
8749 + if (intStat & RXINT)
8750 + receive_chars (info);
8752 + if (intStat & TXINT)
8753 + info->port->intStatus = TXINT;
8754 + else /* don't know what it was, so let's mask it */
8755 + info->port->intMask &= ~intStat;
8757 + intStat = info->port->intStatus & info->port->intMask;
8760 + // Clear the interrupt
8761 + BcmHalInterruptEnable (INTERRUPT_ID_UART);
8762 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
8763 + return IRQ_HANDLED;
8768 + * -------------------------------------------------------------------
8771 + * various initialization tasks
8772 + * -------------------------------------------------------------------
8774 +static int startup (struct bcm_serial *info)
8776 + // Port is already started...
8781 + * -------------------------------------------------------------------
8784 + * This routine will shutdown a serial port; interrupts are disabled, and
8785 + * DTR is dropped if the hangup on close termio flag is on.
8786 + * -------------------------------------------------------------------
8788 +static void shutdown (struct bcm_serial * info)
8790 + unsigned long flags;
8791 + if (!info->is_initialized)
8794 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
8796 + info->port->control &= ~(BRGEN|TXEN|RXEN);
8798 + set_bit (TTY_IO_ERROR, &info->tty->flags);
8799 + info->is_initialized = 0;
8801 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
8804 + * -------------------------------------------------------------------
8807 + * Set the baud rate, character size, parity and stop bits.
8808 + * -------------------------------------------------------------------
8810 +static void change_speed( volatile Uart *pUart, tcflag_t cFlag )
8812 + unsigned long ulFlags, ulBaud, ulClockFreqHz, ulTmp;
8814 + spin_lock_irqsave(&bcm963xx_serial_lock, ulFlags);
8815 + switch( cFlag & (CBAUD | CBAUDEX) )
8873 + /* Calculate buad rate. */
8874 + ulClockFreqHz = BD_BCM63XX_TIMER_CLOCK_INPUT;
8875 + ulTmp = (ulClockFreqHz / ulBaud) / 16;
8876 + if( ulTmp & 0x01 )
8877 + ulTmp /= 2; /* Rounding up, so sub is already accounted for */
8879 + ulTmp = (ulTmp / 2) - 1; /* Rounding down so we must sub 1 */
8880 + pUart->baudword = ulTmp;
8882 + /* Set character size, stop bits and parity. */
8883 + switch( cFlag & CSIZE )
8886 + ulTmp = BITS5SYM; /* select transmit 5 bit data size */
8889 + ulTmp = BITS6SYM; /* select transmit 6 bit data size */
8892 + ulTmp = BITS7SYM; /* select transmit 7 bit data size */
8895 + ulTmp = BITS8SYM; /* select transmit 8 bit data size */
8898 + if( cFlag & CSTOPB )
8899 + ulTmp |= TWOSTOP; /* select 2 stop bits */
8901 + ulTmp |= ONESTOP; /* select one stop bit */
8903 + /* Write these values into the config reg. */
8904 + pUart->config = ulTmp;
8905 + pUart->control &= ~(RXPARITYEN | TXPARITYEN | RXPARITYEVEN | TXPARITYEVEN);
8906 + switch( cFlag & (PARENB | PARODD) )
8908 + case PARENB|PARODD:
8909 + pUart->control |= RXPARITYEN | TXPARITYEN;
8912 + pUart->control |= RXPARITYEN | TXPARITYEN | RXPARITYEVEN | TXPARITYEVEN;
8915 + pUart->control |= 0;
8919 + /* Reset and flush uart */
8920 + pUart->fifoctl = RSTTXFIFOS | RSTRXFIFOS;
8921 + spin_unlock_irqrestore(&bcm963xx_serial_lock, ulFlags);
8926 + * -------------------------------------------------------------------
8927 + * bcm_flush_char ()
8929 + * Nothing to flush. Polled I/O is used.
8930 + * -------------------------------------------------------------------
8932 +static void bcm63xx_cons_flush_chars (struct tty_struct *tty)
8938 + * -------------------------------------------------------------------
8939 + * bcm63xx_cons_write ()
8941 + * Main output routine using polled I/O.
8942 + * -------------------------------------------------------------------
8944 +static int bcm63xx_cons_write (struct tty_struct *tty,
8945 + const unsigned char *buf, int count)
8949 + for (c = 0; c < count; c++)
8955 + * -------------------------------------------------------------------
8956 + * bcm63xx_cons_write_room ()
8958 + * Compute the amount of space available for writing.
8959 + * -------------------------------------------------------------------
8961 +static int bcm63xx_cons_write_room (struct tty_struct *tty)
8963 + /* Pick a number. Any number. Polled I/O is used. */
8968 + * -------------------------------------------------------------------
8969 + * bcm_chars_in_buffer ()
8971 + * compute the amount of char left to be transmitted
8972 + * -------------------------------------------------------------------
8974 +static int bcm_chars_in_buffer (struct tty_struct *tty)
8980 + * -------------------------------------------------------------------
8981 + * bcm_flush_buffer ()
8983 + * Empty the output buffer
8984 + * -------------------------------------------------------------------
8986 +static void bcm_flush_buffer (struct tty_struct *tty)
8992 + * ------------------------------------------------------------
8993 + * bcm_throttle () and bcm_unthrottle ()
8995 + * This routine is called by the upper-layer tty layer to signal that
8996 + * incoming characters should be throttled (or not).
8997 + * ------------------------------------------------------------
8999 +static void bcm_throttle (struct tty_struct *tty)
9001 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9003 + info->x_char = STOP_CHAR(tty);
9006 +static void bcm_unthrottle (struct tty_struct *tty)
9008 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9014 + info->x_char = START_CHAR(tty);
9018 +static void bcm_send_xchar (struct tty_struct *tty, char ch)
9020 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9021 + info->x_char = ch;
9023 + bcm_start (info->tty);
9027 + * ------------------------------------------------------------
9028 + * rs_ioctl () and friends
9029 + * ------------------------------------------------------------
9031 +static int get_serial_info(struct bcm_serial *info, struct serial_struct *retinfo)
9033 + struct serial_struct tmp;
9038 + memset (&tmp, 0, sizeof(tmp));
9039 + tmp.type = info->type;
9040 + tmp.line = info->line;
9041 + tmp.port = (int) info->port;
9042 + tmp.irq = info->irq;
9044 + tmp.baud_base = info->baud_base;
9045 + tmp.close_delay = info->close_delay;
9046 + tmp.closing_wait = info->closing_wait;
9048 + return copy_to_user (retinfo, &tmp, sizeof(*retinfo));
9051 +static int set_serial_info (struct bcm_serial *info, struct serial_struct *new_info)
9053 + struct serial_struct new_serial;
9054 + struct bcm_serial old_info;
9060 + copy_from_user (&new_serial, new_info, sizeof(new_serial));
9063 + if (!capable(CAP_SYS_ADMIN))
9067 + if (info->count > 1)
9070 + /* OK, past this point, all the error checking has been done.
9071 + * At this point, we start making changes.....
9073 + info->baud_base = new_serial.baud_base;
9074 + info->type = new_serial.type;
9075 + info->close_delay = new_serial.close_delay;
9076 + info->closing_wait = new_serial.closing_wait;
9077 + retval = startup (info);
9082 + * get_lsr_info - get line status register info
9084 + * Purpose: Let user call ioctl() to get info when the UART physically
9085 + * is emptied. On bus types like RS485, the transmitter must
9086 + * release the bus after transmitting. This must be done when
9087 + * the transmit shift register is empty, not be done when the
9088 + * transmit holding register is empty. This functionality
9089 + * allows an RS485 driver to be written in user space.
9091 +static int get_lsr_info (struct bcm_serial *info, unsigned int *value)
9097 + * This routine sends a break character out the serial port.
9099 +static void send_break (struct bcm_serial *info, int duration)
9101 + unsigned long flags;
9106 + current->state = TASK_INTERRUPTIBLE;
9108 + /*save_flags (flags);
9110 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
9112 + info->port->control |= XMITBREAK;
9113 + schedule_timeout(duration);
9114 + info->port->control &= ~XMITBREAK;
9116 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9117 + //restore_flags (flags);
9120 +static int bcm_ioctl (struct tty_struct * tty, struct file * file,
9121 + unsigned int cmd, unsigned long arg)
9124 + struct bcm_serial * info = (struct bcm_serial *)tty->driver_data;
9127 + if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
9128 + (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
9129 + (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT))
9131 + if (tty->flags & (1 << TTY_IO_ERROR))
9137 + case TCSBRK: /* SVID version: non-zero arg --> no break */
9138 + retval = tty_check_change (tty);
9141 + tty_wait_until_sent (tty, 0);
9143 + send_break (info, HZ/4); /* 1/4 second */
9146 + case TCSBRKP: /* support for POSIX tcsendbreak() */
9147 + retval = tty_check_change (tty);
9150 + tty_wait_until_sent (tty, 0);
9151 + send_break (info, arg ? arg*(HZ/10) : HZ/4);
9154 + case TIOCGSOFTCAR:
9155 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(long));
9160 + put_user (C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg);
9164 + case TIOCSSOFTCAR:
9165 + error = get_user (arg, (unsigned long *)arg);
9168 + tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
9172 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(struct serial_struct));
9176 + return get_serial_info (info, (struct serial_struct *)arg);
9179 + return set_serial_info (info, (struct serial_struct *) arg);
9181 + case TIOCSERGETLSR: /* Get line status register */
9182 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(unsigned int));
9186 + return get_lsr_info (info, (unsigned int *)arg);
9188 + case TIOCSERGSTRUCT:
9189 + error = access_ok (VERIFY_WRITE, (void *)arg, sizeof(struct bcm_serial));
9194 + copy_to_user((struct bcm_serial *)arg, info, sizeof(struct bcm_serial));
9199 + return -ENOIOCTLCMD;
9204 +static void bcm_set_termios (struct tty_struct *tty, struct termios *old_termios)
9206 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9208 + if( tty->termios->c_cflag != old_termios->c_cflag )
9209 + change_speed (info->port, tty->termios->c_cflag);
9213 + * ------------------------------------------------------------
9214 + * bcm63xx_cons_close()
9216 + * This routine is called when the serial port gets closed. First, we
9217 + * wait for the last remaining data to be sent. Then, we turn off
9218 + * the transmit enable and receive enable flags.
9219 + * ------------------------------------------------------------
9221 +static void bcm63xx_cons_close (struct tty_struct *tty, struct file *filp)
9223 + struct bcm_serial * info = (struct bcm_serial *)tty->driver_data;
9224 + unsigned long flags;
9229 + /*save_flags (flags);
9231 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
9233 + if (tty_hung_up_p (filp))
9235 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9236 + //restore_flags (flags);
9240 + if ((tty->count == 1) && (info->count != 1))
9243 + /* Uh, oh. tty->count is 1, which means that the tty
9244 + * structure will be freed. Info->count should always
9245 + * be one in these conditions. If it's greater than
9246 + * one, we've got real problems, since it means the
9247 + * serial port won't be shutdown.
9249 + printk("bcm63xx_cons_close: bad serial port count; tty->count is 1, "
9250 + "info->count is %d\n", info->count);
9254 + if (--info->count < 0)
9256 + printk("ds_close: bad serial port count for ttys%d: %d\n",
9257 + info->line, info->count);
9263 + //restore_flags (flags);
9264 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9268 + /* Now we wait for the transmit buffer to clear; and we notify
9269 + * the line discipline to only process XON/XOFF characters.
9273 + /* At this point we stop accepting input. To do this, we
9274 + * disable the receive line status interrupts.
9277 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
9278 + if (tty->driver->flush_buffer)
9279 + tty->driver->flush_buffer (tty);
9281 + if (tty->driver.flush_buffer)
9282 + tty->driver.flush_buffer (tty);
9284 + if (tty->ldisc.flush_buffer)
9285 + tty->ldisc.flush_buffer (tty);
9290 + if (tty->ldisc.num != tty_ldisc_get(N_TTY)->num)
9292 + if (tty->ldisc.close)
9293 + (tty->ldisc.close)(tty);
9294 + tty->ldisc = *tty_ldisc_get(N_TTY);
9295 + tty->termios->c_line = N_TTY;
9296 + if (tty->ldisc.open)
9297 + (tty->ldisc.open)(tty);
9299 + if (info->blocked_open)
9301 + if (info->close_delay)
9303 + current->state = TASK_INTERRUPTIBLE;
9304 + schedule_timeout(info->close_delay);
9306 + wake_up_interruptible (&info->open_wait);
9308 + wake_up_interruptible (&info->close_wait);
9310 + //restore_flags (flags);
9311 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9315 + * bcm_hangup () --- called by tty_hangup() when a hangup is signaled.
9317 +static void bcm_hangup (struct tty_struct *tty)
9320 + struct bcm_serial *info = (struct bcm_serial *)tty->driver_data;
9326 + wake_up_interruptible (&info->open_wait);
9330 + * ------------------------------------------------------------
9331 + * rs_open() and friends
9332 + * ------------------------------------------------------------
9334 +static int block_til_ready (struct tty_struct *tty, struct file *filp,
9335 + struct bcm_serial *info)
9341 + * This routine is called whenever a serial port is opened. It
9342 + * enables interrupts for a serial port. It also performs the
9343 + * serial-specific initialization for the tty structure.
9345 +static int bcm63xx_cons_open (struct tty_struct * tty, struct file * filp)
9347 + struct bcm_serial *info;
9350 + // Make sure we're only opening on of the ports we support
9351 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
9352 + line = MINOR(tty->driver->cdev.dev) - tty->driver->minor_start;
9354 + line = MINOR(tty->device) - tty->driver.minor_start;
9357 + if ((line < 0) || (line >= BCM_NUM_UARTS))
9360 + info = lines[line];
9362 + tty->low_latency=1;
9363 + info->port->intMask = 0; /* Clear any pending interrupts */
9364 + info->port->intMask = RXINT; /* Enable RX */
9367 + tty->driver_data = info;
9369 + BcmHalInterruptEnable (INTERRUPT_ID_UART);
9371 + // Start up serial port
9372 + retval = startup (info);
9376 + retval = block_til_ready (tty, filp, info);
9381 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
9382 + info->pgrp = process_group(current);
9383 + info->session = current->signal->session;
9385 + info->session = current->session;
9386 + info->pgrp = current->pgrp;
9393 +static struct tty_operations rs_ops = {
9394 + .open = bcm63xx_cons_open,
9395 + .close = bcm63xx_cons_close,
9396 + .write = bcm63xx_cons_write,
9397 + .flush_chars = bcm63xx_cons_flush_chars,
9398 + .write_room = bcm63xx_cons_write_room,
9399 + .chars_in_buffer = bcm_chars_in_buffer,
9400 + .flush_buffer = bcm_flush_buffer,
9401 + .ioctl = bcm_ioctl,
9402 + .throttle = bcm_throttle,
9403 + .unthrottle = bcm_unthrottle,
9404 + .send_xchar = bcm_send_xchar,
9405 + .set_termios = bcm_set_termios,
9407 + .start = bcm_start,
9408 + .hangup = bcm_hangup,
9411 +/* --------------------------------------------------------------------------
9412 + Name: bcm63xx_serialinit
9413 + Purpose: Initialize our BCM63xx serial driver
9414 +-------------------------------------------------------------------------- */
9415 +static int __init bcm63xx_serialinit(void)
9418 + struct bcm_serial * info;
9420 + // Print the driver version information
9422 + serial_driver = alloc_tty_driver(BCM_NUM_UARTS);
9423 + if (!serial_driver)
9426 + serial_driver->owner = THIS_MODULE;
9427 + serial_driver->devfs_name = "tts/";
9428 +// serial_driver.magic = TTY_DRIVER_MAGIC;
9429 + serial_driver->name = "ttyS";
9430 + serial_driver->major = TTY_MAJOR;
9431 + serial_driver->minor_start = 64;
9432 +// serial_driver.num = BCM_NUM_UARTS;
9433 + serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
9434 + serial_driver->subtype = SERIAL_TYPE_NORMAL;
9435 + serial_driver->init_termios = tty_std_termios;
9436 + serial_driver->init_termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
9437 + serial_driver->flags = TTY_DRIVER_REAL_RAW;
9439 + serial_driver->termios = serial_termios;
9440 + serial_driver->termios_locked = serial_termios_locked;
9442 + tty_set_operations(serial_driver, &rs_ops);
9444 + if (tty_register_driver (serial_driver))
9445 + panic("Couldn't register serial driver\n");
9447 + //save_flags(flags); cli();
9448 + spin_lock_irqsave(&bcm963xx_serial_lock, flags);
9450 + for (i = 0; i < BCM_NUM_UARTS; i++)
9454 + info->magic = SERIAL_MAGIC;
9455 + info->port = (Uart *) ((char *)UART_BASE + (i * 0x20));
9457 + info->irq = (2 - i) + 8;
9459 + info->close_delay = 50;
9460 + info->closing_wait = 3000;
9464 + info->blocked_open = 0;
9465 + info->normal_termios = serial_driver->init_termios;
9466 + init_waitqueue_head(&info->open_wait);
9467 + init_waitqueue_head(&info->close_wait);
9469 + /* If we are pointing to address zero then punt - not correctly
9470 + * set up in setup.c to handle this.
9474 + BcmHalMapInterrupt(bcm_interrupt, 0, INTERRUPT_ID_UART);
9477 + /* order matters here... the trick is that flags
9478 + * is updated... in request_irq - to immediatedly obliterate
9481 + spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
9485 +module_init(bcm63xx_serialinit);
9487 +/* --------------------------------------------------------------------------
9488 + Name: bcm_console_print
9489 + Purpose: bcm_console_print is registered for printk.
9490 + The console_lock must be held when we get here.
9491 +-------------------------------------------------------------------------- */
9492 +static void bcm_console_print (struct console * cons, const char * str,
9493 + unsigned int count)
9497 + for(i=0; i<count; i++, str++)
9507 +static struct tty_driver * bcm_console_device(struct console * c, int *index)
9509 + *index = c->index;
9510 + return serial_driver;
9513 +static int __init bcm_console_setup(struct console * co, char * options)
9518 +static struct console bcm_sercons = {
9520 + .write = bcm_console_print,
9521 + .device = bcm_console_device,
9522 + .setup = bcm_console_setup,
9523 + .flags = CON_PRINTBUFFER,
9527 +static int __init bcm63xx_console_init(void)
9529 + register_console(&bcm_sercons);
9533 +console_initcall(bcm63xx_console_init);
9534 diff -urN linux.old/drivers/serial/Makefile linux.dev/drivers/serial/Makefile
9535 --- linux.old/drivers/serial/Makefile 2006-06-18 03:49:35.000000000 +0200
9536 +++ linux.dev/drivers/serial/Makefile 2006-08-25 15:38:44.000000000 +0200
9538 obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o
9539 obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
9540 obj-$(CONFIG_SERIAL_AT91) += at91_serial.o
9541 +obj-$(CONFIG_BCM_SERIAL) += bcm63xx_cons.o
9542 diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h
9543 --- linux.old/include/asm-mips/bootinfo.h 2006-08-25 00:43:22.000000000 +0200
9544 +++ linux.dev/include/asm-mips/bootinfo.h 2006-08-25 00:39:38.000000000 +0200
9545 @@ -218,6 +218,14 @@
9546 #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
9547 #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
9550 + * Valid machtype for group BRCM
9552 +#define MACH_GROUP_BRCM 23 /* Broadcom boards */
9553 +#define MACH_BCM96338 0
9554 +#define MACH_BCM96345 1
9555 +#define MACH_BCM96348 2
9557 #define CL_SIZE COMMAND_LINE_SIZE
9559 const char *get_system_type(void);
9560 diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
9561 --- linux.old/include/asm-mips/cpu.h 2006-08-25 00:43:22.000000000 +0200
9562 +++ linux.dev/include/asm-mips/cpu.h 2006-08-25 00:39:38.000000000 +0200
9563 @@ -103,6 +103,13 @@
9565 #define PRID_IMP_SR71000 0x0400
9567 +/* These are the PRID's for when 23:16 == PRID_COMP_BROADCOM
9570 +#define PRID_IMP_BCM6338 0x9000
9571 +#define PRID_IMP_BCM6345 0x8000
9572 +#define PRID_IMP_BCM6348 0x9100
9575 * Definitions for 7:0 on legacy processors
9577 @@ -200,7 +207,10 @@
9580 #define CPU_R14000 64
9581 -#define CPU_LAST 64
9582 +#define CPU_BCM6338 65
9583 +#define CPU_BCM6345 66
9584 +#define CPU_BCM6348 67
9585 +#define CPU_LAST 67
9588 * ISA Level encodings
9589 diff -urN linux.old/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h linux.dev/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h
9590 --- linux.old/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h 1970-01-01 01:00:00.000000000 +0100
9591 +++ linux.dev/include/asm-mips/mach-bcm963xx/cpu-feature-overrides.h 2006-08-25 11:27:40.000000000 +0200
9593 +#ifndef __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H
9594 +#define __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H
9596 +#define cpu_has_tlb 1
9597 +#define cpu_has_4kex 4
9598 +#define cpu_has_4ktlb 8
9599 +#define cpu_has_fpu 0
9600 +#define cpu_has_32fpr 0
9601 +#define cpu_has_counter 0x40
9602 +#define cpu_has_watch 0
9603 +#define cpu_has_mips16 0
9604 +#define cpu_has_divec 0x200
9605 +#define cpu_has_vce 0
9606 +#define cpu_has_cache_cdex_p 0
9607 +#define cpu_has_cache_cdex_s 0
9608 +#define cpu_has_prefetch 0x40000
9609 +#define cpu_has_mcheck 0x2000
9610 +#define cpu_has_ejtag 0x4000
9611 +#define cpu_has_llsc 0x10000
9612 +#define cpu_has_vtag_icache 0
9613 +#define cpu_has_dc_aliases 0
9614 +#define cpu_has_ic_fills_f_dc 0
9616 +#define cpu_has_nofpuex 0
9617 +#define cpu_has_64bits 0
9618 +#define cpu_has_64bit_zero_reg 0
9619 +#define cpu_has_64bit_gp_regs 0
9620 +#define cpu_has_64bit_addresses 0
9622 +#define cpu_has_subset_pcaches 0
9624 +#define cpu_dcache_line_size() 16
9625 +#define cpu_icache_line_size() 16
9626 +#define cpu_scache_line_size() 0
9628 +#endif /* __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H */
9629 diff -urN linux.old/include/asm-mips/mach-generic/param.h linux.dev/include/asm-mips/mach-generic/param.h
9630 --- linux.old/include/asm-mips/mach-generic/param.h 2006-08-25 00:43:22.000000000 +0200
9631 +++ linux.dev/include/asm-mips/mach-generic/param.h 2006-08-25 00:39:38.000000000 +0200
9633 #ifndef __ASM_MACH_GENERIC_PARAM_H
9634 #define __ASM_MACH_GENERIC_PARAM_H
9636 -#define HZ 1000 /* Internal kernel timer frequency */
9637 +#define HZ 200 /* Internal kernel timer frequency */
9639 #endif /* __ASM_MACH_GENERIC_PARAM_H */
9640 diff -urN linux.old/include/asm-mips/module.h linux.dev/include/asm-mips/module.h
9641 --- linux.old/include/asm-mips/module.h 2006-08-25 00:43:22.000000000 +0200
9642 +++ linux.dev/include/asm-mips/module.h 2006-08-25 00:39:38.000000000 +0200
9643 @@ -113,6 +113,12 @@
9644 #define MODULE_PROC_FAMILY "RM9000 "
9645 #elif defined CONFIG_CPU_SB1
9646 #define MODULE_PROC_FAMILY "SB1 "
9647 +#elif defined CONFIG_CPU_BCM6338
9648 +#define MODULE_PROC_FAMILY "BCM6338 "
9649 +#elif defined CONFIG_CPU_BCM6345
9650 +#define MODULE_PROC_FAMILY "BCM6345 "
9651 +#elif defined CONFIG_CPU_BCM6348
9652 +#define MODULE_PROC_FAMILY "BCM6348 "
9654 #error MODULE_PROC_FAMILY undefined for your processor configuration