]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
ppc4xx: Fix ECC Correction bug with SMC ordering for NDFC driver
authorFeng Kan <fkan@amcc.com>
Fri, 21 Aug 2009 17:59:42 +0000 (10:59 -0700)
committerStefan Roese <sr@denx.de>
Tue, 25 Aug 2009 15:41:42 +0000 (17:41 +0200)
commit68e74567cf317318df52dbcb2ac170ffc5e7758a
treef2c36859081242b0c1ed87ef1466e7d9cf413873
parenta794f59a75bf9fd4a44f1ad2349cae903c42b89c
ppc4xx: Fix ECC Correction bug with SMC ordering for NDFC driver

Fix ECC Correction bug where the byte offset location were double
flipped causing correction routine to toggle the wrong byte location
in the ECC segment. The ndfc_calculate_ecc routine change the order
of getting the ECC code.
        /* The NDFC uses Smart Media (SMC) bytes order */
        ecc_code[0] = p[2];
        ecc_code[1] = p[1];
        ecc_code[2] = p[3];
But in the Correction algorithm when calculating the byte offset
location, the s1 is used as the upper part of the address. Which
again reverse the order making the final byte offset address
location incorrect.
byteoffs = (s1 << 0) & 0x80;
.
.
byteoffs |= (s0 >> 4) & 0x08;
The order is change to read it in straight and let the correction
function to revert it to SMC order.

Signed-off-by: Feng Kan <fkan@amcc.com>
Acked-by: Victor Gallardo <vgallardo@amcc.com>
Acked-by: Prodyut Hazarika <phazarika@amcc.com>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/nand/ndfc.c