blob: 3aa56e3104bb747da8fedd70da2d3570cfa54103 [file] [log] [blame]
David Woodhousea1452a32010-08-08 20:58:20 +01001/*
2 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> et al.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20/* Overhauled routines for dealing with different mmap regions of flash */
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
22#ifndef __LINUX_MTD_MAP_H__
23#define __LINUX_MTD_MAP_H__
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <linux/types.h>
26#include <linux/list.h>
Tim Schmielau4e57b682005-10-30 15:03:48 -080027#include <linux/string.h>
Kevin Cernekee709c4ef2010-05-04 12:51:34 -070028#include <linux/bug.h>
Artem Bityutskiy4a422432011-12-30 18:28:01 +020029#include <linux/kernel.h>
Dan Williams2584cf82015-08-10 23:07:05 -040030#include <linux/io.h>
Tim Schmielau4e57b682005-10-30 15:03:48 -080031
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#include <asm/unaligned.h>
David Howells96f951e2012-03-28 18:30:03 +010033#include <asm/barrier.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
36#define map_bankwidth(map) 1
37#define map_bankwidth_is_1(map) (map_bankwidth(map) == 1)
38#define map_bankwidth_is_large(map) (0)
39#define map_words(map) (1)
40#define MAX_MAP_BANKWIDTH 1
41#else
42#define map_bankwidth_is_1(map) (0)
43#endif
44
45#ifdef CONFIG_MTD_MAP_BANK_WIDTH_2
46# ifdef map_bankwidth
47# undef map_bankwidth
48# define map_bankwidth(map) ((map)->bankwidth)
49# else
50# define map_bankwidth(map) 2
51# define map_bankwidth_is_large(map) (0)
52# define map_words(map) (1)
53# endif
54#define map_bankwidth_is_2(map) (map_bankwidth(map) == 2)
55#undef MAX_MAP_BANKWIDTH
56#define MAX_MAP_BANKWIDTH 2
57#else
58#define map_bankwidth_is_2(map) (0)
59#endif
60
61#ifdef CONFIG_MTD_MAP_BANK_WIDTH_4
62# ifdef map_bankwidth
63# undef map_bankwidth
64# define map_bankwidth(map) ((map)->bankwidth)
65# else
66# define map_bankwidth(map) 4
67# define map_bankwidth_is_large(map) (0)
68# define map_words(map) (1)
69# endif
70#define map_bankwidth_is_4(map) (map_bankwidth(map) == 4)
71#undef MAX_MAP_BANKWIDTH
72#define MAX_MAP_BANKWIDTH 4
73#else
74#define map_bankwidth_is_4(map) (0)
75#endif
76
77/* ensure we never evaluate anything shorted than an unsigned long
78 * to zero, and ensure we'll never miss the end of an comparison (bjd) */
79
Arnd Bergmann7234bea2015-03-10 17:51:55 +010080#define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1)) / sizeof(unsigned long))
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
82#ifdef CONFIG_MTD_MAP_BANK_WIDTH_8
83# ifdef map_bankwidth
84# undef map_bankwidth
85# define map_bankwidth(map) ((map)->bankwidth)
86# if BITS_PER_LONG < 64
87# undef map_bankwidth_is_large
88# define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8)
89# undef map_words
90# define map_words(map) map_calc_words(map)
91# endif
92# else
93# define map_bankwidth(map) 8
94# define map_bankwidth_is_large(map) (BITS_PER_LONG < 64)
95# define map_words(map) map_calc_words(map)
96# endif
97#define map_bankwidth_is_8(map) (map_bankwidth(map) == 8)
98#undef MAX_MAP_BANKWIDTH
99#define MAX_MAP_BANKWIDTH 8
100#else
101#define map_bankwidth_is_8(map) (0)
102#endif
103
104#ifdef CONFIG_MTD_MAP_BANK_WIDTH_16
105# ifdef map_bankwidth
106# undef map_bankwidth
107# define map_bankwidth(map) ((map)->bankwidth)
108# undef map_bankwidth_is_large
109# define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8)
110# undef map_words
111# define map_words(map) map_calc_words(map)
112# else
113# define map_bankwidth(map) 16
114# define map_bankwidth_is_large(map) (1)
115# define map_words(map) map_calc_words(map)
116# endif
117#define map_bankwidth_is_16(map) (map_bankwidth(map) == 16)
118#undef MAX_MAP_BANKWIDTH
119#define MAX_MAP_BANKWIDTH 16
120#else
121#define map_bankwidth_is_16(map) (0)
122#endif
123
124#ifdef CONFIG_MTD_MAP_BANK_WIDTH_32
Arnd Bergmannfddcca52016-02-29 13:20:28 +0100125/* always use indirect access for 256-bit to preserve kernel stack */
126# undef map_bankwidth
127# define map_bankwidth(map) ((map)->bankwidth)
128# undef map_bankwidth_is_large
129# define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8)
130# undef map_words
131# define map_words(map) map_calc_words(map)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132#define map_bankwidth_is_32(map) (map_bankwidth(map) == 32)
133#undef MAX_MAP_BANKWIDTH
134#define MAX_MAP_BANKWIDTH 32
135#else
136#define map_bankwidth_is_32(map) (0)
137#endif
138
139#ifndef map_bankwidth
Arnd Bergmannfe7579d2015-11-24 23:09:02 +0100140#ifdef CONFIG_MTD
David Woodhouse241651d2007-09-06 09:40:21 +0100141#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
Arnd Bergmannfe7579d2015-11-24 23:09:02 +0100142#endif
David Woodhouse241651d2007-09-06 09:40:21 +0100143static inline int map_bankwidth(void *map)
144{
145 BUG();
146 return 0;
147}
148#define map_bankwidth_is_large(map) (0)
149#define map_words(map) (0)
150#define MAX_MAP_BANKWIDTH 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151#endif
152
153static inline int map_bankwidth_supported(int w)
154{
155 switch (w) {
156#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
157 case 1:
158#endif
159#ifdef CONFIG_MTD_MAP_BANK_WIDTH_2
160 case 2:
161#endif
162#ifdef CONFIG_MTD_MAP_BANK_WIDTH_4
163 case 4:
164#endif
165#ifdef CONFIG_MTD_MAP_BANK_WIDTH_8
166 case 8:
167#endif
168#ifdef CONFIG_MTD_MAP_BANK_WIDTH_16
169 case 16:
170#endif
171#ifdef CONFIG_MTD_MAP_BANK_WIDTH_32
172 case 32:
173#endif
174 return 1;
175
176 default:
177 return 0;
178 }
179}
180
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100181#define MAX_MAP_LONGS (((MAX_MAP_BANKWIDTH * 8) + BITS_PER_LONG - 1) / BITS_PER_LONG)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183typedef union {
184 unsigned long x[MAX_MAP_LONGS];
185} map_word;
186
187/* The map stuff is very simple. You fill in your struct map_info with
188 a handful of routines for accessing the device, making sure they handle
189 paging etc. correctly if your device needs it. Then you pass it off
190 to a chip probe routine -- either JEDEC or CFI probe or both -- via
191 do_map_probe(). If a chip is recognised, the probe code will invoke the
192 appropriate chip driver (if present) and return a struct mtd_info.
Thomas Gleixner61ecfa82005-11-07 11:15:31 +0000193 At which point, you fill in the mtd->module with your own module
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194 address, and register it with the MTD core code. Or you could partition
195 it and register the partitions instead, or keep it for your own private
196 use; whatever.
Thomas Gleixner61ecfa82005-11-07 11:15:31 +0000197
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 The mtd->priv field will point to the struct map_info, and any further
Thomas Gleixner61ecfa82005-11-07 11:15:31 +0000199 private data required by the chip driver is linked from the
200 mtd->priv->fldrv_priv field. This allows the map driver to get at
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 the destructor function map->fldrv_destroy() when it's tired
202 of living.
203*/
204
205struct map_info {
Greg Kroah-Hartmaneadcf0d2008-07-02 12:46:22 -0700206 const char *name;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 unsigned long size;
Stefan Roese0d36da32007-01-19 08:40:04 +0100208 resource_size_t phys;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209#define NO_XIP (-1UL)
210
211 void __iomem *virt;
212 void *cached;
213
Aaron Sierra8e987462011-11-14 18:44:34 -0600214 int swap; /* this mapping's byte-swapping requirement */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 int bankwidth; /* in octets. This isn't necessarily the width
216 of actual bus cycles -- it's the repeat interval
217 in bytes, before you are talking to the first chip again.
218 */
219
220#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
221 map_word (*read)(struct map_info *, unsigned long);
222 void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t);
223
224 void (*write)(struct map_info *, const map_word, unsigned long);
225 void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
226
227 /* We can perhaps put in 'point' and 'unpoint' methods, if we really
228 want to enable XIP for non-linear mappings. Not yet though. */
229#endif
230 /* It's possible for the map driver to use cached memory in its
231 copy_from implementation (and _only_ with copy_from). However,
232 when the chip driver knows some flash area has changed contents,
233 it will signal it to the map driver through this routine to let
234 the map driver invalidate the corresponding cache as needed.
235 If there is no cache to care about this can be set to NULL. */
236 void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
237
Linus Walleij95a001f2016-02-01 23:02:48 +0100238 /* This will be called with 1 as parameter when the first map user
239 * needs VPP, and called with 0 when the last user exits. The map
240 * core maintains a reference counter, and assumes that VPP is a
241 * global resource applying to all mapped flash chips on the system.
242 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243 void (*set_vpp)(struct map_info *, int);
244
Alexey Korolevd13e51e2008-12-16 18:21:10 +0000245 unsigned long pfow_base;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 unsigned long map_priv_1;
247 unsigned long map_priv_2;
Stefan Roese1648eaa2013-01-18 13:10:05 +0100248 struct device_node *device_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249 void *fldrv_priv;
250 struct mtd_chip_driver *fldrv;
251};
252
253struct mtd_chip_driver {
254 struct mtd_info *(*probe)(struct map_info *map);
255 void (*destroy)(struct mtd_info *);
256 struct module *module;
257 char *name;
258 struct list_head list;
259};
260
261void register_mtd_chip_driver(struct mtd_chip_driver *);
262void unregister_mtd_chip_driver(struct mtd_chip_driver *);
263
264struct mtd_info *do_map_probe(const char *name, struct map_info *map);
265void map_destroy(struct mtd_info *mtd);
266
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100267#define ENABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 1); } while (0)
268#define DISABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 0); } while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269
270#define INVALIDATE_CACHED_RANGE(map, from, size) \
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100271 do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
273
274static inline int map_word_equal(struct map_info *map, map_word val1, map_word val2)
275{
276 int i;
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100277
278 for (i = 0; i < map_words(map); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279 if (val1.x[i] != val2.x[i])
280 return 0;
281 }
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100282
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 return 1;
284}
285
286static inline map_word map_word_and(struct map_info *map, map_word val1, map_word val2)
287{
288 map_word r;
289 int i;
290
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100291 for (i = 0; i < map_words(map); i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 r.x[i] = val1.x[i] & val2.x[i];
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100293
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294 return r;
295}
296
Nicolas Pitref77814d2005-02-08 17:11:19 +0000297static inline map_word map_word_clr(struct map_info *map, map_word val1, map_word val2)
298{
299 map_word r;
300 int i;
301
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100302 for (i = 0; i < map_words(map); i++)
Nicolas Pitref77814d2005-02-08 17:11:19 +0000303 r.x[i] = val1.x[i] & ~val2.x[i];
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100304
Nicolas Pitref77814d2005-02-08 17:11:19 +0000305 return r;
306}
307
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308static inline map_word map_word_or(struct map_info *map, map_word val1, map_word val2)
309{
310 map_word r;
311 int i;
312
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100313 for (i = 0; i < map_words(map); i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314 r.x[i] = val1.x[i] | val2.x[i];
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100315
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316 return r;
317}
Nicolas Pitref77814d2005-02-08 17:11:19 +0000318
Arnd Bergmannd09957f2015-03-10 17:48:37 +0100319static inline int map_word_andequal(struct map_info *map, map_word val1, map_word val2, map_word val3)
320{
321 int i;
322
323 for (i = 0; i < map_words(map); i++) {
324 if ((val1.x[i] & val2.x[i]) != val3.x[i])
325 return 0;
326 }
327
328 return 1;
329}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330
331static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
332{
333 int i;
334
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100335 for (i = 0; i < map_words(map); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336 if (val1.x[i] & val2.x[i])
337 return 1;
338 }
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100339
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 return 0;
341}
342
343static inline map_word map_word_load(struct map_info *map, const void *ptr)
344{
Dmitry Eremin-Solenikov24dea0c2013-01-31 21:06:34 +0400345 map_word r;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346
347 if (map_bankwidth_is_1(map))
348 r.x[0] = *(unsigned char *)ptr;
349 else if (map_bankwidth_is_2(map))
350 r.x[0] = get_unaligned((uint16_t *)ptr);
351 else if (map_bankwidth_is_4(map))
352 r.x[0] = get_unaligned((uint32_t *)ptr);
353#if BITS_PER_LONG >= 64
354 else if (map_bankwidth_is_8(map))
355 r.x[0] = get_unaligned((uint64_t *)ptr);
356#endif
357 else if (map_bankwidth_is_large(map))
358 memcpy(r.x, ptr, map->bankwidth);
Dmitry Eremin-Solenikov24dea0c2013-01-31 21:06:34 +0400359 else
360 BUG();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361
362 return r;
363}
364
365static inline map_word map_word_load_partial(struct map_info *map, map_word orig, const unsigned char *buf, int start, int len)
366{
367 int i;
368
369 if (map_bankwidth_is_large(map)) {
370 char *dest = (char *)&orig;
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100371
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372 memcpy(dest+start, buf, len);
373 } else {
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100374 for (i = start; i < start+len; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 int bitpos;
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100376
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377#ifdef __LITTLE_ENDIAN
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100378 bitpos = i * 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379#else /* __BIG_ENDIAN */
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100380 bitpos = (map_bankwidth(map) - 1 - i) * 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381#endif
382 orig.x[0] &= ~(0xff << bitpos);
Wang Haitaoa4d62ba2013-08-22 19:32:38 +0800383 orig.x[0] |= (unsigned long)buf[i-start] << bitpos;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 }
385 }
386 return orig;
387}
388
Thomas Gleixner3a3ab482005-05-24 20:50:18 +0200389#if BITS_PER_LONG < 64
390#define MAP_FF_LIMIT 4
391#else
392#define MAP_FF_LIMIT 8
393#endif
394
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395static inline map_word map_word_ff(struct map_info *map)
396{
397 map_word r;
398 int i;
Thomas Gleixner61ecfa82005-11-07 11:15:31 +0000399
Thomas Gleixnerb0435692005-05-25 12:20:29 +0200400 if (map_bankwidth(map) < MAP_FF_LIMIT) {
Thomas Gleixnera8aff8a2005-05-25 12:32:37 +0200401 int bw = 8 * map_bankwidth(map);
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100402
Wang Haitaoa4d62ba2013-08-22 19:32:38 +0800403 r.x[0] = (1UL << bw) - 1;
Thomas Gleixner3a3ab482005-05-24 20:50:18 +0200404 } else {
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100405 for (i = 0; i < map_words(map); i++)
Thomas Gleixner3a3ab482005-05-24 20:50:18 +0200406 r.x[i] = ~0UL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 }
408 return r;
409}
Nicolas Pitref77814d2005-02-08 17:11:19 +0000410
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
412{
Dmitry Eremin-Solenikov24dea0c2013-01-31 21:06:34 +0400413 map_word r;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414
415 if (map_bankwidth_is_1(map))
416 r.x[0] = __raw_readb(map->virt + ofs);
417 else if (map_bankwidth_is_2(map))
418 r.x[0] = __raw_readw(map->virt + ofs);
419 else if (map_bankwidth_is_4(map))
420 r.x[0] = __raw_readl(map->virt + ofs);
421#if BITS_PER_LONG >= 64
422 else if (map_bankwidth_is_8(map))
423 r.x[0] = __raw_readq(map->virt + ofs);
424#endif
425 else if (map_bankwidth_is_large(map))
Arnd Bergmann7234bea2015-03-10 17:51:55 +0100426 memcpy_fromio(r.x, map->virt + ofs, map->bankwidth);
Kevin Cernekee9ea59732010-04-10 11:18:58 -0700427 else
428 BUG();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429
430 return r;
431}
432
433static inline void inline_map_write(struct map_info *map, const map_word datum, unsigned long ofs)
434{
435 if (map_bankwidth_is_1(map))
436 __raw_writeb(datum.x[0], map->virt + ofs);
437 else if (map_bankwidth_is_2(map))
438 __raw_writew(datum.x[0], map->virt + ofs);
439 else if (map_bankwidth_is_4(map))
440 __raw_writel(datum.x[0], map->virt + ofs);
441#if BITS_PER_LONG >= 64
442 else if (map_bankwidth_is_8(map))
443 __raw_writeq(datum.x[0], map->virt + ofs);
444#endif
445 else if (map_bankwidth_is_large(map))
446 memcpy_toio(map->virt+ofs, datum.x, map->bankwidth);
Dmitry Eremin-Solenikov24dea0c2013-01-31 21:06:34 +0400447 else
448 BUG();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449 mb();
450}
451
452static inline void inline_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
453{
454 if (map->cached)
455 memcpy(to, (char *)map->cached + from, len);
456 else
457 memcpy_fromio(to, map->virt + from, len);
458}
459
460static inline void inline_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
461{
462 memcpy_toio(map->virt + to, from, len);
463}
464
465#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
466#define map_read(map, ofs) (map)->read(map, ofs)
467#define map_copy_from(map, to, from, len) (map)->copy_from(map, to, from, len)
468#define map_write(map, datum, ofs) (map)->write(map, datum, ofs)
469#define map_copy_to(map, to, from, len) (map)->copy_to(map, to, from, len)
470
471extern void simple_map_init(struct map_info *);
472#define map_is_linear(map) (map->phys != NO_XIP)
473
474#else
475#define map_read(map, ofs) inline_map_read(map, ofs)
476#define map_copy_from(map, to, from, len) inline_map_copy_from(map, to, from, len)
477#define map_write(map, datum, ofs) inline_map_write(map, datum, ofs)
478#define map_copy_to(map, to, from, len) inline_map_copy_to(map, to, from, len)
479
480
481#define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth))
Nicolas Pitref16407d2005-02-16 15:55:03 +0000482#define map_is_linear(map) ({ (void)(map); 1; })
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483
484#endif /* !CONFIG_MTD_COMPLEX_MAPPINGS */
485
486#endif /* __LINUX_MTD_MAP_H__ */