[PATCH V6] Nand driver for Nomadik 8815 SoC (on NHK8815 board)

vimal singh vimal.newwork at gmail.com
Tue Jul 28 07:13:32 EDT 2009


Sorry to say, but you missed one comment I gave last time:

On Tue, Jul 28, 2009 at 3:29 PM, Alessandro Rubini<ru at gnudd.com> wrote:

---snip---

> +static inline int parity(int b) /* uses low 8 bits: returns 0 or all-1 */
> +{
> +       b = b ^ (b >> 4);
> +       b = b ^ (b >> 2);
> +       return (b ^ (b >> 1)) & 1
> +               ? ~0 : 0;
> +}

This function is not in use... please remove it.

---snip---

> +       /*
> +        * This stanza declares ECC_HW but uses soft routines. It's because
> +        * HW claims to make the calculation but not the correction. However,
> +        * I haven't managed to get the desired data out of it until now.
> +        */
> +       nand->ecc.mode = NAND_ECC_SOFT;
> +       nand->ecc.layout = &nomadik_ecc_layout;
> +       nand->ecc.hwctl = nomadik_ecc_control;
> +       nand->ecc.size = 512;
> +       nand->ecc.bytes = 3;

As I wrote earlier too, are you aware of that currently 512 byte
sector ECC will not work without below patch: (since in nand_base.c,
SW ECC configurations over write the 'ecc.size' by 256)

http://patchwork.ozlabs.org/patch/13697/

As an alternative, if you use 'NAND_SKIP_BBTSCAN' option, moving assignment:
      nand->ecc.size = 512;
after 'nand_scan' is done, will work.

> +
> +       nand->options = pdata->options;
> +
> +       /*
> +        * Scan to find existance of the device
> +        */
> +       if (nand_scan(&host->mtd, 1)) {
> +               ret = -ENXIO;
> +               goto err_unmap;
> +       }
> +



More information about the linux-mtd mailing list