aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/au1000/mtx-1/platform.c51
-rw-r--r--drivers/mtd/maps/Kconfig7
-rw-r--r--drivers/mtd/maps/Makefile1
-rw-r--r--drivers/mtd/maps/mtx-1_flash.c95
4 files changed, 50 insertions, 104 deletions
diff --git a/arch/mips/au1000/mtx-1/platform.c b/arch/mips/au1000/mtx-1/platform.c
index 9807be37c32f..8b5914d1241f 100644
--- a/arch/mips/au1000/mtx-1/platform.c
+++ b/arch/mips/au1000/mtx-1/platform.c
@@ -24,6 +24,9 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <mtd/mtd-abi.h>
27 30
28static struct gpio_keys_button mtx1_gpio_button[] = { 31static struct gpio_keys_button mtx1_gpio_button[] = {
29 { 32 {
@@ -85,10 +88,56 @@ static struct platform_device mtx1_gpio_leds = {
85 } 88 }
86}; 89};
87 90
91static struct mtd_partition mtx1_mtd_partitions[] = {
92 {
93 .name = "filesystem",
94 .size = 0x01C00000,
95 .offset = 0,
96 },
97 {
98 .name = "yamon",
99 .size = 0x00100000,
100 .offset = MTDPART_OFS_APPEND,
101 .mask_flags = MTD_WRITEABLE,
102 },
103 {
104 .name = "kernel",
105 .size = 0x002c0000,
106 .offset = MTDPART_OFS_APPEND,
107 },
108 {
109 .name = "yamon env",
110 .size = 0x00040000,
111 .offset = MTDPART_OFS_APPEND,
112 },
113};
114
115static struct physmap_flash_data mtx1_flash_data = {
116 .width = 4,
117 .nr_parts = 4,
118 .parts = mtx1_mtd_partitions,
119};
120
121static struct resource mtx1_mtd_resource = {
122 .start = 0x1e000000,
123 .end = 0x1fffffff,
124 .flags = IORESOURCE_MEM,
125};
126
127static struct platform_device mtx1_mtd = {
128 .name = "physmap-flash",
129 .dev = {
130 .platform_data = &mtx1_flash_data,
131 },
132 .num_resources = 1,
133 .resource = &mtx1_mtd_resource,
134};
135
88static struct __initdata platform_device * mtx1_devs[] = { 136static struct __initdata platform_device * mtx1_devs[] = {
89 &mtx1_gpio_leds, 137 &mtx1_gpio_leds,
90 &mtx1_wdt, 138 &mtx1_wdt,
91 &mtx1_button 139 &mtx1_button,
140 &mtx1_mtd,
92}; 141};
93 142
94static int __init mtx1_register_devices(void) 143static int __init mtx1_register_devices(void)
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 17bc87a43ff4..d2fbc2964523 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -258,13 +258,6 @@ config MTD_ALCHEMY
258 help 258 help
259 Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards 259 Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
260 260
261config MTD_MTX1
262 tristate "4G Systems MTX-1 Flash device"
263 depends on MIPS_MTX1 && MTD_CFI
264 help
265 Flash memory access on 4G Systems MTX-1 Board. If you have one of
266 these boards and would like to use the flash chips on it, say 'Y'.
267
268config MTD_DILNETPC 261config MTD_DILNETPC
269 tristate "CFI Flash device mapped on DIL/Net PC" 262 tristate "CFI Flash device mapped on DIL/Net PC"
270 depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT 263 depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 957fb5f70f5e..c6ce8673dab2 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -65,5 +65,4 @@ obj-$(CONFIG_MTD_DMV182) += dmv182.o
65obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o 65obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o
66obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o 66obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
67obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o 67obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
68obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o
69obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o 68obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
diff --git a/drivers/mtd/maps/mtx-1_flash.c b/drivers/mtd/maps/mtx-1_flash.c
deleted file mode 100644
index 2a8fde9b92f0..000000000000
--- a/drivers/mtd/maps/mtx-1_flash.c
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * Flash memory access on 4G Systems MTX-1 boards
3 *
4 * $Id: mtx-1_flash.c,v 1.2 2005/11/07 11:14:27 gleixner Exp $
5 *
6 * (C) 2005 Bruno Randolf <bruno.randolf@4g-systems.biz>
7 * (C) 2005 Joern Engel <joern@wohnheim.fh-wedel.de>
8 *
9 */
10
11#include <linux/module.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/kernel.h>
15
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/map.h>
18#include <linux/mtd/partitions.h>
19
20#include <asm/io.h>
21
22static struct map_info mtx1_map = {
23 .name = "MTX-1 flash",
24 .bankwidth = 4,
25 .size = 0x2000000,
26 .phys = 0x1E000000,
27};
28
29static struct mtd_partition mtx1_partitions[] = {
30 {
31 .name = "filesystem",
32 .size = 0x01C00000,
33 .offset = 0,
34 },{
35 .name = "yamon",
36 .size = 0x00100000,
37 .offset = MTDPART_OFS_APPEND,
38 .mask_flags = MTD_WRITEABLE,
39 },{
40 .name = "kernel",
41 .size = 0x002c0000,
42 .offset = MTDPART_OFS_APPEND,
43 },{
44 .name = "yamon env",
45 .size = 0x00040000,
46 .offset = MTDPART_OFS_APPEND,
47 }
48};
49
50static struct mtd_info *mtx1_mtd;
51
52int __init mtx1_mtd_init(void)
53{
54 int ret = -ENXIO;
55
56 simple_map_init(&mtx1_map);
57
58 mtx1_map.virt = ioremap(mtx1_map.phys, mtx1_map.size);
59 if (!mtx1_map.virt)
60 return -EIO;
61
62 mtx1_mtd = do_map_probe("cfi_probe", &mtx1_map);
63 if (!mtx1_mtd)
64 goto err;
65
66 mtx1_mtd->owner = THIS_MODULE;
67
68 ret = add_mtd_partitions(mtx1_mtd, mtx1_partitions,
69 ARRAY_SIZE(mtx1_partitions));
70 if (ret)
71 goto err;
72
73 return 0;
74
75err:
76 iounmap(mtx1_map.virt);
77 return ret;
78}
79
80static void __exit mtx1_mtd_cleanup(void)
81{
82 if (mtx1_mtd) {
83 del_mtd_partitions(mtx1_mtd);
84 map_destroy(mtx1_mtd);
85 }
86 if (mtx1_map.virt)
87 iounmap(mtx1_map.virt);
88}
89
90module_init(mtx1_mtd_init);
91module_exit(mtx1_mtd_cleanup);
92
93MODULE_AUTHOR("Bruno Randolf <bruno.randolf@4g-systems.biz>");
94MODULE_DESCRIPTION("MTX-1 flash map");
95MODULE_LICENSE("GPL");