aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/cstm_mips_ixx.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-11 11:25:30 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2006-12-11 11:30:26 -0500
commit0bf3a9d82adc62fb05e3f108ddd46eb088960f26 (patch)
tree8ed32ade6cdf79837fa882888ba059b92ef07988 /drivers/mtd/maps/cstm_mips_ixx.c
parent66a1e421b98edaa62c7d95cc53cb381efa3fb9bf (diff)
[MTD] Nuke IVR leftovers
Support for the ITE8172 based boards was deleted a while ago so this is dead code. The Kconfig dependency on MIPS was wrong anyway, MIPS is a processor architecture and nothing else; guesses on systems architecture are likely to be wrong ... Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/maps/cstm_mips_ixx.c')
-rw-r--r--drivers/mtd/maps/cstm_mips_ixx.c164
1 files changed, 0 insertions, 164 deletions
diff --git a/drivers/mtd/maps/cstm_mips_ixx.c b/drivers/mtd/maps/cstm_mips_ixx.c
deleted file mode 100644
index 2ef22a5a1de2..000000000000
--- a/drivers/mtd/maps/cstm_mips_ixx.c
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * $Id: cstm_mips_ixx.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
3 *
4 * Mapping of a custom board with both AMD CFI and JEDEC flash in partitions.
5 * Config with both CFI and JEDEC device support.
6 *
7 * Basically physmap.c with the addition of partitions and
8 * an array of mapping info to accomodate more than one flash type per board.
9 *
10 * Copyright 2000 MontaVista Software Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33#include <linux/module.h>
34#include <linux/types.h>
35#include <linux/kernel.h>
36#include <linux/init.h>
37#include <asm/io.h>
38#include <linux/mtd/mtd.h>
39#include <linux/mtd/map.h>
40#include <linux/mtd/partitions.h>
41#include <linux/delay.h>
42
43/* board and partition description */
44
45#define MAX_PHYSMAP_PARTITIONS 8
46struct cstm_mips_ixx_info {
47 char *name;
48 unsigned long window_addr;
49 unsigned long window_size;
50 int bankwidth;
51 int num_partitions;
52};
53
54#define PHYSMAP_NUMBER 1 // number of board desc structs needed, one per contiguous flash type
55const struct cstm_mips_ixx_info cstm_mips_ixx_board_desc[PHYSMAP_NUMBER] =
56{
57 {
58 "MTD flash", // name
59 CONFIG_MTD_CSTM_MIPS_IXX_START, // window_addr
60 CONFIG_MTD_CSTM_MIPS_IXX_LEN, // window_size
61 CONFIG_MTD_CSTM_MIPS_IXX_BUSWIDTH, // bankwidth
62 1, // num_partitions
63 },
64
65};
66static struct mtd_partition cstm_mips_ixx_partitions[PHYSMAP_NUMBER][MAX_PHYSMAP_PARTITIONS] = {
67{
68 {
69 .name = "main partition",
70 .size = CONFIG_MTD_CSTM_MIPS_IXX_LEN,
71 .offset = 0,
72 },
73},
74};
75
76struct map_info cstm_mips_ixx_map[PHYSMAP_NUMBER];
77
78int __init init_cstm_mips_ixx(void)
79{
80 int i;
81 int jedec;
82 struct mtd_info *mymtd;
83 struct mtd_partition *parts;
84
85 /* Initialize mapping */
86 for (i=0;i<PHYSMAP_NUMBER;i++) {
87 printk(KERN_NOTICE "cstm_mips_ixx flash device: 0x%lx at 0x%lx\n",
88 cstm_mips_ixx_board_desc[i].window_size, cstm_mips_ixx_board_desc[i].window_addr);
89
90
91 cstm_mips_ixx_map[i].phys = cstm_mips_ixx_board_desc[i].window_addr;
92 cstm_mips_ixx_map[i].virt = ioremap(cstm_mips_ixx_board_desc[i].window_addr, cstm_mips_ixx_board_desc[i].window_size);
93 if (!cstm_mips_ixx_map[i].virt) {
94 int j = 0;
95 printk(KERN_WARNING "Failed to ioremap\n");
96 for (j = 0; j < i; j++) {
97 if (cstm_mips_ixx_map[j].virt) {
98 iounmap(cstm_mips_ixx_map[j].virt);
99 cstm_mips_ixx_map[j].virt = NULL;
100 }
101 }
102 return -EIO;
103 }
104 cstm_mips_ixx_map[i].name = cstm_mips_ixx_board_desc[i].name;
105 cstm_mips_ixx_map[i].size = cstm_mips_ixx_board_desc[i].window_size;
106 cstm_mips_ixx_map[i].bankwidth = cstm_mips_ixx_board_desc[i].bankwidth;
107 simple_map_init(&cstm_mips_ixx_map[i]);
108 //printk(KERN_NOTICE "cstm_mips_ixx: ioremap is %x\n",(unsigned int)(cstm_mips_ixx_map[i].virt));
109 }
110
111 for (i=0;i<PHYSMAP_NUMBER;i++) {
112 parts = &cstm_mips_ixx_partitions[i][0];
113 jedec = 0;
114 mymtd = (struct mtd_info *)do_map_probe("cfi_probe", &cstm_mips_ixx_map[i]);
115 //printk(KERN_NOTICE "phymap %d cfi_probe: mymtd is %x\n",i,(unsigned int)mymtd);
116 if (!mymtd) {
117 jedec = 1;
118 mymtd = (struct mtd_info *)do_map_probe("jedec_probe", &cstm_mips_ixx_map[i]);
119 printk(KERN_NOTICE "cstm_mips_ixx %d jedec: mymtd is %x\n",i,(unsigned int)mymtd);
120 }
121 if (mymtd) {
122 mymtd->owner = THIS_MODULE;
123
124 cstm_mips_ixx_map[i].map_priv_2 = (unsigned long)mymtd;
125 add_mtd_partitions(mymtd, parts, cstm_mips_ixx_board_desc[i].num_partitions);
126 }
127 else {
128 for (i = 0; i < PHYSMAP_NUMBER; i++) {
129 if (cstm_mips_ixx_map[i].virt) {
130 iounmap(cstm_mips_ixx_map[i].virt);
131 cstm_mips_ixx_map[i].virt = NULL;
132 }
133 }
134 return -ENXIO;
135 }
136 }
137 return 0;
138}
139
140static void __exit cleanup_cstm_mips_ixx(void)
141{
142 int i;
143 struct mtd_info *mymtd;
144
145 for (i=0;i<PHYSMAP_NUMBER;i++) {
146 mymtd = (struct mtd_info *)cstm_mips_ixx_map[i].map_priv_2;
147 if (mymtd) {
148 del_mtd_partitions(mymtd);
149 map_destroy(mymtd);
150 }
151 if (cstm_mips_ixx_map[i].virt) {
152 iounmap((void *)cstm_mips_ixx_map[i].virt);
153 cstm_mips_ixx_map[i].virt = 0;
154 }
155 }
156}
157
158module_init(init_cstm_mips_ixx);
159module_exit(cleanup_cstm_mips_ixx);
160
161
162MODULE_LICENSE("GPL");
163MODULE_AUTHOR("Alice Hennessy <ahennessy@mvista.com>");
164MODULE_DESCRIPTION("MTD map driver for MIPS boards");