-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/bcmsrom.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/bcmsrom.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/bcmsrom.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/bcmsrom.c 2006-03-21 09:30:59.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/bcmsrom.c linux-2.6.19/arch/mips/bcm947xx/broadcom/bcmsrom.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/bcmsrom.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/bcmsrom.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,481 @@
+/*
+ * Misc useful routines to access NIC SROM/OTP .
+ /* now correct the endianness of the byte array */
+ ltoh16_buf(buf, nwords * 2);
+ }
-+
++
+ return err;
-+}
++}
+
+/*
+* Create variable table from memory.
+ *vars = NULL;
+ *count = 0;
+ }
-+
++
+ return 0;
+}
+
+ uint16 w, b[64];
+ uint8 sromrev;
+ struct ether_addr ea;
-+ char eabuf[32];
++ char eabuf[32];
+ uint32 w32;
+ int woff, i;
+ char *vp, *base;
+ /* bcm4401 sroms misprogrammed */
+ if (sromrev == 0x10)
+ sromrev = 1;
-+
++
+ /* srom version check */
+ if (sromrev > 3)
+ return (-2);
+ vp += sprintf(vp, "wl0gpio3=%d", (w >> 8) & 0xff);
+ vp++;
+ }
-+
++
+ /* Word 52 is max power 0/1 */
+ w = b[52];
+ vp += sprintf(vp, "pa0maxpwr=%d", w & 0xff);
+ return err;
+}
+
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/bcmutils.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/bcmutils.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/bcmutils.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/bcmutils.c 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/bcmutils.c linux-2.6.19/arch/mips/bcm947xx/broadcom/bcmutils.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/bcmutils.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/bcmutils.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,356 @@
+/*
+ * Misc useful OS-independent routines.
+{
+ ulong result, value;
+ bool minus;
-+
++
+ minus = FALSE;
+
+ while (bcm_isspace(*cp))
+ cp++;
-+
++
+ if (cp[0] == '+')
+ cp++;
+ else if (cp[0] == '-') {
+ minus = TRUE;
+ cp++;
+ }
-+
++
+ if (base == 0) {
+ if (cp[0] == '0') {
+ if ((cp[1] == 'x') || (cp[1] == 'X')) {
+ } else if (base == 16 && (cp[0] == '0') && ((cp[1] == 'x') || (cp[1] == 'X'))) {
+ cp = &cp[2];
+ }
-+
++
+ result = 0;
+
+ while (bcm_isxdigit(*cp) &&
+* This format allows multiple features to share the gpio with mutual
+* understanding.
+*
-+* 'def_pin' is returned if a specific gpio is not defined for the requested functionality
++* 'def_pin' is returned if a specific gpio is not defined for the requested functionality
+* and if def_pin is not used by others.
+*/
+uint
+ * x^8 + x^7 +x^6 + x^4 + x^2 + 1
+ *
+ * The caller provides the initial value (either CRC8_INIT_VALUE
-+ * or the previous returned value) to allow for processing of
++ * or the previous returned value) to allow for processing of
+ * discontiguous blocks of data. When generating the CRC the
+ * caller is responsible for complementing the final return value
+ * and inserting it into the byte stream. When checking, a final
+ * return value of CRC8_GOOD_VALUE indicates a valid CRC.
+ *
+ * Reference: Dallas Semiconductor Application Note 27
-+ * Williams, Ross N., "A Painless Guide to CRC Error Detection Algorithms",
++ * Williams, Ross N., "A Painless Guide to CRC Error Detection Algorithms",
+ * ver 3, Aug 1993, ross@guest.adelaide.edu.au, Rocksoft Pty Ltd.,
+ * ftp://ftp.rocksoft.com/clients/rocksoft/papers/crc_v3.txt
+ *
+#define CNBUFS 5
+
+#endif
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/cfe_env.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/cfe_env.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/cfe_env.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/cfe_env.c 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/cfe_env.c linux-2.6.19/arch/mips/bcm947xx/broadcom/cfe_env.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/cfe_env.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/cfe_env.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,234 @@
+/*
+ * NVRAM variable manipulation (Linux kernel half)
+ * $Id$
+ */
+
-+#include <linux/config.h>
++#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+ *
+ * If bit 0 (low bit) is set, the length is an 8-bit value.
+ * If bit 0 (low bit) is clear, the length is a 16-bit value
-+ *
++ *
+ * Bit 7 set indicates "user" TLVs. In this case, bit 0 still
-+ * indicates the size of the length field.
++ * indicates the size of the length field.
+ *
+ * Flags are from the constants below:
+ *
+ * The actual TLV types we support
+ */
+
-+#define ENV_TLV_TYPE_END 0x00
++#define ENV_TLV_TYPE_END 0x00
+#define ENV_TLV_TYPE_ENV ENV_CODE_SYS(0,ENV_LENGTH_8BITS)
+
+/*
-+ * Environment variable flags
++ * Environment variable flags
+ */
+
+#define ENV_FLG_NORMAL 0x00 /* normal read/write */
+
+/* *********************************************************************
+ * _nvram_read(buffer,offset,length)
-+ *
++ *
+ * Read data from the NVRAM device
-+ *
-+ * Input parameters:
++ *
++ * Input parameters:
+ * buffer - destination buffer
+ * offset - offset of data to read
+ * length - number of bytes to read
-+ *
++ *
+ * Return value:
+ * number of bytes read, or <0 if error occured
+ ********************************************************************* */
+{
+ int i;
+ if (offset > NVRAM_SIZE)
-+ return -1;
++ return -1;
+
+ for ( i = 0; i < length; i++) {
+ buffer[i] = ((volatile unsigned char*)nv_buf)[offset + i];
+ * @return value of variable or NULL if undefined
+ */
+
-+char*
++char*
+cfe_env_get(unsigned char *nv_buf, char* name)
+{
+ int size;
+ unsigned int rectype;
+ int offset;
+ int flg;
-+
++
+ size = NVRAM_SIZE;
+ buffer = &_nvdata[0];
+
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
+ goto error;
+ }
-+
++
+ while ((*ptr != ENV_TLV_TYPE_END) && (size > 1)) {
+
+ /* Adjust pointer for TLV type */
+ offset++;
+ size--;
+
-+ /*
++ /*
+ * Read the length. It can be either 1 or 2 bytes
-+ * depending on the code
++ * depending on the code
+ */
+ if (rectype & ENV_LENGTH_8BITS) {
+ /* Read the record type and length - 8 bits */
+ *envval++ = '\0';
+ memcpy(_valuestr,envval,(reclen-1)-(envval-ptr));
+ _valuestr[(reclen-1)-(envval-ptr)] = '\0';
-+#if 0
++#if 0
+ printk(KERN_INFO "NVRAM:%s=%s\n", ptr, _valuestr);
+#endif
+ if(!strcmp(ptr, name)){
+ return _valuestr;
+ }
+ break;
-+
-+ default:
++
++ default:
+ /* Unknown TLV type, skip it. */
+ break;
+ }
+
+ /*
-+ * Advance to next TLV
++ * Advance to next TLV
+ */
-+
++
+ size -= (int)reclen;
+ offset += reclen;
+
+
+}
+
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/linux_osl.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/linux_osl.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/linux_osl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/linux_osl.c 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/linux_osl.c linux-2.6.19/arch/mips/bcm947xx/broadcom/linux_osl.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/linux_osl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/linux_osl.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,102 @@
+/*
+ * Linux OS Independent Layer
+#endif
+#include <pcicfg.h>
+
-+#define PCI_CFG_RETRY 10
++#define PCI_CFG_RETRY 10
+
+#define OS_HANDLE_MAGIC 0x1234abcd
+#define BCM_MEM_FILENAME_LEN 24
+osl_pci_read_config(osl_t *osh, uint offset, uint size)
+{
+ uint val;
-+ uint retry=PCI_CFG_RETRY;
++ uint retry=PCI_CFG_RETRY;
+
+ ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
+
+void
+osl_pci_write_config(osl_t *osh, uint offset, uint size, uint val)
+{
-+ uint retry=PCI_CFG_RETRY;
++ uint retry=PCI_CFG_RETRY;
+
+ ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
+
+ pci_write_config_dword(osh->pdev, offset, val);
+ if (offset!=PCI_BAR0_WIN)
+ break;
-+ if (osl_pci_read_config(osh,offset,size) == val)
++ if (osl_pci_read_config(osh,offset,size) == val)
+ break;
+ } while (retry--);
+
+ }
+}
+
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/Makefile linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/Makefile
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/Makefile 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/Makefile linux-2.6.19/arch/mips/bcm947xx/broadcom/Makefile
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/Makefile 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,6 @@
+#
+# Makefile for the BCM47xx specific kernel interface routines
+#
+
+obj-y := sbutils.o linux_osl.o bcmsrom.o bcmutils.o sbmips.o sbpci.o sflash.o nvram.o cfe_env.o
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/nvram.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/nvram.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/nvram.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/nvram.c 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/nvram.c linux-2.6.19/arch/mips/bcm947xx/broadcom/nvram.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/nvram.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/nvram.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,192 @@
+/*
+ * NVRAM variable manipulation (Linux kernel half)
+ * $Id$
+ */
+
-+#include <linux/config.h>
++#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+static int cfe_env;
+
+extern char *cfe_env_get(char *nv_buf, const char *name);
-+
++
+
+/* Convenience */
+#define sbh_lock bcm947xx_sbh_lock
+ header = (struct nvram_header *) KSEG1ADDR(base + 4 KB);
+ if (header->magic == NVRAM_MAGIC)
+ goto found;
-+
++
+ header = (struct nvram_header *) KSEG1ADDR(base + 1 KB);
+ if (header->magic == NVRAM_MAGIC)
+ goto found;
-+
++
+ return;
+
+found:
+
+ if (!nvram_buf[0])
+ return NULL;
-+
++
+ /* Look for name=value and return value */
+ var = &nvram_buf[sizeof(struct nvram_header)];
+ end = nvram_buf + sizeof(nvram_buf) - 2;
+}
+
+EXPORT_SYMBOL(nvram_get);
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/sbmips.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sbmips.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/sbmips.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sbmips.c 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,1055 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sbmips.c linux-2.6.19/arch/mips/bcm947xx/broadcom/sbmips.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sbmips.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/sbmips.c 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,1115 @@
+/*
+ * BCM47XX Sonics SiliconBackplane MIPS core routines
+ *
+ tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */
+ tmp |= CEIL(10, ns) << FW_W1_SHIFT; /* W1 = 10nS */
+ tmp |= CEIL(120, ns); /* W0 = 120nS */
-+
++
+ // Added by Chen-I for 5365
+ if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)
+ {
+ }
+ }
+ // Added by Chen-I & Yen for enabling 5350 EXTIF
-+ if (BCMINIT(sb_chip)(sbh) == BCM5350_DEVICE_ID)
++ if (BCMINIT(sb_chip)(sbh) == BCM5350_DEVICE_ID)
+ {
+ /* Set programmable interface timing for external uart */
+ tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */
+ BCMINIT(sb_setirq)(sbh, 0, SB_CODEC, 0);
+ BCMINIT(sb_setirq)(sbh, 0, SB_EXTIF, 0);
+ BCMINIT(sb_setirq)(sbh, 2, SB_ENET, 1);
-+ BCMINIT(sb_setirq)(sbh, 3, SB_ILINE20, 0);
++ // BCMINIT(sb_setirq)(sbh, 3, SB_ILINE20, 0); /* seems to be unused */
+ BCMINIT(sb_setirq)(sbh, 4, SB_PCI, 0);
+ ASSERT(eir);
+ value = BCMINIT(early_nvram_get)("et0phyaddr");
+ if (value && !strcmp(value, "31")) {
+ /* Enable internal UART */
+ W_REG(&eir->corecontrol, CC_UE);
-+ /* Give USB its own interrupt */
-+ BCMINIT(sb_setirq)(sbh, 1, SB_USB, 0);
+ } else {
+ /* Disable internal UART */
+ W_REG(&eir->corecontrol, 0);
+ /* Give Ethernet its own interrupt */
+ BCMINIT(sb_setirq)(sbh, 1, SB_ENET, 0);
-+ BCMINIT(sb_setirq)(sbh, 0, SB_USB, 0);
+ }
++ /* USB gets its own interrupt */
++ BCMINIT(sb_setirq)(sbh, 3, SB_USB, 0);
++
+ break;
+ case BCM5350_DEVICE_ID:
+ /* Clear interrupt map */
+ } else
+ goto out;
+
-+ // Added by Chen-I for 5365
++ // Added by Chen-I for 5365
+ if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)
+ rate = 100000000;
+ else
+ return ret;
+}
+
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/sbpci.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sbpci.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/sbpci.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sbpci.c 2006-03-21 09:31:00.000000000 +0100
++uint32
++BCMINITFN(sb_cpu_clock)(sb_t *sbh)
++{
++ extifregs_t *eir;
++ chipcregs_t *cc;
++ uint32 n, m;
++ uint idx;
++ uint32 pll_type, rate = 0;
++
++ /* get index of the current core */
++ idx = sb_coreidx(sbh);
++ pll_type = PLL_TYPE1;
++
++ /* switch to extif or chipc core */
++ if ((eir = (extifregs_t *) sb_setcore(sbh, SB_EXTIF, 0))) {
++ n = R_REG(&eir->clockcontrol_n);
++ m = R_REG(&eir->clockcontrol_sb);
++ } else if ((cc = (chipcregs_t *) sb_setcore(sbh, SB_CC, 0))) {
++ pll_type = R_REG(&cc->capabilities) & CAP_PLL_MASK;
++ n = R_REG(&cc->clockcontrol_n);
++ if ((pll_type == PLL_TYPE2) ||
++ (pll_type == PLL_TYPE4) ||
++ (pll_type == PLL_TYPE6) ||
++ (pll_type == PLL_TYPE7))
++ m = R_REG(&cc->clockcontrol_mips);
++ else if (pll_type == PLL_TYPE5) {
++ rate = 200000000;
++ goto out;
++ }
++ else if (pll_type == PLL_TYPE3) {
++ if (sb_chip(sbh) == 0x5365) {
++ rate = 200000000;
++ goto out;
++ }
++ /* 5350 uses m2 to control mips */
++ else
++ m = R_REG(&cc->clockcontrol_m2);
++ } else
++ m = R_REG(&cc->clockcontrol_sb);
++ } else
++ goto out;
++
++
++ /* calculate rate */
++ if (BCMINIT(sb_chip)(sbh) == 0x5365)
++ rate = 100000000;
++ else
++ rate = sb_clock_rate(pll_type, n, m);
++
++ if (pll_type == PLL_TYPE6)
++ rate = SB2MIPS_T6(rate);
++
++out:
++ /* switch back to previous core */
++ sb_setcoreidx(sbh, idx);
++
++ return rate;
++}
++
++EXPORT_SYMBOL(sb_irq);
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sbpci.c linux-2.6.19/arch/mips/bcm947xx/broadcom/sbpci.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sbpci.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/sbpci.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,534 @@
+/*
+ * Low-Level PCI and SB support for BCM47xx
+ /* Enable PCI interrupts */
+ W_REG(&pci->intmask, PCI_INTA);
+ }
-+
++
+ return 0;
+}
+
+ return 0;
+}
+
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/sbutils.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sbutils.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/sbutils.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sbutils.c 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,2370 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sbutils.c linux-2.6.19/arch/mips/bcm947xx/broadcom/sbutils.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sbutils.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/sbutils.c 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,2375 @@
+/*
+ * Misc utility routines for accessing chip-specific features
+ * of the SiliconBackplane-based Broadcom chips.
+ *
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
-+ *
++ *
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+#define BADIDX (SB_MAXCORES+1)
+#define NOREV -1
+
-+#define PCI(si) ((BUSTYPE(si->sb.bustype) == PCI_BUS) && (si->sb.buscoretype == SB_PCI))
++#define PCI(si) ((BUSTYPE(si->sb.bustype) == PCI_BUS) && (si->sb.buscoretype == SB_PCI))
+
+/* sonicsrev */
+#define SONICS_2_2 (SBIDL_RV_2_2 >> SBIDL_RV_SHIFT)
+static sb_info_t ksi;
+
+/* generic kernel variant of sb_attach() */
-+sb_t *
++sb_t *
+BCMINITFN(sb_kattach)()
+{
+ uint32 *regs;
+}
+#endif
+
-+static sb_info_t *
++static sb_info_t *
+BCMINITFN(sb_doattach)(sb_info_t *si, uint devid, osl_t *osh, void *regs,
+ uint bustype, void *sdh, char **vars, int *varsz)
+{
+ return NULL;
+ }
+ }
-+
++
+ /* srom_var_init() depends on sb_scan() info */
+ if (srom_var_init(si, si->sb.bustype, si->curmap, osh, vars, varsz)) {
+ SB_ERROR(("sb_doattach: srom_var_init failed: bad srom\n"));
+ return (NULL);
+ }
-+
++
+ if (cc == NULL) {
+ /*
+ * The chip revision number is hardwired into all
+ if (si->sb.ccrev >= 16) {
+ w = getintvar(*vars, "gpiotimerval");
+ if (!w)
-+ w = DEFAULT_GPIOTIMERVAL;
++ w = DEFAULT_GPIOTIMERVAL;
+ sb_corereg(si, 0, OFFSETOF(chipcregs_t, gpiotimerval), ~0, w);
+ }
+
+ else {
+ sblo = sb_corereg(si, coreidx, SBCONFIGOFF + OFFSETOF(sbconfig_t, sbtmstatelow), 0, 0);
+ sb_corereg(si, coreidx, SBCONFIGOFF + OFFSETOF(sbconfig_t, sbtmstatelow), ~0, (sblo | SBTML_FGC | SBTML_BE));
-+
++
+ SPINWAIT(((sb_corereg(si, coreidx, SBCONFIGOFF + OFFSETOF(sbconfig_t, sbtmstatehigh), 0, 0) & SBTMH_BISTD) == 0), 100000);
-+
++
+ if (sb_corereg(si, coreidx, SBCONFIGOFF + OFFSETOF(sbconfig_t, sbtmstatehigh), 0, 0) & SBTMH_BISTF)
+ result = BCME_ERROR;
+
+ sb_setcoreidx(&si->sb, i);
+ si->coreid[i] = sb_coreid(&si->sb);
+
-+ if (si->coreid[i] == SB_PCI) {
++ if (si->coreid[i] == SB_PCI) {
+ pciidx = i;
+ pcirev = sb_corerev(&si->sb);
+ pci = TRUE;
+ }
+ if (pci) {
+ si->sb.buscoretype = SB_PCI;
-+ si->sb.buscorerev = pcirev;
-+ si->sb.buscoreidx = pciidx;
++ si->sb.buscorerev = pcirev;
++ si->sb.buscoreidx = pciidx;
+ }
+
+ /*
+ return (BADIDX);
+}
+
-+/*
-+ * this function changes logical "focus" to the indiciated core,
++/*
++ * this function changes logical "focus" to the indiciated core,
+ * must be called with interrupt off.
+ * Moreover, callers should keep interrupts off during switching out of and back to d11 core
+ */
+
+ if (coreidx >= si->numcores)
+ return (NULL);
-+
++
+ /*
+ * If the user has provided an interrupt mask enabled function,
+ * then assert interrupts are disabled before switching the core.
+ return (si->curmap);
+}
+
-+/*
-+ * this function changes logical "focus" to the indiciated core,
++/*
++ * this function changes logical "focus" to the indiciated core,
+ * must be called with interrupt off.
+ * Moreover, callers should keep interrupts off during switching out of and back to d11 core
+ */
+ idx = BADIDX;
+ switch (BUSTYPE(si->sb.bustype)) {
+ case PCI_BUS:
-+ idx = si->sb.buscoreidx;
++ idx = si->sb.buscoreidx;
+ break;
+ case JTAG_BUS:
+ idx = SB_CC_IDX;
+ ASSERT(0);
+ /* PLL types 3 and 7 use BASE2 (25Mhz) */
+ if ((pll_type == PLL_TYPE3) ||
-+ (pll_type == PLL_TYPE7)) {
++ (pll_type == PLL_TYPE7)) {
+ clock = CC_CLOCK_BASE2 * n1 * n2;
+ }
-+ else
++ else
+ clock = CC_CLOCK_BASE1 * n1 * n2;
+
+ if (clock == 0)
+ m = R_REG(&cc->clockcontrol_mips);
+ else if (pll_type == PLL_TYPE3)
+ {
-+ // Added by Chen-I for 5365
-+ if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)
++ // Added by Chen-I for 5365
++ if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)
+ m = R_REG(&cc->clockcontrol_sb);
+ else
+ m = R_REG(&cc->clockcontrol_m2);
+ return 0;
+ }
+
-+ // Added by Chen-I for 5365
++ // Added by Chen-I for 5365
+ if (BCMINIT(sb_chip)(sbh) == BCM5365_DEVICE_ID)
+ {
+ rate = 100000000;
+ }
+ else
-+ {
++ {
+ /* calculate rate */
+ rate = sb_clock_rate(pll_type, n, m);
+ if (pll_type == PLL_TYPE3)
+}
+
+/* release one gpio */
-+/*
-+ * releasing the gpio doesn't change the current value on the GPIO last write value
++/*
++ * releasing the gpio doesn't change the current value on the GPIO last write value
+ * persists till some one overwrites it
+*/
+
+ ASSERT((gpio_bitmask) && !((gpio_bitmask) & (gpio_bitmask - 1)));
+ return -1;
+ }
-+
++
+ /* already released */
+ if (!(sb_gpioreservation & gpio_bitmask))
+ return -1;
+}
+
+/* mask&set gpio timer val */
-+uint32
++uint32
+sb_gpiotimerval(sb_t *sbh, uint32 mask, uint32 gpiotimerval)
+{
+ sb_info_t *si;
+ chipcregs_t *cc;
+ uint intr_val = 0;
+ uint err = 0;
-+
++
+ si = SB_INFO(sbh);
+
+ /* chipcommon cores prior to rev6 don't support slowclkcontrol */
+
+ if (set && ((*div % 4) || (*div < 4)))
+ return 2;
-+
++
+ INTR_OFF(si, intr_val);
+ origidx = si->curidx;
+ cc = (chipcregs_t*) sb_setcore(sbh, SB_CC, 0);
+ ASSERT(cc != NULL);
-+
++
+ if (!(R_REG(&cc->capabilities) & CAP_PWR_CTL)) {
+ err = 3;
+ goto done;
+ /* set all Instaclk chip ILP to 1 MHz */
+ if (si->sb.ccrev >= 10)
+ SET_REG(&cc->system_clk_ctl, SYCC_CD_MASK, (ILP_DIV_1MHZ << SYCC_CD_SHIFT));
-+
++
+ sb_clkctl_setdelay(si, (void *)cc);
+
+done:
+
+
+void
-+sb_corepciid(sb_t *sbh, uint16 *pcivendor, uint16 *pcidevice,
++sb_corepciid(sb_t *sbh, uint16 *pcivendor, uint16 *pcidevice,
+ uint8 *pciclass, uint8 *pcisubclass, uint8 *pciprogif)
+{
+ uint vendor, core, unit;
+ uint chip, chippkg;
+ char varname[8];
+ uint8 class, subclass, progif;
-+
++
+ vendor = sb_corevendor(sbh);
+ core = sb_coreid(sbh);
+ unit = sb_coreunit(sbh);
+ chippkg = BCMINIT(sb_chippkg)(sbh);
+
+ progif = 0;
-+
++
+ /* Known vendor translations */
+ switch (vendor) {
+ case SB_VEND_BCM:
+
+EXPORT_SYMBOL(sb_boardtype);
+EXPORT_SYMBOL(sb_boardvendor);
++EXPORT_SYMBOL(sb_corereg);
++EXPORT_SYMBOL(sb_coreidx);
++EXPORT_SYMBOL(sb_setcore);
++EXPORT_SYMBOL(sb_setcoreidx);
+EXPORT_SYMBOL(sb_gpiocontrol);
+EXPORT_SYMBOL(sb_gpioin);
+EXPORT_SYMBOL(sb_gpiointmask);
+EXPORT_SYMBOL(sb_gpiosetcore);
+EXPORT_SYMBOL(sb_gpiotimerval);
+EXPORT_SYMBOL(sb_watchdog);
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/broadcom/sflash.c linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sflash.c
---- linux-2.6.16/arch/mips/bcm947xx/broadcom/sflash.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/broadcom/sflash.c 2006-03-21 09:31:00.000000000 +0100
++EXPORT_SYMBOL(sb_kattach);
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sflash.c linux-2.6.19/arch/mips/bcm947xx/broadcom/sflash.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/broadcom/sflash.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/broadcom/sflash.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,418 @@
+/*
+ * Broadcom SiliconBackplane chipcommon serial flash interface
+
+ /* Copy entire block */
+ while(blk_len) {
-+ copied = sflash_read(cc, blk_offset, blk_len, blk_ptr);
++ copied = sflash_read(cc, blk_offset, blk_len, blk_ptr);
+ blk_offset += copied;
+ blk_len -= copied;
+ blk_ptr += copied;
+ return ret;
+}
+
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/bcmdevs.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmdevs.h
---- linux-2.6.16/arch/mips/bcm947xx/include/bcmdevs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmdevs.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmdevs.h linux-2.6.19/arch/mips/bcm947xx/include/bcmdevs.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmdevs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/bcmdevs.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,391 @@
+/*
+ * Broadcom device-specific manifest constants.
+
+#define BCM4306_DEVICE_ID 0x4306 /* 4306 chipcommon chipid */
+#define BCM4306_D11G_ID 0x4320 /* 4306 802.11g */
-+#define BCM4306_D11G_ID2 0x4325
++#define BCM4306_D11G_ID2 0x4325
+#define BCM4306_D11A_ID 0x4321 /* 4306 802.11a */
+#define BCM4306_UART_ID 0x4322 /* 4306 uart */
+#define BCM4306_V90_ID 0x4323 /* 4306 v90 codec */
+#define GPIO_NUMPINS 16
+
+#endif /* _BCMDEVS_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/bcmendian.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmendian.h
---- linux-2.6.16/arch/mips/bcm947xx/include/bcmendian.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmendian.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmendian.h linux-2.6.19/arch/mips/bcm947xx/include/bcmendian.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmendian.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/bcmendian.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,152 @@
+/*
+ * local version of endian.h - byte order defines
+ ((uint16)( \
+ (((uint16)(val) & (uint16)0x00ffU) << 8) | \
+ (((uint16)(val) & (uint16)0xff00U) >> 8) ))
-+
++
+/* Byte swap a 32 bit value */
+#define BCMSWAP32(val) \
+ ((uint32)( \
+ (((uint32)(val) & (uint32)0x0000ff00UL) << 8) | \
+ (((uint32)(val) & (uint32)0x00ff0000UL) >> 8) | \
+ (((uint32)(val) & (uint32)0xff000000UL) >> 24) ))
-+
++
+/* 2 Byte swap a 32 bit value */
+#define BCMSWAP32BY16(val) \
+ ((uint32)( \
+ (((uint32)(val) & (uint32)0x0000ffffUL) << 16) | \
+ (((uint32)(val) & (uint32)0xffff0000UL) >> 16) ))
-+
++
+
+static INLINE uint16
+bcmswap16(uint16 val)
+)
+
+#endif /* _BCMENDIAN_H_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/bcmnvram.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmnvram.h
---- linux-2.6.16/arch/mips/bcm947xx/include/bcmnvram.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmnvram.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmnvram.h linux-2.6.19/arch/mips/bcm947xx/include/bcmnvram.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmnvram.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/bcmnvram.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,95 @@
+/*
+ * NVRAM variable manipulation
+ */
+extern char *nvram_get(const char *name);
+
-+/*
++/*
+ * Get the value of an NVRAM variable.
+ * @param name name of variable to get
+ * @return value of variable or NUL if undefined
+#define NVRAM_MAX_PARAM_LEN 64
+
+#endif /* _bcmnvram_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/bcmsrom.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmsrom.h
---- linux-2.6.16/arch/mips/bcm947xx/include/bcmsrom.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmsrom.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmsrom.h linux-2.6.19/arch/mips/bcm947xx/include/bcmsrom.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmsrom.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/bcmsrom.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,23 @@
+/*
+ * Misc useful routines to access NIC local SROM/OTP .
+extern int srom_write(uint bus, void *curmap, osl_t *osh, uint byteoff, uint nbytes, uint16 *buf);
+
+#endif /* _bcmsrom_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/bcmutils.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmutils.h
---- linux-2.6.16/arch/mips/bcm947xx/include/bcmutils.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/bcmutils.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmutils.h linux-2.6.19/arch/mips/bcm947xx/include/bcmutils.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/bcmutils.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/bcmutils.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,308 @@
+/*
+ * Misc useful os-independent macros and functions.
+#define _BCM_X 0x40 /* hex digit */
+#define _BCM_SP 0x80 /* hard space (0x20) */
+
-+#define GPIO_PIN_NOTDEFINED 0x20
++#define GPIO_PIN_NOTDEFINED 0x20
+
+extern unsigned char bcm_ctype[];
+#define bcm_ismask(x) (bcm_ctype[(int)(unsigned char)(x)])
+#define VALID_BCMERROR(e) ((e <= 0) && (e >= BCME_LAST))
+
+
-+/*
-+ * error codes could be added but the defined ones shouldn't be changed/deleted
-+ * these error codes are exposed to the user code
-+ * when ever a new error code is added to this list
-+ * please update errorstring table with the related error string and
-+ * update osl files with os specific errorcode map
++/*
++ * error codes could be added but the defined ones shouldn't be changed/deleted
++ * these error codes are exposed to the user code
++ * when ever a new error code is added to this list
++ * please update errorstring table with the related error string and
++ * update osl files with os specific errorcode map
+*/
+
+#define BCME_ERROR -1 /* Error generic */
+#define BCME_NOCLK -11 /* No Clock*/
+#define BCME_BADRATESET -12 /* BAD RateSet*/
+#define BCME_BADBAND -13 /* BAD Band */
-+#define BCME_BUFTOOSHORT -14 /* Buffer too short */
-+#define BCME_BUFTOOLONG -15 /* Buffer too Long */
-+#define BCME_BUSY -16 /* Busy*/
++#define BCME_BUFTOOSHORT -14 /* Buffer too short */
++#define BCME_BUFTOOLONG -15 /* Buffer too Long */
++#define BCME_BUSY -16 /* Busy*/
+#define BCME_NOTASSOCIATED -17 /* Not associated*/
+#define BCME_BADSSIDLEN -18 /* BAD SSID Len */
+#define BCME_OUTOFRANGECHAN -19 /* Out of Range Channel*/
+#define BCME_ASSOCIATED -28 /* Associated */
+#define BCME_RANGE -29 /* Range Error*/
+#define BCME_NOTFOUND -30 /* Not found */
-+#define BCME_LAST BCME_NOTFOUND
++#define BCME_LAST BCME_NOTFOUND
+
+#ifndef ABS
+#define ABS(a) (((a)<0)?-(a):(a))
+extern uint bcm_mkiovar(char *name, char *data, uint datalen, char *buf, uint len);
+
+#endif /* _bcmutils_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/bitfuncs.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/bitfuncs.h
---- linux-2.6.16/arch/mips/bcm947xx/include/bitfuncs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/bitfuncs.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/bitfuncs.h linux-2.6.19/arch/mips/bcm947xx/include/bitfuncs.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/bitfuncs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/bitfuncs.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,85 @@
+/*
+ * bit manipulation utility functions
+#endif
+
+#endif /* _BITFUNCS_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/flash.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/flash.h
---- linux-2.6.16/arch/mips/bcm947xx/include/flash.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/flash.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/flash.h linux-2.6.19/arch/mips/bcm947xx/include/flash.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/flash.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/flash.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,188 @@
+/*
+ * flash.h: Common definitions for flash access.
+
+
+#ifdef DECLARE_FLASHES
-+flash_cmds_t sflash_cmd_t =
++flash_cmds_t sflash_cmd_t =
+ { SFLASH, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+flash_cmds_t flash_cmds[] = {
+};
+
+
-+flash_desc_t sflash_desc =
++flash_desc_t sflash_desc =
+ { 0, 0, 0, 0, SFLASH, 0, 0, 0, 0, 0, NULL, "SFLASH" };
+
+flash_desc_t flashes[] = {
+ { 0x0004, 0x22F6, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "MBM29LV320TE 2Mx16 TopB" },
+ { 0x0004, 0x22F9, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "MBM29LV320BE 2Mx16 BotB" },
+ { 0x0098, 0x009A, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "TC58FVT321 2Mx16 TopB" },
-+ { 0x0098, 0x009C, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "TC58FVB321 2Mx16 BotB" },
++ { 0x0098, 0x009C, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "TC58FVB321 2Mx16 BotB" },
+ { 0x00C2, 0x22A7, 0x0400000, 2, AMD, 0x10000, 64, 0, 62, 4, amd4112, "MX29LV320T 2Mx16 TopB" },
+ { 0x00C2, 0x22A8, 0x0400000, 2, AMD, 0x10000, 64, 1, 63, 4, amd2114, "MX29LV320B 2Mx16 BotB" },
+ { 0x00BF, 0x2783, 0x0400000, 2, SST, 0x10000, 64, 0, 63, 0, NULL, "SST39VF320 2Mx16" },
+extern flash_desc_t flashes[];
+
+#endif
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/flashutl.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/flashutl.h
---- linux-2.6.16/arch/mips/bcm947xx/include/flashutl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/flashutl.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/flashutl.h linux-2.6.19/arch/mips/bcm947xx/include/flashutl.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/flashutl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/flashutl.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,27 @@
+/*
+ * BCM47XX FLASH driver interface
+#endif /* _LANGUAGE_ASSEMBLY */
+
+#endif /* _flashutl_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/hndmips.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/hndmips.h
---- linux-2.6.16/arch/mips/bcm947xx/include/hndmips.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/hndmips.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/hndmips.h linux-2.6.19/arch/mips/bcm947xx/include/hndmips.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/hndmips.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/hndmips.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,16 @@
+/*
+ * Alternate include file for HND sbmips.h since CFE also ships with
+ *
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
-+ *
++ *
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ */
+
+#include "sbmips.h"
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/linux_osl.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/linux_osl.h
---- linux-2.6.16/arch/mips/bcm947xx/include/linux_osl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/linux_osl.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/linux_osl.h linux-2.6.19/arch/mips/bcm947xx/include/linux_osl.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/linux_osl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/linux_osl.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,331 @@
+/*
+ * Linux OS Independent Layer
+#define ASSERT(exp) do {} while (0)
+#else
+/* ASSERT could causes segmentation fault on GCC3.1, use empty instead*/
-+#define ASSERT(exp)
++#define ASSERT(exp)
+#endif
+#endif
+
+
+/* register access macros */
+#if !defined(BCMJTAG)
-+#ifndef IL_BIGENDIAN
++#ifndef IL_BIGENDIAN
+#define R_REG(r) ( \
+ sizeof(*(r)) == sizeof(uint8) ? readb((volatile uint8*)(r)) : \
+ sizeof(*(r)) == sizeof(uint16) ? readw((volatile uint16*)(r)) : \
+extern void *osl_pktget(osl_t *osh, uint len, bool send);
+extern void osl_pktfree(void *skb);
+
-+#else /* BINOSL */
++#else /* BINOSL */
+
+/* string library */
+#ifndef LINUX_OSL
+#define PKTBUFSZ 2048
+
+#endif /* _linux_osl_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/linuxver.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/linuxver.h
---- linux-2.6.16/arch/mips/bcm947xx/include/linuxver.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/linuxver.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/linuxver.h linux-2.6.19/arch/mips/bcm947xx/include/linuxver.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/linuxver.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/linuxver.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,389 @@
+/*
+ * Linux-specific abstractions to gain some independence from linux kernel versions.
+ *
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
-+ *
++ *
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
-+ *
++ *
+ * $Id$
+ */
+
+#ifndef _linuxver_h_
+#define _linuxver_h_
+
-+#include <linux/config.h>
++#include <linux/autoconf.h>
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
+#endif
+
+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-+#define module_param(_name_, _type_, _perm_) MODULE_PARM(_name_, "i")
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
++#define module_param(_name_, _type_, _perm_) MODULE_PARM(_name_, "i")
+#define module_param_string(_name_, _string_, _size_, _perm_) MODULE_PARM(_string_, "c" __MODULE_STRING(_size_))
+#endif
+
+ return 0;
+}
+
-+static inline int
++static inline int
+pci_restore_state(struct pci_dev *dev, u32 *buffer)
+{
+ int i;
+ * This works around a problem where warm-booting from Windows
+ * combined with a D3(hot)->D0 transition causes PCI config
+ * header data to be forgotten.
-+ */
++ */
+ else {
+ for (i = 0; i < 6; i ++)
+ pci_write_config_dword(dev,
+#endif
+
+#endif /* _linuxver_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/mipsinc.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/mipsinc.h
---- linux-2.6.16/arch/mips/bcm947xx/include/mipsinc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/mipsinc.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/mipsinc.h linux-2.6.19/arch/mips/bcm947xx/include/mipsinc.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/mipsinc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/mipsinc.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,552 @@
+/*
+ * HND Run Time Environment for standalone MIPS programs.
+
+
+/*
-+ * CP0 Registers
++ * CP0 Registers
+ */
+
+#define C0_INX $0
+
+
+/*
-+ * CP0 Registers
++ * CP0 Registers
+ */
+
+#define C0_INX 0 /* CP0: TLB Index */
+#define PFC_I_AND_D_NOPF (PFC_INST_NOPF | PFC_DATA_NOPF)
+
+
-+/*
++/*
+ * These are the UART port assignments, expressed as offsets from the base
+ * register. These assignments should hold for any serial port based on
+ * a 8250, 16450, or 16550(A).
+#endif /* !_LANGUAGE_ASSEMBLY */
+
+#endif /* _MISPINC_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/osl.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/osl.h
---- linux-2.6.16/arch/mips/bcm947xx/include/osl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/osl.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/osl.h linux-2.6.19/arch/mips/bcm947xx/include/osl.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/osl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/osl.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,42 @@
+/*
+ * OS Abstraction Layer
+#define MAXPRIO 7 /* 0-7 */
+
+#endif /* _osl_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/pcicfg.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/pcicfg.h
---- linux-2.6.16/arch/mips/bcm947xx/include/pcicfg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/pcicfg.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/pcicfg.h linux-2.6.19/arch/mips/bcm947xx/include/pcicfg.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/pcicfg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/pcicfg.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,398 @@
+/*
+ * pcicfg.h: PCI configuration constants and structures.
+#define PCI_CAP_POWERMGMTCAP_ID 0x01
+#define PCI_CAP_MSICAP_ID 0x05
+
-+/* Data structure to define the Message Signalled Interrupt facility
++/* Data structure to define the Message Signalled Interrupt facility
+ * Valid for PCI and PCIE configurations */
+typedef struct _pciconfig_cap_msi {
+ unsigned char capID;
+ unsigned char capID;
+ unsigned char nextptr;
+ unsigned short pme_cap;
-+ unsigned short pme_sts_ctrl;
++ unsigned short pme_sts_ctrl;
+ unsigned char pme_bridge_ext;
+ unsigned char data;
+} pciconfig_cap_pwrmgmt;
+#define PCI_CFG_CMD_STAT_TA 0x08000000 /* target abort status */
+
+#endif
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/proto/ethernet.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/proto/ethernet.h
---- linux-2.6.16/arch/mips/bcm947xx/include/proto/ethernet.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/proto/ethernet.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/proto/ethernet.h linux-2.6.19/arch/mips/bcm947xx/include/proto/ethernet.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/proto/ethernet.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/proto/ethernet.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * $Id$
+#undef PACKED
+
+#endif /* _NET_ETHERNET_H_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/s5.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/s5.h
---- linux-2.6.16/arch/mips/bcm947xx/include/s5.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/s5.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/s5.h linux-2.6.19/arch/mips/bcm947xx/include/s5.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/s5.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/s5.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,103 @@
+#ifndef _S5_H_
+#define _S5_H_
+ * LICENSE.
+ *
+ * $Id: s5.h,v 1.3 2003/06/10 18:54:51 jfd Exp $
-+ *
++ *
+ */
+
+/* BCM5365 Address map */
+
+
+#endif /*!_S5_H_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbchipc.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbchipc.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbchipc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbchipc.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbchipc.h linux-2.6.19/arch/mips/bcm947xx/include/sbchipc.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbchipc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbchipc.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,440 @@
+/*
+ * SiliconBackplane Chipcommon core hardware definitions.
+ * $Id$
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
-+ *
++ *
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+#define CLKD_OTP 0x000f0000
+#define CLKD_OTP_SHIFT 16
+#define CLKD_JTAG 0x00000f00
-+#define CLKD_JTAG_SHIFT 8
++#define CLKD_JTAG_SHIFT 8
+#define CLKD_UART 0x000000ff
+
+/* intstatus/intmask */
+#define OTP_MAGIC 0x4e56
+
+#endif /* _SBCHIPC_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbconfig.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbconfig.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbconfig.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbconfig.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbconfig.h linux-2.6.19/arch/mips/bcm947xx/include/sbconfig.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbconfig.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbconfig.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,342 @@
+/*
+ * Broadcom SiliconBackplane hardware register definitions.
+#define BISZ_SIZE 7 /* descriptor size in 32-bit intergers */
+
+#endif /* _SBCONFIG_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbextif.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbextif.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbextif.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbextif.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbextif.h linux-2.6.19/arch/mips/bcm947xx/include/sbextif.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbextif.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbextif.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,242 @@
+/*
+ * Hardware-specific External Interface I/O core definitions
+ * The external interface core also contains 2 on-chip 16550 UARTs, clock
+ * frequency control, a watchdog interrupt timer, and a GPIO interface.
+ *
-+ * Copyright 2005, Broadcom Corporation
-+ * All Rights Reserved.
-+ *
-+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
-+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
-+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
-+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
++ * Copyright 2005, Broadcom Corporation
++ * All Rights Reserved.
++ *
++ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
++ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
++ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
++ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ * $Id$
+ */
+
+#define CC_CLOCK_BASE 24000000 /* Half the clock freq. in the 4710 */
+
+#endif /* _SBEXTIF_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbmemc.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbmemc.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbmemc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbmemc.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbmemc.h linux-2.6.19/arch/mips/bcm947xx/include/sbmemc.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbmemc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbmemc.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,148 @@
+/*
+ * BCM47XX Sonics SiliconBackplane DDR/SDRAM controller core hardware definitions.
+#define MEMC_CONFIG_DDR 0x00000001
+
+#endif /* _SBMEMC_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbmips.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbmips.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbmips.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbmips.h 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,62 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbmips.h linux-2.6.19/arch/mips/bcm947xx/include/sbmips.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbmips.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbmips.h 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,63 @@
+/*
+ * Broadcom SiliconBackplane MIPS definitions
+ *
+ *
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
-+ *
++ *
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+extern bool BCMINIT(sb_mips_setclock)(sb_t *sbh, uint32 mipsclock, uint32 sbclock, uint32 pciclock);
+extern void BCMINIT(enable_pfc)(uint32 mode);
+extern uint32 BCMINIT(sb_memc_get_ncdl)(sb_t *sbh);
++extern uint32 BCMINIT(sb_cpu_clock)(sb_t *sbh);
+
+
+#endif /* _LANGUAGE_ASSEMBLY */
+
+#endif /* _SBMIPS_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbpci.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbpci.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbpci.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbpci.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbpci.h linux-2.6.19/arch/mips/bcm947xx/include/sbpci.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbpci.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbpci.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,122 @@
+/*
+ * BCM47XX Sonics SiliconBackplane PCI core hardware definitions.
+#define PCI_RST_OE 0x01 /* When set, drives PCI_RESET out to pin */
+#define PCI_RST 0x02 /* Value driven out to pin */
+#define PCI_CLK_OE 0x04 /* When set, drives clock as gated by PCI_CLK out to pin */
-+#define PCI_CLK 0x08 /* Gate for clock driven out to pin */
++#define PCI_CLK 0x08 /* Gate for clock driven out to pin */
+
+/* PCI arbiter control */
+#define PCI_INT_ARB 0x01 /* When set, use an internal arbiter */
+#endif /* !_LANGUAGE_ASSEMBLY */
+
+#endif /* _SBPCI_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbsdram.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbsdram.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbsdram.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbsdram.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbsdram.h linux-2.6.19/arch/mips/bcm947xx/include/sbsdram.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbsdram.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbsdram.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,75 @@
+/*
+ * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
+#define MEM8MX16X2 0xc29 /* 32 MB */
+
+#endif /* _SBSDRAM_H */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sbutils.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbutils.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sbutils.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sbutils.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sbutils.h linux-2.6.19/arch/mips/bcm947xx/include/sbutils.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sbutils.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sbutils.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,136 @@
+/*
+ * Misc utility routines for accessing chip-specific features
+ *
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
-+ *
++ *
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+#ifndef _sbutils_h_
+#define _sbutils_h_
+
-+/*
-+ * Datastructure to export all chip specific common variables
-+ * public (read-only) portion of sbutils handle returned by
++/*
++ * Datastructure to export all chip specific common variables
++ * public (read-only) portion of sbutils handle returned by
+ * sb_attach()/sb_kattach()
+*/
+
+extern void sb_register_intr_callback(sb_t *sbh, void *intrsoff_fn,
+ void *intrsrestore_fn, void *intrsenabled_fn, void *intr_arg);
+extern uint32 sb_set_initiator_to(sb_t *sbh, uint32 to);
-+extern void sb_corepciid(sb_t *sbh, uint16 *pcivendor, uint16 *pcidevice,
++extern void sb_corepciid(sb_t *sbh, uint16 *pcivendor, uint16 *pcidevice,
+ uint8 *pciclass, uint8 *pcisubclass, uint8 *pciprogif);
+extern uint32 sb_gpiotimerval(sb_t *sbh, uint32 mask, uint32 val);
+
+#define SB_DEVPATH_BUFSZ 16 /* min buffer size in bytes */
+
+#endif /* _sbutils_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/sflash.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/sflash.h
---- linux-2.6.16/arch/mips/bcm947xx/include/sflash.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/sflash.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/sflash.h linux-2.6.19/arch/mips/bcm947xx/include/sflash.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/sflash.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/sflash.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,36 @@
+/*
+ * Broadcom SiliconBackplane chipcommon serial flash interface
+extern struct sflash * sflash_init(chipcregs_t *cc);
+
+#endif /* _sflash_h_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/trxhdr.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/trxhdr.h
---- linux-2.6.16/arch/mips/bcm947xx/include/trxhdr.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/trxhdr.h 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/trxhdr.h linux-2.6.19/arch/mips/bcm947xx/include/trxhdr.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/trxhdr.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/trxhdr.h 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,33 @@
+/*
+ * TRX image file header format.
+
+/* Compatibility */
+typedef struct trx_header TRXHDR, *PTRXHDR;
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/include/typedefs.h linux-2.6.16-owrt/arch/mips/bcm947xx/include/typedefs.h
---- linux-2.6.16/arch/mips/bcm947xx/include/typedefs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/include/typedefs.h 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,326 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/include/typedefs.h linux-2.6.19/arch/mips/bcm947xx/include/typedefs.h
+--- linux-2.6.19.ref/arch/mips/bcm947xx/include/typedefs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/include/typedefs.h 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,322 @@
+/*
+ * Copyright 2005, Broadcom Corporation
+ * All Rights Reserved.
+
+#else
+
-+#include <sys/types.h>
++#include <sys/types.h>
+
+#endif
+
+#ifdef USE_TYPEDEF_DEFAULTS
+#undef USE_TYPEDEF_DEFAULTS
+
-+#ifndef TYPEDEF_BOOL
-+typedef /*@abstract@*/ unsigned char bool;
-+#endif
-+
+/*----------------------- define uchar, ushort, uint, ulong ------------------*/
+
+#ifndef TYPEDEF_UCHAR
+/* Reclaiming text and data :
+ The following macros specify special linker sections that can be reclaimed
+ after a system is considered 'up'.
-+ */
++ */
+#if defined(__GNUC__) && defined(BCMRECLAIM)
+extern bool bcmreclaimed;
-+#define BCMINITDATA(_data) __attribute__ ((__section__ (".dataini." #_data))) _data##_ini
++#define BCMINITDATA(_data) __attribute__ ((__section__ (".dataini." #_data))) _data##_ini
+#define BCMINITFN(_fn) __attribute__ ((__section__ (".textini." #_fn))) _fn##_ini
+#define BCMINIT(_id) _id##_ini
-+#else
-+#define BCMINITDATA(_data) _data
++#else
++#define BCMINITDATA(_data) _data
+#define BCMINITFN(_fn) _fn
+#define BCMINIT(_id) _id
+#define bcmreclaimed 0
+#endif /* USE_TYPEDEF_DEFAULTS */
+
+#endif /* _TYPEDEFS_H_ */
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/int-handler.S linux-2.6.16-owrt/arch/mips/bcm947xx/int-handler.S
---- linux-2.6.16/arch/mips/bcm947xx/int-handler.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/int-handler.S 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,48 @@
-+/*
-+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; either version 2 of the License, or (at your
-+ * option) any later version.
-+ *
-+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
-+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ *
-+ * You should have received a copy of the GNU General Public License along
-+ * with this program; if not, write to the Free Software Foundation, Inc.,
-+ * 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <asm/asm.h>
-+#include <asm/mipsregs.h>
-+#include <asm/regdef.h>
-+#include <asm/stackframe.h>
-+
-+ .text
-+ .set noreorder
-+ .set noat
-+ .align 5
-+
-+ NESTED(bcm47xx_irq_handler, PT_SIZE, sp)
-+ SAVE_ALL
-+ CLI
-+
-+ .set at
-+ .set noreorder
-+
-+ jal bcm47xx_irq_dispatch
-+ move a0, sp
-+
-+ j ret_from_irq
-+ nop
-+
-+ END(bcm47xx_irq_handler)
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/irq.c linux-2.6.16-owrt/arch/mips/bcm947xx/irq.c
---- linux-2.6.16/arch/mips/bcm947xx/irq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/irq.c 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,67 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/irq.c linux-2.6.19/arch/mips/bcm947xx/irq.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/irq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/irq.c 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+ *
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
-+#include <linux/config.h>
++#include <linux/autoconf.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/irq.h>
+#include <asm/irq_cpu.h>
+
-+extern asmlinkage void bcm47xx_irq_handler(void);
-+
-+void bcm47xx_irq_dispatch(struct pt_regs *regs)
++void plat_irq_dispatch(struct pt_regs *regs)
+{
+ u32 cause;
+
+ clear_c0_status(cause);
+
+ if (cause & CAUSEF_IP7)
-+ do_IRQ(7, regs);
++ do_IRQ(7);
+ if (cause & CAUSEF_IP2)
-+ do_IRQ(2, regs);
++ do_IRQ(2);
+ if (cause & CAUSEF_IP3)
-+ do_IRQ(3, regs);
++ do_IRQ(3);
+ if (cause & CAUSEF_IP4)
-+ do_IRQ(4, regs);
++ do_IRQ(4);
+ if (cause & CAUSEF_IP5)
-+ do_IRQ(5, regs);
++ do_IRQ(5);
+ if (cause & CAUSEF_IP6)
-+ do_IRQ(6, regs);
++ do_IRQ(6);
+}
+
+void __init arch_init_irq(void)
+{
-+ set_except_vector(0, bcm47xx_irq_handler);
+ mips_cpu_irq_init(0);
+}
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/Makefile linux-2.6.16-owrt/arch/mips/bcm947xx/Makefile
---- linux-2.6.16/arch/mips/bcm947xx/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/Makefile 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/Makefile linux-2.6.19/arch/mips/bcm947xx/Makefile
+--- linux-2.6.19.ref/arch/mips/bcm947xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/Makefile 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,6 @@
+#
+# Makefile for the BCM47xx specific kernel interface routines
+# under Linux.
+#
+
-+obj-y := irq.o int-handler.o prom.o setup.o time.o pci.o
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/pci.c linux-2.6.16-owrt/arch/mips/bcm947xx/pci.c
---- linux-2.6.16/arch/mips/bcm947xx/pci.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/pci.c 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,215 @@
++obj-y := irq.o prom.o setup.o time.o pci.o
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/pci.c linux-2.6.19/arch/mips/bcm947xx/pci.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/pci.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/pci.c 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,227 @@
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+{
+ int ret;
+ unsigned long flags;
-+
++
+ spin_lock_irqsave(&sbh_lock, flags);
+ ret = sbpci_read_config(sbh, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), reg, val, size);
+ spin_unlock_irqrestore(&sbh_lock, flags);
+{
+ int ret;
+ unsigned long flags;
-+
++
+ spin_lock_irqsave(&sbh_lock, flags);
+ ret = sbpci_write_config(sbh, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), reg, &val, size);
+ spin_unlock_irqrestore(&sbh_lock, flags);
+static struct resource ext_pci_io_resource = {
+ .name = "Ext PCI I/O resources",
+ .start = 0x100,
-+ .end = 0x1FF,
++ .end = 0x7FF,
+ .flags = IORESOURCE_IO,
+};
+
+void bcm47xx_pci_init(void)
+{
+ unsigned long flags;
-+
++
+ spin_lock_irqsave(&sbh_lock, flags);
+ sbpci_init(sbh);
+ spin_unlock_irqrestore(&sbh_lock, flags);
+
+int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
++ unsigned long flags;
+ u8 irq;
-+
-+ if (dev->bus->number == 1)
-+ return 2;
++ uint idx;
++
++ /* external: use the irq of the pci core */
++ if (dev->bus->number >= 1) {
++ spin_lock_irqsave(&sbh_lock, flags);
++ idx = sb_coreidx(sbh);
++ sb_setcore(sbh, SB_PCI, 0);
++ irq = sb_irq(sbh);
++ sb_setcoreidx(sbh, idx);
++ spin_unlock_irqrestore(&sbh_lock, flags);
+
++ return irq + 2;
++ }
++
++ /* internal */
+ pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
+ return irq + 2;
+}
+
+ if (d->bus->number == 0)
+ return;
-+
++
+ printk("PCI: Fixing up device %s\n", pci_name(d));
+
+ /* Fix up resource bases */
+{
+ if (dev->bus->number != 1 || PCI_SLOT(dev->devfn) != 0)
+ return;
-+
++
+ printk("PCI: fixing up bridge\n");
+
+ /* Enable PCI bridge bus mastering and memory space */
+ pci_set_master(dev);
+ pcibios_enable_device(dev, ~0);
-+
++
+ /* Enable PCI bridge BAR1 prefetch and burst */
+ pci_write_config_dword(dev, PCI_BAR1_CONTROL, 3);
+}
+{
+ uint coreidx;
+ unsigned long flags;
-+
++
+ bcm47xx_fixup_device(dev);
+
+ /* These cores come out of reset enabled */
+ spin_lock_irqsave(&sbh_lock, flags);
+ coreidx = sb_coreidx(sbh);
+ if (sb_setcoreidx(sbh, PCI_SLOT(dev->devfn)) && (sb_coreid(sbh) == SB_USB)) {
-+ /*
++ /*
+ * The USB core requires a special bit to be set during core
+ * reset to enable host (OHCI) mode. Resetting the SB core in
+ * pcibios_enable_device() is a hack for compatibility with
+}
+
+DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, bcm47xx_fixup_bridge);
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/prom.c linux-2.6.16-owrt/arch/mips/bcm947xx/prom.c
---- linux-2.6.16/arch/mips/bcm947xx/prom.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/prom.c 2006-03-21 09:31:00.000000000 +0100
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/prom.c linux-2.6.19/arch/mips/bcm947xx/prom.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/prom.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/prom.c 2006-12-04 21:33:48.000000000 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+
+ /* Figure out memory size by finding aliases */
+ for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
-+ if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
++ if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
+ *(unsigned long *)(prom_init))
+ break;
+ }
+{
+ return 0;
+}
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/setup.c linux-2.6.16-owrt/arch/mips/bcm947xx/setup.c
---- linux-2.6.16/arch/mips/bcm947xx/setup.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/setup.c 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,158 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/setup.c linux-2.6.19/arch/mips/bcm947xx/setup.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/setup.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/setup.c 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
+
+extern void bcm47xx_pci_init(void);
+extern void bcm47xx_time_init(void);
-+extern void bcm47xx_timer_setup(struct irqaction *irq);
+void *sbh;
+spinlock_t sbh_lock = SPIN_LOCK_UNLOCKED;
+int boardflags;
+ uint baud_base;
+ uint reg_shift;
+ struct uart_port s;
-+
++
+ regs = port->regs;
+ irq = port->irq;
+ baud_base = port->baud_base;
+ s.membase = regs;
+ s.irq = irq + 2;
+ s.uartclk = baud_base;
-+ s.flags = ASYNC_BOOT_AUTOCONF;
++ s.flags = ASYNC_BOOT_AUTOCONF | UPF_SHARE_IRQ;
+ s.iotype = SERIAL_IO_MEM;
+ s.regshift = reg_shift;
+
+static void bcm47xx_machine_restart(char *command)
+{
+ printk("Please stand by while rebooting the system...\n");
-+
++
+ /* Set the watchdog timer to reset immediately */
+ local_irq_disable();
+ sb_watchdog(sbh, 1);
+ while (1);
+}
+
-+void __init plat_setup(void)
++void __init plat_mem_setup(void)
+{
+ char *s;
+ int i;
-+
++
+ sbh = (void *) sb_kattach();
+ sb_mips_init(sbh);
+
+ pm_power_off = bcm47xx_machine_halt;
+
+ board_time_init = bcm47xx_time_init;
-+ board_timer_setup = bcm47xx_timer_setup;
+}
+
+EXPORT_SYMBOL(sbh);
+EXPORT_SYMBOL(sbh_lock);
+EXPORT_SYMBOL(boardflags);
-diff -Nur linux-2.6.16/arch/mips/bcm947xx/time.c linux-2.6.16-owrt/arch/mips/bcm947xx/time.c
---- linux-2.6.16/arch/mips/bcm947xx/time.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/bcm947xx/time.c 2006-03-21 09:31:00.000000000 +0100
-@@ -0,0 +1,59 @@
+diff -urN linux-2.6.19.ref/arch/mips/bcm947xx/time.c linux-2.6.19/arch/mips/bcm947xx/time.c
+--- linux-2.6.19.ref/arch/mips/bcm947xx/time.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/arch/mips/bcm947xx/time.c 2006-12-04 21:33:48.000000000 +0100
+@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+ *
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
-+#include <linux/config.h>
++#include <linux/autoconf.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <asm/addrspace.h>
+#include <asm/io.h>
+#include <asm/time.h>
++#include <typedefs.h>
++#include <osl.h>
++#include <sbutils.h>
++#include <sbmips.h>
++
++extern sb_t *sbh;
+
+void __init
+bcm47xx_time_init(void)
+ write_c0_count(0);
+ write_c0_compare(0xffff);
+
-+ hz = 200 * 1000 * 1000;
++ hz = sb_cpu_clock(sbh);
+
+ /* Set MIPS counter frequency for fixed_rate_gettimeoffset() */
+ mips_hpt_frequency = hz / 2;
+}
+
+void __init
-+bcm47xx_timer_setup(struct irqaction *irq)
++plat_timer_setup(struct irqaction *irq)
+{
+ /* Enable the timer interrupt */
+ setup_irq(7, irq);
+}
-diff -Nur linux-2.6.16/arch/mips/Kconfig linux-2.6.16-owrt/arch/mips/Kconfig
---- linux-2.6.16/arch/mips/Kconfig 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/Kconfig 2006-03-21 09:31:00.000000000 +0100
-@@ -244,6 +244,17 @@
+diff -urN linux-2.6.19.ref/arch/mips/Kconfig linux-2.6.19/arch/mips/Kconfig
+--- linux-2.6.19.ref/arch/mips/Kconfig 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/arch/mips/Kconfig 2006-12-04 21:33:48.000000000 +0100
+@@ -222,6 +222,17 @@
Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
Olivetti M700-10 workstations.
+ Support for BCM947xx based boards
+
config LASAT
- bool "Support for LASAT Networks platforms"
+ bool "LASAT Networks platforms"
select DMA_NONCOHERENT
-diff -Nur linux-2.6.16/arch/mips/kernel/cpu-probe.c linux-2.6.16-owrt/arch/mips/kernel/cpu-probe.c
---- linux-2.6.16/arch/mips/kernel/cpu-probe.c 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/kernel/cpu-probe.c 2006-03-21 09:32:48.000000000 +0100
-@@ -678,6 +678,28 @@
+diff -urN linux-2.6.19.ref/arch/mips/kernel/cpu-probe.c linux-2.6.19/arch/mips/kernel/cpu-probe.c
+--- linux-2.6.19.ref/arch/mips/kernel/cpu-probe.c 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/arch/mips/kernel/cpu-probe.c 2006-12-04 21:33:48.000000000 +0100
+@@ -723,6 +723,28 @@
}
__init void cpu_probe(void)
{
struct cpuinfo_mips *c = ¤t_cpu_data;
-@@ -700,6 +722,9 @@
+@@ -745,6 +767,9 @@
case PRID_COMP_SIBYTE:
cpu_probe_sibyte(c);
break;
case PRID_COMP_SANDCRAFT:
cpu_probe_sandcraft(c);
break;
-diff -Nur linux-2.6.16/arch/mips/kernel/head.S linux-2.6.16-owrt/arch/mips/kernel/head.S
---- linux-2.6.16/arch/mips/kernel/head.S 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/kernel/head.S 2006-03-21 09:31:00.000000000 +0100
-@@ -107,6 +107,11 @@
- #endif
- .endm
+diff -urN linux-2.6.19.ref/arch/mips/kernel/head.S linux-2.6.19/arch/mips/kernel/head.S
+--- linux-2.6.19.ref/arch/mips/kernel/head.S 2006-12-04 21:30:35.000000000 +0100
++++ linux-2.6.19/arch/mips/kernel/head.S 2006-12-04 21:33:48.000000000 +0100
+@@ -133,6 +133,11 @@
+ j kernel_entry
+ nop
+#ifdef CONFIG_BCM4710
+#undef eret
/*
* Reserved space for exception handlers.
* Necessary for machines which link their kernels at KSEG0.
-diff -Nur linux-2.6.16/arch/mips/kernel/proc.c linux-2.6.16-owrt/arch/mips/kernel/proc.c
---- linux-2.6.16/arch/mips/kernel/proc.c 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/kernel/proc.c 2006-03-21 09:31:00.000000000 +0100
-@@ -82,6 +82,8 @@
+diff -urN linux-2.6.19.ref/arch/mips/kernel/proc.c linux-2.6.19/arch/mips/kernel/proc.c
+--- linux-2.6.19.ref/arch/mips/kernel/proc.c 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/arch/mips/kernel/proc.c 2006-12-04 21:33:48.000000000 +0100
+@@ -83,6 +83,8 @@
[CPU_VR4181] = "NEC VR4181",
[CPU_VR4181A] = "NEC VR4181A",
[CPU_SR71000] = "Sandcraft SR71000",
[CPU_PR4450] = "Philips PR4450",
};
-diff -Nur linux-2.6.16/arch/mips/Makefile linux-2.6.16-owrt/arch/mips/Makefile
---- linux-2.6.16/arch/mips/Makefile 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/Makefile 2006-03-21 09:31:00.000000000 +0100
-@@ -710,6 +710,13 @@
+diff -urN linux-2.6.19.ref/arch/mips/Makefile linux-2.6.19/arch/mips/Makefile
+--- linux-2.6.19.ref/arch/mips/Makefile 2006-12-04 21:31:44.000000000 +0100
++++ linux-2.6.19/arch/mips/Makefile 2006-12-04 21:33:48.000000000 +0100
+@@ -571,6 +571,13 @@
load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000
#
# SNI RM200 PCI
#
core-$(CONFIG_SNI_RM200_PCI) += arch/mips/sni/
-diff -Nur linux-2.6.16/arch/mips/mm/tlbex.c linux-2.6.16-owrt/arch/mips/mm/tlbex.c
---- linux-2.6.16/arch/mips/mm/tlbex.c 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/arch/mips/mm/tlbex.c 2006-03-21 09:31:00.000000000 +0100
-@@ -858,6 +858,8 @@
+diff -urN linux-2.6.19.ref/arch/mips/mm/tlbex.c linux-2.6.19/arch/mips/mm/tlbex.c
+--- linux-2.6.19.ref/arch/mips/mm/tlbex.c 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/arch/mips/mm/tlbex.c 2006-12-04 21:33:48.000000000 +0100
+@@ -880,6 +880,8 @@
case CPU_4KSC:
case CPU_20KC:
case CPU_25KF:
tlbw(p);
break;
-diff -Nur linux-2.6.16/include/asm-mips/bootinfo.h linux-2.6.16-owrt/include/asm-mips/bootinfo.h
---- linux-2.6.16/include/asm-mips/bootinfo.h 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/include/asm-mips/bootinfo.h 2006-03-21 09:31:00.000000000 +0100
-@@ -218,6 +218,12 @@
- #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
- #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
+diff -urN linux-2.6.19.ref/include/asm-mips/bootinfo.h linux-2.6.19/include/asm-mips/bootinfo.h
+--- linux-2.6.19.ref/include/asm-mips/bootinfo.h 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/include/asm-mips/bootinfo.h 2006-12-04 21:33:48.000000000 +0100
+@@ -212,6 +212,12 @@
+ #define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
+ #define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
+/*
+ * Valid machtype for group Broadcom
#define CL_SIZE COMMAND_LINE_SIZE
const char *get_system_type(void);
-diff -Nur linux-2.6.16/include/asm-mips/cpu.h linux-2.6.16-owrt/include/asm-mips/cpu.h
---- linux-2.6.16/include/asm-mips/cpu.h 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/include/asm-mips/cpu.h 2006-03-21 09:31:00.000000000 +0100
-@@ -102,6 +102,13 @@
+diff -urN linux-2.6.19.ref/include/asm-mips/cpu.h linux-2.6.19/include/asm-mips/cpu.h
+--- linux-2.6.19.ref/include/asm-mips/cpu.h 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/include/asm-mips/cpu.h 2006-12-04 21:33:48.000000000 +0100
+@@ -104,6 +104,13 @@
#define PRID_IMP_SR71000 0x0400
/*
* Definitions for 7:0 on legacy processors
*/
-@@ -196,7 +203,9 @@
- #define CPU_34K 60
- #define CPU_PR4450 61
+@@ -200,7 +207,9 @@
#define CPU_SB1A 62
--#define CPU_LAST 62
-+#define CPU_BCM3302 63
-+#define CPU_BCM4710 64
-+#define CPU_LAST 64
+ #define CPU_74K 63
+ #define CPU_R14000 64
+-#define CPU_LAST 64
++#define CPU_BCM3302 65
++#define CPU_BCM4710 66
++#define CPU_LAST 66
/*
* ISA Level encodings
-diff -Nur linux-2.6.16/include/linux/pci_ids.h linux-2.6.16-owrt/include/linux/pci_ids.h
---- linux-2.6.16/include/linux/pci_ids.h 2006-03-20 06:53:29.000000000 +0100
-+++ linux-2.6.16-owrt/include/linux/pci_ids.h 2006-03-21 09:31:00.000000000 +0100
-@@ -1885,6 +1885,7 @@
- #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e
+diff -urN linux-2.6.19.ref/include/linux/pci_ids.h linux-2.6.19/include/linux/pci_ids.h
+--- linux-2.6.19.ref/include/linux/pci_ids.h 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/include/linux/pci_ids.h 2006-12-04 21:33:48.000000000 +0100
+@@ -1950,6 +1950,7 @@
+ #define PCI_DEVICE_ID_TIGON3_5906M 0x1713
#define PCI_DEVICE_ID_BCM4401 0x4401
#define PCI_DEVICE_ID_BCM4401B0 0x4402
+#define PCI_DEVICE_ID_BCM4713 0x4713
#define PCI_VENDOR_ID_TOPIC 0x151f
#define PCI_DEVICE_ID_TOPIC_TP560 0x0000
+diff -urN linux-2.6.19.ref/lib/kobject_uevent.c linux-2.6.19/lib/kobject_uevent.c
+--- linux-2.6.19.ref/lib/kobject_uevent.c 2006-11-29 22:57:37.000000000 +0100
++++ linux-2.6.19/lib/kobject_uevent.c 2006-12-04 21:33:48.000000000 +0100
+@@ -29,6 +29,7 @@
+ u64 uevent_seqnum;
+ char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
+ static DEFINE_SPINLOCK(sequence_lock);
++EXPORT_SYMBOL(uevent_helper);
+ #if defined(CONFIG_NET)
+ static struct sock *uevent_sock;
+ #endif