* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
@ 2016-07-12 2:49 Yunhui Cui
2016-07-12 3:06 ` Prabhakar Kushwaha
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Yunhui Cui @ 2016-07-12 2:49 UTC (permalink / raw)
To: u-boot
From: Yunhui Cui <yunhui.cui@nxp.com>
Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
---
drivers/spi/fsl_qspi.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
index 75cbab2..0354e20 100644
--- a/drivers/spi/fsl_qspi.c
+++ b/drivers/spi/fsl_qspi.c
@@ -438,13 +438,23 @@ static void qspi_enable_ddr_mode(struct fsl_qspi_priv *priv)
static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
{
struct fsl_qspi_regs *regs = priv->regs;
+ int rx_size = 0x80;
/* AHB configuration for access buffer 0/1/2 .*/
qspi_write32(priv->flags, ®s->buf0cr, QSPI_BUFXCR_INVALID_MSTRID);
qspi_write32(priv->flags, ®s->buf1cr, QSPI_BUFXCR_INVALID_MSTRID);
qspi_write32(priv->flags, ®s->buf2cr, QSPI_BUFXCR_INVALID_MSTRID);
+
+#ifdef CONFIG_SYS_FSL_ERRATUM_A009282
+ /*A-009282: QuadSPI data pre-fetch can result in incorrect data
+ *Workaround: Keep the read data size to 64 bits (8 Bytes), which
+ *disables the prefetch on the AHB buffer,and prevents this issue
+ *from occurring.
+ */
+ rx_size = 0x1;
+#endif
qspi_write32(priv->flags, ®s->buf3cr, QSPI_BUF3CR_ALLMST_MASK |
- (0x80 << QSPI_BUF3CR_ADATSZ_SHIFT));
+ (rx_size << QSPI_BUF3CR_ADATSZ_SHIFT));
/* We only use the buffer3 */
qspi_write32(priv->flags, ®s->buf0ind, 0);
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
2016-07-12 2:49 [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch Yunhui Cui
@ 2016-07-12 3:06 ` Prabhakar Kushwaha
2016-07-20 6:40 ` Yunhui Cui
2016-07-12 15:14 ` york sun
2016-07-19 23:01 ` york sun
2 siblings, 1 reply; 7+ messages in thread
From: Prabhakar Kushwaha @ 2016-07-12 3:06 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Yunhui Cui
> Sent: Tuesday, July 12, 2016 8:20 AM
> To: york sun <york.sun@nxp.com>
> Cc: Yunhui Cui <yunhui.cui@nxp.com>; u-boot at lists.denx.de
> Subject: [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
>
> From: Yunhui Cui <yunhui.cui@nxp.com>
>
> Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
> We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
>
Can we add slightly more details about workaround other than Just enabling CONFIG_SYS_FSL_QSPI_AHB.
With this you can avoid details of workaround in code.
Please add CONFIG_SYS_FSL_QSPI_AHB in README file
> Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
> ---
Patch revision history missing.
--prabhakar
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
2016-07-12 2:49 [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch Yunhui Cui
2016-07-12 3:06 ` Prabhakar Kushwaha
@ 2016-07-12 15:14 ` york sun
2016-07-13 2:24 ` Yunhui Cui
2016-07-19 23:01 ` york sun
2 siblings, 1 reply; 7+ messages in thread
From: york sun @ 2016-07-12 15:14 UTC (permalink / raw)
To: u-boot
On 07/11/2016 08:00 PM, Yunhui Cui wrote:
> From: Yunhui Cui <yunhui.cui@nxp.com>
>
> Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
> We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
>
> Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
> ---
> drivers/spi/fsl_qspi.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
> index 75cbab2..0354e20 100644
> --- a/drivers/spi/fsl_qspi.c
> +++ b/drivers/spi/fsl_qspi.c
> @@ -438,13 +438,23 @@ static void qspi_enable_ddr_mode(struct fsl_qspi_priv *priv)
> static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
> {
> struct fsl_qspi_regs *regs = priv->regs;
> + int rx_size = 0x80;
Wrap this with ifdef, or you will have compiling warning when the macro
is not defined.
York
>
> /* AHB configuration for access buffer 0/1/2 .*/
> qspi_write32(priv->flags, ®s->buf0cr, QSPI_BUFXCR_INVALID_MSTRID);
> qspi_write32(priv->flags, ®s->buf1cr, QSPI_BUFXCR_INVALID_MSTRID);
> qspi_write32(priv->flags, ®s->buf2cr, QSPI_BUFXCR_INVALID_MSTRID);
> +
> +#ifdef CONFIG_SYS_FSL_ERRATUM_A009282
> + /*A-009282: QuadSPI data pre-fetch can result in incorrect data
> + *Workaround: Keep the read data size to 64 bits (8 Bytes), which
> + *disables the prefetch on the AHB buffer,and prevents this issue
> + *from occurring.
> + */
> + rx_size = 0x1;
> +#endif
> qspi_write32(priv->flags, ®s->buf3cr, QSPI_BUF3CR_ALLMST_MASK |
> - (0x80 << QSPI_BUF3CR_ADATSZ_SHIFT));
> + (rx_size << QSPI_BUF3CR_ADATSZ_SHIFT));
>
> /* We only use the buffer3 */
> qspi_write32(priv->flags, ®s->buf0ind, 0);
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
2016-07-12 15:14 ` york sun
@ 2016-07-13 2:24 ` Yunhui Cui
2016-07-13 14:59 ` york sun
0 siblings, 1 reply; 7+ messages in thread
From: Yunhui Cui @ 2016-07-13 2:24 UTC (permalink / raw)
To: u-boot
On 07/12/2016 11:15 PM, York wrote:
> On 07/11/2016 08:00 PM, Yunhui Cui wrote:
> > From: Yunhui Cui <yunhui.cui@nxp.com>
> >
> > Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
> > We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
> >
> > Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
> > ---
> > drivers/spi/fsl_qspi.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index
> > 75cbab2..0354e20 100644
> > --- a/drivers/spi/fsl_qspi.c
> > +++ b/drivers/spi/fsl_qspi.c
> > @@ -438,13 +438,23 @@ static void qspi_enable_ddr_mode(struct
> fsl_qspi_priv *priv)
> > static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
> > {
> > struct fsl_qspi_regs *regs = priv->regs;
> > + int rx_size = 0x80;
>
> Wrap this with ifdef, or you will have compiling warning when the macro
> is not defined.
>
> York
[Yunhui] Whether This macro defined or not, rx_size will be used, It seems that Wrap is not necessary and have no compiling warning.
thanks.
Yunhui
>
>
> >
> > /* AHB configuration for access buffer 0/1/2 .*/
> > qspi_write32(priv->flags, ®s->buf0cr,
> QSPI_BUFXCR_INVALID_MSTRID);
> > qspi_write32(priv->flags, ®s->buf1cr,
> QSPI_BUFXCR_INVALID_MSTRID);
> > qspi_write32(priv->flags, ®s->buf2cr,
> > QSPI_BUFXCR_INVALID_MSTRID);
> > +
> > +#ifdef CONFIG_SYS_FSL_ERRATUM_A009282
> > + /*A-009282: QuadSPI data pre-fetch can result in incorrect data
> > + *Workaround: Keep the read data size to 64 bits (8 Bytes), which
> > + *disables the prefetch on the AHB buffer,and prevents this issue
> > + *from occurring.
> > + */
> > + rx_size = 0x1;
> > +#endif
> > qspi_write32(priv->flags, ®s->buf3cr, QSPI_BUF3CR_ALLMST_MASK |
> > - (0x80 << QSPI_BUF3CR_ADATSZ_SHIFT));
> > + (rx_size << QSPI_BUF3CR_ADATSZ_SHIFT));
> >
> > /* We only use the buffer3 */
> > qspi_write32(priv->flags, ®s->buf0ind, 0);
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
2016-07-13 2:24 ` Yunhui Cui
@ 2016-07-13 14:59 ` york sun
0 siblings, 0 replies; 7+ messages in thread
From: york sun @ 2016-07-13 14:59 UTC (permalink / raw)
To: u-boot
On 07/12/2016 07:24 PM, Yunhui Cui wrote:
>
> On 07/12/2016 11:15 PM, York wrote:
>> On 07/11/2016 08:00 PM, Yunhui Cui wrote:
>>> From: Yunhui Cui <yunhui.cui@nxp.com>
>>>
>>> Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
>>> We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
>>>
>>> Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
>>> ---
>>> drivers/spi/fsl_qspi.c | 12 +++++++++++-
>>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index
>>> 75cbab2..0354e20 100644
>>> --- a/drivers/spi/fsl_qspi.c
>>> +++ b/drivers/spi/fsl_qspi.c
>>> @@ -438,13 +438,23 @@ static void qspi_enable_ddr_mode(struct
>> fsl_qspi_priv *priv)
>>> static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
>>> {
>>> struct fsl_qspi_regs *regs = priv->regs;
>>> + int rx_size = 0x80;
>>
>> Wrap this with ifdef, or you will have compiling warning when the macro
>> is not defined.
>>
>> York
>
> [Yunhui] Whether This macro defined or not, rx_size will be used, It seems that Wrap is not necessary and have no compiling warning.
OK. That's fine.
York
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
2016-07-12 2:49 [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch Yunhui Cui
2016-07-12 3:06 ` Prabhakar Kushwaha
2016-07-12 15:14 ` york sun
@ 2016-07-19 23:01 ` york sun
2 siblings, 0 replies; 7+ messages in thread
From: york sun @ 2016-07-19 23:01 UTC (permalink / raw)
To: u-boot
On 07/11/2016 08:00 PM, Yunhui Cui wrote:
> From: Yunhui Cui <yunhui.cui@nxp.com>
>
> Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
> We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
>
> Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
> ---
> drivers/spi/fsl_qspi.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
> index 75cbab2..0354e20 100644
> --- a/drivers/spi/fsl_qspi.c
> +++ b/drivers/spi/fsl_qspi.c
> @@ -438,13 +438,23 @@ static void qspi_enable_ddr_mode(struct fsl_qspi_priv *priv)
> static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
> {
> struct fsl_qspi_regs *regs = priv->regs;
> + int rx_size = 0x80;
>
> /* AHB configuration for access buffer 0/1/2 .*/
> qspi_write32(priv->flags, ®s->buf0cr, QSPI_BUFXCR_INVALID_MSTRID);
> qspi_write32(priv->flags, ®s->buf1cr, QSPI_BUFXCR_INVALID_MSTRID);
> qspi_write32(priv->flags, ®s->buf2cr, QSPI_BUFXCR_INVALID_MSTRID);
> +
> +#ifdef CONFIG_SYS_FSL_ERRATUM_A009282
> + /*A-009282: QuadSPI data pre-fetch can result in incorrect data
> + *Workaround: Keep the read data size to 64 bits (8 Bytes), which
> + *disables the prefetch on the AHB buffer,and prevents this issue
> + *from occurring.
> + */
Please fix the multi-line comment style, and address Prabhakar's comment.
York
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch
2016-07-12 3:06 ` Prabhakar Kushwaha
@ 2016-07-20 6:40 ` Yunhui Cui
0 siblings, 0 replies; 7+ messages in thread
From: Yunhui Cui @ 2016-07-20 6:40 UTC (permalink / raw)
To: u-boot
On Tuesday, July 12, 2016 11:06 AM Prabhakar Wrote
>
> > -----Original Message-----
> > From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Yunhui
> > Cui
> > Sent: Tuesday, July 12, 2016 8:20 AM
> > To: york sun <york.sun@nxp.com>
> > Cc: Yunhui Cui <yunhui.cui@nxp.com>; u-boot at lists.denx.de
> > Subject: [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer
> > prefetch
> >
> > From: Yunhui Cui <yunhui.cui@nxp.com>
> >
> > Errata: A-009282: QuadSPI data pre-fetch can result in incorrect data
> > We need this errata workaround when CONFIG_SYS_FSL_QSPI_AHB is enabled.
> >
>
> Can we add slightly more details about workaround other than Just
> enabling CONFIG_SYS_FSL_QSPI_AHB.
> With this you can avoid details of workaround in code.
>
[Yunhui] ok!
> Please add CONFIG_SYS_FSL_QSPI_AHB in README file
[Yunhui] why should we add it and how to add it ?
>
> > Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
> > ---
>
> Patch revision history missing.
>
> --prabhakar
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-07-20 6:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 2:49 [U-Boot] [PATCH v3] driver: spi: fsl-qspi: disable AHB buffer prefetch Yunhui Cui
2016-07-12 3:06 ` Prabhakar Kushwaha
2016-07-20 6:40 ` Yunhui Cui
2016-07-12 15:14 ` york sun
2016-07-13 2:24 ` Yunhui Cui
2016-07-13 14:59 ` york sun
2016-07-19 23:01 ` york sun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.