add Id tag, standardize
[openwrt.git] / target / linux / linux-2.6 / patches / brcm / 001-bcm947xx.patch
index 538ef69..739590b 100644 (file)
@@ -1,6 +1,6 @@
 diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
 diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
---- linux.old/arch/mips/Kconfig        2005-12-15 13:26:49.758027500 +0100
-+++ linux.dev/arch/mips/Kconfig        2005-12-15 12:57:27.889182500 +0100
+--- linux.old/arch/mips/Kconfig        2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/arch/mips/Kconfig        2005-12-28 16:37:32.810257250 +0100
 @@ -244,6 +244,17 @@
         Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
         Olivetti M700-10 workstations.
 @@ -244,6 +244,17 @@
         Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
         Olivetti M700-10 workstations.
@@ -20,8 +20,8 @@ diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig
        bool "Support for LASAT Networks platforms"
        select DMA_NONCOHERENT
 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
        bool "Support for LASAT Networks platforms"
        select DMA_NONCOHERENT
 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
---- linux.old/arch/mips/Makefile       2005-12-15 13:26:49.766024000 +0100
-+++ linux.dev/arch/mips/Makefile       2005-12-15 12:57:27.921168500 +0100
+--- linux.old/arch/mips/Makefile       2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/arch/mips/Makefile       2005-12-28 16:37:32.814257500 +0100
 @@ -689,6 +689,13 @@
  load-$(CONFIG_SIBYTE_BIGSUR)  := 0xffffffff80100000
  
 @@ -689,6 +689,13 @@
  load-$(CONFIG_SIBYTE_BIGSUR)  := 0xffffffff80100000
  
@@ -38,7 +38,7 @@ diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
  core-$(CONFIG_SNI_RM200_PCI)  += arch/mips/sni/
 diff -urN linux.old/arch/mips/bcm947xx/Makefile linux.dev/arch/mips/bcm947xx/Makefile
 --- linux.old/arch/mips/bcm947xx/Makefile      1970-01-01 01:00:00.000000000 +0100
  core-$(CONFIG_SNI_RM200_PCI)  += arch/mips/sni/
 diff -urN linux.old/arch/mips/bcm947xx/Makefile linux.dev/arch/mips/bcm947xx/Makefile
 --- linux.old/arch/mips/bcm947xx/Makefile      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/Makefile      2005-12-15 14:32:03.580639500 +0100
++++ linux.dev/arch/mips/bcm947xx/Makefile      2005-12-28 16:37:32.814257500 +0100
 @@ -0,0 +1,6 @@
 +#
 +# Makefile for the BCM47xx specific kernel interface routines
 @@ -0,0 +1,6 @@
 +#
 +# Makefile for the BCM47xx specific kernel interface routines
@@ -48,7 +48,7 @@ diff -urN linux.old/arch/mips/bcm947xx/Makefile linux.dev/arch/mips/bcm947xx/Mak
 +obj-y := irq.o int-handler.o prom.o setup.o time.o pci.o
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/Makefile linux.dev/arch/mips/bcm947xx/broadcom/Makefile
 --- linux.old/arch/mips/bcm947xx/broadcom/Makefile     1970-01-01 01:00:00.000000000 +0100
 +obj-y := irq.o int-handler.o prom.o setup.o time.o pci.o
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/Makefile linux.dev/arch/mips/bcm947xx/broadcom/Makefile
 --- linux.old/arch/mips/bcm947xx/broadcom/Makefile     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/Makefile     2005-12-17 20:51:17.749271000 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/Makefile     2005-12-28 16:37:32.814257500 +0100
 @@ -0,0 +1,6 @@
 +#
 +# Makefile for the BCM47xx specific kernel interface routines
 @@ -0,0 +1,6 @@
 +#
 +# Makefile for the BCM47xx specific kernel interface routines
@@ -58,7 +58,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/Makefile linux.dev/arch/mips/bcm
 +obj-y := sbutils.o linux_osl.o bcmsrom.o bcmutils.o sbmips.o sbpci.o sflash.o nvram.o cfe_env.o
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/bcmsrom.c linux.dev/arch/mips/bcm947xx/broadcom/bcmsrom.c
 --- linux.old/arch/mips/bcm947xx/broadcom/bcmsrom.c    1970-01-01 01:00:00.000000000 +0100
 +obj-y := sbutils.o linux_osl.o bcmsrom.o bcmutils.o sbmips.o sbpci.o sflash.o nvram.o cfe_env.o
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/bcmsrom.c linux.dev/arch/mips/bcm947xx/broadcom/bcmsrom.c
 --- linux.old/arch/mips/bcm947xx/broadcom/bcmsrom.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/bcmsrom.c    2005-12-17 01:21:23.007883000 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/bcmsrom.c    2005-12-28 16:37:32.814257500 +0100
 @@ -0,0 +1,481 @@
 +/*
 + *  Misc useful routines to access NIC SROM/OTP .
 @@ -0,0 +1,481 @@
 +/*
 + *  Misc useful routines to access NIC SROM/OTP .
@@ -543,7 +543,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/bcmsrom.c linux.dev/arch/mips/bc
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/bcmutils.c linux.dev/arch/mips/bcm947xx/broadcom/bcmutils.c
 --- linux.old/arch/mips/bcm947xx/broadcom/bcmutils.c   1970-01-01 01:00:00.000000000 +0100
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/bcmutils.c linux.dev/arch/mips/bcm947xx/broadcom/bcmutils.c
 --- linux.old/arch/mips/bcm947xx/broadcom/bcmutils.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/bcmutils.c   2005-12-17 17:53:52.387365000 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/bcmutils.c   2005-12-28 16:37:32.814257500 +0100
 @@ -0,0 +1,356 @@
 +/*
 + * Misc useful OS-independent routines.
 @@ -0,0 +1,356 @@
 +/*
 + * Misc useful OS-independent routines.
@@ -903,7 +903,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/bcmutils.c linux.dev/arch/mips/b
 +#endif
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/cfe_env.c linux.dev/arch/mips/bcm947xx/broadcom/cfe_env.c
 --- linux.old/arch/mips/bcm947xx/broadcom/cfe_env.c    1970-01-01 01:00:00.000000000 +0100
 +#endif
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/cfe_env.c linux.dev/arch/mips/bcm947xx/broadcom/cfe_env.c
 --- linux.old/arch/mips/bcm947xx/broadcom/cfe_env.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/cfe_env.c    2005-12-17 21:40:08.166726750 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/cfe_env.c    2005-12-28 16:37:32.818257750 +0100
 @@ -0,0 +1,234 @@
 +/*
 + * NVRAM variable manipulation (Linux kernel half)
 @@ -0,0 +1,234 @@
 +/*
 + * NVRAM variable manipulation (Linux kernel half)
@@ -1141,7 +1141,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/cfe_env.c linux.dev/arch/mips/bc
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/linux_osl.c linux.dev/arch/mips/bcm947xx/broadcom/linux_osl.c
 --- linux.old/arch/mips/bcm947xx/broadcom/linux_osl.c  1970-01-01 01:00:00.000000000 +0100
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/linux_osl.c linux.dev/arch/mips/bcm947xx/broadcom/linux_osl.c
 --- linux.old/arch/mips/bcm947xx/broadcom/linux_osl.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/linux_osl.c  2005-12-15 17:11:05.818041750 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/linux_osl.c  2005-12-28 16:37:32.834258750 +0100
 @@ -0,0 +1,102 @@
 +/*
 + * Linux OS Independent Layer
 @@ -0,0 +1,102 @@
 +/*
 + * Linux OS Independent Layer
@@ -1247,8 +1247,8 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/linux_osl.c linux.dev/arch/mips/
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/nvram.c linux.dev/arch/mips/bcm947xx/broadcom/nvram.c
 --- linux.old/arch/mips/bcm947xx/broadcom/nvram.c      1970-01-01 01:00:00.000000000 +0100
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/nvram.c linux.dev/arch/mips/bcm947xx/broadcom/nvram.c
 --- linux.old/arch/mips/bcm947xx/broadcom/nvram.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/nvram.c      2005-12-17 21:41:45.656819500 +0100
-@@ -0,0 +1,165 @@
++++ linux.dev/arch/mips/bcm947xx/broadcom/nvram.c      2005-12-28 19:30:54.804469750 +0100
+@@ -0,0 +1,192 @@
 +/*
 + * NVRAM variable manipulation (Linux kernel half)
 + *
 +/*
 + * NVRAM variable manipulation (Linux kernel half)
 + *
@@ -1294,7 +1294,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/nvram.c linux.dev/arch/mips/bcm9
 +extern spinlock_t bcm947xx_sbh_lock;
 +static int cfe_env;
 +
 +extern spinlock_t bcm947xx_sbh_lock;
 +static int cfe_env;
 +
-+extern char *cfe_env_get(unsigned char *nv_buf, char *name);
++extern char *cfe_env_get(char *nv_buf, const char *name);
 +              
 +
 +/* Convenience */
 +              
 +
 +/* Convenience */
