Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Feng Kan's avatar
    68e74567
    ppc4xx: Fix ECC Correction bug with SMC ordering for NDFC driver · 68e74567
    Feng Kan authored
    
    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: default avatarFeng Kan <fkan@amcc.com>
    Acked-by: default avatarVictor Gallardo <vgallardo@amcc.com>
    Acked-by: default avatarProdyut Hazarika <phazarika@amcc.com>
    Signed-off-by: default avatarStefan Roese <sr@denx.de>
    68e74567
    History
    ppc4xx: Fix ECC Correction bug with SMC ordering for NDFC driver
    Feng Kan authored
    
    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: default avatarFeng Kan <fkan@amcc.com>
    Acked-by: default avatarVictor Gallardo <vgallardo@amcc.com>
    Acked-by: default avatarProdyut Hazarika <phazarika@amcc.com>
    Signed-off-by: default avatarStefan Roese <sr@denx.de>