#ifndef __LINUX_MTD_MAP_H__
#define __LINUX_MTD_MAP_H__
#include <linux/types.h>
#include <linux/list.h>
#include <linux/string.h>
#include <linux/bug.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <asm/unaligned.h>
#include <asm/barrier.h>
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
#define map_bankwidth(map) …
#define map_bankwidth_is_1(map) …
#define map_bankwidth_is_large(map) …
#define map_words(map) …
#define MAX_MAP_BANKWIDTH …
#else
#define map_bankwidth_is_1 …
#endif
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_2
# ifdef map_bankwidth
# undef map_bankwidth
#define map_bankwidth(map) …
# else
#define map_bankwidth …
#define map_bankwidth_is_large …
#define map_words …
# endif
#define map_bankwidth_is_2(map) …
#undef MAX_MAP_BANKWIDTH
#define MAX_MAP_BANKWIDTH …
#else
#define map_bankwidth_is_2 …
#endif
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_4
# ifdef map_bankwidth
# undef map_bankwidth
#define map_bankwidth(map) …
# else
#define map_bankwidth …
#define map_bankwidth_is_large …
#define map_words …
# endif
#define map_bankwidth_is_4(map) …
#undef MAX_MAP_BANKWIDTH
#define MAX_MAP_BANKWIDTH …
#else
#define map_bankwidth_is_4 …
#endif
#define map_calc_words(map) …
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_8
# ifdef map_bankwidth
# undef map_bankwidth
#define map_bankwidth(map) …
# if BITS_PER_LONG < 64
# undef map_bankwidth_is_large
#define map_bankwidth_is_large …
# undef map_words
#define map_words …
# endif
# else
#define map_bankwidth …
#define map_bankwidth_is_large …
#define map_words …
# endif
#define map_bankwidth_is_8(map) …
#undef MAX_MAP_BANKWIDTH
#define MAX_MAP_BANKWIDTH …
#else
#define map_bankwidth_is_8 …
#endif
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_16
# ifdef map_bankwidth
# undef map_bankwidth
#define map_bankwidth(map) …
# undef map_bankwidth_is_large
#define map_bankwidth_is_large(map) …
# undef map_words
#define map_words(map) …
# else
#define map_bankwidth …
#define map_bankwidth_is_large …
#define map_words …
# endif
#define map_bankwidth_is_16(map) …
#undef MAX_MAP_BANKWIDTH
#define MAX_MAP_BANKWIDTH …
#else
#define map_bankwidth_is_16 …
#endif
#ifdef CONFIG_MTD_MAP_BANK_WIDTH_32
# undef map_bankwidth
#define map_bankwidth(map) …
# undef map_bankwidth_is_large
#define map_bankwidth_is_large(map) …
# undef map_words
#define map_words(map) …
#define map_bankwidth_is_32(map) …
#undef MAX_MAP_BANKWIDTH
#define MAX_MAP_BANKWIDTH …
#else
#define map_bankwidth_is_32 …
#endif
#ifndef map_bankwidth
#ifdef CONFIG_MTD
#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
#endif
static inline int map_bankwidth(void *map)
{
BUG();
return 0;
}
#define map_bankwidth_is_large …
#define map_words …
#define MAX_MAP_BANKWIDTH …
#endif
static inline int map_bankwidth_supported(int w)
{ … }
#define MAX_MAP_LONGS …
map_word;
struct map_info { … };
struct mtd_chip_driver { … };
void register_mtd_chip_driver(struct mtd_chip_driver *);
void unregister_mtd_chip_driver(struct mtd_chip_driver *);
struct mtd_info *do_map_probe(const char *name, struct map_info *map);
void map_destroy(struct mtd_info *mtd);
#define ENABLE_VPP(map) …
#define DISABLE_VPP(map) …
#define INVALIDATE_CACHED_RANGE(map, from, size) …
#define map_word_equal(map, val1, val2) …
#define map_word_and(map, val1, val2) …
#define map_word_clr(map, val1, val2) …
#define map_word_or(map, val1, val2) …
#define map_word_andequal(map, val1, val2, val3) …
#define map_word_bitsset(map, val1, val2) …
static inline map_word map_word_load(struct map_info *map, const void *ptr)
{ … }
static inline map_word map_word_load_partial(struct map_info *map, map_word orig, const unsigned char *buf, int start, int len)
{ … }
#if BITS_PER_LONG < 64
#define MAP_FF_LIMIT …
#else
#define MAP_FF_LIMIT …
#endif
static inline map_word map_word_ff(struct map_info *map)
{ … }
static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
{ … }
static inline void inline_map_write(struct map_info *map, const map_word datum, unsigned long ofs)
{ … }
static inline void inline_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
{ … }
static inline void inline_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
{ … }
#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
#define map_read(map, ofs) …
#define map_copy_from(map, to, from, len) …
#define map_write(map, datum, ofs) …
#define map_copy_to(map, to, from, len) …
extern void simple_map_init(struct map_info *);
#define map_is_linear(map) …
#else
#define map_read …
#define map_copy_from …
#define map_write …
#define map_copy_to …
#define simple_map_init …
#define map_is_linear …
#endif
#endif