@@ -1383,7 +1383,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/nvram.c linux.dev/arch/mips/bcm9
 +}
 +
 +/* Early (before mm or mtd) read-only access to NVRAM */
 +}
 +
 +/* Early (before mm or mtd) read-only access to NVRAM */
-+char * __init nvram_get(const char *name)
++char * __init early_nvram_get(const char *name)
 +{
 +      char *var, *value, *end, *eq;
 +
 +{
 +      char *var, *value, *end, *eq;
 +
@@ -1414,9 +1414,36 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/nvram.c linux.dev/arch/mips/bcm9
 +
 +      return NULL;
 +}
 +
 +      return NULL;
 +}
++
++char *nvram_get(const char *name)
++{
++      char *var, *value, *end, *eq;
++
++      if (!name)
++              return NULL;
++
++      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;
++      end[0] = end[1] = '\0';
++      for (; *var; var = value + strlen(value) + 1) {
++              if (!(eq = strchr(var, '=')))
++                      break;
++              value = eq + 1;
++              if ((eq - var) == strlen(name) && strncmp(var, name, (eq - var)) == 0)
++                      return value;
++      }
++      
++      return NULL;
++}
++
++EXPORT_SYMBOL(nvram_get);
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm947xx/broadcom/sbmips.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sbmips.c     1970-01-01 01:00:00.000000000 +0100
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm947xx/broadcom/sbmips.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sbmips.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/sbmips.c     2005-12-15 16:46:31.122961250 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/sbmips.c     2005-12-28 19:19:50.570957750 +0100
 @@ -0,0 +1,1038 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane MIPS core routines
 @@ -0,0 +1,1038 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane MIPS core routines
@@ -1836,7 +1863,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm
 +              BCMINIT(sb_setirq)(sbh, 3, SB_ILINE20, 0);
 +              BCMINIT(sb_setirq)(sbh, 4, SB_PCI, 0);
 +              ASSERT(eir);
 +              BCMINIT(sb_setirq)(sbh, 3, SB_ILINE20, 0);
 +              BCMINIT(sb_setirq)(sbh, 4, SB_PCI, 0);
 +              ASSERT(eir);
