ENGR00303533 mtd: fsl-quadspi: reset the module in the probe
authorHuang Shijie <b32955@freescale.com>
Fri, 14 Mar 2014 07:13:36 +0000 (15:13 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Wed, 16 Apr 2014 13:57:59 +0000 (08:57 -0500)
The uboot may run the QuadSpi controler with command:
    #sf probe

So we should reset the module in the probe.
This patch also clear the pending interrupts which arised by the uboot
code.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/spi-nor/fsl-quadspi.c

index 08878b9634db8d322113a538e78da80b2c274255..66664e2b92151fd491f4102ebd17b24d8592ec62 100644 (file)
@@ -655,6 +655,11 @@ static int fsl_qspi_nor_setup(struct fsl_qspi *q)
        if (ret)
                return ret;
 
+       /* Reset the module */
+       writel(QUADSPI_MCR_SWRSTSD_MASK | QUADSPI_MCR_SWRSTHD_MASK,
+               base + QUADSPI_MCR);
+       udelay(1);
+
        /* Init the LUT table. */
        fsl_qspi_init_lut(q);
 
@@ -673,6 +678,7 @@ static int fsl_qspi_nor_setup(struct fsl_qspi *q)
                        base + QUADSPI_MCR);
 
        /* enable the interrupt */
+       writel(0xffffffff, q->iobase + QUADSPI_FR);
        writel(QUADSPI_RSER_TFIE, q->iobase + QUADSPI_RSER);
 
        return 0;