1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_MTD_MAP_H__
13 #define __LINUX_MTD_MAP_H__
15 #include <linux/types.h>
16 #include <linux/list.h>
17 #include <linux/string.h>
19 #include <linux/mtd/compatmac.h>
21 #include <asm/unaligned.h>
22 #include <asm/system.h>
25 #define map_bankwidth_is_1(map) (0)
27 #define map_bankwidth_is_2(map) (0)
29 #define map_bankwidth_is_4(map) (0)
31 #define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1))/ sizeof(unsigned long))
33 #define map_bankwidth_is_8(map) (0)
35 #define map_bankwidth_is_16(map) (0)
37 #define map_bankwidth_is_32(map) (0)
40 #error "No bus width supported. What's the point?"
43 #define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG )
56 void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
58 void (*set_vpp)(struct map_info *, int);
60 unsigned long map_priv_1;
61 unsigned long map_priv_2;
63 struct mtd_chip_driver *fldrv;
66 struct mtd_chip_driver {
67 struct mtd_info *(*probe)(struct map_info *map);
68 void (*destroy)(struct mtd_info *);
69 struct module *module;
71 struct list_head list;
74 struct mtd_info *do_map_probe(const char *name, struct map_info *map);
76 #define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
77 #define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
79 #define INVALIDATE_CACHED_RANGE(map, from, size) do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0)
81 #define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
82 #if BITS_PER_LONG >= 64
84 #ifdef __LITTLE_ENDIAN
87 #if BITS_PER_LONG < 64
88 #define MAP_FF_LIMIT 4
90 #define MAP_FF_LIMIT 8
92 #if BITS_PER_LONG >= 64
94 #if BITS_PER_LONG >= 64
96 #define map_read(map, ofs) inline_map_read(map, ofs)
97 #define map_copy_from(map, to, from, len) inline_map_copy_from(map, to, from, len)
98 #define map_write(map, datum, ofs) inline_map_write(map, datum, ofs)
99 #define map_copy_to(map, to, from, len) inline_map_copy_to(map, to, from, len)
100 #define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth))
101 #define map_is_linear(map) ({ (void)(map); 1; })