-+              value = BCMINIT(nvram_get)("et0phyaddr");
++              value = BCMINIT(early_nvram_get)("et0phyaddr");
 +              if (value && !strcmp(value, "31")) {
 +                      /* Enable internal UART */
 +                      W_REG(&eir->corecontrol, CC_UE);
 +              if (value && !strcmp(value, "31")) {
 +                      /* Enable internal UART */
 +                      W_REG(&eir->corecontrol, CC_UE);
@@ -2458,8 +2485,8 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbpci.c linux.dev/arch/mips/bcm947xx/broadcom/sbpci.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sbpci.c      1970-01-01 01:00:00.000000000 +0100
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbpci.c linux.dev/arch/mips/bcm947xx/broadcom/sbpci.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sbpci.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/sbpci.c      2005-12-15 23:50:31.846688500 +0100
-@@ -0,0 +1,531 @@
++++ linux.dev/arch/mips/bcm947xx/broadcom/sbpci.c      2005-12-28 16:37:32.854260000 +0100
+@@ -0,0 +1,533 @@
 +/*
 + * Low-Level PCI and SB support for BCM47xx
 + *
 +/*
 + * Low-Level PCI and SB support for BCM47xx
 + *
@@ -2873,9 +2900,11 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbpci.c linux.dev/arch/mips/bcm9
 +                      subclass = PCI_MEMORY_RAM;
 +                      break;
 +              case SB_PCI:
 +                      subclass = PCI_MEMORY_RAM;
 +                      break;
 +              case SB_PCI:
++#if 0
 +                      class = PCI_CLASS_BRIDGE;
 +                      subclass = PCI_BRIDGE_PCI;
 +                      break;
 +                      class = PCI_CLASS_BRIDGE;
 +                      subclass = PCI_BRIDGE_PCI;
 +                      break;
++#endif
 +              case SB_MIPS:
 +              case SB_MIPS33:
 +                      class = PCI_CLASS_CPU;
 +              case SB_MIPS:
 +              case SB_MIPS33:
 +                      class = PCI_CLASS_CPU;
@@ -2993,7 +3022,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbpci.c linux.dev/arch/mips/bcm9
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbutils.c linux.dev/arch/mips/bcm947xx/broadcom/sbutils.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sbutils.c    1970-01-01 01:00:00.000000000 +0100
 +
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbutils.c linux.dev/arch/mips/bcm947xx/broadcom/sbutils.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sbutils.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/sbutils.c    2005-12-17 01:21:12.951254500 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/sbutils.c    2005-12-28 16:37:32.858260250 +0100
 @@ -0,0 +1,2370 @@
 +/*
 + * Misc utility routines for accessing chip-specific features
 @@ -0,0 +1,2370 @@
 +/*
 + * Misc utility routines for accessing chip-specific features
@@ -5367,7 +5396,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbutils.c linux.dev/arch/mips/bc
 +EXPORT_SYMBOL(sb_watchdog);
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sflash.c linux.dev/arch/mips/bcm947xx/broadcom/sflash.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sflash.c     1970-01-01 01:00:00.000000000 +0100
 +EXPORT_SYMBOL(sb_watchdog);
 diff -urN linux.old/arch/mips/bcm947xx/broadcom/sflash.c linux.dev/arch/mips/bcm947xx/broadcom/sflash.c
 --- linux.old/arch/mips/bcm947xx/broadcom/sflash.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/broadcom/sflash.c     2005-12-15 16:59:20.045933750 +0100
++++ linux.dev/arch/mips/bcm947xx/broadcom/sflash.c     2005-12-28 16:37:32.870261000 +0100
 @@ -0,0 +1,418 @@
 +/*
 + * Broadcom SiliconBackplane chipcommon serial flash interface
 @@ -0,0 +1,418 @@
 +/*
 + * Broadcom SiliconBackplane chipcommon serial flash interface
@@ -5789,7 +5818,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sflash.c linux.dev/arch/mips/bcm
 +
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmdevs.h linux.dev/arch/mips/bcm947xx/include/bcmdevs.h
 --- linux.old/arch/mips/bcm947xx/include/bcmdevs.h     1970-01-01 01:00:00.000000000 +0100
 +
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmdevs.h linux.dev/arch/mips/bcm947xx/include/bcmdevs.h
 --- linux.old/arch/mips/bcm947xx/include/bcmdevs.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/bcmdevs.h     2005-12-15 15:25:24.905340500 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmdevs.h     2005-12-28 16:37:32.874261250 +0100
 @@ -0,0 +1,391 @@
 +/*
 + * Broadcom device-specific manifest constants.
 @@ -0,0 +1,391 @@
 +/*
 + * Broadcom device-specific manifest constants.
@@ -6184,7 +6213,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmdevs.h linux.dev/arch/mips/bcm
 +#endif /* _BCMDEVS_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmendian.h linux.dev/arch/mips/bcm947xx/include/bcmendian.h
 --- linux.old/arch/mips/bcm947xx/include/bcmendian.h   1970-01-01 01:00:00.000000000 +0100
 +#endif /* _BCMDEVS_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmendian.h linux.dev/arch/mips/bcm947xx/include/bcmendian.h
 --- linux.old/arch/mips/bcm947xx/include/bcmendian.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/bcmendian.h   2005-12-15 15:25:47.146730500 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmendian.h   2005-12-28 16:37:32.874261250 +0100
 @@ -0,0 +1,152 @@
 +/*
 + * local version of endian.h - byte order defines
 @@ -0,0 +1,152 @@
 +/*
 + * local version of endian.h - byte order defines
@@ -6340,8 +6369,8 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmendian.h linux.dev/arch/mips/b
 +#endif /* _BCMENDIAN_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bcm947xx/include/bcmnvram.h
 --- linux.old/arch/mips/bcm947xx/include/bcmnvram.h    1970-01-01 01:00:00.000000000 +0100
 +#endif /* _BCMENDIAN_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bcm947xx/include/bcmnvram.h
 --- linux.old/arch/mips/bcm947xx/include/bcmnvram.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/bcmnvram.h    2005-12-15 16:04:35.850827500 +0100
-@@ -0,0 +1,87 @@
++++ linux.dev/arch/mips/bcm947xx/include/bcmnvram.h    2005-12-28 19:28:28.399320000 +0100
+@@ -0,0 +1,95 @@
 +/*
 + * NVRAM variable manipulation
 + *
 +/*
 + * NVRAM variable manipulation
 + *
@@ -6383,14 +6412,22 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bc
 + * @param     name    name of variable to get
 + * @return    value of variable or NULL if undefined
 + */
 + * @param     name    name of variable to get
 + * @return    value of variable or NULL if undefined
 + */
-+extern char * __init nvram_get(const char *name);
++extern char * __init early_nvram_get(const char *name);
++
++/*
++ * Get the value of an NVRAM variable. The pointer returned may be
++ * invalid after a set.
++ * @param     name    name of variable to get
++ * @return    value of variable or NULL if undefined
++ */
++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
 + */
 +
 +/* 
 + * Get the value of an NVRAM variable.
 + * @param     name    name of variable to get
 + * @return    value of variable or NUL if undefined
 + */
-+#define nvram_safe_get(name) (BCMINIT(nvram_get)(name) ? : "")
++#define nvram_safe_get(name) (BCMINIT(early_nvram_get)(name) ? : "")
 +
 +/*
 + * Match an NVRAM variable.
 +
 +/*
 + * Match an NVRAM variable.
@@ -6401,7 +6438,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bc
 + */
 +static inline int
 +nvram_match(char *name, char *match) {
 + */
 +static inline int
 +nvram_match(char *name, char *match) {
-+      const char *value = BCMINIT(nvram_get)(name);
++      const char *value = BCMINIT(early_nvram_get)(name);
 +      return (value && !strcmp(value, match));
 +}
 +
 +      return (value && !strcmp(value, match));
 +}
 +
@@ -6414,7 +6451,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bc
 + */
 +static inline int
 +nvram_invmatch(char *name, char *invmatch) {
 + */
 +static inline int
 +nvram_invmatch(char *name, char *invmatch) {
-+      const char *value = BCMINIT(nvram_get)(name);
++      const char *value = BCMINIT(early_nvram_get)(name);
 +      return (value && strcmp(value, invmatch));
 +}
 +
 +      return (value && strcmp(value, invmatch));
 +}
 +
@@ -6431,7 +6468,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmnvram.h linux.dev/arch/mips/bc
 +#endif /* _bcmnvram_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmsrom.h linux.dev/arch/mips/bcm947xx/include/bcmsrom.h
 --- linux.old/arch/mips/bcm947xx/include/bcmsrom.h     1970-01-01 01:00:00.000000000 +0100
 +#endif /* _bcmnvram_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmsrom.h linux.dev/arch/mips/bcm947xx/include/bcmsrom.h
 --- linux.old/arch/mips/bcm947xx/include/bcmsrom.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/bcmsrom.h     2005-12-15 15:34:32.919589250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmsrom.h     2005-12-28 16:37:32.874261250 +0100
 @@ -0,0 +1,23 @@
 +/*
 + * Misc useful routines to access NIC local SROM/OTP .
 @@ -0,0 +1,23 @@
 +/*
 + * Misc useful routines to access NIC local SROM/OTP .
@@ -6458,7 +6495,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmsrom.h linux.dev/arch/mips/bcm
 +#endif        /* _bcmsrom_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmutils.h linux.dev/arch/mips/bcm947xx/include/bcmutils.h
 --- linux.old/arch/mips/bcm947xx/include/bcmutils.h    1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _bcmsrom_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bcmutils.h linux.dev/arch/mips/bcm947xx/include/bcmutils.h
 --- linux.old/arch/mips/bcm947xx/include/bcmutils.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/bcmutils.h    2005-12-15 16:44:25.619117750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bcmutils.h    2005-12-28 16:37:32.874261250 +0100
 @@ -0,0 +1,308 @@
 +/*
 + * Misc useful os-independent macros and functions.
 @@ -0,0 +1,308 @@
 +/*
 + * Misc useful os-independent macros and functions.
@@ -6770,7 +6807,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bcmutils.h linux.dev/arch/mips/bc
 +#endif        /* _bcmutils_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bitfuncs.h linux.dev/arch/mips/bcm947xx/include/bitfuncs.h
 --- linux.old/arch/mips/bcm947xx/include/bitfuncs.h    1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _bcmutils_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/bitfuncs.h linux.dev/arch/mips/bcm947xx/include/bitfuncs.h
 --- linux.old/arch/mips/bcm947xx/include/bitfuncs.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/bitfuncs.h    2005-12-15 15:34:40.268048500 +0100
++++ linux.dev/arch/mips/bcm947xx/include/bitfuncs.h    2005-12-28 16:37:32.874261250 +0100
 @@ -0,0 +1,85 @@
 +/*
 + * bit manipulation utility functions
 @@ -0,0 +1,85 @@
 +/*
 + * bit manipulation utility functions
@@ -6859,7 +6896,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/bitfuncs.h linux.dev/arch/mips/bc
 +#endif /* _BITFUNCS_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/flash.h linux.dev/arch/mips/bcm947xx/include/flash.h
 --- linux.old/arch/mips/bcm947xx/include/flash.h       1970-01-01 01:00:00.000000000 +0100
 +#endif /* _BITFUNCS_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/flash.h linux.dev/arch/mips/bcm947xx/include/flash.h
 --- linux.old/arch/mips/bcm947xx/include/flash.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/flash.h       2005-12-15 15:34:44.280299250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/flash.h       2005-12-28 16:37:32.874261250 +0100
 @@ -0,0 +1,188 @@
 +/*
 + * flash.h: Common definitions for flash access.
 @@ -0,0 +1,188 @@
 +/*
 + * flash.h: Common definitions for flash access.
@@ -7051,7 +7088,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/flash.h linux.dev/arch/mips/bcm94
 +#endif
 diff -urN linux.old/arch/mips/bcm947xx/include/flashutl.h linux.dev/arch/mips/bcm947xx/include/flashutl.h
 --- linux.old/arch/mips/bcm947xx/include/flashutl.h    1970-01-01 01:00:00.000000000 +0100
 +#endif
 diff -urN linux.old/arch/mips/bcm947xx/include/flashutl.h linux.dev/arch/mips/bcm947xx/include/flashutl.h
 --- linux.old/arch/mips/bcm947xx/include/flashutl.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/flashutl.h    2005-12-15 15:34:48.160541750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/flashutl.h    2005-12-28 16:37:32.878261500 +0100
 @@ -0,0 +1,27 @@
 +/*
 + * BCM47XX FLASH driver interface
 @@ -0,0 +1,27 @@
 +/*
 + * BCM47XX FLASH driver interface
@@ -7082,7 +7119,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/flashutl.h linux.dev/arch/mips/bc
 +#endif /* _flashutl_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/hndmips.h linux.dev/arch/mips/bcm947xx/include/hndmips.h
 --- linux.old/arch/mips/bcm947xx/include/hndmips.h     1970-01-01 01:00:00.000000000 +0100
 +#endif /* _flashutl_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/hndmips.h linux.dev/arch/mips/bcm947xx/include/hndmips.h
 --- linux.old/arch/mips/bcm947xx/include/hndmips.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/hndmips.h     2005-12-15 15:34:53.396869000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/hndmips.h     2005-12-28 16:37:32.878261500 +0100
 @@ -0,0 +1,16 @@
 +/*
 + * Alternate include file for HND sbmips.h since CFE also ships with
 @@ -0,0 +1,16 @@
 +/*
 + * Alternate include file for HND sbmips.h since CFE also ships with
@@ -7102,7 +7139,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/hndmips.h linux.dev/arch/mips/bcm
 +#include "sbmips.h"
 diff -urN linux.old/arch/mips/bcm947xx/include/linux_osl.h linux.dev/arch/mips/bcm947xx/include/linux_osl.h
 --- linux.old/arch/mips/bcm947xx/include/linux_osl.h   1970-01-01 01:00:00.000000000 +0100
 +#include "sbmips.h"
 diff -urN linux.old/arch/mips/bcm947xx/include/linux_osl.h linux.dev/arch/mips/bcm947xx/include/linux_osl.h
 --- linux.old/arch/mips/bcm947xx/include/linux_osl.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/linux_osl.h   2005-12-15 17:23:39.225126750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/linux_osl.h   2005-12-28 16:37:32.878261500 +0100
 @@ -0,0 +1,331 @@
 +/*
 + * Linux OS Independent Layer
 @@ -0,0 +1,331 @@
 +/*
 + * Linux OS Independent Layer
@@ -7437,7 +7474,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/linux_osl.h linux.dev/arch/mips/b
 +#endif        /* _linux_osl_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/linuxver.h linux.dev/arch/mips/bcm947xx/include/linuxver.h
 --- linux.old/arch/mips/bcm947xx/include/linuxver.h    1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _linux_osl_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/linuxver.h linux.dev/arch/mips/bcm947xx/include/linuxver.h
 --- linux.old/arch/mips/bcm947xx/include/linuxver.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/linuxver.h    2005-12-15 16:02:45.467929000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/linuxver.h    2005-12-28 16:37:32.878261500 +0100
 @@ -0,0 +1,389 @@
 +/*
 + * Linux-specific abstractions to gain some independence from linux kernel versions.
 @@ -0,0 +1,389 @@
 +/*
 + * Linux-specific abstractions to gain some independence from linux kernel versions.
@@ -7830,7 +7867,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/linuxver.h linux.dev/arch/mips/bc
 +#endif /* _linuxver_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/mipsinc.h linux.dev/arch/mips/bcm947xx/include/mipsinc.h
 --- linux.old/arch/mips/bcm947xx/include/mipsinc.h     1970-01-01 01:00:00.000000000 +0100
 +#endif /* _linuxver_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/mipsinc.h linux.dev/arch/mips/bcm947xx/include/mipsinc.h
 --- linux.old/arch/mips/bcm947xx/include/mipsinc.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/mipsinc.h     2005-12-15 16:47:29.886633750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/mipsinc.h     2005-12-28 16:37:32.878261500 +0100
 @@ -0,0 +1,552 @@
 +/*
 + * HND Run Time Environment for standalone MIPS programs.
 @@ -0,0 +1,552 @@
 +/*
 + * HND Run Time Environment for standalone MIPS programs.
@@ -8386,7 +8423,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/mipsinc.h linux.dev/arch/mips/bcm
 +#endif        /* _MISPINC_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/osl.h linux.dev/arch/mips/bcm947xx/include/osl.h
 --- linux.old/arch/mips/bcm947xx/include/osl.h 1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _MISPINC_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/osl.h linux.dev/arch/mips/bcm947xx/include/osl.h
 --- linux.old/arch/mips/bcm947xx/include/osl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/osl.h 2005-12-15 15:35:08.321801750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/osl.h 2005-12-28 16:37:32.878261500 +0100
 @@ -0,0 +1,42 @@
 +/*
 + * OS Abstraction Layer
 @@ -0,0 +1,42 @@
 +/*
 + * OS Abstraction Layer
@@ -8432,7 +8469,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/osl.h linux.dev/arch/mips/bcm947x
 +#endif        /* _osl_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/pcicfg.h linux.dev/arch/mips/bcm947xx/include/pcicfg.h
 --- linux.old/arch/mips/bcm947xx/include/pcicfg.h      1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _osl_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/pcicfg.h linux.dev/arch/mips/bcm947xx/include/pcicfg.h
 --- linux.old/arch/mips/bcm947xx/include/pcicfg.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/pcicfg.h      2005-12-15 15:36:31.719013750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/pcicfg.h      2005-12-28 16:37:32.882261750 +0100
 @@ -0,0 +1,398 @@
 +/*
 + * pcicfg.h: PCI configuration  constants and structures.
 @@ -0,0 +1,398 @@
 +/*
 + * pcicfg.h: PCI configuration  constants and structures.
@@ -8834,7 +8871,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/pcicfg.h linux.dev/arch/mips/bcm9
 +#endif
 diff -urN linux.old/arch/mips/bcm947xx/include/proto/ethernet.h linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h
 --- linux.old/arch/mips/bcm947xx/include/proto/ethernet.h      1970-01-01 01:00:00.000000000 +0100
 +#endif
 diff -urN linux.old/arch/mips/bcm947xx/include/proto/ethernet.h linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h
 --- linux.old/arch/mips/bcm947xx/include/proto/ethernet.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h      2005-12-15 12:57:27.869191250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h      2005-12-28 16:37:32.882261750 +0100
 @@ -0,0 +1,145 @@
 +/*******************************************************************************
 + * $Id$
 @@ -0,0 +1,145 @@
 +/*******************************************************************************
 + * $Id$
@@ -8983,7 +9020,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/proto/ethernet.h linux.dev/arch/m
 +#endif /* _NET_ETHERNET_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/s5.h linux.dev/arch/mips/bcm947xx/include/s5.h
 --- linux.old/arch/mips/bcm947xx/include/s5.h  1970-01-01 01:00:00.000000000 +0100
 +#endif /* _NET_ETHERNET_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/s5.h linux.dev/arch/mips/bcm947xx/include/s5.h
 --- linux.old/arch/mips/bcm947xx/include/s5.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/s5.h  2005-12-15 12:57:27.869191250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/s5.h  2005-12-28 16:37:32.882261750 +0100
 @@ -0,0 +1,103 @@
 +#ifndef _S5_H_
 +#define _S5_H_
 @@ -0,0 +1,103 @@
 +#ifndef _S5_H_
 +#define _S5_H_
@@ -9090,7 +9127,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/s5.h linux.dev/arch/mips/bcm947xx
 +#endif /*!_S5_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbchipc.h linux.dev/arch/mips/bcm947xx/include/sbchipc.h
 --- linux.old/arch/mips/bcm947xx/include/sbchipc.h     1970-01-01 01:00:00.000000000 +0100
 +#endif /*!_S5_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbchipc.h linux.dev/arch/mips/bcm947xx/include/sbchipc.h
 --- linux.old/arch/mips/bcm947xx/include/sbchipc.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbchipc.h     2005-12-15 15:35:20.458560250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbchipc.h     2005-12-28 16:37:32.882261750 +0100
 @@ -0,0 +1,440 @@
 +/*
 + * SiliconBackplane Chipcommon core hardware definitions.
 @@ -0,0 +1,440 @@
 +/*
 + * SiliconBackplane Chipcommon core hardware definitions.
@@ -9534,7 +9571,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbchipc.h linux.dev/arch/mips/bcm
 +#endif        /* _SBCHIPC_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbconfig.h linux.dev/arch/mips/bcm947xx/include/sbconfig.h
 --- linux.old/arch/mips/bcm947xx/include/sbconfig.h    1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBCHIPC_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbconfig.h linux.dev/arch/mips/bcm947xx/include/sbconfig.h
 --- linux.old/arch/mips/bcm947xx/include/sbconfig.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbconfig.h    2005-12-15 15:35:24.538815250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbconfig.h    2005-12-28 16:37:32.898262750 +0100
 @@ -0,0 +1,342 @@
 +/*
 + * Broadcom SiliconBackplane hardware register definitions.
 @@ -0,0 +1,342 @@
 +/*
 + * Broadcom SiliconBackplane hardware register definitions.
@@ -9880,7 +9917,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbconfig.h linux.dev/arch/mips/bc
 +#endif        /* _SBCONFIG_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbextif.h linux.dev/arch/mips/bcm947xx/include/sbextif.h
 --- linux.old/arch/mips/bcm947xx/include/sbextif.h     1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBCONFIG_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbextif.h linux.dev/arch/mips/bcm947xx/include/sbextif.h
 --- linux.old/arch/mips/bcm947xx/include/sbextif.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbextif.h     2005-12-15 16:48:55.651993750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbextif.h     2005-12-28 16:37:32.898262750 +0100
 @@ -0,0 +1,242 @@
 +/*
 + * Hardware-specific External Interface I/O core definitions
 @@ -0,0 +1,242 @@
 +/*
 + * Hardware-specific External Interface I/O core definitions
@@ -10126,7 +10163,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbextif.h linux.dev/arch/mips/bcm
 +#endif        /* _SBEXTIF_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbmemc.h linux.dev/arch/mips/bcm947xx/include/sbmemc.h
 --- linux.old/arch/mips/bcm947xx/include/sbmemc.h      1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBEXTIF_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbmemc.h linux.dev/arch/mips/bcm947xx/include/sbmemc.h
 --- linux.old/arch/mips/bcm947xx/include/sbmemc.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbmemc.h      2005-12-15 15:35:31.567254500 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbmemc.h      2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,148 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane DDR/SDRAM controller core hardware definitions.
 @@ -0,0 +1,148 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane DDR/SDRAM controller core hardware definitions.
@@ -10278,7 +10315,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbmemc.h linux.dev/arch/mips/bcm9
 +#endif        /* _SBMEMC_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbmips.h linux.dev/arch/mips/bcm947xx/include/sbmips.h
 --- linux.old/arch/mips/bcm947xx/include/sbmips.h      1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBMEMC_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbmips.h linux.dev/arch/mips/bcm947xx/include/sbmips.h
 --- linux.old/arch/mips/bcm947xx/include/sbmips.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbmips.h      2005-12-15 16:46:57.616617000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbmips.h      2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,62 @@
 +/*
 + * Broadcom SiliconBackplane MIPS definitions
 @@ -0,0 +1,62 @@
 +/*
 + * Broadcom SiliconBackplane MIPS definitions
@@ -10344,7 +10381,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbmips.h linux.dev/arch/mips/bcm9
 +#endif        /* _SBMIPS_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbpci.h linux.dev/arch/mips/bcm947xx/include/sbpci.h
 --- linux.old/arch/mips/bcm947xx/include/sbpci.h       1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBMIPS_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbpci.h linux.dev/arch/mips/bcm947xx/include/sbpci.h
 --- linux.old/arch/mips/bcm947xx/include/sbpci.h       1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbpci.h       2005-12-15 15:35:36.795581250 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbpci.h       2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,122 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane PCI core hardware definitions.
 @@ -0,0 +1,122 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane PCI core hardware definitions.
@@ -10470,7 +10507,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbpci.h linux.dev/arch/mips/bcm94
 +#endif        /* _SBPCI_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbsdram.h linux.dev/arch/mips/bcm947xx/include/sbsdram.h
 --- linux.old/arch/mips/bcm947xx/include/sbsdram.h     1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBPCI_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbsdram.h linux.dev/arch/mips/bcm947xx/include/sbsdram.h
 --- linux.old/arch/mips/bcm947xx/include/sbsdram.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbsdram.h     2005-12-15 15:35:40.175792500 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbsdram.h     2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,75 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
 @@ -0,0 +1,75 @@
 +/*
 + * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions.
@@ -10549,7 +10586,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbsdram.h linux.dev/arch/mips/bcm
 +#endif        /* _SBSDRAM_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbutils.h linux.dev/arch/mips/bcm947xx/include/sbutils.h
 --- linux.old/arch/mips/bcm947xx/include/sbutils.h     1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _SBSDRAM_H */
 diff -urN linux.old/arch/mips/bcm947xx/include/sbutils.h linux.dev/arch/mips/bcm947xx/include/sbutils.h
 --- linux.old/arch/mips/bcm947xx/include/sbutils.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sbutils.h     2005-12-15 16:00:47.404550500 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sbutils.h     2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,136 @@
 +/*
 + * Misc utility routines for accessing chip-specific features
 @@ -0,0 +1,136 @@
 +/*
 + * Misc utility routines for accessing chip-specific features
@@ -10689,7 +10726,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbutils.h linux.dev/arch/mips/bcm
 +#endif        /* _sbutils_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/sflash.h linux.dev/arch/mips/bcm947xx/include/sflash.h
 --- linux.old/arch/mips/bcm947xx/include/sflash.h      1970-01-01 01:00:00.000000000 +0100
 +#endif        /* _sbutils_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/sflash.h linux.dev/arch/mips/bcm947xx/include/sflash.h
 --- linux.old/arch/mips/bcm947xx/include/sflash.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/sflash.h      2005-12-15 16:49:23.001703000 +0100
++++ linux.dev/arch/mips/bcm947xx/include/sflash.h      2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,36 @@
 +/*
 + * Broadcom SiliconBackplane chipcommon serial flash interface
 @@ -0,0 +1,36 @@
 +/*
 + * Broadcom SiliconBackplane chipcommon serial flash interface
@@ -10729,7 +10766,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sflash.h linux.dev/arch/mips/bcm9
 +#endif /* _sflash_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/trxhdr.h linux.dev/arch/mips/bcm947xx/include/trxhdr.h
 --- linux.old/arch/mips/bcm947xx/include/trxhdr.h      1970-01-01 01:00:00.000000000 +0100
 +#endif /* _sflash_h_ */
 diff -urN linux.old/arch/mips/bcm947xx/include/trxhdr.h linux.dev/arch/mips/bcm947xx/include/trxhdr.h
 --- linux.old/arch/mips/bcm947xx/include/trxhdr.h      1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/trxhdr.h      2005-12-15 15:35:49.220357750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/trxhdr.h      2005-12-28 16:37:32.902263000 +0100
 @@ -0,0 +1,33 @@
 +/*
 + * TRX image file header format.
 @@ -0,0 +1,33 @@
 +/*
 + * TRX image file header format.
@@ -10766,7 +10803,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/trxhdr.h linux.dev/arch/mips/bcm9
 +typedef struct trx_header TRXHDR, *PTRXHDR;
 diff -urN linux.old/arch/mips/bcm947xx/include/typedefs.h linux.dev/arch/mips/bcm947xx/include/typedefs.h
 --- linux.old/arch/mips/bcm947xx/include/typedefs.h    1970-01-01 01:00:00.000000000 +0100
 +typedef struct trx_header TRXHDR, *PTRXHDR;
 diff -urN linux.old/arch/mips/bcm947xx/include/typedefs.h linux.dev/arch/mips/bcm947xx/include/typedefs.h
 --- linux.old/arch/mips/bcm947xx/include/typedefs.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/include/typedefs.h    2005-12-15 15:35:52.436558750 +0100
++++ linux.dev/arch/mips/bcm947xx/include/typedefs.h    2005-12-28 16:37:32.906263250 +0100
 @@ -0,0 +1,326 @@
 +/*
 + * Copyright 2005, Broadcom Corporation      
 @@ -0,0 +1,326 @@
 +/*
 + * Copyright 2005, Broadcom Corporation      
@@ -11096,7 +11133,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/typedefs.h linux.dev/arch/mips/bc
 +#endif /* _TYPEDEFS_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/int-handler.S linux.dev/arch/mips/bcm947xx/int-handler.S
 --- linux.old/arch/mips/bcm947xx/int-handler.S 1970-01-01 01:00:00.000000000 +0100
 +#endif /* _TYPEDEFS_H_ */
 diff -urN linux.old/arch/mips/bcm947xx/int-handler.S linux.dev/arch/mips/bcm947xx/int-handler.S
 --- linux.old/arch/mips/bcm947xx/int-handler.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/int-handler.S 2005-12-15 12:57:27.877187750 +0100
++++ linux.dev/arch/mips/bcm947xx/int-handler.S 2005-12-28 16:37:32.906263250 +0100
 @@ -0,0 +1,48 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
 @@ -0,0 +1,48 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
@@ -11148,7 +11185,7 @@ diff -urN linux.old/arch/mips/bcm947xx/int-handler.S linux.dev/arch/mips/bcm947x
 +      END(bcm47xx_irq_handler)
 diff -urN linux.old/arch/mips/bcm947xx/irq.c linux.dev/arch/mips/bcm947xx/irq.c
 --- linux.old/arch/mips/bcm947xx/irq.c 1970-01-01 01:00:00.000000000 +0100
 +      END(bcm47xx_irq_handler)
 diff -urN linux.old/arch/mips/bcm947xx/irq.c linux.dev/arch/mips/bcm947xx/irq.c
 --- linux.old/arch/mips/bcm947xx/irq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/irq.c 2005-12-15 12:57:27.877187750 +0100
++++ linux.dev/arch/mips/bcm947xx/irq.c 2005-12-28 16:37:32.906263250 +0100
 @@ -0,0 +1,67 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
 @@ -0,0 +1,67 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
@@ -11219,8 +11256,8 @@ diff -urN linux.old/arch/mips/bcm947xx/irq.c linux.dev/arch/mips/bcm947xx/irq.c
 +}
 diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 --- linux.old/arch/mips/bcm947xx/pci.c 1970-01-01 01:00:00.000000000 +0100
 +}
 diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 --- linux.old/arch/mips/bcm947xx/pci.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/pci.c 2005-12-17 18:11:52.350836000 +0100
