Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx
[oweals/u-boot.git] / cpu / ppc4xx / ndfc.c
index 398457726f426b3898ff794b6ebcd1018eaf3f76..5b2ae88d93b84242edc6910f1fcf702d908cd93d 100644 (file)
@@ -34,7 +34,8 @@
 #if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY) && \
        (defined(CONFIG_440EP) || defined(CONFIG_440GR) ||           \
         defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||         \
-        defined(CONFIG_405EZ))
+        defined(CONFIG_405EZ) || defined(CONFIG_405EX) ||           \
+        defined(CONFIG_460EX) || defined(CONFIG_460GT))
 
 #include <nand.h>
 #include <linux/mtd/ndfc.h>
@@ -121,8 +122,8 @@ static int ndfc_calculate_ecc(struct mtd_info *mtdinfo,
 
        /* The NDFC uses Smart Media (SMC) bytes order
         */
-       ecc_code[0] = p[2];
-       ecc_code[1] = p[1];
+       ecc_code[0] = p[1];
+       ecc_code[1] = p[2];
        ecc_code[2] = p[3];
 
        return 0;
@@ -222,6 +223,7 @@ int board_nand_init(struct nand_chip *nand)
         */
        board_nand_select_device(nand, cs);
        out_be32((u32 *)(base + NDFC_BCFG0 + (cs << 2)), 0x80002222);
+
        return 0;
 }