[PATCH] IXDP425 write16 alignment

Scott Wood scott at timesys.com
Thu Sep 16 17:32:19 EDT 2004


I've attached a patch to the ixp4xx.c map file to prevent
ixp4xx_write16() from writing to an unaligned address, which happens
when probing the device width.  Such an access causes a fault handler
to attempt to do the write a byte at a time, which apparently
aggravates the hardware into causing a delayed data abort, which
crashes the system.

With this patch, unaligned writes are ignored, causing the 8-bit
probe to fail and proceed to the 16-bit probe (which succeeds).

Signed-off-by: Scott Wood <scott.wood at timesys.com> under TS0068

--- linux-2.6.8.1/drivers/mtd/maps/ixp4xx.c	2004-08-17 15:22:35.000000000 -0400
+++ linux-ixdp425/drivers/mtd/maps/ixp4xx.c	2004-09-16 17:21:20.000000000 -0400
@@ -71,7 +71,8 @@
 
 static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr)
 {
-	*(__u16 *) (map->map_priv_1 + adr) = d.x[0];
+	if (!(adr & 1))
+		*(__u16 *) (map->map_priv_1 + adr) = d.x[0];
 }
 
 struct ixp4xx_flash_info {




More information about the linux-mtd mailing list