-@@ -0,0 +1,92 @@
++++ linux.dev/arch/mips/bcm947xx/pci.c 2005-12-28 16:37:32.906263250 +0100
+@@ -0,0 +1,215 @@
 +#include <linux/kernel.h>
 +#include <linux/init.h>
 +#include <linux/pci.h>
 +#include <linux/kernel.h>
 +#include <linux/init.h>
 +#include <linux/pci.h>
@@ -11235,8 +11272,11 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 +#include <sbmips.h>
 +#include <sbconfig.h>
 +#include <sbpci.h>
 +#include <sbmips.h>
 +#include <sbconfig.h>
 +#include <sbpci.h>
++#include <bcmdevs.h>
++#include <pcicfg.h>
 +
 +extern sb_t *sbh;
 +
 +extern sb_t *sbh;
++extern spinlock_t sbh_lock;
 +
 +
 +static int
 +
 +
 +static int
@@ -11244,7 +11284,12 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 +                              int reg, int size, u32 *val)
 +{
 +      int ret;
 +                              int reg, int size, u32 *val)
 +{
 +      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);
 +      ret = sbpci_read_config(sbh, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), reg, val, size);
++      spin_unlock_irqrestore(&sbh_lock, flags);
++
 +      return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
 +}
 +
 +      return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
 +}
 +
