1 Index: linux-3.1.10/drivers/mtd/mtdpart.c
2 ===================================================================
3 --- linux-3.1.10.orig/drivers/mtd/mtdpart.c 2012-02-14 19:38:40.102266817 +0100
4 +++ linux-3.1.10/drivers/mtd/mtdpart.c 2012-02-14 19:38:40.146266819 +0100
6 return le32_to_cpu(temp) == SQUASHFS_MAGIC;
9 +static unsigned long find_brnimage_size(struct mtd_info *mtd,
10 + unsigned long offset)
12 + unsigned long buf[4];
13 + // Assume at most 2MB of kernel image
14 + unsigned long end = offset + (2 << 20);
15 + unsigned long ptr = offset + 0x400 - 12;
20 + long size_min = ptr - 0x400 - 12 - offset;
21 + long size_max = ptr + 12 - offset;
22 + ret = mtd->read(mtd, ptr, 16, &len, (void *)buf);
23 + if (ret || len != 16)
26 + if (le32_to_cpu(buf[0]) < size_min ||
27 + le32_to_cpu(buf[0]) > size_max) {
32 + if (le32_to_cpu(buf[3]) == SQUASHFS_MAGIC)
33 + return ptr + 12 - offset;
41 static int split_uimage(struct mtd_info *mtd,
42 const struct mtd_partition *part)
46 split_partitions[0].size = find_uimage_size(mtd, part->offset);
47 if (!split_partitions[0].size) {
48 - printk(KERN_NOTICE "no uImage found in linux partition\n");
50 + split_partitions[0].size = find_brnimage_size(mtd, part->offset);
51 + if (!split_partitions[0].size) {
52 + printk(KERN_NOTICE "no uImage or brnImage found in linux partition\n");
57 if (!detect_squashfs_partition(mtd,
58 Index: linux-3.1.10/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
59 ===================================================================
60 --- linux-3.1.10.orig/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h 2012-02-14 19:38:40.058266816 +0100
61 +++ linux-3.1.10/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h 2012-02-14 19:57:07.790314179 +0100
64 extern __iomem void *ltq_ebu_membase;
65 extern __iomem void *ltq_cgu_membase;
66 +extern unsigned long ltq_brn_boot;
68 /* request a non-gpio and set the PIO config */
69 extern int ltq_gpio_request(unsigned int pin, unsigned int alt0,
70 Index: linux-3.1.10/arch/mips/lantiq/setup.c
71 ===================================================================
72 --- linux-3.1.10.orig/arch/mips/lantiq/setup.c 2012-02-14 19:38:40.010266814 +0100
73 +++ linux-3.1.10/arch/mips/lantiq/setup.c 2012-02-14 19:38:40.150266820 +0100
76 /* assume 16M as default incase uboot fails to pass proper ramsize */
77 unsigned long physical_memsize = 16L;
78 +/* set to 1 if the bootloader is BRN-BOOT instead of u-boot */
79 +unsigned long ltq_brn_boot = 0;
81 void __init plat_mem_setup(void)
84 if (strict_strtoul(e, 0, &physical_memsize))
85 pr_warn("bad memsize specified\n");
87 + if (!strncmp(e, "BRN-BOOT", 8)){
88 + pr_info("Found BRN-BOOT instead of u-boot\n");
93 physical_memsize *= 1024 * 1024;