X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/39acb695cbc0d7a333e4af0b5a023e513acdd1e0..f47c09307a66f78767e3fb501e25e2f9be524632:/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 533418de3..c079c5a4b 100644 --- a/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch +++ b/target/linux/brcm63xx-2.6/patches/001-bcm963xx.patch @@ -586,8 +586,8 @@ diff -urN linux.old/arch/mips/bcm963xx/bcm63xx_led.c linux.dev/arch/mips/bcm963x + diff -urN linux.old/arch/mips/bcm963xx/board.c linux.dev/arch/mips/bcm963xx/board.c --- linux.old/arch/mips/bcm963xx/board.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux.dev/arch/mips/bcm963xx/board.c 2006-08-25 15:16:26.000000000 +0200 -@@ -0,0 +1,555 @@ ++++ linux.dev/arch/mips/bcm963xx/board.c 2006-08-27 21:02:04.000000000 +0200 +@@ -0,0 +1,559 @@ +/* +<:copyright-gpl + Copyright 2002 Broadcom Corp. All Rights Reserved. @@ -760,17 +760,21 @@ diff -urN linux.old/arch/mips/bcm963xx/board.c linux.dev/arch/mips/bcm963xx/boar + /* CMO -- Fix le problème avec les adresses mac que l'on n'arrive pas + * * à relire plusieurs fois */ + /* inv_xde */ ++#if 0 + if (boot_loader_type == BOOT_CFE) + memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr, + NVRAM_MAC_ADDRESS_LEN ); + else { ++#endif + pucaMacAddr[0] = 0x00; + pucaMacAddr[1] = 0x07; + pucaMacAddr[2] = 0x3A; + pucaMacAddr[3] = 0xFF; + pucaMacAddr[4] = 0xFF; + pucaMacAddr[5] = 0xFF; ++#if 0 + } ++#endif + + return nRet; +} /* kerSysGetMacAddr */ @@ -6916,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-25 01:49:57.000000000 +0200 -@@ -0,0 +1,128 @@ +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. +:> +*/ +/* @@ -6961,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); @@ -7018,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); + @@ -7030,18 +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"); +} + +/* -------------------------------------------------------------------------- + Name: prom_free_prom_memory -+Abstract: ++Abstract: + -------------------------------------------------------------------------- */ +void __init prom_free_prom_memory(void) +{ @@ -8013,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 @@ -8072,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; @@ -8083,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); @@ -8098,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 @@ -8393,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 @@ -8420,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 = { @@ -8440,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) @@ -9626,3 +9653,4 @@ diff -urN linux.old/include/asm-mips/module.h linux.dev/include/asm-mips/module. #else #error MODULE_PROC_FAMILY undefined for your processor configuration #endif +