Skip to contentSkip to conversation

MTD: [NAND] Fix the sharpsl driver after breakage from a core conversion

PATCH New Richard Purdie 1 participant 1 message Jul 15, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: [NAND] Fix the sharpsl driver after breakage from a core conversion

MTD: [NAND] Fix the sharpsl driver after breakage from a core conversion

The CNE bits are inverted on the device and writeb function is missing a NOT operation.

drivers/mtd/nand/sharpsl.c +5 -2
Index: git/drivers/mtd/nand/sharpsl.c
===================================================================
@@ -78,7 +78,7 @@
 /*
  *	hardware specific access to control-lines
  *	ctrl:
- *	NAND_CNE: bit 0 -> bit 0 & 4
+ *	NAND_CNE: bit 0 -> ! bit 0 & 4
  *	NAND_CLE: bit 1 -> bit 1
  *	NAND_ALE: bit 2 -> bit 2
  *
@@ -92,7 +92,10 @@
 		unsigned char bits = ctrl & 0x07;
 
 		bits |= (ctrl & 0x01) << 4;
-		writeb((readb(FLASHCTL) & 0x17) | bits, FLASHCTL);
+		
+		bits ^= 0x11;
+		
+		writeb((readb(FLASHCTL) & ~0x17) | bits, FLASHCTL);
 	}
 
 	if (cmd != NAND_CMD_NONE)