base-files: Changed UCI variable name for GPIO value from 'default' to 'value'
[openwrt/openwrt.git] / package / boot / uboot-layerscape / patches / 0071-driver-fsl_qspi-disable-AHB-buffer-prefetch.patch
1 From e2a5bba97cd6e42b2b631bd17012aa26ffdb5f67 Mon Sep 17 00:00:00 2001
2 From: Yunhui Cui <yunhui.cui@nxp.com>
3 Date: Tue, 12 Jul 2016 10:30:08 +0800
4 Subject: [PATCH 71/93] driver: fsl_qspi: disable AHB buffer prefetch
5
6 Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
7 When we enable the CONFIG_SYS_FSL_QSPI_AHB, we need this errata workaround.
8
9 Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
10 ---
11 drivers/spi/fsl_qspi.c | 12 +++++++++++-
12 include/configs/ls1012a_common.h | 1 +
13 2 files changed, 12 insertions(+), 1 deletion(-)
14
15 diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
16 index 09759fa..f1c87f5 100644
17 --- a/drivers/spi/fsl_qspi.c
18 +++ b/drivers/spi/fsl_qspi.c
19 @@ -441,13 +441,23 @@ static void qspi_enable_ddr_mode(struct fsl_qspi_priv *priv)
20 static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
21 {
22 struct fsl_qspi_regs *regs = priv->regs;
23 + int rx_size = 0x80;
24
25 /* AHB configuration for access buffer 0/1/2 .*/
26 qspi_write32(priv->flags, &regs->buf0cr, QSPI_BUFXCR_INVALID_MSTRID);
27 qspi_write32(priv->flags, &regs->buf1cr, QSPI_BUFXCR_INVALID_MSTRID);
28 qspi_write32(priv->flags, &regs->buf2cr, QSPI_BUFXCR_INVALID_MSTRID);
29 +
30 +#ifdef CONFIG_SYS_FSL_ERRATUM_A009282
31 + /*A-009282: QuadSPI data pre-fetch can result in incorrect data
32 + *Workaround: Keep the read data size to 64 bits (8 Bytes), which
33 + *disables the prefetch on the AHB buffer,and prevents this issue
34 + *from occurring.
35 + */
36 + rx_size = 0x1;
37 +#endif
38 qspi_write32(priv->flags, &regs->buf3cr, QSPI_BUF3CR_ALLMST_MASK |
39 - (0x80 << QSPI_BUF3CR_ADATSZ_SHIFT));
40 + (rx_size << QSPI_BUF3CR_ADATSZ_SHIFT));
41
42 /* We only use the buffer3 */
43 qspi_write32(priv->flags, &regs->buf0ind, 0);
44 diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
45 index 47b8ec3..f0ae355 100644
46 --- a/include/configs/ls1012a_common.h
47 +++ b/include/configs/ls1012a_common.h
48 @@ -68,6 +68,7 @@
49 #define FSL_QSPI_FLASH_SIZE (1 << 26)
50 #define FSL_QSPI_FLASH_NUM 2
51 #define CONFIG_SYS_FSL_QSPI_AHB
52 +#define CONFIG_SYS_FSL_ERRATUM_A009282
53
54 /*
55 * Environment
56 --
57 1.7.9.5
58