diff options
author | Joern Engel <joern@wohnheim.fh-wedel.de> | 2005-09-18 06:46:45 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 15:58:57 -0500 |
commit | b523b3bac3a745fefd6f604082f2ffa09b808e5e (patch) | |
tree | 9eb77323c6fe5e7d660d21928808aaf86d377c9f /drivers | |
parent | 34c0e906718fa2f85b54b937f79bffdca48ee864 (diff) |
[MTD] maps: Add support for MTX-1 Flash device
Add support for "4G Systems MTX-1 Flash device", better known as meshcube.
From: Bruno Randolf <bruno.randolf@4g-systems.biz>
Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/maps/Kconfig | 9 | ||||
-rw-r--r-- | drivers/mtd/maps/Makefile | 3 | ||||
-rw-r--r-- | drivers/mtd/maps/mtx-1_flash.c | 96 |
3 files changed, 106 insertions, 2 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 8e3e93d62525..7f1ce08fb7b1 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | # drivers/mtd/maps/Kconfig | 1 | # drivers/mtd/maps/Kconfig |
2 | # $Id: Kconfig,v 1.58 2005/09/14 19:14:13 tpoynor Exp $ | 2 | # $Id: Kconfig,v 1.59 2005/09/18 10:46:41 joern Exp $ |
3 | 3 | ||
4 | menu "Mapping drivers for chip access" | 4 | menu "Mapping drivers for chip access" |
5 | depends on MTD!=n | 5 | depends on MTD!=n |
@@ -214,6 +214,13 @@ config MTD_ALCHEMY | |||
214 | help | 214 | help |
215 | Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards | 215 | Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards |
216 | 216 | ||
217 | config MTD_MTX1 | ||
218 | tristate "4G Systems MTX-1 Flash device" | ||
219 | depends on MIPS && MIPS_MTX1 | ||
220 | help | ||
221 | Flash memory access on 4G Systems MTX-1 Board. If you have one of | ||
222 | these boards and would like to use the flash chips on it, say 'Y'. | ||
223 | |||
217 | config MTD_DILNETPC | 224 | config MTD_DILNETPC |
218 | tristate "CFI Flash device mapped on DIL/Net PC" | 225 | tristate "CFI Flash device mapped on DIL/Net PC" |
219 | depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT | 226 | depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT |
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index 095517847c77..2afa80678d53 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # linux/drivers/maps/Makefile | 2 | # linux/drivers/maps/Makefile |
3 | # | 3 | # |
4 | # $Id: Makefile.common,v 1.31 2005/09/14 19:14:13 tpoynor Exp $ | 4 | # $Id: Makefile.common,v 1.32 2005/09/18 10:46:41 joern Exp $ |
5 | 5 | ||
6 | ifeq ($(CONFIG_MTD_COMPLEX_MAPPINGS),y) | 6 | ifeq ($(CONFIG_MTD_COMPLEX_MAPPINGS),y) |
7 | obj-$(CONFIG_MTD) += map_funcs.o | 7 | obj-$(CONFIG_MTD) += map_funcs.o |
@@ -71,3 +71,4 @@ obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o | |||
71 | obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o | 71 | obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o |
72 | obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o | 72 | obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o |
73 | obj-$(CONFIG_MTD_PQ2FADS) += pq2fads.o | 73 | obj-$(CONFIG_MTD_PQ2FADS) += pq2fads.o |
74 | obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o | ||
diff --git a/drivers/mtd/maps/mtx-1_flash.c b/drivers/mtd/maps/mtx-1_flash.c new file mode 100644 index 000000000000..43f4416a611a --- /dev/null +++ b/drivers/mtd/maps/mtx-1_flash.c | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * Flash memory access on 4G Systems MTX-1 boards | ||
3 | * | ||
4 | * $Id: mtx-1_flash.c,v 1.1 2005/09/18 10:46:41 joern Exp $ | ||
5 | * | ||
6 | * (C) 2005 Bruno Randolf <bruno.randolf@4g-systems.biz> | ||
7 | * (C) 2005 Jörn Engel <joern@wohnheim.fh-wedel.de> | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/config.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/types.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/kernel.h> | ||
16 | |||
17 | #include <linux/mtd/mtd.h> | ||
18 | #include <linux/mtd/map.h> | ||
19 | #include <linux/mtd/partitions.h> | ||
20 | |||
21 | #include <asm/io.h> | ||
22 | |||
23 | static struct map_info mtx1_map = { | ||
24 | .name = "MTX-1 flash", | ||
25 | .bankwidth = 4, | ||
26 | .size = 0x2000000, | ||
27 | .phys = 0x1E000000, | ||
28 | }; | ||
29 | |||
30 | static struct mtd_partition mtx1_partitions[] = { | ||
31 | { | ||
32 | .name = "filesystem", | ||
33 | .size = 0x01C00000, | ||
34 | .offset = 0, | ||
35 | },{ | ||
36 | .name = "yamon", | ||
37 | .size = 0x00100000, | ||
38 | .offset = MTDPART_OFS_APPEND, | ||
39 | .mask_flags = MTD_WRITEABLE, | ||
40 | },{ | ||
41 | .name = "kernel", | ||
42 | .size = 0x002c0000, | ||
43 | .offset = MTDPART_OFS_APPEND, | ||
44 | },{ | ||
45 | .name = "yamon env", | ||
46 | .size = 0x00040000, | ||
47 | .offset = MTDPART_OFS_APPEND, | ||
48 | } | ||
49 | }; | ||
50 | |||
51 | static struct mtd_info *mtx1_mtd; | ||
52 | |||
53 | int __init mtx1_mtd_init(void) | ||
54 | { | ||
55 | int ret = -ENXIO; | ||
56 | |||
57 | simple_map_init(&mtx1_map); | ||
58 | |||
59 | mtx1_map.virt = ioremap(mtx1_map.phys, mtx1_map.size); | ||
60 | if (!mtx1_map.virt) | ||
61 | return -EIO; | ||
62 | |||
63 | mtx1_mtd = do_map_probe("cfi_probe", &mtx1_map); | ||
64 | if (!mtx1_mtd) | ||
65 | goto err; | ||
66 | |||
67 | mtx1_mtd->owner = THIS_MODULE; | ||
68 | |||
69 | ret = add_mtd_partitions(mtx1_mtd, mtx1_partitions, | ||
70 | ARRAY_SIZE(mtx1_partitions)); | ||
71 | if (ret) | ||
72 | goto err; | ||
73 | |||
74 | return 0; | ||
75 | |||
76 | err: | ||
77 | iounmap(mtx1_map.virt); | ||
78 | return ret; | ||
79 | } | ||
80 | |||
81 | static void __exit mtx1_mtd_cleanup(void) | ||
82 | { | ||
83 | if (mtx1_mtd) { | ||
84 | del_mtd_partitions(mtx1_mtd); | ||
85 | map_destroy(mtx1_mtd); | ||
86 | } | ||
87 | if (mtx1_map.virt) | ||
88 | iounmap(mtx1_map.virt); | ||
89 | } | ||
90 | |||
91 | module_init(mtx1_mtd_init); | ||
92 | module_exit(mtx1_mtd_cleanup); | ||
93 | |||
94 | MODULE_AUTHOR("Bruno Randolf <bruno.randolf@4g-systems.biz>"); | ||
95 | MODULE_DESCRIPTION("MTX-1 flash map"); | ||
96 | MODULE_LICENSE("GPL"); | ||