@@ -11253,7 +11298,12 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 +                              int reg, int size, u32 val)
 +{
 +      int ret;
 +                              int reg, int size, u32 val)
 +{
 +      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);
 +      ret = sbpci_write_config(sbh, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), reg, &val, size);
++      spin_unlock_irqrestore(&sbh_lock, flags);
++
 +      return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
 +}
 +
 +      return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
 +}
 +
@@ -11263,7 +11313,6 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 +      .write  = sb_pci_write_config,
 +};
 +
 +      .write  = sb_pci_write_config,
 +};
 +
-+
 +static struct resource sb_pci_mem_resource = {
 +      .name   = "SB PCI Memory resources",
 +      .start  = SB_ENUM_BASE,
 +static struct resource sb_pci_mem_resource = {
 +      .name   = "SB PCI Memory resources",
 +      .start  = SB_ENUM_BASE,
@@ -11273,8 +11322,8 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 +
 +static struct resource sb_pci_io_resource = {
 +      .name   = "SB PCI I/O resources",
 +
 +static struct resource sb_pci_io_resource = {
 +      .name   = "SB PCI I/O resources",
-+      .start  = 0x100,
-+      .end    = 0x1FF,
++      .start  = 0x000,
++      .end    = 0x0FF,
 +      .flags  = IORESOURCE_IO,
 +};
 +
 +      .flags  = IORESOURCE_IO,
 +};
 +
@@ -11287,35 +11336,146 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c
 +static struct resource ext_pci_mem_resource = {
 +      .name   = "Ext PCI Memory resources",
 +      .start  = 0x40000000,
 +static struct resource ext_pci_mem_resource = {
 +      .name   = "Ext PCI Memory resources",
 +      .start  = 0x40000000,
-+      .end    = 0x40ffffff,
++      .end    = 0x7fffffff,
 +      .flags  = IORESOURCE_MEM,
 +};
 +
 +static struct resource ext_pci_io_resource = {
 +      .name   = "Ext PCI I/O resources",
 +      .flags  = IORESOURCE_MEM,
 +};
 +
 +static struct resource ext_pci_io_resource = {
 +      .name   = "Ext PCI I/O resources",
-+      .start  = 0x200,
-+      .end    = 0x2FF,
++      .start  = 0x100,
++      .end    = 0x1FF,
 +      .flags  = IORESOURCE_IO,
 +};
 +
 +static struct pci_controller bcm47xx_ext_pci_controller = {
 +      .pci_ops        = &sb_pci_ops,
 +      .flags  = IORESOURCE_IO,
 +};
 +
 +static struct pci_controller bcm47xx_ext_pci_controller = {
 +      .pci_ops        = &sb_pci_ops,
-+      .mem_resource   = &ext_pci_mem_resource,
 +      .io_resource    = &ext_pci_io_resource,
 +      .io_resource    = &ext_pci_io_resource,
++      .mem_resource   = &ext_pci_mem_resource,
++      .mem_offset             = 0x24000000,
 +};
 +
 +void bcm47xx_pci_init(void)
 +{
 +};
 +
 +void bcm47xx_pci_init(void)
 +{
++      unsigned long flags;
++      
++      spin_lock_irqsave(&sbh_lock, flags);
 +      sbpci_init(sbh);
 +      sbpci_init(sbh);
++      spin_unlock_irqrestore(&sbh_lock, flags);
 +
 +      set_io_port_base((unsigned long) ioremap_nocache(SB_PCI_MEM, 0x04000000));
 +
 +      register_pci_controller(&bcm47xx_sb_pci_controller);
 +      register_pci_controller(&bcm47xx_ext_pci_controller);
 +}
 +
 +      set_io_port_base((unsigned long) ioremap_nocache(SB_PCI_MEM, 0x04000000));
 +
 +      register_pci_controller(&bcm47xx_sb_pci_controller);
 +      register_pci_controller(&bcm47xx_ext_pci_controller);
 +}
++
++int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
++{
++      u8 irq;
++      
++      if (dev->bus->number == 1)
++              return 2;
++
++      pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
++      return irq + 2;
++}
++
++u32 pci_iobase = 0x100;
++u32 pci_membase = SB_PCI_DMA;
++
++static void bcm47xx_fixup_device(struct pci_dev *d)
++{
++      struct resource *res;
++      int pos, size;
++      u32 *base;
++
++      if (d->bus->number == 0)
++              return;
++      
++      printk("PCI: Fixing up device %s\n", pci_name(d));
++
++      /* Fix up resource bases */
++      for (pos = 0; pos < 6; pos++) {
++              res = &d->resource[pos];
++              base = ((res->flags & IORESOURCE_IO) ? &pci_iobase : &pci_membase);
++              if (res->end) {
++                      size = res->end - res->start + 1;
++                      if (*base & (size - 1))
++                              *base = (*base + size) & ~(size - 1);
++                      res->start = *base;
++                      res->end = res->start + size - 1;
++                      *base += size;
++                      pci_write_config_dword(d, PCI_BASE_ADDRESS_0 + (pos << 2), res->start);
++              }
++              /* Fix up PCI bridge BAR0 only */
++              if (d->bus->number == 1 && PCI_SLOT(d->devfn) == 0)
++                      break;
++      }
++      /* Fix up interrupt lines */
++      if (pci_find_device(VENDOR_BROADCOM, SB_PCI, NULL))
++              d->irq = (pci_find_device(VENDOR_BROADCOM, SB_PCI, NULL))->irq;
++      pci_write_config_byte(d, PCI_INTERRUPT_LINE, d->irq);
++}
++
++
++static void bcm47xx_fixup_bridge(struct pci_dev *dev)
++{
++      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);
++}
++
++/* Do platform specific device initialization at pci_enable_device() time */
++int pcibios_plat_dev_init(struct pci_dev *dev)
++{
++      uint coreidx;
++      unsigned long flags;
++      
++      bcm47xx_fixup_device(dev);
++
++      /* These cores come out of reset enabled */
++      if ((dev->bus->number != 0) ||
++              (dev->device == SB_MIPS) ||
++              (dev->device == SB_MIPS33) ||
++              (dev->device == SB_EXTIF) ||
++              (dev->device == SB_CC))
++              return 0;
++
++      /* Do a core reset */
++      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
++               * vanilla usb-ohci so that it does not have to know about
++               * SB. A driver that wants to use the USB core in device mode
++               * should know about SB and should reset the bit back to 0
++               * after calling pcibios_enable_device().
++               */
++              sb_core_disable(sbh, sb_coreflags(sbh, 0, 0));
++              sb_core_reset(sbh, 1 << 29);
++      } else {
++              sb_core_reset(sbh, 0);
++      }
++      sb_setcoreidx(sbh, coreidx);
++      spin_unlock_irqrestore(&sbh_lock, flags);
++      
++      return 0;
++}
++
++DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, bcm47xx_fixup_bridge);
 diff -urN linux.old/arch/mips/bcm947xx/prom.c linux.dev/arch/mips/bcm947xx/prom.c
 --- linux.old/arch/mips/bcm947xx/prom.c        1970-01-01 01:00:00.000000000 +0100
 diff -urN linux.old/arch/mips/bcm947xx/prom.c linux.dev/arch/mips/bcm947xx/prom.c
 --- linux.old/arch/mips/bcm947xx/prom.c        1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/prom.c        2005-12-15 12:57:27.877187750 +0100
