From patchwork Thu Dec 2 17:43:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Tyser X-Patchwork-Id: 74005 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AB859B70A3 for ; Fri, 3 Dec 2010 04:43:29 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ED3A3280D1; Thu, 2 Dec 2010 18:43:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Cql0AEhmszT; Thu, 2 Dec 2010 18:43:25 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 578C52810D; Thu, 2 Dec 2010 18:43:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B98F2810D for ; Thu, 2 Dec 2010 18:43:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V+Yxsop7-4A0 for ; Thu, 2 Dec 2010 18:43:19 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from xes-mad.com (xes-mad.com [216.165.139.218]) by theia.denx.de (Postfix) with ESMTPS id 15BB4280D1 for ; Thu, 2 Dec 2010 18:43:17 +0100 (CET) Received: from localhost.localdomain (petert.xes-mad.com [10.52.0.62]) by xes-mad.com (8.13.8/8.13.8) with ESMTP id oB2HhC2W005129; Thu, 2 Dec 2010 11:43:12 -0600 From: Peter Tyser To: u-boot@lists.denx.de Date: Thu, 2 Dec 2010 11:43:10 -0600 Message-Id: <1291311790-2001-1-git-send-email-ptyser@xes-inc.com> X-Mailer: git-send-email 1.7.0.4 X-Virus-Scanned: clamav-milter 0.96 at mail X-Virus-Status: Clean Cc: Peter Tyser , galak@kernel.crashing.org Subject: [U-Boot] [PATCH] fsl_upm: Add MxMR/MDR synchronization X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: John Schmoller According to Freescale reference manuals (eg section "13.4.4.2 Programming the UPMs" of the P4080 Reference Manual): "Since the result of any update to the MxMR/MDR register must be in effect before the dummy read or write to the UPM region, a write to MxMR/MDR should be followed immediately by a read of MxMR/MDR." The UPM on a custom P4080-based board did not work without performing a read of MxMR/MDR after a write. Signed-off-by: John Schmoller Signed-off-by: Peter Tyser Acked-by: Scott Wood --- drivers/mtd/nand/fsl_upm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index b76c673..be00555 100644 --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c @@ -21,6 +21,7 @@ static void fsl_upm_start_pattern(struct fsl_upm *upm, u32 pat_offset) { clrsetbits_be32(upm->mxmr, MxMR_MAD_MSK, MxMR_OP_RUNP | pat_offset); + (void)in_be32(upm->mxmr); } static void fsl_upm_end_pattern(struct fsl_upm *upm) @@ -35,6 +36,7 @@ static void fsl_upm_run_pattern(struct fsl_upm *upm, int width, void __iomem *io_addr, u32 mar) { out_be32(upm->mar, mar); + (void)in_be32(upm->mar); switch (width) { case 8: out_8(io_addr, 0x0);