summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-2.6.25
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-11-15 11:21:42 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-11-15 11:21:42 +0000
commit42dd4ac5f0d25d070b888dae143e0987f46826c3 (patch)
tree18e3915ee612328a9a1a17deaf7bc6f4ad63e1dd /target/linux/brcm63xx/patches-2.6.25
parente3c583df0fbff69ea20d2e83a7bbbc466f73eb67 (diff)
Delete old brcm63xx files
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13210 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-2.6.25')
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/001-bcm963xx.patch170
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/002-bcm963xx_serial.patch18
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/040-bcm963xx_flashmap.patch73
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/050-bcm963xx_add_trailing_zero.patch24
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/060-bcm963xx_rewrite_irq_handling_code.patch452
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/070-bcm963xx_fix_uart_isr.patch31
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/080-bcm963xx_remove_unused_int_handler.patch87
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/090-bcm963xx_remove_obsolete_timer_code.patch66
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/100-bcm963xx_add_new_timer_code.patch115
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/110-bcm963xx_fix_cfe_detection.patch41
-rw-r--r--target/linux/brcm63xx/patches-2.6.25/500-bcm96345_fixes.patch116
11 files changed, 0 insertions, 1193 deletions
diff --git a/target/linux/brcm63xx/patches-2.6.25/001-bcm963xx.patch b/target/linux/brcm63xx/patches-2.6.25/001-bcm963xx.patch
deleted file mode 100644
index 909ff61a5..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/001-bcm963xx.patch
+++ /dev/null
@@ -1,170 +0,0 @@
-From 2b2b8e163d28646cbbfde81c900fbb57d6572a11 Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Thu, 15 May 2008 11:00:43 +0200
-Subject: [PATCH] bcm963xx: board support
-
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/Kconfig | 11 +++++++++++
- arch/mips/Makefile | 4 ++++
- arch/mips/kernel/cpu-probe.c | 16 ++++++++++++++++
- arch/mips/mm/c-r4k.c | 7 +++++++
- arch/mips/mm/tlbex.c | 4 ++++
- arch/mips/pci/Makefile | 1 +
- include/asm-mips/bootinfo.h | 12 ++++++++++++
- include/asm-mips/cpu.h | 7 ++++++-
- 8 files changed, 61 insertions(+), 1 deletions(-)
-
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -59,6 +59,17 @@
- help
- Support for BCM47XX based boards
-
-+config BCM963XX
-+ bool "Support for Broadcom BCM963xx SoC"
-+ select SYS_SUPPORTS_32BIT_KERNEL
-+ select SYS_SUPPORTS_BIG_ENDIAN
-+ select SYS_HAS_CPU_MIPS32_R1
-+ select HW_HAS_PCI
-+ select DMA_NONCOHERENT
-+ select IRQ_CPU
-+ help
-+ This is a fmaily of boards based on the Broadcom MIPS32
-+
- config MIPS_COBALT
- bool "Cobalt Server"
- select CEVT_R4K
---- a/arch/mips/Makefile
-+++ b/arch/mips/Makefile
-@@ -560,6 +560,10 @@
- cflags-$(CONFIG_BCM47XX) += -Iinclude/asm-mips/mach-bcm47xx
- load-$(CONFIG_BCM47XX) := 0xffffffff80001000
-
-+core-$(CONFIG_BCM963XX) += arch/mips/bcm963xx/
-+cflags-$(CONFIG_BCM963XX) += -Iinclude/asm-mips/mach-bcm963xx
-+load-$(CONFIG_BCM963XX) := 0xffffffff8001000
-+
- #
- # SNI RM
- #
---- a/arch/mips/kernel/cpu-probe.c
-+++ b/arch/mips/kernel/cpu-probe.c
-@@ -803,6 +803,21 @@
- case PRID_IMP_BCM4710:
- c->cputype = CPU_BCM4710;
- break;
-+// case PRID_IMP_BCM6338:
-+// c->cputype = CPU_BCM6338;
-+// break;
-+ case PRID_IMP_BCM6345:
-+ c->cputype = CPU_BCM6345;
-+ break;
-+ case PRID_IMP_BCM6348:
-+ c->cputype = CPU_BCM6348;
-+ break;
-+ case PRID_IMP_BCM6358:
-+ c->cputype = CPU_BCM6358;
-+ break;
-+ case PRID_IMP_BCM3350:
-+ c->cputype = CPU_BCM3350;
-+ break;
- default:
- c->cputype = CPU_UNKNOWN;
- break;
-@@ -887,6 +902,11 @@
- case CPU_SR71000: name = "Sandcraft SR71000"; break;
- case CPU_BCM3302: name = "Broadcom BCM3302"; break;
- case CPU_BCM4710: name = "Broadcom BCM4710"; break;
-+ case CPU_BCM6338: name = "Broadcom BCM6338"; break;
-+ case CPU_BCM6345: name = "Broadcom BCM6345"; break;
-+ case CPU_BCM6348: name = "Broadcom BCM6348"; break;
-+ case CPU_BCM6358: name = "Broadcom BCM6358"; break;
-+ case CPU_BCM3350: name = "Broadcom BCM3350"; break;
- case CPU_PR4450: name = "Philips PR4450"; break;
- case CPU_LOONGSON2: name = "ICT Loongson-2"; break;
- default:
---- a/arch/mips/mm/c-r4k.c
-+++ b/arch/mips/mm/c-r4k.c
-@@ -882,6 +882,13 @@
- if (!(config & MIPS_CONF_M))
- panic("Don't know how to probe P-caches on this cpu.");
-
-+ if (c->cputype == CPU_BCM6338 || c->cputype == CPU_BCM6345 || c->cputype == CPU_BCM6348 || c->cputype == CPU_BCM6358 || c->cputype == CPU_BCM3350)
-+ {
-+ printk("bcm963xx: enabling icache and dcache...\n");
-+ /* Enable caches */
-+ write_c0_diag(read_c0_diag() | 0xC0000000);
-+ }
-+
- /*
- * So we seem to be a MIPS32 or MIPS64 CPU
- * So let's probe the I-cache ...
---- a/arch/mips/mm/tlbex.c
-+++ b/arch/mips/mm/tlbex.c
-@@ -315,6 +315,11 @@
- case CPU_25KF:
- case CPU_BCM3302:
- case CPU_BCM4710:
-+// case CPU_BCM6338:
-+ case CPU_BCM6345:
-+ case CPU_BCM6348:
-+ case CPU_BCM6358:
-+ case CPU_BCM3350:
- case CPU_LOONGSON2:
- if (m4kc_tlbp_war())
- uasm_i_nop(p);
---- a/arch/mips/pci/Makefile
-+++ b/arch/mips/pci/Makefile
-@@ -48,3 +48,4 @@
- obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
- obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
- obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o
-+obj-$(CONFIG_BCM963XX) += fixup-bcm96348.o pci-bcm96348.o ops-bcm96348.o
---- a/include/asm-mips/bootinfo.h
-+++ b/include/asm-mips/bootinfo.h
-@@ -94,6 +94,19 @@
- #define MACH_MSP7120_FPGA 5 /* PMC-Sierra MSP7120 Emulation */
- #define MACH_MSP_OTHER 255 /* PMC-Sierra unknown board type */
-
-+#define MACH_WRPPMC 1
-+
-+/*
-+ * Valid machtype for group Broadcom
-+ */
-+#define MACH_GROUP_BRCM 23 /* Broadcom */
-+#define MACH_BCM47XX 1 /* Broadcom BCM47XX */
-+#define MACH_BCM96338 2
-+#define MACH_BCM96345 3
-+#define MACH_BCM96348 4
-+#define MACH_BCM96358 5
-+#define MACH_BCM3350 6
-+
- #define CL_SIZE COMMAND_LINE_SIZE
-
- extern char *system_type;
---- a/include/asm-mips/cpu.h
-+++ b/include/asm-mips/cpu.h
-@@ -111,6 +111,11 @@
-
- #define PRID_IMP_BCM4710 0x4000
- #define PRID_IMP_BCM3302 0x9000
-+//#define PRID_IMP_BCM6338 0x9000
-+#define PRID_IMP_BCM6345 0x8000
-+#define PRID_IMP_BCM6348 0x9100
-+#define PRID_IMP_BCM6358 0xA000
-+#define PRID_IMP_BCM3350 0x28000
-
- /*
- * Definitions for 7:0 on legacy processors
-@@ -196,7 +201,8 @@
- */
- CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_74K, CPU_AU1000,
- CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500, CPU_AU1550,
-- CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
-+ CPU_PR4450, CPU_BCM3302, CPU_BCM4710, CPU_BCM6338, CPU_BCM6345, CPU_BCM6348,
-+ CPU_BCM6358, CPU_BCM3350,
-
- /*
- * MIPS64 class processors
diff --git a/target/linux/brcm63xx/patches-2.6.25/002-bcm963xx_serial.patch b/target/linux/brcm63xx/patches-2.6.25/002-bcm963xx_serial.patch
deleted file mode 100644
index 7c46a79e7..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/002-bcm963xx_serial.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-From 53bc5316c1123689dddf2c78a4cdfd15834237e8 Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Mon, 12 May 2008 18:53:47 +0200
-Subject: [PATCH] bcm963xx: serial port support
-
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- drivers/serial/Makefile | 1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
---- a/drivers/serial/Makefile
-+++ b/drivers/serial/Makefile
-@@ -67,3 +67,4 @@
- obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
- obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
- obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
-+obj-$(CONFIG_BCM963XX) += bcm63xx_cons.o
diff --git a/target/linux/brcm63xx/patches-2.6.25/040-bcm963xx_flashmap.patch b/target/linux/brcm63xx/patches-2.6.25/040-bcm963xx_flashmap.patch
deleted file mode 100644
index e4e6ff5c5..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/040-bcm963xx_flashmap.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From e734ace5baa04e0e8af1d4483475fbd6bd2b32a1 Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Mon, 12 May 2008 18:54:09 +0200
-Subject: [PATCH] bcm963xx: flashmap support
-
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- drivers/mtd/maps/Kconfig | 7 +++++++
- drivers/mtd/maps/Makefile | 1 +
- drivers/mtd/redboot.c | 13 ++++++++++---
- 3 files changed, 18 insertions(+), 3 deletions(-)
-
---- a/drivers/mtd/maps/Kconfig
-+++ b/drivers/mtd/maps/Kconfig
-@@ -262,6 +262,13 @@
- Flash memory access on 4G Systems MTX-1 Board. If you have one of
- these boards and would like to use the flash chips on it, say 'Y'.
-
-+config MTD_BCM963XX
-+ tristate "BCM963xx Flash device"
-+ depends on MIPS && BCM963XX
-+ help
-+ Flash memory access on BCM963xx boards. Currently only works with
-+ RedBoot and CFE.
-+
- config MTD_DILNETPC
- tristate "CFI Flash device mapped on DIL/Net PC"
- depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
---- a/drivers/mtd/maps/Makefile
-+++ b/drivers/mtd/maps/Makefile
-@@ -68,3 +68,4 @@
- obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
- obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o
- obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
-+obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o
---- a/drivers/mtd/redboot.c
-+++ b/drivers/mtd/redboot.c
-@@ -39,7 +39,7 @@
- return 1;
- }
-
--static int parse_redboot_partitions(struct mtd_info *master,
-+int parse_redboot_partitions(struct mtd_info *master,
- struct mtd_partition **pparts,
- unsigned long fis_origin)
- {
-@@ -161,6 +161,14 @@
- goto out;
- }
-
-+ if (!fis_origin) {
-+ for (i = 0; i < numslots; i++) {
-+ if (!strncmp(buf[i].name, "RedBoot", 8)) {
-+ fis_origin = (buf[i].flash_base & (master->size << 1) - 1);
-+ }
-+ }
-+ }
-+
- for (i = 0; i < numslots; i++) {
- struct fis_list *new_fl, **prev;
-
-@@ -183,9 +191,8 @@
- new_fl->img = &buf[i];
- if (fis_origin) {
- buf[i].flash_base -= fis_origin;
-- } else {
-- buf[i].flash_base &= master->size-1;
- }
-+ buf[i].flash_base &= (master->size << 1) - 1;
-
- /* I'm sure the JFFS2 code has done me permanent damage.
- * I now think the following is _normal_
diff --git a/target/linux/brcm63xx/patches-2.6.25/050-bcm963xx_add_trailing_zero.patch b/target/linux/brcm63xx/patches-2.6.25/050-bcm963xx_add_trailing_zero.patch
deleted file mode 100644
index d13ca9266..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/050-bcm963xx_add_trailing_zero.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 40dd38388c3d1c87efe254cee533fc5db5ffc4ed Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Wed, 14 May 2008 12:43:34 +0200
-Subject: [PATCH] bcm963xx: add missing trailing zero to load address
-
-The load address for BCM963xx is 0x80010000, not 0xf8001000 as in the current
-sources. I think this is just a typo, so this patch fixes it (tested on 96345).
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/Makefile | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
---- a/arch/mips/Makefile
-+++ b/arch/mips/Makefile
-@@ -562,7 +562,7 @@
-
- core-$(CONFIG_BCM963XX) += arch/mips/bcm963xx/
- cflags-$(CONFIG_BCM963XX) += -Iinclude/asm-mips/mach-bcm963xx
--load-$(CONFIG_BCM963XX) := 0xffffffff8001000
-+load-$(CONFIG_BCM963XX) := 0xffffffff80010000
-
- #
- # SNI RM
diff --git a/target/linux/brcm63xx/patches-2.6.25/060-bcm963xx_rewrite_irq_handling_code.patch b/target/linux/brcm63xx/patches-2.6.25/060-bcm963xx_rewrite_irq_handling_code.patch
deleted file mode 100644
index 349010486..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/060-bcm963xx_rewrite_irq_handling_code.patch
+++ /dev/null
@@ -1,452 +0,0 @@
-From 9a70f2dcb24a5aab29386373c86ba035acba4891 Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Sun, 18 May 2008 12:07:21 +0200
-Subject: [PATCH] bcm963xx: rewrite irq handling code
-
-This patch adds interrupt handling as on AR7. The old code was very messy and
-didn't work too well.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/bcm963xx/irq.c | 308 ++++++++++-------------------
- drivers/serial/bcm63xx_cons.c | 13 +-
- include/asm-mips/mach-bcm963xx/bcm_intr.h | 18 +--
- 3 files changed, 119 insertions(+), 220 deletions(-)
-
---- a/arch/mips/bcm963xx/irq.c
-+++ b/arch/mips/bcm963xx/irq.c
-@@ -1,259 +1,159 @@
- /*
--<:copyright-gpl
-- Copyright 2002 Broadcom Corp. All Rights Reserved.
--
-- This program is free software; you can distribute it and/or modify it
-- under the terms of the GNU General Public License (Version 2) as
-- published by the Free Software Foundation.
--
-- This program is distributed in the hope it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for more details.
--
-- 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.,
-- 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
--:>
--*/
--/*
-- * Interrupt control functions for Broadcom 963xx MIPS boards
-+ * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
-+ * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
-+ * Copyright (C) 2008 Axel Gembe <ago@bastart.eu.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 program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
--#include <asm/atomic.h>
--
--#include <linux/delay.h>
--#include <linux/init.h>
--#include <linux/ioport.h>
--#include <linux/irq.h>
- #include <linux/interrupt.h>
--#include <linux/kernel.h>
--#include <linux/slab.h>
--#include <linux/module.h>
-+#include <linux/io.h>
-
--#include <asm/irq.h>
-+#include <asm/irq_cpu.h>
- #include <asm/mipsregs.h>
--#include <asm/addrspace.h>
--#include <asm/signal.h>
-+
- #include <6348_map_part.h>
- #include <6348_intr.h>
- #include <bcm_map_part.h>
- #include <bcm_intr.h>
-
--static void irq_dispatch_int(void)
--{
-- unsigned int pendingIrqs;
-- static unsigned int irqBit;
-- static unsigned int isrNumber = 31;
--
-- pendingIrqs = PERF->IrqStatus & PERF->IrqMask;
-- if (!pendingIrqs) {
-- return;
-- }
-+static int bcm963xx_irq_base;
-
-- while (1) {
-- irqBit <<= 1;
-- isrNumber++;
-- if (isrNumber == 32) {
-- isrNumber = 0;
-- irqBit = 0x1;
-- }
-- if (pendingIrqs & irqBit) {
-- PERF->IrqMask &= ~irqBit; // mask
-- do_IRQ(isrNumber + INTERNAL_ISR_TABLE_OFFSET);
-- break;
-- }
-- }
-+void bcm963xx_unmask_irq(unsigned int irq)
-+{
-+ PERF->IrqMask |= (1 << (irq - bcm963xx_irq_base));
- }
-
--static void irq_dispatch_ext(uint32 irq)
-+void bcm963xx_mask_irq(unsigned int irq)
- {
-- if (!(PERF->ExtIrqCfg & (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)))) {
-- printk("**** Ext IRQ mask. Should not dispatch ****\n");
-- }
-- /* disable and clear interrupt in the controller */
-- PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
-- PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
-- do_IRQ(irq);
-+ PERF->IrqMask &= ~(1 << (irq - bcm963xx_irq_base));
- }
-
--
--//extern void brcm_timer_interrupt(struct pt_regs *regs);
--
--asmlinkage void plat_irq_dispatch(void)
-+void bcm963xx_ack_irq(unsigned int irq)
- {
-- unsigned long cause;
--
-- cause = read_c0_status() & read_c0_cause() & ST0_IM;
-- if (cause & CAUSEF_IP7)
-- do_IRQ(7);
-- else if (cause & CAUSEF_IP2)
-- irq_dispatch_int();
-- else if (cause & CAUSEF_IP3)
-- irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_0);
-- else if (cause & CAUSEF_IP4)
-- irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_1);
-- else if (cause & CAUSEF_IP5)
-- irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_2);
-- else if (cause & CAUSEF_IP6) {
-- irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_3);
-- local_irq_disable();
-- }
-+ PERF->IrqStatus &= ~(1 << (irq - bcm963xx_irq_base));
- }
-
--
--void enable_brcm_irq(unsigned int irq)
-+void bcm963xx_unmask_ext_irq(unsigned int irq)
- {
-- unsigned long flags;
--
-- local_irq_save(flags);
-- if( irq >= INTERNAL_ISR_TABLE_OFFSET ) {
-- PERF->IrqMask |= (1 << (irq - INTERNAL_ISR_TABLE_OFFSET));
-- }
-- else if (irq >= INTERRUPT_ID_EXTERNAL_0 && irq <= INTERRUPT_ID_EXTERNAL_3) {
-- /* enable and clear interrupt in the controller */
-- PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
- PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
-- }
-- local_irq_restore(flags);
- }
-
--void disable_brcm_irq(unsigned int irq)
-+void bcm963xx_mask_ext_irq(unsigned int irq)
- {
-- unsigned long flags;
--
-- local_irq_save(flags);
-- if( irq >= INTERNAL_ISR_TABLE_OFFSET ) {
-- PERF->IrqMask &= ~(1 << (irq - INTERNAL_ISR_TABLE_OFFSET));
-- }
-- else if (irq >= INTERRUPT_ID_EXTERNAL_0 && irq <= INTERRUPT_ID_EXTERNAL_3) {
-- /* disable interrupt in the controller */
- PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT));
-- }
-- local_irq_restore(flags);
- }
-
--void ack_brcm_irq(unsigned int irq)
-+void bcm963xx_ack_ext_irq(unsigned int irq)
- {
-- /* Already done in brcm_irq_dispatch */
-+ PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT));
- }
-
--unsigned int startup_brcm_irq(unsigned int irq)
-+static void bcm963xx_dispatch_ext_irq(unsigned int irq)
- {
-- enable_brcm_irq(irq);
--
-- return 0; /* never anything pending */
-+ bcm963xx_ack_ext_irq(irq);
-+ bcm963xx_mask_ext_irq(irq);
-+ do_IRQ(irq);
- }
-
--unsigned int startup_brcm_none(unsigned int irq)
-+static void bcm963xx_cascade(void)
- {
-- return 0;
--}
-+ uint32_t pending, bit, irq;
-
--void end_brcm_irq(unsigned int irq)
--{
-- if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-- enable_brcm_irq(irq);
--}
-+ if (!(pending = PERF->IrqStatus & PERF->IrqMask))
-+ return;
-
--void end_brcm_none(unsigned int irq)
--{
--}
-+ for (irq = 0, bit = 1; irq < 32; irq++, bit <<= 1) {
-+ if (pending & bit) {
-+ bcm963xx_ack_irq(irq + bcm963xx_irq_base);
-+ bcm963xx_mask_irq(irq + bcm963xx_irq_base);
-+ do_IRQ(irq + bcm963xx_irq_base);
-+ return;
-+ }
-+ }
-+
-+ spurious_interrupt();
-+}
-+
-+static struct irq_chip bcm963xx_irq_type = {
-+ .name = "bcm963xx",
-+ .unmask = bcm963xx_unmask_irq,
-+ .mask = bcm963xx_mask_irq,
-+ .ack = bcm963xx_ack_irq
-+};
-
--static struct hw_interrupt_type brcm_irq_type = {
-- .typename = "MIPS",
-- .startup = startup_brcm_irq,
-- .shutdown = disable_brcm_irq,
-- .enable = enable_brcm_irq,
-- .disable = disable_brcm_irq,
-- .ack = ack_brcm_irq,
-- .end = end_brcm_irq,
-- .set_affinity = NULL
-+static struct irq_chip bcm963xx_ext_irq_type = {
-+ .name = "bcm963xx_ext",
-+ .unmask = bcm963xx_unmask_ext_irq,
-+ .mask = bcm963xx_mask_ext_irq,
-+ .ack = bcm963xx_ack_ext_irq,
- };
-
--static struct hw_interrupt_type brcm_irq_no_end_type = {
-- .typename = "MIPS",
-- .startup = startup_brcm_none,
-- .shutdown = disable_brcm_irq,
-- .enable = enable_brcm_irq,
-- .disable = disable_brcm_irq,
-- .ack = ack_brcm_irq,
-- .end = end_brcm_none,
-- .set_affinity = NULL
-+static struct irqaction bcm963xx_cascade_action = {
-+ .handler = no_action,
-+ .name = "BCM963xx cascade interrupt"
- };
-
--void __init arch_init_irq(void)
-+static void __init bcm963xx_irq_init(int base)
- {
- int i;
-
-- clear_c0_status(ST0_BEV);
-- change_c0_status(ST0_IM, (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4));
-+ bcm963xx_irq_base = base;
-
-- for (i = 0; i < NR_IRQS; i++) {
-- irq_desc[i].status = IRQ_DISABLED;
-- irq_desc[i].action = 0;
-- irq_desc[i].depth = 1;
-- irq_desc[i].chip = &brcm_irq_type;
-- }
-+ /* External IRQs */
-+ set_irq_chip_and_handler(INTERRUPT_ID_EXTERNAL_0, &bcm963xx_ext_irq_type,
-+ handle_level_irq);
-+ set_irq_chip_and_handler(INTERRUPT_ID_EXTERNAL_1, &bcm963xx_ext_irq_type,
-+ handle_level_irq);
-+ set_irq_chip_and_handler(INTERRUPT_ID_EXTERNAL_2, &bcm963xx_ext_irq_type,
-+ handle_level_irq);
-+ set_irq_chip_and_handler(INTERRUPT_ID_EXTERNAL_3, &bcm963xx_ext_irq_type,
-+ handle_level_irq);
-+
-+ for (i = 0; i < 32; i++) {
-+ set_irq_chip_and_handler(base + i, &bcm963xx_irq_type,
-+ handle_level_irq);
-+ }
-+
-+ setup_irq(2, &bcm963xx_cascade_action);
-+ setup_irq(bcm963xx_irq_base, &bcm963xx_cascade_action);
-+ set_c0_status(IE_IRQ0);
- }
-
--int request_external_irq(unsigned int irq,
-- FN_HANDLER handler,
-- unsigned long irqflags,
-- const char * devname,
-- void *dev_id)
-+asmlinkage void plat_irq_dispatch(void)
- {
-- unsigned long flags;
--
-- local_irq_save(flags);
-+ unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
-
-- PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_CLEAR_SHFT)); // Clear
-- PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)); // Mask
-- PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_INSENS_SHFT)); // Edge insesnsitive
-- PERF->ExtIrqCfg |= (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_LEVEL_SHFT)); // Level triggered
-- PERF->ExtIrqCfg &= ~(1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_SENSE_SHFT)); // Low level
--
-- local_irq_restore(flags);
--
-- return( request_irq(irq, handler, irqflags, devname, dev_id) );
-+ if (pending & STATUSF_IP7) /* cpu timer */
-+ do_IRQ(7);
-+ else if (pending & STATUSF_IP2) /* internal interrupt cascade */
-+ bcm963xx_cascade();
-+ else if (pending & STATUSF_IP3)
-+ bcm963xx_dispatch_ext_irq(INTERRUPT_ID_EXTERNAL_0);
-+ else if (pending & STATUSF_IP4)
-+ bcm963xx_dispatch_ext_irq(INTERRUPT_ID_EXTERNAL_1);
-+ else if (pending & STATUSF_IP5)
-+ bcm963xx_dispatch_ext_irq(INTERRUPT_ID_EXTERNAL_2);
-+ else if (pending & STATUSF_IP6)
-+ bcm963xx_dispatch_ext_irq(INTERRUPT_ID_EXTERNAL_3);
-+ else
-+ spurious_interrupt();
- }
-
--/* VxWorks compatibility function(s). */
--
--unsigned int BcmHalMapInterrupt(FN_HANDLER pfunc, unsigned int param,
-- unsigned int interruptId)
-+void __init arch_init_irq(void)
- {
-- int nRet = -1;
-- char *devname;
--
-- devname = kmalloc(16, GFP_KERNEL);
-- if (devname)
-- sprintf( devname, "brcm_%d", interruptId );
--
-- /* Set the IRQ description to not automatically enable the interrupt at
-- * the end of an ISR. The driver that handles the interrupt must
-- * explicitly call BcmHalInterruptEnable or enable_brcm_irq. This behavior
-- * is consistent with interrupt handling on VxWorks.
-- */
-- irq_desc[interruptId].chip = &brcm_irq_no_end_type;
--
-- if( interruptId >= INTERNAL_ISR_TABLE_OFFSET )
-- {
-- printk("BcmHalMapInterrupt : internal IRQ\n");
-- nRet = request_irq( interruptId, pfunc, IRQF_DISABLED, devname, (void *) param );
-- }
-- else if (interruptId >= INTERRUPT_ID_EXTERNAL_0 && interruptId <= INTERRUPT_ID_EXTERNAL_3)
-- {
-- printk("BcmHalMapInterrupt : external IRQ\n");
-- nRet = request_external_irq( interruptId, pfunc, IRQF_DISABLED, devname, (void *) param );
-- }
--
-- return( nRet );
-+ mips_cpu_irq_init();
-+ bcm963xx_irq_init(INTERNAL_ISR_TABLE_OFFSET);
- }
--
--
--EXPORT_SYMBOL(enable_brcm_irq);
--EXPORT_SYMBOL(disable_brcm_irq);
--EXPORT_SYMBOL(request_external_irq);
--EXPORT_SYMBOL(BcmHalMapInterrupt);
--
---- a/drivers/serial/bcm63xx_cons.c
-+++ b/drivers/serial/bcm63xx_cons.c
-@@ -267,7 +267,7 @@
- }
-
- // Clear the interrupt
-- enable_brcm_irq(INTERRUPT_ID_UART);
-+// bcm963xx_unmask_irq(INTERRUPT_ID_UART);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- return IRQ_HANDLED;
- #endif
-@@ -880,7 +880,7 @@
- info->count++;
- tty->driver_data = info;
- info->tty = tty;
-- enable_brcm_irq(INTERRUPT_ID_UART);
-+ bcm963xx_unmask_irq(INTERRUPT_ID_UART);
-
- // Start up serial port
- retval = startup(info);
-@@ -927,7 +927,7 @@
- -------------------------------------------------------------------------- */
- static int __init bcm63xx_serialinit(void)
- {
-- int i, flags;
-+ int i, flags, res;
- struct bcm_serial *info;
-
- // Print the driver version information
-@@ -981,7 +981,12 @@
- */
- if (!info->port)
- return 0;
-- BcmHalMapInterrupt(bcm_interrupt, 0, INTERRUPT_ID_UART);
-+
-+ res = request_irq(INTERRUPT_ID_UART, bcm_interrupt, 0, "bcm-uart", NULL);
-+ if (res) {
-+ spin_unlock_irqrestore(&bcm963xx_serial_lock, flags);
-+ return res;
-+ }
- }
-
- /* order matters here... the trick is that flags
---- a/include/asm-mips/mach-bcm963xx/bcm_intr.h
-+++ b/include/asm-mips/mach-bcm963xx/bcm_intr.h
-@@ -39,18 +39,12 @@
- typedef int (*FN_HANDLER) (int, void *);
-
- /* prototypes */
--extern void enable_brcm_irq(unsigned int irq);
--extern void disable_brcm_irq(unsigned int irq);
--extern int request_external_irq(unsigned int irq,
-- FN_HANDLER handler, unsigned long irqflags,
-- const char * devname, void *dev_id);
--extern unsigned int BcmHalMapInterrupt(FN_HANDLER isr, unsigned int param,
-- unsigned int interruptId);
--extern void dump_intr_regs(void);
--
--/* compatibility definitions */
--#define BcmHalInterruptEnable(irq) enable_brcm_irq( irq )
--#define BcmHalInterruptDisable(irq) disable_brcm_irq( irq )
-+extern void bcm963xx_unmask_irq(unsigned int irq);
-+extern void bcm963xx_mask_irq(unsigned int irq);
-+extern void bcm963xx_ack_irq(unsigned int irq);
-+extern void bcm963xx_unmask_ext_irq(unsigned int irq);
-+extern void bcm963xx_mask_ext_irq(unsigned int irq);
-+extern void bcm963xx_ack_ext_irq(unsigned int irq);
-
- #ifdef __cplusplus
- }
diff --git a/target/linux/brcm63xx/patches-2.6.25/070-bcm963xx_fix_uart_isr.patch b/target/linux/brcm63xx/patches-2.6.25/070-bcm963xx_fix_uart_isr.patch
deleted file mode 100644
index a90bde3f8..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/070-bcm963xx_fix_uart_isr.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 7bc3950017d2c54883591367723b7fd84cc65d6f Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Sun, 18 May 2008 12:09:14 +0200
-Subject: [PATCH] bcm963xx: fix uart isr
-
-The ISR ended up in an endless loop because the TX ISR never got used or masked.
-This patch basically makes the TX ISR mask the the TX interrupt when it
-encounters it, because it doesn't even use the TX interrupt.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- drivers/serial/bcm63xx_cons.c | 6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
---- a/drivers/serial/bcm63xx_cons.c
-+++ b/drivers/serial/bcm63xx_cons.c
-@@ -258,8 +258,14 @@
- while (intStat) {
- if (intStat & RXINT)
- receive_chars(info);
-+
-+#if 0 /* This code is total bullshit, TXINT doesn't get masked anywhere, so this will give an endless loop */
-+
- else if (intStat & TXINT)
- info->port->intStatus = TXINT;
-+
-+#endif /* 0 */
-+
- else /* don't know what it was, so let's mask it */
- info->port->intMask &= ~intStat;
-
diff --git a/target/linux/brcm63xx/patches-2.6.25/080-bcm963xx_remove_unused_int_handler.patch b/target/linux/brcm63xx/patches-2.6.25/080-bcm963xx_remove_unused_int_handler.patch
deleted file mode 100644
index 0abfd9885..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/080-bcm963xx_remove_unused_int_handler.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From e3abd028e7631ee952fe73d8f9ee97bc615526a8 Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Sat, 17 May 2008 16:07:46 +0200
-Subject: [PATCH] bcm963xx: remove unused int-handler.S
-
-The code is not used anymore.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/bcm963xx/Makefile | 2 +-
- arch/mips/bcm963xx/int-handler.S | 59 --------------------------------------
- 2 files changed, 1 insertions(+), 60 deletions(-)
- delete mode 100644 arch/mips/bcm963xx/int-handler.S
-
---- a/arch/mips/bcm963xx/Makefile
-+++ b/arch/mips/bcm963xx/Makefile
-@@ -3,7 +3,7 @@
- #
- # Copyright (C) 2004 Broadcom Corporation
- #
--obj-y := irq.o prom.o setup.o time.o ser_init.o int-handler.o info.o wdt.o
-+obj-y := irq.o prom.o setup.o time.o ser_init.o info.o wdt.o
-
- SRCBASE := $(TOPDIR)
- EXTRA_CFLAGS += -I$(SRCBASE)/include
---- a/arch/mips/bcm963xx/int-handler.S
-+++ /dev/null
-@@ -1,59 +0,0 @@
--/*
--<:copyright-gpl
-- Copyright 2002 Broadcom Corp. All Rights Reserved.
--
-- This program is free software; you can distribute it and/or modify it
-- under the terms of the GNU General Public License (Version 2) as
-- published by the Free Software Foundation.
--
-- This program is distributed in the hope it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for more details.
--
-- 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.,
-- 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
--:>
--*/
--/*
-- * Generic interrupt handler for Broadcom MIPS boards
-- */
--
--#include <linux/autoconf.h>
--
--#include <asm/asm.h>
--#include <asm/mipsregs.h>
--#include <asm/regdef.h>
--#include <asm/stackframe.h>
--
--/*
-- * MIPS IRQ Source
-- * -------- ------
-- * 0 Software (ignored)
-- * 1 Software (ignored)
-- * 2 Combined hardware interrupt (hw0)
-- * 3 Hardware
-- * 4 Hardware
-- * 5 Hardware
-- * 6 Hardware
-- * 7 R4k timer
-- */
--
-- .text
-- .set noreorder
-- .set noat
-- .align 5
-- NESTED(brcmIRQ, PT_SIZE, sp)
-- SAVE_ALL
-- CLI
-- .set noreorder
-- .set at
--
-- jal plat_irq_dispatch
-- move a0, sp
--
-- j ret_from_irq
-- nop
--
-- END(brcmIRQ)
diff --git a/target/linux/brcm63xx/patches-2.6.25/090-bcm963xx_remove_obsolete_timer_code.patch b/target/linux/brcm63xx/patches-2.6.25/090-bcm963xx_remove_obsolete_timer_code.patch
deleted file mode 100644
index 72ccfea7f..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/090-bcm963xx_remove_obsolete_timer_code.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 42ecc15386869684cf29881a3a6941bafaa3bf69 Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Wed, 14 May 2008 00:25:28 +0200
-Subject: [PATCH] bcm963xx: remove obsolete timer code
-
-This removes some code that has been deprecated in kernels >= 2.6.24.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/bcm963xx/setup.c | 2 --
- arch/mips/bcm963xx/time.c | 29 -----------------------------
- 2 files changed, 0 insertions(+), 31 deletions(-)
-
---- a/arch/mips/bcm963xx/setup.c
-+++ b/arch/mips/bcm963xx/setup.c
-@@ -465,8 +465,6 @@
- _machine_halt = brcm_machine_halt;
- pm_power_off = brcm_machine_halt;
-
-- //board_time_init = brcm_time_init;
--
- /* mpi initialization */
- mpi_init();
- }
---- a/arch/mips/bcm963xx/time.c
-+++ b/arch/mips/bcm963xx/time.c
-@@ -71,26 +71,6 @@
- return (mips_hpt_frequency / HZ);
- }
-
--
--/*
-- * There are a lot of conceptually broken versions of the MIPS timer interrupt
-- * handler floating around. This one is rather different, but the algorithm
-- * is provably more robust.
-- */
--#if 0
--irqreturn_t brcm_timer_interrupt(struct pt_regs *regs)
--{
-- int irq = MIPS_TIMER_INT;
--
-- irq_enter();
-- kstat_this_cpu.irqs[irq]++;
--
-- timer_interrupt(irq, regs);
-- irq_exit();
-- return IRQ_HANDLED;
--}
--#endif
--
- void __init plat_time_init(void)
- {
- unsigned int est_freq, flags;
-@@ -107,12 +87,3 @@
- (est_freq % 1000000) * 100 / 1000000);
- local_irq_restore(flags);
- }
--
--#if 0
--void __init plat_timer_setup(struct irqaction *irq)
--{
-- r4k_cur = (read_c0_count() + r4k_offset);
-- write_c0_compare(r4k_cur);
-- set_c0_status(IE_IRQ5);
--}
--#endif
diff --git a/target/linux/brcm63xx/patches-2.6.25/100-bcm963xx_add_new_timer_code.patch b/target/linux/brcm63xx/patches-2.6.25/100-bcm963xx_add_new_timer_code.patch
deleted file mode 100644
index 9d08ab087..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/100-bcm963xx_add_new_timer_code.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 7d6656dc127b54e53e507e8f264bb7e14e620cad Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Sat, 17 May 2008 15:02:39 +0200
-Subject: [PATCH] bcm963xx: add new timer code
-
-This basically selects the new generic MIPS timer code for BCM963xx and
-simplifies the timer setup code.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/Kconfig | 2 +
- arch/mips/bcm963xx/time.c | 64 ++++++++++++++++++++------------------------
- 2 files changed, 31 insertions(+), 35 deletions(-)
-
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -67,6 +67,8 @@
- select HW_HAS_PCI
- select DMA_NONCOHERENT
- select IRQ_CPU
-+ select CEVT_R4K
-+ select CSRC_R4K
- help
- This is a fmaily of boards based on the Broadcom MIPS32
-
---- a/arch/mips/bcm963xx/time.c
-+++ b/arch/mips/bcm963xx/time.c
-@@ -1,6 +1,7 @@
- /*
- <:copyright-gpl
- Copyright 2004 Broadcom Corp. All Rights Reserved.
-+ Copyright (C) 2008 Axel Gembe <ago@bastart.eu.org>
-
- This program is free software; you can distribute it and/or modify it
- under the terms of the GNU General Public License (Version 2) as
-@@ -40,50 +41,43 @@
- #include <bcm_map_part.h>
- #include <bcm_intr.h>
-
--static unsigned long r4k_offset; /* Amount to increment compare reg each time */
--static unsigned long r4k_cur; /* What counter should be at next timer irq */
--
--/* *********************************************************************
-- * calculateCpuSpeed()
-- * Calculate the BCM6348 CPU speed by reading the PLL strap register
-- * and applying the following formula:
-- * cpu_clk = (.25 * 64MHz freq) * (N1 + 1) * (N2 + 2) / (M1_CPU + 1)
-- * Input parameters:
-- * none
-- * Return value:
-- * none
-- ********************************************************************* */
--
-+/*
-+ * calculateCpuSpeed()
-+ *
-+ * Calculate the BCM6348 CPU speed by reading the PLL strap register and applying
-+ * the following formula:
-+ *
-+ * cpu_clk = (.25 * 64MHz freq) * (N1 + 1) * (N2 + 2) / (M1_CPU + 1)
-+ */
- static inline unsigned long __init calculateCpuSpeed(void)
- {
-- u32 pllStrap = PERF->PllStrap;
-- int n1 = (pllStrap & PLL_N1_MASK) >> PLL_N1_SHFT;
-- int n2 = (pllStrap & PLL_N2_MASK) >> PLL_N2_SHFT;
-- int m1cpu = (pllStrap & PLL_M1_CPU_MASK) >> PLL_M1_CPU_SHFT;
-+ u32 pllStrap;
-+ int n1, n2, m1cpu;
-+
-+ pllStrap = PERF->PllStrap;
-+ n1 = (pllStrap & PLL_N1_MASK) >> PLL_N1_SHFT;
-+ n2 = (pllStrap & PLL_N2_MASK) >> PLL_N2_SHFT;
-+ m1cpu = (pllStrap & PLL_M1_CPU_MASK) >> PLL_M1_CPU_SHFT;
-
- return (16 * (n1 + 1) * (n2 + 2) / (m1cpu + 1)) * 1000000;
- }
-
-
--static inline unsigned long __init cal_r4koff(void)
--{
-- mips_hpt_frequency = calculateCpuSpeed() / 2;
-- return (mips_hpt_frequency / HZ);
--}
--
- void __init plat_time_init(void)
- {
-- unsigned int est_freq, flags;
-- local_irq_save(flags);
-+ unsigned long cpu_clock;
-+
-+ cpu_clock = calculateCpuSpeed();
-+
-+ printk("CPU frequency %lu.%02lu MHz\n", cpu_clock / 1000000,
-+ (cpu_clock % 1000000) * 100 / 1000000);
-+
-+ mips_hpt_frequency = cpu_clock / 2;
-
-- printk("calculating r4koff... ");
-- r4k_offset = cal_r4koff();
-- printk("%08lx(%d)\n", r4k_offset, (int)r4k_offset);
--
-- est_freq = 2 * r4k_offset * HZ;
-- est_freq += 5000; /* round */
-- est_freq -= est_freq % 10000;
-- printk("CPU frequency %d.%02d MHz\n", est_freq / 1000000,
-- (est_freq % 1000000) * 100 / 1000000);
-- local_irq_restore(flags);
-+ /*
-+ * Use deterministic values for initial counter interrupt
-+ * so that calibrate delay avoids encountering a counter wrap.
-+ */
-+ write_c0_count(0);
-+ write_c0_compare(0xffff);
- }
diff --git a/target/linux/brcm63xx/patches-2.6.25/110-bcm963xx_fix_cfe_detection.patch b/target/linux/brcm63xx/patches-2.6.25/110-bcm963xx_fix_cfe_detection.patch
deleted file mode 100644
index 3cf460266..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/110-bcm963xx_fix_cfe_detection.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From f1a605c36cf1659f5f486ae4135de1e285fdf86c Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Sat, 17 May 2008 16:17:22 +0200
-Subject: [PATCH] bcm963xx: fix cfe detection
-
-The CFE detection failed to account for zero termination.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- drivers/mtd/maps/bcm963xx-flash.c | 11 ++++++-----
- 1 files changed, 6 insertions(+), 5 deletions(-)
-
---- a/drivers/mtd/maps/bcm963xx-flash.c
-+++ b/drivers/mtd/maps/bcm963xx-flash.c
-@@ -1,8 +1,7 @@
- /*
-- * $Id$
- * Copyright (C) 2006 Florian Fainelli <florian@openwrt.org>
-- * Mike Albon <malbon@openwrt.org>
-- * Copyright (C) $Date$ $Author$
-+ * Mike Albon <malbon@openwrt.org>
-+ * Copyright (C) 2008 Axel Gembe <ago@bastart.eu.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
-@@ -184,11 +183,13 @@
- static int bcm963xx_detect_cfe(struct mtd_info *master)
- {
- int idoffset = 0x4e0;
-- static char idstring[8] = "CFE1CFE1";
-- char buf[8];
-+ static char idstring[9] = "CFE1CFE1";
-+ char buf[9];
- int ret;
- size_t retlen;
-
-+ memset(buf, 0, sizeof(buf));
-+
- ret = master->read(master, idoffset, 8, &retlen, (void *)buf);
- printk("bcm963xx: Read Signature value of %s\n", buf);
- return strcmp(idstring,buf);
diff --git a/target/linux/brcm63xx/patches-2.6.25/500-bcm96345_fixes.patch b/target/linux/brcm63xx/patches-2.6.25/500-bcm96345_fixes.patch
deleted file mode 100644
index dd55cd163..000000000
--- a/target/linux/brcm63xx/patches-2.6.25/500-bcm96345_fixes.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From d1259cf42ce84246c695f06b44d58e3aca0a480b Mon Sep 17 00:00:00 2001
-From: Axel Gembe <ago@bastart.eu.org>
-Date: Sat, 17 May 2008 14:59:35 +0200
-Subject: [PATCH] bcm96345: correct some 6345 specific stuff
-
-This fixes some problems with the 6345 support and adds a macro for CPU
-identification that is easier on the eyes. The first thing it does is to not
-initialize MPI on the 6345 as it does not have PCI. The second thing it does is
-to use a static value for the CPU frequency of the 6345 chip to provide an
-accurate timer.
-
-Signed-off-by: Axel Gembe <ago@bastart.eu.org>
----
- arch/mips/bcm963xx/setup.c | 8 ++++++--
- arch/mips/bcm963xx/time.c | 5 ++++-
- arch/mips/pci/pci-bcm96348.c | 21 +++++++++++++--------
- include/asm-mips/mach-bcm963xx/board.h | 2 ++
- 4 files changed, 25 insertions(+), 11 deletions(-)
-
---- a/arch/mips/bcm963xx/setup.c
-+++ b/arch/mips/bcm963xx/setup.c
-@@ -43,6 +43,7 @@
- #include <asm/bootinfo.h>
- #include <asm/cpu.h>
- #include <asm/mach-bcm963xx/bootloaders.h>
-+#include <asm/mach-bcm963xx/board.h>
-
- extern void brcm_time_init(void);
- extern int boot_loader_type;
-@@ -465,6 +466,9 @@
- _machine_halt = brcm_machine_halt;
- pm_power_off = brcm_machine_halt;
-
-- /* mpi initialization */
-- mpi_init();
-+ /* BCM96345 has no MPI */
-+ if (!ISBCM(0x6345)) {
-+ /* mpi initialization */
-+ mpi_init();
-+ }
- }
---- a/arch/mips/bcm963xx/time.c
-+++ b/arch/mips/bcm963xx/time.c
-@@ -40,6 +40,8 @@
- #include <6348_intr.h>
- #include <bcm_map_part.h>
- #include <bcm_intr.h>
-+#include <asm/mach-bcm963xx/board.h>
-+
-
- /*
- * calculateCpuSpeed()
-@@ -63,11 +65,12 @@
- }
-
-
-+#define BCM96345_CPU_CLOCK 140000000
- void __init plat_time_init(void)
- {
- unsigned long cpu_clock;
-
-- cpu_clock = calculateCpuSpeed();
-+ cpu_clock = ISBCM(0x6345) ? BCM96345_CPU_CLOCK : calculateCpuSpeed();
-
- printk("CPU frequency %lu.%02lu MHz\n", cpu_clock / 1000000,
- (cpu_clock % 1000000) * 100 / 1000000);
---- a/arch/mips/pci/pci-bcm96348.c
-+++ b/arch/mips/pci/pci-bcm96348.c
-@@ -21,6 +21,8 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
-
-+#include <asm/mach-bcm963xx/6348_map_part.h>
-+#include <asm/mach-bcm963xx/board.h>
- #include <bcmpci.h>
-
- static struct resource bcm_pci_io_resource = {
-@@ -47,16 +49,19 @@
-
- static __init int bcm96348_pci_init(void)
- {
-- /* Avoid ISA compat ranges. */
-- PCIBIOS_MIN_IO = 0x00000000;
-- PCIBIOS_MIN_MEM = 0x00000000;
--
-- /* Set I/O resource limits. */
-- ioport_resource.end = 0x1fffffff;
-- iomem_resource.end = 0xffffffff;
-+ if (!ISBCM(0x6345)) {
-+ /* Avoid ISA compat ranges. */
-+ PCIBIOS_MIN_IO = 0x00000000;
-+ PCIBIOS_MIN_MEM = 0x00000000;
-+
-+ /* Set I/O resource limits. */
-+ ioport_resource.end = 0x1fffffff;
-+ iomem_resource.end = 0xffffffff;
-
-- register_pci_controller(&bcm96348_controller);
-- return 0;
-+ register_pci_controller(&bcm96348_controller);
-+ }
-+
-+ return 0;
- }
-
- arch_initcall(bcm96348_pci_init);
---- a/include/asm-mips/mach-bcm963xx/board.h
-+++ b/include/asm-mips/mach-bcm963xx/board.h
-@@ -369,5 +369,7 @@
-
- extern int boot_loader_type;
-
-+#define ISBCM(x) (((PERF->RevID & 0xFFFF0000) >> 16) == x)
-+
- #endif /* _BOARD_H */
-