From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Tue, 25 Aug 2009 17:45:26 +0200 Subject: [U-Boot] [PATCH 1/1] ppc4xx: Fix ECC Correction bug with SMC ordering for NDFC driver In-Reply-To: <1250877582-16538-1-git-send-email-fkan@amcc.com> References: <1250877582-16538-1-git-send-email-fkan@amcc.com> Message-ID: <200908251745.26167.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 21 August 2009 19:59:42 Feng Kan wrote: > 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 > Acked-by: Victor Gallardo > Acked-by: Prodyut Hazarika Applied to u-boot-ppc4xx/master. Thanks. Cheers, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de