1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-01-13 09:20:14 +02:00

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

git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4695 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2006-08-29 07:21:20 +00:00
parent 4dd54d3132
commit 05f06c4c28

View File

@ -6920,10 +6920,10 @@ 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.
@ -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,15 +7047,15 @@ 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");
+} +}
+ +
+/* -------------------------------------------------------------------------- +/* --------------------------------------------------------------------------