--- nand_ecc.c.orig 2006-09-23 09:51:09.000000000 +1200 +++ nand_ecc.c 2006-09-23 09:52:12.000000000 +1200 @@ -128,7 +128,7 @@ /* Get CP0 - CP5 from table */ idx = nand_ecc_precalc_table[dat[j]]; - reg1 ^= (idx & 0x3f); + reg1 ^= idx; /* All bit XOR = 1 ? */ if (idx & 0x40) { @@ -136,6 +136,8 @@ reg2 ^= ~((u_char) j); } } + + reg1 &= 0x3f; /* Create non-inverted ECC code from line parity */ nand_trans_result(reg2, reg3, ecc_code);