X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fmap_funcs.c;h=9105e6ca0aa61de3be27f9063464e1c3372a9a25;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=4bb4af6c864e5c6a58f854e0858be871a637293e;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/mtd/maps/map_funcs.c b/drivers/mtd/maps/map_funcs.c index 4bb4af6c8..9105e6ca0 100644 --- a/drivers/mtd/maps/map_funcs.c +++ b/drivers/mtd/maps/map_funcs.c @@ -1,5 +1,5 @@ /* - * $Id: map_funcs.c,v 1.2 2003/05/21 15:15:07 dwmw2 Exp $ + * $Id: map_funcs.c,v 1.10 2005/06/06 23:04:36 tpoynor Exp $ * * Out-of-line map I/O functions for simple maps when CONFIG_COMPLEX_MAPPINGS * is enabled. @@ -7,87 +7,36 @@ #include #include -#include -#include -#include -#include #include -#include +#include -static u8 simple_map_read8(struct map_info *map, unsigned long ofs) +static map_word __xipram simple_map_read(struct map_info *map, unsigned long ofs) { - return __raw_readb(map->virt + ofs); + return inline_map_read(map, ofs); } -static u16 simple_map_read16(struct map_info *map, unsigned long ofs) +static void __xipram simple_map_write(struct map_info *map, const map_word datum, unsigned long ofs) { - return __raw_readw(map->virt + ofs); + inline_map_write(map, datum, ofs); } -static u32 simple_map_read32(struct map_info *map, unsigned long ofs) +static void __xipram simple_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) { - return __raw_readl(map->virt + ofs); + inline_map_copy_from(map, to, from, len); } -static u64 simple_map_read64(struct map_info *map, unsigned long ofs) +static void __xipram simple_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) { -#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */ - BUG(); - return 0; -#else - return __raw_readll(map->virt + ofs); -#endif -} - -static void simple_map_write8(struct map_info *map, u8 datum, unsigned long ofs) -{ - __raw_writeb(datum, map->virt + ofs); - mb(); -} - -static void simple_map_write16(struct map_info *map, u16 datum, unsigned long ofs) -{ - __raw_writew(datum, map->virt + ofs); - mb(); -} - -static void simple_map_write32(struct map_info *map, u32 datum, unsigned long ofs) -{ - __raw_writel(datum, map->virt + ofs); - mb(); -} - -static void simple_map_write64(struct map_info *map, u64 datum, unsigned long ofs) -{ -#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */ - BUG(); -#else - __raw_writell(datum, map->virt + ofs); - mb(); -#endif /* CFI_B8 */ -} - -static void simple_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) -{ - memcpy_fromio(to, map->virt + from, len); -} - -static void simple_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) -{ - memcpy_toio(map->virt + to, from, len); + inline_map_copy_to(map, to, from, len); } void simple_map_init(struct map_info *map) { - map->read8 = simple_map_read8; - map->read16 = simple_map_read16; - map->read32 = simple_map_read32; - map->read64 = simple_map_read64; - map->write8 = simple_map_write8; - map->write16 = simple_map_write16; - map->write32 = simple_map_write32; - map->write64 = simple_map_write64; + BUG_ON(!map_bankwidth_supported(map->bankwidth)); + + map->read = simple_map_read; + map->write = simple_map_write; map->copy_from = simple_map_copy_from; map->copy_to = simple_map_copy_to; }