X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/dab3ca1324288a1abeb32590e1caec8848efe3e0..ac329a6a7ec73bc191d17cd0dbb1c34cf570e879:/target/linux/brcm-2.6/patches/001-bcm947xx.patch diff --git a/target/linux/brcm-2.6/patches/001-bcm947xx.patch b/target/linux/brcm-2.6/patches/001-bcm947xx.patch index 739590b1c..5e855be92 100644 --- a/target/linux/brcm-2.6/patches/001-bcm947xx.patch +++ b/target/linux/brcm-2.6/patches/001-bcm947xx.patch @@ -1,64 +1,6 @@ -diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig ---- 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. - -+config BCM947XX -+ bool "Support for BCM947xx based boards" -+ select DMA_NONCOHERENT -+ select HW_HAS_PCI -+ select IRQ_CPU -+ select SYS_HAS_CPU_MIPS32_R1 -+ select SYS_SUPPORTS_32BIT_KERNEL -+ select SYS_SUPPORTS_LITTLE_ENDIAN -+ help -+ Support for BCM947xx based boards -+ - config LASAT - 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-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 - - # -+# Broadcom BCM47XX boards -+# -+core-$(CONFIG_BCM947XX) += arch/mips/bcm947xx/ arch/mips/bcm947xx/broadcom/ -+cflags-$(CONFIG_BCM947XX) += -Iarch/mips/bcm947xx/include -+load-$(CONFIG_BCM947XX) := 0xffffffff80001000 -+ -+# - # SNI RM200 PCI - # - 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-28 16:37:32.814257500 +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 -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-28 16:37:32.814257500 +0100 -@@ -0,0 +1,6 @@ -+# -+# Makefile for the BCM47xx specific kernel interface routines -+# under Linux. -+# -+ -+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-28 16:37:32.814257500 +0100 ++++ linux.dev/arch/mips/bcm947xx/broadcom/bcmsrom.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,481 @@ +/* + * Misc useful routines to access NIC SROM/OTP . @@ -543,7 +485,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 -+++ linux.dev/arch/mips/bcm947xx/broadcom/bcmutils.c 2005-12-28 16:37:32.814257500 +0100 ++++ linux.dev/arch/mips/bcm947xx/broadcom/bcmutils.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,356 @@ +/* + * Misc useful OS-independent routines. @@ -903,7 +845,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 -+++ linux.dev/arch/mips/bcm947xx/broadcom/cfe_env.c 2005-12-28 16:37:32.818257750 +0100 ++++ linux.dev/arch/mips/bcm947xx/broadcom/cfe_env.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,234 @@ +/* + * NVRAM variable manipulation (Linux kernel half) @@ -1141,7 +1083,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 -+++ linux.dev/arch/mips/bcm947xx/broadcom/linux_osl.c 2005-12-28 16:37:32.834258750 +0100 ++++ linux.dev/arch/mips/bcm947xx/broadcom/linux_osl.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,102 @@ +/* + * Linux OS Independent Layer @@ -1245,9 +1187,19 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/linux_osl.c linux.dev/arch/mips/ + } +} + +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 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,6 @@ ++# ++# Makefile for the BCM47xx specific kernel interface routines ++# under Linux. ++# ++ ++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/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-28 19:30:54.804469750 +0100 ++++ linux.dev/arch/mips/bcm947xx/broadcom/nvram.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,192 @@ +/* + * NVRAM variable manipulation (Linux kernel half) @@ -1443,8 +1395,8 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/nvram.c linux.dev/arch/mips/bcm9 +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 -+++ linux.dev/arch/mips/bcm947xx/broadcom/sbmips.c 2005-12-28 19:19:50.570957750 +0100 -@@ -0,0 +1,1038 @@ ++++ linux.dev/arch/mips/bcm947xx/broadcom/sbmips.c 2006-10-15 23:46:15.000000000 +0200 +@@ -0,0 +1,1115 @@ +/* + * BCM47XX Sonics SiliconBackplane MIPS core routines + * @@ -1828,6 +1780,13 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm + tmp = tmp | CEIL(120, ns); /* W0 = 120nS */ + W_REG(&eir->prog_waitcount, tmp); /* 0x01020a0c for a 100Mhz clock */ + } else if ((cc = sb_setcore(sbh, SB_CC, 0))) { ++ /* set register for external IO to control LED. */ ++ W_REG(&cc->prog_config, 0x11); ++ tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */ ++ tmp = tmp | (CEIL(40, ns) << FW_W1_SHIFT); /* W1 = 40nS */ ++ tmp = tmp | CEIL(240, ns); /* W0 = 120nS */ ++ W_REG(&cc->prog_waitcount, tmp); /* 0x01020a0c for a 100Mhz clock */ ++ + /* Set timing for the flash */ + tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */ + tmp |= CEIL(10, ns) << FW_W1_SHIFT; /* W1 = 10nS */ @@ -1849,6 +1808,16 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm + W_REG(&cc->pcmcia_memwait, tmp); + } + } ++ // Added by Chen-I & Yen for enabling 5350 EXTIF ++ if (BCMINIT(sb_chip)(sbh) == BCM5350_DEVICE_ID) ++ { ++ /* Set programmable interface timing for external uart */ ++ tmp = CEIL(10, ns) << FW_W3_SHIFT; /* W3 = 10nS */ ++ tmp = tmp | (CEIL(20, ns) << FW_W2_SHIFT); /* W2 = 20nS */ ++ tmp = tmp | (CEIL(100, ns) << FW_W1_SHIFT); /* W1 = 100nS */ ++ tmp = tmp | CEIL(120, ns); /* W0 = 120nS */ ++ W_REG(&cc->prog_waitcount, tmp); /* 0x01020a0c for a 100Mhz clock */ ++ } + } + + /* Chip specific initialization */ @@ -1860,22 +1829,22 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm + 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 */ @@ -2483,10 +2452,71 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbmips.c linux.dev/arch/mips/bcm + return ret; +} + ++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; ++} ++ ++ + 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-28 16:37:32.854260000 +0100 -@@ -0,0 +1,533 @@ ++++ linux.dev/arch/mips/bcm947xx/broadcom/sbpci.c 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,534 @@ +/* + * Low-Level PCI and SB support for BCM47xx + * @@ -2770,6 +2800,7 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbpci.c linux.dev/arch/mips/bcm9 + if (((chip == BCM4712_DEVICE_ID) && + ((chippkg == BCM4712SMALL_PKG_ID) || + (chippkg == BCM4712MID_PKG_ID))) || ++ (chip == BCM5350_DEVICE_ID) || + (boardflags & BFL_NOPCI)) + pci_disabled = TRUE; + @@ -3022,8 +3053,8 @@ 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 -+++ linux.dev/arch/mips/bcm947xx/broadcom/sbutils.c 2005-12-28 16:37:32.858260250 +0100 -@@ -0,0 +1,2370 @@ ++++ linux.dev/arch/mips/bcm947xx/broadcom/sbutils.c 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,2371 @@ +/* + * Misc utility routines for accessing chip-specific features + * of the SiliconBackplane-based Broadcom chips. @@ -5394,9 +5425,10 @@ diff -urN linux.old/arch/mips/bcm947xx/broadcom/sbutils.c linux.dev/arch/mips/bc +EXPORT_SYMBOL(sb_gpiosetcore); +EXPORT_SYMBOL(sb_gpiotimerval); +EXPORT_SYMBOL(sb_watchdog); ++EXPORT_SYMBOL(sb_kattach); 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-28 16:37:32.870261000 +0100 ++++ linux.dev/arch/mips/bcm947xx/broadcom/sflash.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,418 @@ +/* + * Broadcom SiliconBackplane chipcommon serial flash interface @@ -5818,7 +5850,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 -+++ linux.dev/arch/mips/bcm947xx/include/bcmdevs.h 2005-12-28 16:37:32.874261250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/bcmdevs.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,391 @@ +/* + * Broadcom device-specific manifest constants. @@ -6213,7 +6245,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 -+++ linux.dev/arch/mips/bcm947xx/include/bcmendian.h 2005-12-28 16:37:32.874261250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/bcmendian.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,152 @@ +/* + * local version of endian.h - byte order defines @@ -6369,7 +6401,7 @@ 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 -+++ linux.dev/arch/mips/bcm947xx/include/bcmnvram.h 2005-12-28 19:28:28.399320000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/bcmnvram.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,95 @@ +/* + * NVRAM variable manipulation @@ -6468,7 +6500,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 -+++ linux.dev/arch/mips/bcm947xx/include/bcmsrom.h 2005-12-28 16:37:32.874261250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/bcmsrom.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,23 @@ +/* + * Misc useful routines to access NIC local SROM/OTP . @@ -6495,7 +6527,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 -+++ linux.dev/arch/mips/bcm947xx/include/bcmutils.h 2005-12-28 16:37:32.874261250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/bcmutils.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,308 @@ +/* + * Misc useful os-independent macros and functions. @@ -6807,7 +6839,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 -+++ linux.dev/arch/mips/bcm947xx/include/bitfuncs.h 2005-12-28 16:37:32.874261250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/bitfuncs.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,85 @@ +/* + * bit manipulation utility functions @@ -6896,7 +6928,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 -+++ linux.dev/arch/mips/bcm947xx/include/flash.h 2005-12-28 16:37:32.874261250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/flash.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,188 @@ +/* + * flash.h: Common definitions for flash access. @@ -7088,7 +7120,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 -+++ linux.dev/arch/mips/bcm947xx/include/flashutl.h 2005-12-28 16:37:32.878261500 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/flashutl.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,27 @@ +/* + * BCM47XX FLASH driver interface @@ -7119,7 +7151,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 -+++ linux.dev/arch/mips/bcm947xx/include/hndmips.h 2005-12-28 16:37:32.878261500 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/hndmips.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,16 @@ +/* + * Alternate include file for HND sbmips.h since CFE also ships with @@ -7139,7 +7171,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 -+++ linux.dev/arch/mips/bcm947xx/include/linux_osl.h 2005-12-28 16:37:32.878261500 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/linux_osl.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,331 @@ +/* + * Linux OS Independent Layer @@ -7474,7 +7506,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 -+++ linux.dev/arch/mips/bcm947xx/include/linuxver.h 2005-12-28 16:37:32.878261500 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/linuxver.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,389 @@ +/* + * Linux-specific abstractions to gain some independence from linux kernel versions. @@ -7867,7 +7899,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 -+++ linux.dev/arch/mips/bcm947xx/include/mipsinc.h 2005-12-28 16:37:32.878261500 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/mipsinc.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,552 @@ +/* + * HND Run Time Environment for standalone MIPS programs. @@ -8423,7 +8455,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 -+++ linux.dev/arch/mips/bcm947xx/include/osl.h 2005-12-28 16:37:32.878261500 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/osl.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,42 @@ +/* + * OS Abstraction Layer @@ -8469,7 +8501,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 -+++ linux.dev/arch/mips/bcm947xx/include/pcicfg.h 2005-12-28 16:37:32.882261750 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/pcicfg.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,398 @@ +/* + * pcicfg.h: PCI configuration constants and structures. @@ -8871,7 +8903,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 -+++ linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h 2005-12-28 16:37:32.882261750 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/proto/ethernet.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,145 @@ +/******************************************************************************* + * $Id$ @@ -9020,7 +9052,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 -+++ linux.dev/arch/mips/bcm947xx/include/s5.h 2005-12-28 16:37:32.882261750 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/s5.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,103 @@ +#ifndef _S5_H_ +#define _S5_H_ @@ -9127,7 +9159,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbchipc.h 2005-12-28 16:37:32.882261750 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbchipc.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,440 @@ +/* + * SiliconBackplane Chipcommon core hardware definitions. @@ -9571,7 +9603,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbconfig.h 2005-12-28 16:37:32.898262750 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbconfig.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,342 @@ +/* + * Broadcom SiliconBackplane hardware register definitions. @@ -9917,7 +9949,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbextif.h 2005-12-28 16:37:32.898262750 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbextif.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,242 @@ +/* + * Hardware-specific External Interface I/O core definitions @@ -10163,7 +10195,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbmemc.h 2005-12-28 16:37:32.902263000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbmemc.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,148 @@ +/* + * BCM47XX Sonics SiliconBackplane DDR/SDRAM controller core hardware definitions. @@ -10315,8 +10347,8 @@ 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 -+++ linux.dev/arch/mips/bcm947xx/include/sbmips.h 2005-12-28 16:37:32.902263000 +0100 -@@ -0,0 +1,62 @@ ++++ linux.dev/arch/mips/bcm947xx/include/sbmips.h 2006-10-15 23:37:15.000000000 +0200 +@@ -0,0 +1,63 @@ +/* + * Broadcom SiliconBackplane MIPS definitions + * @@ -10374,6 +10406,7 @@ diff -urN linux.old/arch/mips/bcm947xx/include/sbmips.h linux.dev/arch/mips/bcm9 +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 */ @@ -10381,7 +10414,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbpci.h 2005-12-28 16:37:32.902263000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbpci.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,122 @@ +/* + * BCM47XX Sonics SiliconBackplane PCI core hardware definitions. @@ -10507,7 +10540,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbsdram.h 2005-12-28 16:37:32.902263000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbsdram.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,75 @@ +/* + * BCM47XX Sonics SiliconBackplane SDRAM controller core hardware definitions. @@ -10586,7 +10619,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 -+++ linux.dev/arch/mips/bcm947xx/include/sbutils.h 2005-12-28 16:37:32.902263000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sbutils.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,136 @@ +/* + * Misc utility routines for accessing chip-specific features @@ -10726,7 +10759,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 -+++ linux.dev/arch/mips/bcm947xx/include/sflash.h 2005-12-28 16:37:32.902263000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/sflash.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,36 @@ +/* + * Broadcom SiliconBackplane chipcommon serial flash interface @@ -10766,7 +10799,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 -+++ linux.dev/arch/mips/bcm947xx/include/trxhdr.h 2005-12-28 16:37:32.902263000 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/trxhdr.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,33 @@ +/* + * TRX image file header format. @@ -10803,7 +10836,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 -+++ linux.dev/arch/mips/bcm947xx/include/typedefs.h 2005-12-28 16:37:32.906263250 +0100 ++++ linux.dev/arch/mips/bcm947xx/include/typedefs.h 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,326 @@ +/* + * Copyright 2005, Broadcom Corporation @@ -11131,62 +11164,10 @@ diff -urN linux.old/arch/mips/bcm947xx/include/typedefs.h linux.dev/arch/mips/bc +#endif /* USE_TYPEDEF_DEFAULTS */ + +#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-28 16:37:32.906263250 +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 -+#include -+#include -+#include -+ -+ .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 -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-28 16:37:32.906263250 +0100 -@@ -0,0 +1,67 @@ ++++ linux.dev/arch/mips/bcm947xx/irq.c 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,64 @@ +/* + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org) + * @@ -11225,9 +11206,7 @@ diff -urN linux.old/arch/mips/bcm947xx/irq.c linux.dev/arch/mips/bcm947xx/irq.c +#include +#include + -+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; + @@ -11251,13 +11230,22 @@ diff -urN linux.old/arch/mips/bcm947xx/irq.c linux.dev/arch/mips/bcm947xx/irq.c + +void __init arch_init_irq(void) +{ -+ set_except_vector(0, bcm47xx_irq_handler); + mips_cpu_irq_init(0); +} +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 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,6 @@ ++# ++# Makefile for the BCM47xx specific kernel interface routines ++# under Linux. ++# ++ ++obj-y := irq.o prom.o setup.o time.o pci.o 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-28 16:37:32.906263250 +0100 -@@ -0,0 +1,215 @@ ++++ linux.dev/arch/mips/bcm947xx/pci.c 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,227 @@ +#include +#include +#include @@ -11343,7 +11331,7 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c +static struct resource ext_pci_io_resource = { + .name = "Ext PCI I/O resources", + .start = 0x100, -+ .end = 0x1FF, ++ .end = 0x7FF, + .flags = IORESOURCE_IO, +}; + @@ -11370,11 +11358,23 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c + +int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) +{ ++ unsigned long flags; + u8 irq; ++ uint idx; + -+ if (dev->bus->number == 1) -+ return 2; -+ ++ /* 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; +} @@ -11475,7 +11475,7 @@ diff -urN linux.old/arch/mips/bcm947xx/pci.c linux.dev/arch/mips/bcm947xx/pci.c +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 -+++ linux.dev/arch/mips/bcm947xx/prom.c 2005-12-28 16:37:32.906263250 +0100 ++++ linux.dev/arch/mips/bcm947xx/prom.c 2006-10-15 23:29:14.000000000 +0200 @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org) @@ -11538,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 -+++ linux.dev/arch/mips/bcm947xx/setup.c 2005-12-28 19:29:25.870911750 +0100 -@@ -0,0 +1,157 @@ ++++ linux.dev/arch/mips/bcm947xx/setup.c 2006-10-15 23:29:14.000000000 +0200 +@@ -0,0 +1,158 @@ +/* + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org) + * Copyright (C) 2005 Waldemar Brodkorb @@ -11575,6 +11575,7 @@ diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setu +#include +#include +#include ++#include + +#include +#include @@ -11688,7 +11689,7 @@ diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setu + + _machine_restart = bcm47xx_machine_restart; + _machine_halt = bcm47xx_machine_halt; -+ _machine_power_off = bcm47xx_machine_halt; ++ pm_power_off = bcm47xx_machine_halt; + + board_time_init = bcm47xx_time_init; + board_timer_setup = bcm47xx_timer_setup; @@ -11699,8 +11700,8 @@ diff -urN linux.old/arch/mips/bcm947xx/setup.c linux.dev/arch/mips/bcm947xx/setu +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-28 16:37:32.906263250 +0100 -@@ -0,0 +1,59 @@ ++++ linux.dev/arch/mips/bcm947xx/time.c 2006-10-15 23:38:36.000000000 +0200 +@@ -0,0 +1,65 @@ +/* + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org) + * @@ -11734,6 +11735,12 @@ diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time. +#include +#include +#include ++#include ++#include ++#include ++#include ++ ++extern sb_t *sbh; + +void __init +bcm47xx_time_init(void) @@ -11747,7 +11754,7 @@ diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time. + 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; @@ -11760,10 +11767,31 @@ diff -urN linux.old/arch/mips/bcm947xx/time.c linux.dev/arch/mips/bcm947xx/time. + /* Enable the timer interrupt */ + setup_irq(7, irq); +} +diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig +--- linux.old/arch/mips/Kconfig 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/arch/mips/Kconfig 2006-10-15 23:29:14.000000000 +0200 +@@ -245,6 +245,17 @@ + Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and + Olivetti M700-10 workstations. + ++config BCM947XX ++ bool "Support for BCM947xx based boards" ++ select DMA_NONCOHERENT ++ select HW_HAS_PCI ++ select IRQ_CPU ++ select SYS_HAS_CPU_MIPS32_R1 ++ select SYS_SUPPORTS_32BIT_KERNEL ++ select SYS_SUPPORTS_LITTLE_ENDIAN ++ help ++ Support for BCM947xx based boards ++ + config LASAT + bool "LASAT Networks platforms" + select DMA_NONCOHERENT 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-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 @@ +--- linux.old/arch/mips/kernel/cpu-probe.c 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/arch/mips/kernel/cpu-probe.c 2006-10-15 23:29:14.000000000 +0200 +@@ -691,6 +691,28 @@ } @@ -11773,13 +11801,13 @@ diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu- + switch (c->processor_id & 0xff00) { + case PRID_IMP_BCM3302: + c->cputype = CPU_BCM3302; -+ c->isa_level = MIPS_CPU_ISA_M32; ++ c->isa_level = MIPS_CPU_ISA_M32R1; + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | + MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER; + break; + case PRID_IMP_BCM4710: + c->cputype = CPU_BCM4710; -+ c->isa_level = MIPS_CPU_ISA_M32; ++ c->isa_level = MIPS_CPU_ISA_M32R1; + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | + MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER; + break; @@ -11792,7 +11820,7 @@ diff -urN linux.old/arch/mips/kernel/cpu-probe.c linux.dev/arch/mips/kernel/cpu- __init void cpu_probe(void) { struct cpuinfo_mips *c = ¤t_cpu_data; -@@ -678,6 +700,9 @@ +@@ -713,6 +735,9 @@ case PRID_COMP_SIBYTE: cpu_probe_sibyte(c); break; @@ -11803,27 +11831,24 @@ 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 ---- 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 +--- linux.old/arch/mips/kernel/head.S 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/arch/mips/kernel/head.S 2006-10-15 23:29:14.000000000 +0200 +@@ -133,6 +133,11 @@ + j kernel_entry + nop +#ifdef CONFIG_BCM4710 +#undef eret +#define eret nop; nop; eret +#endif -+ -+ j kernel_entry -+ nop + /* * 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-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 @@ +--- linux.old/arch/mips/kernel/proc.c 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/arch/mips/kernel/proc.c 2006-10-15 23:29:14.000000000 +0200 +@@ -84,6 +84,8 @@ [CPU_VR4181] = "NEC VR4181", [CPU_VR4181A] = "NEC VR4181A", [CPU_SR71000] = "Sandcraft SR71000", @@ -11832,10 +11857,27 @@ diff -urN linux.old/arch/mips/kernel/proc.c linux.dev/arch/mips/kernel/proc.c [CPU_PR4450] = "Philips PR4450", }; +diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile +--- linux.old/arch/mips/Makefile 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/arch/mips/Makefile 2006-10-15 23:29:14.000000000 +0200 +@@ -565,6 +565,13 @@ + load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000 + + # ++# Broadcom BCM47XX boards ++# ++core-$(CONFIG_BCM947XX) += arch/mips/bcm947xx/ arch/mips/bcm947xx/broadcom/ ++cflags-$(CONFIG_BCM947XX) += -Iarch/mips/bcm947xx/include ++load-$(CONFIG_BCM947XX) := 0xffffffff80001000 ++ ++# + # SNI RM200 PCI + # + core-$(CONFIG_SNI_RM200_PCI) += arch/mips/sni/ 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-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 @@ +--- linux.old/arch/mips/mm/tlbex.c 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/arch/mips/mm/tlbex.c 2006-10-15 23:31:06.000000000 +0200 +@@ -882,6 +882,8 @@ case CPU_4KSC: case CPU_20KC: case CPU_25KF: @@ -11845,8 +11887,8 @@ diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c break; 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-19 01:36:54.000000000 +0100 -+++ linux.dev/include/asm-mips/bootinfo.h 2005-12-28 16:37:32.970267250 +0100 +--- linux.old/include/asm-mips/bootinfo.h 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/include/asm-mips/bootinfo.h 2006-10-15 23:29:14.000000000 +0200 @@ -218,6 +218,12 @@ #define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ #define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */ @@ -11861,9 +11903,9 @@ 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 ---- 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 @@ +--- linux.old/include/asm-mips/cpu.h 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/include/asm-mips/cpu.h 2006-10-15 23:29:14.000000000 +0200 +@@ -104,6 +104,13 @@ #define PRID_IMP_SR71000 0x0400 /* @@ -11877,33 +11919,21 @@ diff -urN linux.old/include/asm-mips/cpu.h linux.dev/include/asm-mips/cpu.h * 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 -urN linux.old/include/linux/init.h linux.dev/include/linux/init.h ---- 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 - -+#define early_initcall(fn) __define_initcall(".early1",fn) -+ - #define core_initcall(fn) __define_initcall("1",fn) - #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-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 @@ +--- linux.old/include/linux/pci_ids.h 2006-10-15 23:32:44.000000000 +0200 ++++ linux.dev/include/linux/pci_ids.h 2006-10-15 23:29:14.000000000 +0200 +@@ -1906,6 +1906,7 @@ #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e #define PCI_DEVICE_ID_BCM4401 0x4401 #define PCI_DEVICE_ID_BCM4401B0 0x4402