summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2014-03-14 15:13:36 +0800
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 08:57:59 -0500
commitf9315d91ea2451dde9948762427e2babac2fc5d2 (patch)
tree20f9a399797590ae2fefe4e78d63641a148ba68d /drivers/mtd
parent65ed5f098398bf5bd588f692add3c80798017c4c (diff)
ENGR00303533 mtd: fsl-quadspi: reset the module in the probe
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi-nor/fsl-quadspi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 08878b9634db..66664e2b9215 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -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;