@@ -1662,7 +1662,7 @@ static int omap_nand_probe(struct platform_device *pdev)
mtd->owner = THIS_MODULE;
nand_chip = &info->nand;
nand_chip->ecc.priv = NULL;
- nand_chip->options |= NAND_SKIP_BBTSCAN;
+ nand_chip->options |= NAND_SKIP_BBTSCAN | NAND_BUSWIDTH_AUTO;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
@@ -1708,7 +1708,6 @@ static int omap_nand_probe(struct platform_device *pdev)
}
/* scan NAND device connected to chip controller */
- nand_chip->options |= pdata->devsize & NAND_BUSWIDTH_16;
if (nand_scan_ident(mtd, 1, NULL)) {
pr_err("nand device scan failed, may be bus-width mismatch\n");
err = -ENXIO;
Because the device bus can be 8-bit or 16-bit width, yet ONFI detection cannot work in 16-bit mode, we need to set the NAND_BUSWIDTH_AUTO option which allows proper initialization configuration. Once the bus width is detected, nand_scan_ident() updates the nand_chip struct 'option' field to use the appropriate read/write functions and configure the ECC engine. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> --- drivers/mtd/nand/omap2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)