This patch is for broadcom 96348GW-11 boards, to get USB and Ethernet working. Also...
[openwrt.git] / target / linux / brcm63xx / files / drivers / mtd / maps / bcm963xx-flash.c
index c4c4526..9543c17 100644 (file)
  *
  */
 
-#include <asm/io.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/vmalloc.h>
-#include <board.h>
+
+#include <asm/io.h>
 
 #define WINDOW_ADDR 0x1FC00000         /* Real address of the flash */
 #define WINDOW_SIZE 0x400000           /* Size of flash */
@@ -128,10 +128,6 @@ int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition **pparts
                nrparts++;
                namelen =+ 6;
        };
-       if (sparelen > 0){
-               nrparts++;
-               namelen =+ 6;
-       };
        // Ask kernel for more memory.
        parts = kmalloc(sizeof(*parts)*nrparts+10*nrparts, GFP_KERNEL);
        if (!parts){
@@ -145,24 +141,20 @@ int parse_cfe_partitions( struct mtd_info *master, struct mtd_partition **pparts
        parts[curpart].size = master->erasesize;
        curpart++;
        if (kernellen > 0){
-               parts[curpart].name = "Kernel";
+               parts[curpart].name = "kernel";
                parts[curpart].offset = kerneladdr;
                parts[curpart].size = kernellen;
                curpart++;
        };
        if (rootfslen > 0){
-               parts[curpart].name = "Rootfs";
+               parts[curpart].name = "rootfs";
                parts[curpart].offset = rootfsaddr;
                parts[curpart].size = rootfslen;
+               if (sparelen > 0)
+                       parts[curpart].size += sparelen;
                curpart++;
        };
-       if (sparelen > 0){
-               parts[curpart].name = "OpenWrt";
-               parts[curpart].offset = spareaddr;
-               parts[curpart].size = sparelen;
-               curpart++;
-       };
-       parts[curpart].name = "NVRAM";
+       parts[curpart].name = "nvram";
        parts[curpart].offset = master->size - master->erasesize;
        parts[curpart].size = master->erasesize;
        for (i = 0; i < nrparts; i++) {
@@ -185,13 +177,14 @@ static int bcm963xx_detect_cfe(struct mtd_info *master)
 {
        int idoffset = 0x4e0;
        static char idstring[8] = "CFE1CFE1";
-       char buf[8];
+       char buf[9];
        int ret;
        size_t retlen;
 
        ret = master->read(master, idoffset, 8, &retlen, (void *)buf);
+       buf[retlen] = 0;
        printk("bcm963xx: Read Signature value of %s\n", buf);
-       return strcmp(idstring,buf);
+       return strncmp(idstring,buf,8);
 }
 
 static int __init bcm963xx_mtd_init(void)
This page took 0.022822 seconds and 4 git commands to generate.