+obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o
--- /dev/null
+++ b/drivers/mtd/maps/bcm963xx-flash.c
-@@ -0,0 +1,267 @@
+@@ -0,0 +1,276 @@
+/*
+ * Copyright (C) 2006-2008 Florian Fainelli <florian@openwrt.org>
+ * Mike Albon <malbon@openwrt.org>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/platform_device.h>
++#include <linux/magic.h>
++#include <linux/jffs2.h>
+
+#include <bcm_tag.h>
+#include <asm/io.h>
+
+#define PFX KBUILD_MODNAME ": "
+
++struct squashfs_super_block {
++ __le32 s_magic;
++ __le32 pad0[9];
++ __le64 bytes_used;
++};
++
+extern int parse_redboot_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long fis_origin);
+static struct mtd_partition *parsed_parts;
+
+ .bankwidth = BUSWIDTH,
+};
+
-+
+static int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition **pparts)
+{
+ int nrparts = 3, curpart = 0; /* CFE,NVRAM and global LINUX are always present. */
+ int ret;
+ size_t retlen;
+ unsigned int rootfsaddr, kerneladdr, spareaddr;
-+ unsigned int rootfslen, kernellen, sparelen, totallen;
++ unsigned int rootfslen, kernellen, sparelen;
+ int namelen = 0;
-+ int i;
++ int i, offset;
+ char *boardid;
-+ char *tagversion;
++ char *tagversion;
+
+ /* Allocate memory for buffer */
+ buf = vmalloc(sizeof(struct bcm_tag));
+
+ sscanf(buf->kernelAddress, "%u", &kerneladdr);
+ sscanf(buf->kernelLength, "%u", &kernellen);
-+ sscanf(buf->totalLength, "%u", &totallen);
++ rootfslen = *(uint32_t *)(&(buf->rootLength[0]));
+ tagversion = &(buf->tagVersion[0]);
+ boardid = &(buf->boardid[0]);
+
+
+ kerneladdr = kerneladdr - EXTENDED_SIZE;
+ rootfsaddr = kerneladdr + kernellen;
-+ spareaddr = roundup(totallen, master->erasesize) + master->erasesize;
++
++ rootfslen = ( ( rootfslen % master->erasesize ) > 0 ? (((rootfslen / master->erasesize) + 1 ) * master->erasesize) : rootfslen);
++
++ spareaddr = rootfsaddr + rootfslen;
+ sparelen = master->size - spareaddr - master->erasesize;
-+ rootfslen = spareaddr - rootfsaddr;
+
+ /* Determine number of partitions */
+ namelen = 8;