--- linux-bcm/include/linux/mtd/map.h-old 2003-05-28 14:42:22.000000000 +0200 +++ linux-bcm/include/linux/mtd/map.h 2004-02-08 17:43:55.398928752 +0100 @@ -156,7 +156,30 @@ static inline void map_write64(struct ma static inline void map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) { - memcpy_fromio(to, map->virt + from, len); +#define MTD_ALIGN (4 - 1) +//#define MTD_ALIGN ((BITS_PER_LONG / 2) - 1) + u64 buf; + ssize_t transfer; + ssize_t done = (map->buswidth == 1) ? len : (len & ~MTD_ALIGN); + memcpy_fromio(to, map->virt + from, done); + while (done < len) { + switch(map->buswidth) { + case 2: + buf = map_read16(map, from + done); + break; + case 4: + buf = map_read32(map, from + done); + break; + case 8: + buf = map_read64(map, from + done); + break; + } + transfer = len - done; + if (transfer > map->buswidth) + transfer = map->buswidth; + memcpy((void *)((unsigned long)to + done), &buf, transfer); + done += transfer; + } } static inline void map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)