spi: fsl_qspi: Move AHB read buffer config after LUT
When using CONFIG_FSL_QSPI_AHB_FULL_MAP the fsl_qspi_default_setup() sets the BFGENCR register to use the LUT(SEQID_LUT_AHB) before the Look Up Table is populated. This result in a situation that after 'sf probe' command any memory read from qspi using AHB will result in undefined behaviour (hang) untill first 'sf read' op is executed. Move the BFGENCR write to fsl_qspi_prepare_lut() to ensure that the setup is consistent. AHB reads will use the default LUT(index 0) setup by previous boot stage untill the first read op. Signed-off-by: Pawel Kochanowski <pkochanowski@sii.pl>
This commit is contained in:

committed by
Fabio Estevam

parent
81b1a42be0
commit
ddd6d6f8db
@@ -472,7 +472,13 @@ static void fsl_qspi_prepare_lut(struct fsl_qspi *q,
|
|||||||
op->addr.nbytes) {
|
op->addr.nbytes) {
|
||||||
for (i = 0; i < ARRAY_SIZE(lutval); i++)
|
for (i = 0; i < ARRAY_SIZE(lutval); i++)
|
||||||
qspi_writel(q, lutval[i], base + QUADSPI_AHB_LUT_REG(i));
|
qspi_writel(q, lutval[i], base + QUADSPI_AHB_LUT_REG(i));
|
||||||
|
|
||||||
|
qspi_writel(q, QUADSPI_BFGENCR_SEQID(SEQID_LUT_AHB),
|
||||||
|
q->iobase + QUADSPI_BFGENCR);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
qspi_writel(q, QUADSPI_BFGENCR_SEQID(SEQID_LUT),
|
||||||
|
q->iobase + QUADSPI_BFGENCR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lock LUT */
|
/* lock LUT */
|
||||||
@@ -737,13 +743,6 @@ static int fsl_qspi_default_setup(struct fsl_qspi *q)
|
|||||||
qspi_writel(q, 0, base + QUADSPI_BUF1IND);
|
qspi_writel(q, 0, base + QUADSPI_BUF1IND);
|
||||||
qspi_writel(q, 0, base + QUADSPI_BUF2IND);
|
qspi_writel(q, 0, base + QUADSPI_BUF2IND);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_FSL_QSPI_AHB_FULL_MAP))
|
|
||||||
qspi_writel(q, QUADSPI_BFGENCR_SEQID(SEQID_LUT_AHB),
|
|
||||||
q->iobase + QUADSPI_BFGENCR);
|
|
||||||
else
|
|
||||||
qspi_writel(q, QUADSPI_BFGENCR_SEQID(SEQID_LUT),
|
|
||||||
q->iobase + QUADSPI_BFGENCR);
|
|
||||||
|
|
||||||
qspi_writel(q, QUADSPI_RBCT_WMRK_MASK, base + QUADSPI_RBCT);
|
qspi_writel(q, QUADSPI_RBCT_WMRK_MASK, base + QUADSPI_RBCT);
|
||||||
qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK |
|
qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK |
|
||||||
QUADSPI_BUF3CR_ADATSZ(q->devtype_data->ahb_buf_size / 8),
|
QUADSPI_BUF3CR_ADATSZ(q->devtype_data->ahb_buf_size / 8),
|
||||||
|
Reference in New Issue
Block a user