X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/4dd54d3132dce7fa7c870d9215237e3bf471cd74..7605432c908bc7809c7ceee3aaadb28981190771:/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch diff --git a/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch b/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch index 23d0d6964..3b8b2597c 100644 --- a/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch +++ b/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch @@ -710,7 +710,7 @@ diff -urN linux.old/arch/mips/bcm963xx/board.c linux.dev/arch/mips/bcm963xx/boar + +/* DyingGasp function prototype */ +static void __init kerSysDyingGaspMapIntr(void); -+static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs); ++static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id); +static void __init kerSysInitDyingGaspHandler( void ); +static void __exit kerSysDeinitDyingGaspHandler( void ); +/* -DyingGasp function prototype - */ @@ -982,7 +982,7 @@ diff -urN linux.old/arch/mips/bcm963xx/board.c linux.dev/arch/mips/bcm963xx/boar +} + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) -+static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs) ++static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id) +#else +static unsigned int kerSysDyingGaspIsr(void) +#endif @@ -5577,7 +5577,7 @@ diff -urN linux.old/arch/mips/bcm963xx/include/bcm_intr.h linux.dev/arch/mips/bc + +/* defines */ +struct pt_regs; -+typedef int (*FN_HANDLER) (int, void *, struct pt_regs *); ++typedef int (*FN_HANDLER) (int, void *); + +/* prototypes */ +extern void enable_brcm_irq(unsigned int irq); @@ -6454,7 +6454,7 @@ diff -urN linux.old/arch/mips/bcm963xx/int-handler.S linux.dev/arch/mips/bcm963x + * Generic interrupt handler for Broadcom MIPS boards + */ + -+#include ++#include + +#include +#include @@ -6555,13 +6555,13 @@ diff -urN linux.old/arch/mips/bcm963xx/irq.c linux.dev/arch/mips/bcm963xx/irq.c + } + if (pendingIrqs & irqBit) { + PERF->IrqMask &= ~irqBit; // mask -+ do_IRQ(isrNumber + INTERNAL_ISR_TABLE_OFFSET, regs); ++ do_IRQ(isrNumber + INTERNAL_ISR_TABLE_OFFSET); + break; + } + } +} + -+static void irq_dispatch_ext(uint32 irq, struct pt_regs *regs) ++static void irq_dispatch_ext(uint32 irq) +{ + if (!(PERF->ExtIrqCfg & (1 << (irq - INTERRUPT_ID_EXTERNAL_0 + EI_MASK_SHFT)))) { + printk("**** Ext IRQ mask. Should not dispatch ****\n"); @@ -6569,7 +6569,7 @@ diff -urN linux.old/arch/mips/bcm963xx/irq.c linux.dev/arch/mips/bcm963xx/irq.c + /* 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, regs); ++ do_IRQ(irq); +} + + @@ -6584,13 +6584,13 @@ diff -urN linux.old/arch/mips/bcm963xx/irq.c linux.dev/arch/mips/bcm963xx/irq.c + else if (cause & CAUSEF_IP2) + irq_dispatch_int(regs); + else if (cause & CAUSEF_IP3) -+ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_0, regs); ++ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_0); + else if (cause & CAUSEF_IP4) -+ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_1, regs); ++ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_1); + else if (cause & CAUSEF_IP5) -+ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_2, regs); ++ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_2); + else if (cause & CAUSEF_IP6) -+ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_3, regs); ++ irq_dispatch_ext(INTERRUPT_ID_EXTERNAL_3); + local_irq_disable(); + } +} @@ -6758,7 +6758,7 @@ diff -urN linux.old/arch/mips/bcm963xx/Kconfig linux.dev/arch/mips/bcm963xx/Kcon +# Kernel and Driver configuration for Broadcom Commengine ADSL board +choice + prompt "Broadcom Commengine ADSL board" -+ depends on MIPS_BRCM ++ depends on BCM963XX + default BCM96345 + help + Select different Broadcom ADSL board @@ -6920,26 +6920,26 @@ diff -urN linux.old/arch/mips/bcm963xx/Makefile linux.dev/arch/mips/bcm963xx/Mak +EXTRA_CFLAGS += -DADSL_ANNEXC +endif + -diff -urN linux.old/arch/mips/bcm963xx/prom.c linux.dev/arch/mips/bcm963xx/prom.c ---- linux.old/arch/mips/bcm963xx/prom.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/arch/mips/bcm963xx/prom.c 2006-08-27 21:02:04.000000000 +0200 -@@ -0,0 +1,130 @@ +diff -urN linux-2.6.17/arch/mips/bcm963xx/prom.c linux-2.6.17-brcm63xx/arch/mips/bcm963xx/prom.c +--- linux-2.6.17/arch/mips/bcm963xx/prom.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.17-brcm63xx/arch/mips/bcm963xx/prom.c 2006-08-29 07:10:10.000000000 +0200 +@@ -0,0 +1,143 @@ +/* -+<:copyright-gpl -+ Copyright 2004 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. ++<:copyright-gpl ++ Copyright 2004 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. +:> +*/ +/* @@ -6965,6 +6965,8 @@ diff -urN linux.old/arch/mips/bcm963xx/prom.c linux.dev/arch/mips/bcm963xx/prom. +//char arcs_cmdline[CL_SIZE] __initdata = {0}; +/* inv_xde */ +int boot_loader_type; ++int prom_argc; ++char **prom_argv, **prom_envp; + +extern int do_syslog(int, char *, int); +extern void serial_init(void); @@ -7022,9 +7024,20 @@ diff -urN linux.old/arch/mips/bcm963xx/prom.c linux.dev/arch/mips/bcm963xx/prom. + + serial_init(); + -+ /* Need to fixup boot loader detection code -+ * whithout changing prom_init prototype -+ */ ++ prom_argc = fw_arg0; ++ prom_argv = (char **) fw_arg1; ++ prom_envp = (char **) fw_arg2; ++ ++ if ((prom_argv > 0x80000000) && (prom_argv < 0x82000000)) { ++ strncpy(arcs_cmdline, prom_argv[1], CL_SIZE); ++ } ++ ++ if (strncmp(arcs_cmdline, "boot_loader=RedBoot", 19) != 0) { ++ boot_loader_type = BOOT_CFE; ++ } ++ else { ++ boot_loader_type = BOOT_REDBOOT; ++ } + + do_syslog(8, NULL, 8); + @@ -7034,20 +7047,20 @@ diff -urN linux.old/arch/mips/bcm963xx/prom.c linux.dev/arch/mips/bcm963xx/prom. + + arcs_cmdline[0] = '\0'; + -+ if (boot_loader_type == BOOT_CFE) ++ if (boot_loader_type == BOOT_CFE) + add_memory_region(0, (getMemorySize() - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM); + else -+ add_memory_region(0, (0x01000000 - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM); ++ add_memory_region(0, (0x01000000 - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM); + + mips_machgroup = MACH_GROUP_BRCM; + mips_machtype = MACH_BCM; + -+ BpSetBoardId("96348GW-10"); ++ BpSetBoardId("96348GW-10"); +} + +/* -------------------------------------------------------------------------- + Name: prom_free_prom_memory -+Abstract: ++Abstract: + -------------------------------------------------------------------------- */ +void __init prom_free_prom_memory(void) +{ @@ -7082,7 +7095,7 @@ diff -urN linux.old/arch/mips/bcm963xx/ser_init.c linux.dev/arch/mips/bcm963xx/s + * + */ + -+#include ++#include +#include +#include +#include @@ -7264,7 +7277,7 @@ diff -urN linux.old/arch/mips/bcm963xx/setup.c linux.dev/arch/mips/bcm963xx/setu + * Generic setup routines for Broadcom 963xx MIPS boards + */ + -+#include ++#include +#include +#include +#include @@ -7799,7 +7812,7 @@ diff -urN linux.old/arch/mips/bcm963xx/time.c linux.dev/arch/mips/bcm963xx/time. + * Setup time for Broadcom 963xx MIPS boards + */ + -+#include ++#include +#include +#include +#include @@ -7898,7 +7911,7 @@ diff -urN linux.old/arch/mips/Kconfig linux.dev/arch/mips/Kconfig prompt "System type" default SGI_IP22 -+config MIPS_BRCM ++config BCM963XX + bool "Support for the Broadcom boards" + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_BIG_ENDIAN @@ -7979,10 +7992,10 @@ diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile # +# Broadcom board +# -+core-$(CONFIG_MIPS_BRCM) += arch/mips/bcm963xx/ -+cflags-$(CONFIG_MIPS_BRCM) += -Iinclude/asm-mips/mach-bcm963xx -+cflags-$(CONFIG_MIPS_BRCM) += -Iarch/mips/bcm963xx/include -+load-$(CONFIG_MIPS_BRCM) += 0xffffffff80010000 ++core-$(CONFIG_BCM963XX) += arch/mips/bcm963xx/ ++cflags-$(CONFIG_BCM963XX) += -Iinclude/asm-mips/mach-bcm963xx ++cflags-$(CONFIG_BCM963XX) += -Iarch/mips/bcm963xx/include ++load-$(CONFIG_BCM963XX) += 0xffffffff80010000 + + +# @@ -8019,26 +8032,26 @@ diff -urN linux.old/arch/mips/mm/tlbex.c linux.dev/arch/mips/mm/tlbex.c tlbw(p); break; -diff -urN linux.old/arch/mips/pci/fixup-bcm96348.c linux.dev/arch/mips/pci/fixup-bcm96348.c ---- linux.old/arch/mips/pci/fixup-bcm96348.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/arch/mips/pci/fixup-bcm96348.c 2006-08-25 00:39:38.000000000 +0200 -@@ -0,0 +1,85 @@ +diff -urN linux-2.6.17/arch/mips/pci/fixup-bcm96348.c linux-2.6.17-brcm63xx/arch/mips/pci/fixup-bcm96348.c +--- linux-2.6.17/arch/mips/pci/fixup-bcm96348.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.17-brcm63xx/arch/mips/pci/fixup-bcm96348.c 2006-08-29 10:25:22.000000000 +0200 +@@ -0,0 +1,93 @@ +/* -+<: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. ++<: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. +:> +*/ +#include @@ -8078,10 +8091,10 @@ diff -urN linux.old/arch/mips/pci/fixup-bcm96348.c linux.dev/arch/mips/pci/fixup + // Memory Window 1. Mask determines which bits are decoded. + mpi->l2pmrange1 = ~(size-1); + // UBUS to PCI Memory base address. This is akin to the ChipSelect base -+ // register. ++ // register. + mpi->l2pmbase1 = memaddr & BCM_PCI_ADDR_MASK; + // UBUS to PCI Remap Address. Replaces the masked address bits in the -+ // range register with this setting. ++ // range register with this setting. + // Also, enable direct I/O and direct Memory accesses + mpi->l2pmremap1 = (memaddr | MEM_WINDOW_EN); + break; @@ -8089,7 +8102,7 @@ diff -urN linux.old/arch/mips/pci/fixup-bcm96348.c linux.dev/arch/mips/pci/fixup + case 1: + // Memory Window 2 + mpi->l2pmrange2 = ~(size-1); -+ // UBUS to PCI Memory base address. ++ // UBUS to PCI Memory base address. + mpi->l2pmbase2 = memaddr & BCM_PCI_ADDR_MASK; + // UBUS to PCI Remap Address + mpi->l2pmremap2 = (memaddr | MEM_WINDOW_EN); @@ -8104,10 +8117,18 @@ diff -urN linux.old/arch/mips/pci/fixup-bcm96348.c linux.dev/arch/mips/pci/fixup + } +} + -+struct pci_fixup pcibios_fixups[] = { ++int pcibios_plat_dev_init(struct pci_dev *dev) ++{ ++ return 0; ++} ++ ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_ANY_ID, ++ bcm96348_fixup); ++ ++/*struct pci_fixup pcibios_fixups[] = { + { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, bcm96348_fixup }, + {0} -+}; ++};*/ diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile --- linux.old/arch/mips/pci/Makefile 2006-08-25 00:43:29.000000000 +0200 +++ linux.dev/arch/mips/pci/Makefile 2006-08-25 00:39:38.000000000 +0200 @@ -8399,26 +8420,26 @@ diff -urN linux.old/arch/mips/pci/ops-bcm96348.c linux.dev/arch/mips/pci/ops-bcm + .read = bcm96348_pcibios_read, + .write = bcm96348_pcibios_write +}; -diff -urN linux.old/arch/mips/pci/pci-bcm96348.c linux.dev/arch/mips/pci/pci-bcm96348.c ---- linux.old/arch/mips/pci/pci-bcm96348.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/arch/mips/pci/pci-bcm96348.c 2006-08-25 00:39:38.000000000 +0200 +diff -urN linux-2.6.17/arch/mips/pci/pci-bcm96348.c linux-2.6.17-brcm63xx/arch/mips/pci/pci-bcm96348.c +--- linux-2.6.17/arch/mips/pci/pci-bcm96348.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.17-brcm63xx/arch/mips/pci/pci-bcm96348.c 2006-08-29 10:25:13.000000000 +0200 @@ -0,0 +1,54 @@ +/* -+<: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. ++<: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. +:> +*/ +#include @@ -8426,7 +8447,7 @@ diff -urN linux.old/arch/mips/pci/pci-bcm96348.c linux.dev/arch/mips/pci/pci-bcm +#include +#include + -+#include ++//#include +#include + +static struct resource bcm_pci_io_resource = { @@ -8446,9 +8467,9 @@ diff -urN linux.old/arch/mips/pci/pci-bcm96348.c linux.dev/arch/mips/pci/pci-bcm +extern struct pci_ops bcm96348_pci_ops; + +struct pci_controller bcm96348_controller = { -+ .pci_ops = &bcm96348_pci_ops, -+ .io_resource = &bcm_pci_io_resource, -+ .mem_resource = &bcm_pci_mem_resource, ++ .pci_ops = &bcm96348_pci_ops, ++ .io_resource = &bcm_pci_io_resource, ++ .mem_resource = &bcm_pci_mem_resource, +}; + +static void bcm96348_pci_init(void) @@ -8711,7 +8732,7 @@ diff -urN linux.old/drivers/serial/bcm63xx_cons.c linux.dev/drivers/serial/bcm63 + * ------------------------------------------------------------ + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -+static irqreturn_t bcm_interrupt (int irq, void * dev, struct pt_regs * regs) ++static irqreturn_t bcm_interrupt (int irq, void * dev) +#else +static void bcm_interrupt (int irq, void * dev, struct pt_regs * regs) +#endif