++++ linux.dev/arch/mips/bcm947xx/prom.c        2005-12-28 16:37:32.906263250 +0100
 @@ -0,0 +1,59 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
 @@ -0,0 +1,59 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
@@ -11378,8 +11538,8 @@ diff -urN linux.old/arch/mips/bcm947xx/prom.c linux.dev/arch/mips/bcm947xx/prom.
 +}
 diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setup.c
 --- linux.old/arch/mips/bcm947xx/setup.c       1970-01-01 01:00:00.000000000 +0100
 +}
 diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setup.c
 --- linux.old/arch/mips/bcm947xx/setup.c       1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/setup.c       2005-12-17 22:14:27.619043750 +0100
-@@ -0,0 +1,155 @@
++++ linux.dev/arch/mips/bcm947xx/setup.c       2005-12-28 19:29:25.870911750 +0100
+@@ -0,0 +1,157 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
 + *  Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
 + *  Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
@@ -11423,11 +11583,14 @@ diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setu
 +#include <sbpci.h>
 +#include <sbconfig.h>
 +#include <bcmdevs.h>
 +#include <sbpci.h>
 +#include <sbconfig.h>
 +#include <bcmdevs.h>
++#include <bcmutils.h>
++#include <bcmnvram.h>
 +
 +extern void bcm47xx_pci_init(void);
 +extern void bcm47xx_time_init(void);
 +extern void bcm47xx_timer_setup(struct irqaction *irq);
 +void *sbh;
 +
 +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;
 +
 +static int ser_line = 0;
 +int boardflags;
 +
 +static int ser_line = 0;
