Restore boot loader detection by parsing the command line, fixes issue with Inventel liveboxes

SVN-Revision: 4695
owl
Florian Fainelli 2006-08-29 07:21:20 +00:00
parent b6a32036a8
commit 900afdb448
1 changed files with 39 additions and 26 deletions

View File

@ -6920,26 +6920,26 @@ diff -urN linux.old/arch/mips/bcm963xx/Makefile linux.dev/arch/mips/bcm963xx/Mak
+EXTRA_CFLAGS += -DADSL_ANNEXC +EXTRA_CFLAGS += -DADSL_ANNEXC
+endif +endif
+ +
diff -urN linux.old/arch/mips/bcm963xx/prom.c linux.dev/arch/mips/bcm963xx/prom.c diff -urN linux-2.6.17/arch/mips/bcm963xx/prom.c linux-2.6.17-brcm63xx/arch/mips/bcm963xx/prom.c
--- linux.old/arch/mips/bcm963xx/prom.c 1970-01-01 01:00:00.000000000 +0100 --- linux-2.6.17/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 +++ linux-2.6.17-brcm63xx/arch/mips/bcm963xx/prom.c 2006-08-29 07:10:10.000000000 +0200
@@ -0,0 +1,130 @@ @@ -0,0 +1,143 @@
+/* +/*
+<:copyright-gpl +<:copyright-gpl
+ Copyright 2004 Broadcom Corp. All Rights Reserved. + Copyright 2004 Broadcom Corp. All Rights Reserved.
+ +
+ This program is free software; you can distribute it and/or modify it + 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 + under the terms of the GNU General Public License (Version 2) as
+ published by the Free Software Foundation. + published by the Free Software Foundation.
+ +
+ This program is distributed in the hope it will be useful, but WITHOUT + This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details. + for more details.
+ +
+ You should have received a copy of the GNU General Public License along + 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., + with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + 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}; +//char arcs_cmdline[CL_SIZE] __initdata = {0};
+/* inv_xde */ +/* inv_xde */
+int boot_loader_type; +int boot_loader_type;
+int prom_argc;
+char **prom_argv, **prom_envp;
+ +
+extern int do_syslog(int, char *, int); +extern int do_syslog(int, char *, int);
+extern void serial_init(void); +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(); + serial_init();
+ +
+ /* Need to fixup boot loader detection code + prom_argc = fw_arg0;
+ * whithout changing prom_init prototype + 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); + 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'; + 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); + add_memory_region(0, (getMemorySize() - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);
+ else + 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_machgroup = MACH_GROUP_BRCM;
+ mips_machtype = MACH_BCM; + mips_machtype = MACH_BCM;
+ +
+ BpSetBoardId("96348GW-10"); + BpSetBoardId("96348GW-10");
+} +}
+ +
+/* -------------------------------------------------------------------------- +/* --------------------------------------------------------------------------
+ Name: prom_free_prom_memory + Name: prom_free_prom_memory
+Abstract: +Abstract:
+ -------------------------------------------------------------------------- */ + -------------------------------------------------------------------------- */
+void __init prom_free_prom_memory(void) +void __init prom_free_prom_memory(void)
+{ +{