1 --- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h
2 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h
3 @@ -85,8 +85,10 @@ struct bcm_tag {
5 /* 224-227: CRC32 of kernel partition */
7 - /* 228-235: Unused at present */
9 + /* 228-231: Image sequence number */
10 + char image_sequence[4];
11 + /* 222-235: Openwrt: real rootfs length */
12 + __u32 real_rootfs_length;
13 /* 236-239: CRC32 of header excluding last 20 bytes */
15 /* 240-255: Unused at present */
16 --- a/drivers/mtd/bcm63xxpart.c
17 +++ b/drivers/mtd/bcm63xxpart.c
18 @@ -77,7 +77,7 @@ static int bcm63xx_parse_cfe_partitions(
21 unsigned int rootfsaddr, kerneladdr, spareaddr;
22 - unsigned int rootfslen, kernellen, sparelen, totallen;
23 + unsigned int rootfslen, kernellen, sparelen;
24 unsigned int cfelen, nvramlen;
27 @@ -111,14 +111,15 @@ static int bcm63xx_parse_cfe_partitions(
29 sscanf(buf->kernel_address, "%u", &kerneladdr);
30 sscanf(buf->kernel_length, "%u", &kernellen);
31 - sscanf(buf->total_length, "%u", &totallen);
32 + rootfslen = buf->real_rootfs_length;
34 pr_info("CFE boot tag found with version %s and board type %s\n",
37 kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE;
38 rootfsaddr = kerneladdr + kernellen;
39 - spareaddr = roundup(totallen, master->erasesize) + cfelen;
40 + rootfslen = roundup(rootfslen, master->erasesize);
41 + spareaddr = rootfsaddr + rootfslen;
42 sparelen = master->size - spareaddr - nvramlen;
43 rootfslen = spareaddr - rootfsaddr;