@@ -11504,18 +11667,16 @@ diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setu
 +      char *s;
 +      int i;
 +      
 +      char *s;
 +      int i;
 +      
-+      sbh = sb_kattach();
++      sbh = (void *) sb_kattach();
 +      sb_mips_init(sbh);
 +
 +      bcm47xx_pci_init();
 +
 +      sb_mips_init(sbh);
 +
 +      bcm47xx_pci_init();
 +
-+      set_io_port_base((unsigned long) ioremap_nocache(SB_PCI_MEM, 0x04000000));
-+
 +      sb_serial_init(sbh, serial_add);
 +      boardflags = getintvar(NULL, "boardflags");
 +
 +      /* reverse serial ports if the nvram variable kernel_args starts with console=ttyS1 */
 +      sb_serial_init(sbh, serial_add);
 +      boardflags = getintvar(NULL, "boardflags");
 +
 +      /* reverse serial ports if the nvram variable kernel_args starts with console=ttyS1 */
-+      s = nvram_get("kernel_args");
++      s = early_nvram_get("kernel_args");
 +      if (!s) s = "";
 +      if (!strncmp(s, "console=ttyS1", 13)) {
 +              for (i = num_ports; i; i--)
 +      if (!s) s = "";
 +      if (!strncmp(s, "console=ttyS1", 13)) {
 +              for (i = num_ports; i; i--)
@@ -11534,10 +11695,11 @@ diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setu
 +}
 +
 +EXPORT_SYMBOL(sbh);
 +}
 +
 +EXPORT_SYMBOL(sbh);
++EXPORT_SYMBOL(sbh_lock);
 +EXPORT_SYMBOL(boardflags);
 diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.c
 --- linux.old/arch/mips/bcm947xx/time.c        1970-01-01 01:00:00.000000000 +0100
 +EXPORT_SYMBOL(boardflags);
 diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.c
 --- linux.old/arch/mips/bcm947xx/time.c        1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/bcm947xx/time.c        2005-12-15 12:57:27.877187750 +0100
