public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] ppc4xx: add support for alternate format for ndfc
@ 2010-02-18 22:25 fkan at amcc.com
  2010-02-18 23:13 ` Wolfgang Denk
  2010-02-19  7:57 ` Stefan Roese
  0 siblings, 2 replies; 10+ messages in thread
From: fkan at amcc.com @ 2010-02-18 22:25 UTC (permalink / raw)
  To: u-boot

From: Feng Kan <fkan@amcc.com>

This is to lock down the ordering in the correction routine against
the calculate routine. Otherwise, incorrect define would cause ECC errors.

Signed-off-by: Feng Kan <fkan@amcc.com>
Acked-by: Victor Gallardo <vgallardo@amcc.com>
---
 drivers/mtd/nand/ndfc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 0dd6789..88e341d 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -89,9 +89,15 @@ static int ndfc_calculate_ecc(struct mtd_info *mtdinfo,
 
 	/* The NDFC uses Smart Media (SMC) bytes order
 	 */
+#ifdef CONFIG_MTD_NAND_ECC_SMC
 	ecc_code[0] = p[1];
 	ecc_code[1] = p[2];
 	ecc_code[2] = p[3];
+#else
+	ecc_code[0] = p[2];
+	ecc_code[1] = p[1];
+	ecc_code[2] = p[3];
+#endif
 
 	return 0;
 }
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-02-23  5:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-18 22:25 [U-Boot] [PATCH 1/1] ppc4xx: add support for alternate format for ndfc fkan at amcc.com
2010-02-18 23:13 ` Wolfgang Denk
2010-02-19  0:08   ` Feng Kan
2010-02-19  8:45     ` Wolfgang Denk
2010-02-19  7:57 ` Stefan Roese
2010-02-19 18:27   ` Feng Kan
2010-02-22 10:52     ` Stefan Roese
2010-02-22 18:06       ` Feng Kan
2010-02-22 20:54         ` Wolfgang Denk
2010-02-23  5:13           ` Feng Kan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox