]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/nomadik.c
dfu, nand: before write a buffer to nand, erase the nand sectors
[u-boot] / drivers / mtd / nand / nomadik.c
index 08944d1cfa153786ee6f037d7c6bf0b54893124f..dc8e5137397d6035a024433b9a9c9e76e2d60737 100644 (file)
@@ -42,7 +42,7 @@ static inline int parity(int b) /* b is really a byte; returns 0 or ~0 */
  * HW claims to make the calculation but not the correction; so we must
  * recalculate the bytes for a comparison.
  */
-static int ecc512(unsigned char *data, unsigned char *ecc)
+static int ecc512(const unsigned char *data, unsigned char *ecc)
 {
        int gpar = 0;
        int i, val, par;
@@ -212,6 +212,7 @@ int board_nand_init(struct nand_chip *chip)
        chip->ecc.mode = NAND_ECC_HW;
        chip->ecc.bytes = 3;
        chip->ecc.size = 512;
+       chip->ecc.strength = 1;
        chip->ecc.layout = &nomadik_ecc_layout;
        chip->ecc.calculate = nomadik_ecc_calculate;
        chip->ecc.hwctl = nomadik_ecc_hwctl;