++++ linux.dev/arch/mips/bcm947xx/time.c        2005-12-28 16:37:32.906263250 +0100
 @@ -0,0 +1,59 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
 @@ -0,0 +1,59 @@
 +/*
 + *  Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
@@ -11599,8 +11761,8 @@ diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time.
 +      setup_irq(7, irq);
 +}
 diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-probe.c
 +      setup_irq(7, irq);
 +}
 diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-probe.c
---- linux.old/arch/mips/kernel/cpu-probe.c     2005-12-15 13:26:49.766024000 +0100
-+++ linux.dev/arch/mips/kernel/cpu-probe.c     2005-12-15 12:57:27.901177250 +0100
+--- linux.old/arch/mips/kernel/cpu-probe.c     2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/arch/mips/kernel/cpu-probe.c     2005-12-28 16:37:32.934265000 +0100
 @@ -656,6 +656,28 @@
  }
  
 @@ -656,6 +656,28 @@
  }
  
@@ -11641,8 +11803,8 @@ diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu-
                cpu_probe_sandcraft(c);
                break;
 diff -urN linux.old/arch/mips/kernel/head.S linux.dev/arch/mips/kernel/head.S
                cpu_probe_sandcraft(c);
                break;
 diff -urN linux.old/arch/mips/kernel/head.S linux.dev/arch/mips/kernel/head.S
---- linux.old/arch/mips/kernel/head.S  2005-12-15 13:26:49.766024000 +0100
-+++ linux.dev/arch/mips/kernel/head.S  2005-12-15 12:57:27.901177250 +0100
+--- linux.old/arch/mips/kernel/head.S  2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/arch/mips/kernel/head.S  2005-12-28 16:37:32.934265000 +0100
 @@ -107,6 +107,14 @@
  #endif
        .endm
 @@ -107,6 +107,14 @@
  #endif
        .endm
@@ -11659,8 +11821,8 @@ diff -urN linux.old/arch/mips/kernel/head.S linux.dev/arch/mips/kernel/head.S
         * Reserved space for exception handlers.
         * Necessary for machines which link their kernels at KSEG0.
 diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c
         * Reserved space for exception handlers.
         * Necessary for machines which link their kernels at KSEG0.
 diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c
---- linux.old/arch/mips/kernel/proc.c  2005-12-15 13:26:49.766024000 +0100
-+++ linux.dev/arch/mips/kernel/proc.c  2005-12-15 12:57:27.921168500 +0100
+--- linux.old/arch/mips/kernel/proc.c  2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/arch/mips/kernel/proc.c  2005-12-28 16:37:32.946265750 +0100
 @@ -82,6 +82,8 @@
        [CPU_VR4181]    = "NEC VR4181",
        [CPU_VR4181A]   = "NEC VR4181A",
 @@ -82,6 +82,8 @@
        [CPU_VR4181]    = "NEC VR4181",
        [CPU_VR4181A]   = "NEC VR4181A",
@@ -11671,8 +11833,8 @@ diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c
  };
  
 diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
  };
  
 diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
---- linux.old/arch/mips/mm/tlbex.c     2005-12-15 13:26:49.794011750 +0100
-+++ linux.dev/arch/mips/mm/tlbex.c     2005-12-15 12:57:27.945158000 +0100
+--- linux.old/arch/mips/mm/tlbex.c     2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/arch/mips/mm/tlbex.c     2005-12-28 16:37:32.970267250 +0100
 @@ -858,6 +858,8 @@
        case CPU_4KSC:
        case CPU_20KC:
 @@ -858,6 +858,8 @@
        case CPU_4KSC:
        case CPU_20KC:
@@ -11682,60 +11844,9 @@ diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c
                tlbw(p);
                break;
  
                tlbw(p);
                break;
  
-diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile
---- linux.old/arch/mips/pci/Makefile   2005-12-15 13:26:49.814003000 +0100
-+++ linux.dev/arch/mips/pci/Makefile   2005-12-15 14:27:26.439319250 +0100
-@@ -18,6 +18,7 @@
- obj-$(CONFIG_MIPS_TX3927)     += ops-tx3927.o
- obj-$(CONFIG_PCI_VR41XX)      += ops-vr41xx.o pci-vr41xx.o
- obj-$(CONFIG_NEC_CMBVR4133)   += fixup-vr4133.o
-+obj-$(CONFIG_BCM947XX)                += fixup-bcm47xx.o
- #
- # These are still pretty much in the old state, watch, go blind.
-diff -urN linux.old/arch/mips/pci/fixup-bcm47xx.c linux.dev/arch/mips/pci/fixup-bcm47xx.c
---- linux.old/arch/mips/pci/fixup-bcm47xx.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux.dev/arch/mips/pci/fixup-bcm47xx.c    2005-12-15 12:57:27.945158000 +0100
-@@ -0,0 +1,23 @@
-+#include <linux/init.h>
-+#include <linux/pci.h>
-+
-+/* Do platform specific device initialization at pci_enable_device() time */
-+int pcibios_plat_dev_init(struct pci_dev *dev)
-+{
-+      return 0;
-+}
-+
-+int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
-+{
-+      u8 irq;
-+      
-+      if (dev->bus->number == 1)
-+              return 2;
-+
-+      pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
-+      return irq + 2;
-+}
-+
-+struct pci_fixup pcibios_fixups[] = {
-+      { 0 }
-+};
-diff -urN linux.old/arch/mips/pci/pci.c linux.dev/arch/mips/pci/pci.c
---- linux.old/arch/mips/pci/pci.c      2005-12-15 13:26:49.814003000 +0100
-+++ linux.dev/arch/mips/pci/pci.c      2005-12-17 18:08:13.553162000 +0100
-@@ -307,7 +307,8 @@
-       if (res->flags & IORESOURCE_IO)
-               offset = hose->io_offset;
-       else if (res->flags & IORESOURCE_MEM)
--              offset = hose->mem_offset;
-+//            offset = hose->mem_offset;
-+              offset = 0x24000000;
-       res->start = region->start + offset;
-       res->end = region->end + offset;
 diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h
 diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/bootinfo.h
---- linux.old/include/asm-mips/bootinfo.h      2005-12-15 13:26:49.818001250 +0100
-+++ linux.dev/include/asm-mips/bootinfo.h      2005-12-15 12:57:27.969147500 +0100
+--- linux.old/include/asm-mips/bootinfo.h      2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/include/asm-mips/bootinfo.h      2005-12-28 16:37:32.970267250 +0100
 @@ -218,6 +218,12 @@
  #define MACH_GROUP_TITAN       22     /* PMC-Sierra Titan             */
  #define  MACH_TITAN_YOSEMITE  1       /* PMC-Sierra Yosemite          */
 @@ -218,6 +218,12 @@
  #define MACH_GROUP_TITAN       22     /* PMC-Sierra Titan             */
  #define  MACH_TITAN_YOSEMITE  1       /* PMC-Sierra Yosemite          */
@@ -11750,8 +11861,8 @@ diff -urN linux.old/include/asm-mips/bootinfo.h linux.dev/include/asm-mips/booti
  
  const char *get_system_type(void);
 diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
  
  const char *get_system_type(void);
 diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
---- linux.old/include/asm-mips/cpu.h   2005-12-15 13:26:49.818001250 +0100
-+++ linux.dev/include/asm-mips/cpu.h   2005-12-15 12:57:27.969147500 +0100
+--- linux.old/include/asm-mips/cpu.h   2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/include/asm-mips/cpu.h   2005-12-28 16:37:32.974267500 +0100
 @@ -102,6 +102,13 @@
  #define PRID_IMP_SR71000        0x0400
  
 @@ -102,6 +102,13 @@
  #define PRID_IMP_SR71000        0x0400
  
@@ -11778,8 +11889,8 @@ diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h
  /*
   * ISA Level encodings
 diff -urN linux.old/include/linux/init.h linux.dev/include/linux/init.h
  /*
   * ISA Level encodings
 diff -urN linux.old/include/linux/init.h linux.dev/include/linux/init.h
---- linux.old/include/linux/init.h     2005-12-15 13:26:49.818001250 +0100
-+++ linux.dev/include/linux/init.h     2005-12-15 12:57:27.973145750 +0100
+--- linux.old/include/linux/init.h     2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/include/linux/init.h     2005-12-28 16:37:32.982268000 +0100
 @@ -86,6 +86,8 @@
        static initcall_t __initcall_##fn __attribute_used__ \
        __attribute__((__section__(".initcall" level ".init"))) = fn
 @@ -86,6 +86,8 @@
        static initcall_t __initcall_##fn __attribute_used__ \
        __attribute__((__section__(".initcall" level ".init"))) = fn
@@ -11790,9 +11901,9 @@ diff -urN linux.old/include/linux/init.h linux.dev/include/linux/init.h
  #define postcore_initcall(fn)         __define_initcall("2",fn)
  #define arch_initcall(fn)             __define_initcall("3",fn)
 diff -urN linux.old/include/linux/pci_ids.h linux.dev/include/linux/pci_ids.h
  #define postcore_initcall(fn)         __define_initcall("2",fn)
  #define arch_initcall(fn)             __define_initcall("3",fn)
 diff -urN linux.old/include/linux/pci_ids.h linux.dev/include/linux/pci_ids.h
---- linux.old/include/linux/pci_ids.h  2005-12-15 13:26:49.818001250 +0100
-+++ linux.dev/include/linux/pci_ids.h  2005-12-15 12:57:27.977144000 +0100
-@@ -1835,6 +1835,7 @@
+--- linux.old/include/linux/pci_ids.h  2005-12-19 01:36:54.000000000 +0100
++++ linux.dev/include/linux/pci_ids.h  2005-12-28 16:37:32.994268750 +0100
+@@ -1836,6 +1836,7 @@
  #define PCI_DEVICE_ID_TIGON3_5901_2   0x170e
  #define PCI_DEVICE_ID_BCM4401         0x4401
  #define PCI_DEVICE_ID_BCM4401B0               0x4402
  #define PCI_DEVICE_ID_TIGON3_5901_2   0x170e
  #define PCI_DEVICE_ID_BCM4401         0x4401
  #define PCI_DEVICE_ID_BCM4401B0               0x4402
This page took 0.058032 seconds and 4 git commands to generate.