diff --exclude .depend --exclude .hdepend -ur linux-11-08-snay/drivers/mtd/nora.c linux-agenda-www-20020207/drivers/mtd/nora.c
--- linux-11-08-snay/drivers/mtd/nora.c	Wed Jul 11 16:59:01 2001
+++ linux-agenda-www-20020207/drivers/mtd/nora.c	Fri Jan 25 20:29:22 2002
@@ -87,6 +87,11 @@
 	return mymtd->write(mymtd, to + (unsigned long)mtd->priv, len, retlen, buf);
 }
 
+MTD_ELF_SECTION static int nora_mtd_nowrite(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
+{
+	return -EIO;
+}
+
 MTD_ELF_SECTION static int nora_mtd_erase (struct mtd_info *mtd, struct erase_info *instr)
 {
 	instr->addr += (unsigned long)mtd->priv;
@@ -108,13 +113,13 @@
 	mymtd->resume(mymtd);
 }
 
-static struct mtd_info nora_mtds[1] = {  /* boot, kernel, ramdisk, fs */
+static struct mtd_info nora_mtds[] = {  /* boot, kernel, ramdisk, fs */
 	{
 		type: MTD_NORFLASH,
 		flags: MTD_CAP_NORFLASH,
 		size: 0x380000,
 		erasesize: 0x20000,
-		name: "Agenda JFFS Partition Un-Normal (testing)",
+		name: "Agenda JFFS partition (/flash)",
 		module: THIS_MODULE,
 		erase: nora_mtd_erase,
 		read: nora_mtd_read,
@@ -123,6 +128,54 @@
 		resume: nora_mtd_resume,
 		sync: nora_mtd_sync,
 		priv: (void *)0xc80000
+	},
+	{
+		type: MTD_NORFLASH,
+		flags: MTD_CAP_NORFLASH,
+		size: 0x100000,
+		erasesize: 0x20000,
+		name: "Agenda kernel partition",
+		module: THIS_MODULE,
+		erase: nora_mtd_erase,
+		read: nora_mtd_read,
+		write: nora_mtd_write,
+		suspend: NULL,
+		resume: NULL,
+		sync: nora_mtd_sync,
+		priv: (void *)0x000000
+	},
+	{
+		type: MTD_NORFLASH,
+		flags: MTD_CAP_NORFLASH,
+		size: 0xb00000,
+		erasesize: 0x20000,
+		name: "Agenda CRAMFS partition (/)",
+		module: THIS_MODULE,
+		erase: nora_mtd_erase,
+		read: nora_mtd_read,
+		write: nora_mtd_write,
+		suspend: NULL,
+		resume: NULL,
+		sync: nora_mtd_sync,
+		priv: (void *)0x100000
+	},
+	{
+		type: MTD_NORFLASH,
+		flags: MTD_CAP_NORFLASH,
+		size: 0x080000,
+		erasesize: 0x20000,
+		name: "Agenda PMON boot loader (read-only)",
+		module: THIS_MODULE,
+		erase: NULL,
+		read: nora_mtd_read,
+		write: nora_mtd_nowrite,
+		suspend: NULL,
+		resume: NULL,
+		sync: NULL,
+		priv: (void *)0xc00000
+	},
+	{
+		name : NULL
 	}
 };
 
@@ -136,6 +189,7 @@
 
 int __init init_nora(void)
 {
+	struct mtd_info * p;
        	printk(KERN_NOTICE "nora flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
 
 	mymtd = do_cfi_probe(&nora_map);
@@ -144,7 +198,8 @@
 		mymtd->module = &__this_module;
 #endif
 		
-		add_mtd_device(&nora_mtds[0]);
+		for (p=nora_mtds; p->name; p++)
+			add_mtd_device(p);
 		return 0;
 	}
 
@@ -153,8 +208,10 @@
 
 static void __exit cleanup_nora(void)
 {
+	struct mtd_info * p;
 	if (mymtd) {
-		del_mtd_device(&nora_mtds[0]);
+		for (p=nora_mtds; p->name; p++)
+			del_mtd_device(p);
 		map_destroy(mymtd);
 	}
 }
