update flash map driver for jffs2, squashfs will follow later

SVN-Revision: 4710
master
Felix Fietkau 18 years ago
parent dfc990dfef
commit d61fa4ec2a
  1. 49
      openwrt/target/linux/magicbox-2.6/patches/002-flash_map.patch

@ -1,6 +1,6 @@
diff -Nur linux-2.6.17/drivers/mtd/maps/Kconfig linux-2.6.17-owrt/drivers/mtd/maps/Kconfig
--- linux-2.6.17/drivers/mtd/maps/Kconfig 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/drivers/mtd/maps/Kconfig 2006-08-25 23:33:05.000000000 +0200
diff -urN linux.old/drivers/mtd/maps/Kconfig linux.dev/drivers/mtd/maps/Kconfig
--- linux.old/drivers/mtd/maps/Kconfig 2006-08-30 06:30:59.000000000 +0200
+++ linux.dev/drivers/mtd/maps/Kconfig 2006-08-30 06:11:51.000000000 +0200
@@ -323,6 +323,15 @@
Walnut board. If you have one of these boards and would like to
use the flash chips on it, say 'Y'.
@ -17,10 +17,10 @@ diff -Nur linux-2.6.17/drivers/mtd/maps/Kconfig linux-2.6.17-owrt/drivers/mtd/ma
config MTD_EBONY
tristate "Flash devices mapped on IBM 440GP Ebony"
depends on MTD_JEDECPROBE && EBONY
diff -Nur linux-2.6.17/drivers/mtd/maps/magicmap.c linux-2.6.17-owrt/drivers/mtd/maps/magicmap.c
--- linux-2.6.17/drivers/mtd/maps/magicmap.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.17-owrt/drivers/mtd/maps/magicmap.c 2006-08-25 23:33:05.000000000 +0200
@@ -0,0 +1,102 @@
diff -urN linux.old/drivers/mtd/maps/magicmap.c linux.dev/drivers/mtd/maps/magicmap.c
--- linux.old/drivers/mtd/maps/magicmap.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/drivers/mtd/maps/magicmap.c 2006-08-30 06:52:34.000000000 +0200
@@ -0,0 +1,112 @@
+/*
+ * magicmap.c: Copyleft 2005 Karol Lewandowski
+ *
@ -57,21 +57,16 @@ diff -Nur linux-2.6.17/drivers/mtd/maps/magicmap.c linux-2.6.17-owrt/drivers/mtd
+
+static struct mtd_partition magic_partitions[] = {
+ {
+ .name = "kernel",
+ .name = "linux",
+ .offset = 0x0,
+ .size = 0x0e0000,
+ .size = 0x3c0000,
+ },
+ {
+ .name = "ramdisk",
+ .offset = 0x0e0000,
+ .name = "rootfs",
+ .offset = 0x100000,
+ .size = 0x2c0000,
+ },
+ {
+ .name = "persistent",
+ .offset = 0x3a0000,
+ .size = 0x020000,
+ },
+ {
+ .name = "bootloader",
+ .offset = 0x3c0000,
+ .size = 0x040000,
@ -81,6 +76,8 @@ diff -Nur linux-2.6.17/drivers/mtd/maps/magicmap.c linux-2.6.17-owrt/drivers/mtd
+
+int __init init_magic(void)
+{
+ u32 size, len;
+
+ magic_map.virt =
+ (void __iomem *)ioremap(magic_map.phys, magic_map.size);
+
@ -94,6 +91,19 @@ diff -Nur linux-2.6.17/drivers/mtd/maps/magicmap.c linux-2.6.17-owrt/drivers/mtd
+ flash = do_map_probe("cfi_probe", &magic_map);
+ if (flash) {
+ flash->owner = THIS_MODULE;
+ if (MTD_READ(flash, 12, sizeof(u32), &len, (char *) &size) ||
+ len != 4)
+ return -ENXIO;
+ if ((size > 0) && (size < 0x400000)) {
+ /* skip to next erase block */
+ if (size & (flash->erasesize - 1)) {
+ size |= (flash->erasesize - 1);
+ size += 1;
+ }
+ magic_partitions[1].offset = size;
+ magic_partitions[1].size = magic_partitions[2].offset - size;
+ }
+
+ add_mtd_partitions(flash, magic_partitions,
+ ARRAY_SIZE(magic_partitions));
+ } else {
@ -123,9 +133,9 @@ diff -Nur linux-2.6.17/drivers/mtd/maps/magicmap.c linux-2.6.17-owrt/drivers/mtd
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Karol Lewandowski");
+MODULE_DESCRIPTION("MTD map and partitions for IBM 405EP MagicBox boards");
diff -Nur linux-2.6.17/drivers/mtd/maps/Makefile linux-2.6.17-owrt/drivers/mtd/maps/Makefile
--- linux-2.6.17/drivers/mtd/maps/Makefile 2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-owrt/drivers/mtd/maps/Makefile 2006-08-25 23:33:05.000000000 +0200
diff -urN linux.old/drivers/mtd/maps/Makefile linux.dev/drivers/mtd/maps/Makefile
--- linux.old/drivers/mtd/maps/Makefile 2006-08-30 06:30:59.000000000 +0200
+++ linux.dev/drivers/mtd/maps/Makefile 2006-08-30 06:11:51.000000000 +0200
@@ -58,6 +58,7 @@
obj-$(CONFIG_MTD_BEECH) += beech-mtd.o
obj-$(CONFIG_MTD_ARCTIC) += arctic-mtd.o
@ -134,4 +144,3 @@ diff -Nur linux-2.6.17/drivers/mtd/maps/Makefile linux-2.6.17-owrt/drivers/mtd/m
obj-$(CONFIG_MTD_H720X) += h720x-flash.o
obj-$(CONFIG_MTD_SBC8240) += sbc8240.o
obj-$(CONFIG_MTD_NOR_TOTO) += omap-toto-flash.o

Loading…
Cancel
Save