diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2011-03-31 14:25:25 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2011-03-31 14:25:25 (GMT) |
commit | a45a416fd4f85215ccccb1200dd2c0f0f74dba17 (patch) | |
tree | 6d7513f7002cbbd7c612fb2a9b0e40a147c54474 /uClinux-2.4.20-uc1/include/linux/mtd/map.h | |
parent | d810895d6ad59222c4b220d602fc307d80ee97a2 (diff) | |
download | openipcam-a45a416fd4f85215ccccb1200dd2c0f0f74dba17.zip openipcam-a45a416fd4f85215ccccb1200dd2c0f0f74dba17.tar.gz openipcam-a45a416fd4f85215ccccb1200dd2c0f0f74dba17.tar.bz2 |
w90n745 flash mappings and nand driver
Diffstat (limited to 'uClinux-2.4.20-uc1/include/linux/mtd/map.h')
-rw-r--r-- | uClinux-2.4.20-uc1/include/linux/mtd/map.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/uClinux-2.4.20-uc1/include/linux/mtd/map.h b/uClinux-2.4.20-uc1/include/linux/mtd/map.h index 94ffed2..4527e83 100644 --- a/uClinux-2.4.20-uc1/include/linux/mtd/map.h +++ b/uClinux-2.4.20-uc1/include/linux/mtd/map.h @@ -10,6 +10,48 @@ #include <linux/mtd/mtd.h> #include <linux/slab.h> +#ifdef CONFIG_MTD_CFI_B1 +#define map_bankwidth(map) 1 +#define map_bankwidth_is_1(map) (map_bankwidth(map) == 1) +#define MAX_MAP_BANKWIDTH 1 +#else +#define map_bankwidth_is_1(map) (0) +#endif + +#ifdef CONFIG_MTD_CFI_B2 +# ifdef map_bankwidth +# undef map_bankwidth +# define map_bankwidth(map) ((map)->bankwidth) +# else +# define map_bankwidth(map) 2 +# endif +#define map_bankwidth_is_2(map) (map_bankwidth(map) == 2) +#undef MAX_MAP_BANKWIDTH +#define MAX_MAP_BANKWIDTH 2 +#else +#define map_bankwidth_is_2(map) (0) +#endif + +#ifdef CONFIG_MTD_CFI_B4 +# ifdef map_bankwidth +# undef map_bankwidth +# define map_bankwidth(map) ((map)->bankwidth) +# else +# define map_bankwidth(map) 4 +# endif +#define map_bankwidth_is_4(map) (map_bankwidth(map) == 4) +#undef MAX_MAP_BANKWIDTH +#define MAX_MAP_BANKWIDTH 4 +#else +#define map_bankwidth_is_4(map) (0) +#endif + +#define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG ) + +typedef union { + unsigned long x[MAX_MAP_LONGS]; +} map_word; + /* The map stuff is very simple. You fill in your struct map_info with a handful of routines for accessing the device, making sure they handle paging etc. correctly if your device needs it. Then you pass it off @@ -38,10 +80,12 @@ struct map_info { * I won't. * dwmw2 */ + map_word (*read)(struct map_info *, unsigned long); void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t); void (*write8)(struct map_info *, __u8, unsigned long); void (*write16)(struct map_info *, __u16, unsigned long); void (*write32)(struct map_info *, __u32, unsigned long); + void (*write)(struct map_info *, const map_word, unsigned long); void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t); void (*set_vpp)(struct map_info *, int); |