From: Aaron Sierra <asierra@xes-inc.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>,
linux-mtd@lists.infradead.org, Nate Case <ncase@xes-inc.com>,
David Woodhouse <David.Woodhouse@intel.com>
Subject: [PATCH 1/3] powerpc/fsl_lbc: Synchronize MAR/MxMR writes
Date: Thu, 21 Feb 2013 14:49:07 -0600 (CST) [thread overview]
Message-ID: <b7cb37fa-dd4e-4d47-8aca-2acc9dfabc25@zimbra> (raw)
In-Reply-To: <f227ad8a-d116-4c4c-b758-92d004e71086@zimbra>
Author: Nate Case <ncase@xes-inc.com>
According to Freescale documentation, it is necessary to perform
a dummy read after writing to the MxMR/MDR registers. This dummy
read will ensure that the write took effect before performing the
subsequent write to the UPM region.
Although the documentation does not mention the MAR register (only
MxMR and MDR), it has been shown on a P4080 platform that UPM cycles
would on rare occurrence utilize a stale value for MAR from the
previous pattern. Inserting a dummy read after writing MAR corrects
this problem.
This fixes a problem observed using a UPM NAND flash device where
NAND commands would occasionally get corrupted.
Signed-off-by: Nate Case <ncase@xes-inc.com>
---
arch/powerpc/include/asm/fsl_lbc.h | 1 +
arch/powerpc/sysdev/fsl_lbc.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index 420b453..19e0cd2 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -263,6 +263,7 @@ extern int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm);
static inline void fsl_upm_start_pattern(struct fsl_upm *upm, u8 pat_offset)
{
clrsetbits_be32(upm->mxmr, MxMR_MAD, MxMR_OP_RP | pat_offset);
+ (void) in_be32(upm->mxmr);
}
/**
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index 6bc5a54..9b4f0cf 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -163,6 +163,11 @@ int fsl_upm_run_pattern(struct fsl_upm *upm, void __iomem *io_base, u32 mar)
spin_lock_irqsave(&fsl_lbc_lock, flags);
out_be32(&fsl_lbc_ctrl_dev->regs->mar, mar);
+ /*
+ * Dummy read required to ensure that the MAR write takes effect
+ * before running the pattern
+ */
+ (void) in_be32(&fsl_lbc_ctrl_dev->regs->mar);
switch (upm->width) {
case 8:
--
1.7.9.5
parent reply other threads:[~2013-02-21 20:49 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <f227ad8a-d116-4c4c-b758-92d004e71086@zimbra>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b7cb37fa-dd4e-4d47-8aca-2acc9dfabc25@zimbra \
--to=asierra@xes-inc.com \
--cc=Artem.Bityutskiy@linux.intel.com \
--cc=David.Woodhouse@intel.com \
--cc=galak@kernel.crashing.org \
--cc=linux-mtd@lists.infradead.org \
--cc=ncase@xes-inc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox