MLK-11095: mtd:qspi: clear the DDR_EN bit on 6UL and 7D
authorHan Xu <b45815@freescale.com>
Thu, 11 Jun 2015 19:50:47 +0000 (14:50 -0500)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:25 +0000 (14:49 -0500)
the obsolete bit DDR_EN on 6UL and 7D should be clear in case other
program set the bit and cause qspi probe fail.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit d8b51cc358780f68e732522ee9bd6bd578dd6771)

drivers/mtd/spi-nor/fsl-quadspi.c

index 0a1f864..1b04099 100644 (file)
@@ -807,6 +807,14 @@ static int fsl_qspi_nor_setup(struct fsl_qspi *q)
        if (ret)
                return ret;
 
+       if ((q->devtype_data->devtype == FSL_QUADSPI_IMX6UL) ||
+               (q->devtype_data->devtype == FSL_QUADSPI_IMX7D)) {
+               /* clear the DDR_EN bit for 6UL and 7D */
+               reg = readl(base + QUADSPI_MCR);
+               writel(~(QUADSPI_MCR_DDR_EN_MASK) & reg, base + QUADSPI_MCR);
+               udelay(1);
+       }
+
        /* Reset the module */
        qspi_writel(q, QUADSPI_MCR_SWRSTSD_MASK | QUADSPI_MCR_SWRSTHD_MASK,
                base + QUADSPI_MCR);