*
*/
-#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 */
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){
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++) {
{
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)