
mark roths wrote:
Sorry if this has been covered already, the problem exists in all the u-boot versions I have up to 1.2.0.
1.2.0 is rather old; you should check the latest code when submitting bug reports and patches.
*** ../u-boot-1.1.5/drivers/nand/nand_ecc.c 2006-10-20 08:54:33.000000000 -0700 --- drivers/nand/nand_ecc.c 2008-06-10 12:59:21.000000000 -0700
*** 118,123 **** --- 118,124 ---- { u_char idx, reg1, reg2, reg3; int j;
u_char tmp0, tmp1; /* Initialize variables */ reg1 = reg2 = reg3 = 0;
*** 140,148 **** --- 141,157 ---- /* Create non-inverted ECC code from line parity */ nand_trans_result(reg2, reg3, ecc_code);
- #define CONFIG_MTD_NAND_ECC_SMC /* Calculate final ECC code */
- #ifdef CONFIG_MTD_NAND_ECC_SMC
tmp0 = ~ecc_code[0];
tmp1 = ~ecc_code[1];
ecc_code[0] = tmp1;
ecc_code[1] = tmp0;
- #else ecc_code[0] = ~ecc_code[0]; ecc_code[1] = ~ecc_code[1];
- #endif
The current code appears to have a similar change already.
In the future, please use unified diffs, avoid whitespace mangling, and add a Signed-off-by: line.
-Scott