]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/ndfc.c
Merge branch 'master' of git://git.denx.de/u-boot-imx
[u-boot] / drivers / mtd / nand / ndfc.c
index 528b22b49aeb32ec2a57720d385a080c12bd9a8d..0729e0c9c02a5d00c250f4fa92f6b1eb8a49a5c4 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/mtd/nand_ecc.h>
 #include <asm/processor.h>
 #include <asm/io.h>
-#include <ppc4xx.h>
+#include <asm/ppc4xx.h>
 
 /*
  * We need to store the info, which chip-select (CS) is used for the
@@ -89,8 +89,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;
@@ -201,17 +201,17 @@ int board_nand_init(struct nand_chip *nand)
 #ifndef CONFIG_NAND_SPL
        nand->write_buf  = ndfc_write_buf;
        nand->verify_buf = ndfc_verify_buf;
+
+       chip++;
 #else
        /*
         * Setup EBC (CS0 only right now)
         */
        mtebc(EBC0_CFG, 0xb8400000);
 
-       mtebc(pb0cr, CONFIG_SYS_EBC_PB0CR);
-       mtebc(pb0ap, CONFIG_SYS_EBC_PB0AP);
+       mtebc(PB0CR, CONFIG_SYS_EBC_PB0CR);
+       mtebc(PB0AP, CONFIG_SYS_EBC_PB0AP);
 #endif
 
-       chip++;
-
        return 0;
 }