NOR flash is attached to the same EBU (External Bus Unit) as PCI. As
in the PCI patch, the EBU is a little buggy, resulting in the upper
16 bit of the data on a 32 bit read are swapped. (essentially we have
"Are" not needed.
To work around this we do a addr^=2 during the probe. Once probed we
cfi->addr_unlock1 and cfi->addr_unlock2 to represent the endianess bug.
Signed-off-by: John Crispin<firstname.lastname@example.org>
Signed-off-by: Ralph Hempel<email@example.com>
Cc: David Woodhouse<firstname.lastname@example.org>
Cc: Daniel Schwierzeck<email@example.com>
diff --git a/drivers/mtd/maps/lantiq.c b/drivers/mtd/maps/lantiq.c
new file mode 100644
@@ -0,0 +1,190 @@
+ltq_copy_from(struct map_info *map, void *to,
> + unsigned long from, ssize_t len)
Shouldn't it be static?
+ unsigned char *p;
+ unsigned char *to_8;
+ unsigned long flags;
+ spin_lock_irqsave(&ebu_lock, flags);
+ from = (unsigned long) (map->virt + from);
from += (unsigned long) map->virt;
like you do in ltq_copy_to()?
+ p = (unsigned char *) from;
Could be done in initializer, like in ltq_copy_to().
+ to_8 = (unsigned char *) to;
+ while (len--)
+ *to_8++ = *p++;
BTW, you could use memcpy_fromio().
Actually not, as on MIPS it's implemented via memcpy(). On ARM it doesn
byte-by-byte copying -- that's why I remembered about it...