[U-Boot] [PATCH v2] NAND: add support for reading ONFI page table

Scott Wood scottwood at freescale.com
Tue Jan 4 21:42:10 CET 2011


On Tue, Dec 28, 2010 at 01:21:06AM +0100, Florian Fainelli wrote:
> +       /* check version */
> +       val = le16_to_cpu(p->revision);
> +       if (val == 1 || val > (1 << 4)) {
> +               printk(KERN_INFO "%s: unsupported ONFI version: %d\n", __func__, val);

Line length.

> +       chip->options &= ~NAND_CHIPOPTIONS_MSK;
> +       chip->options |= (NAND_NO_READRDY |
> +                       NAND_NO_AUTOINCR) & NAND_CHIPOPTIONS_MSK;

NAND_NO_AUTOINCR is not included in NAND_CHIPOPTIONS_MSK, so including it
here has no effect.

> +       ret = nand_flash_detect_onfi(mtd, chip, &busw);
> +       if (!ret)
> +               nand_flash_detect_non_onfi(mtd, chip, type, &busw);
> 
> -       } else {
> -               /*
> -                * Old devices have chip data hardcoded in the device id table
> -                */
> -               mtd->erasesize = type->erasesize;
> -               mtd->writesize = type->pagesize;
> -               mtd->oobsize = mtd->writesize / 32;
> -               busw = type->options & NAND_BUSWIDTH_16;
> -       }
> +       /* Get chip options, preserve non chip based options */
> +       chip->options &= ~NAND_CHIPOPTIONS_MSK;
> +       chip->options |= type->options & NAND_CHIPOPTIONS_MSK;
> +       /*
> +        * Set chip as a default. Board drivers can override it, if necessary
> +        */
> +       chip->options |= NAND_NO_AUTOINCR;


Won't this duplicate/overwrite what was done in nand_flash_detect_*()?

> +       u8 input_pin_capacitance_max;
> +       u8 driver_strenght_support;
> +       __le16 t_int_r;
> +       __le16 t_ald;
> +       u8 reserved4[7];
> +
> +       /* vendor */
> +       u8 reserved5[90];
> +
> +        __le16 crc;

Extra space before __le16.

-Scott



More information about the U-Boot mailing list