From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org, Adrian Hunter <adrian.hunter@nokia.com>
Subject: [PATCH 09/12] OMAP2/3: gpmc-onenand: correct use of async timings
Date: Mon, 22 Jun 2009 14:49:05 +0300 [thread overview]
Message-ID: <20090622114905.28477.48166.stgit@localhost> (raw)
In-Reply-To: <20090622113422.28477.27052.stgit@localhost>
From: Adrian Hunter <adrian.hunter@nokia.com>
Use async timings when sync timings are not requested.
Also ensure that OneNAND is in async mode when async
timings are used.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/gpmc-onenand.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 2fd22f9..54fec53 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -31,6 +31,8 @@ static struct platform_device gpmc_onenand_device = {
static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
{
struct gpmc_timings t;
+ u32 reg;
+ int err;
const int t_cer = 15;
const int t_avdp = 12;
@@ -43,6 +45,11 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
const int t_wpl = 40;
const int t_wph = 30;
+ /* Ensure sync read and sync write are disabled */
+ reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
+ reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
+ writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
+
memset(&t, 0, sizeof(t));
t.sync_clk = 0;
t.cs_on = 0;
@@ -74,7 +81,16 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
GPMC_CONFIG1_DEVICESIZE_16 |
GPMC_CONFIG1_MUXADDDATA);
- return gpmc_cs_set_timings(cs, &t);
+ err = gpmc_cs_set_timings(cs, &t);
+ if (err)
+ return err;
+
+ /* Ensure sync read and sync write are disabled */
+ reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
+ reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
+ writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
+
+ return 0;
}
static void set_onenand_cfg(void __iomem *onenand_base, int latency,
@@ -124,7 +140,8 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
} else if (cfg->flags & ONENAND_SYNC_READWRITE) {
sync_read = 1;
sync_write = 1;
- }
+ } else
+ return omap2_onenand_set_async_mode(cs, onenand_base);
if (!freq) {
/* Very first call freq is not known */
next prev parent reply other threads:[~2009-06-22 11:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-22 11:36 [PATCH 00/12] Omap fixes for 2.6.31 Tony Lindgren
2009-06-22 11:38 ` [PATCH 01/12] OMAP1: Fix compilation of arch/arm/mach-omap1/mailbox.c Tony Lindgren
2009-06-22 11:39 ` [PATCH 02/12] OMAP1: Fix N770 MMC support Tony Lindgren
2009-06-22 11:41 ` [PATCH 03/12] OMAP1: remove duplicated #include Tony Lindgren
2009-06-22 11:42 ` [PATCH 04/12] OMAP2/3: mmc-twl4030: use correct controller in twl_mmc23_set_power Tony Lindgren
2009-06-22 11:43 ` [PATCH 05/12] OMAP2/3: omap mailbox: platform_get_irq() error ignored Tony Lindgren
2009-06-22 11:45 ` [PATCH 06/12] OMAP2/3: Add omap_type() for determining GP/EMU/HS Tony Lindgren
2009-06-22 11:46 ` [PATCH 07/12] OMAP3: SRAM size fix for HS/EMU devices Tony Lindgren
2009-06-22 11:47 ` [PATCH 08/12] OMAP3: DMA: Enable idlemodes for DMA OCP Tony Lindgren
2009-06-22 11:49 ` Tony Lindgren [this message]
2009-06-22 11:50 ` [PATCH 10/12] OMAP3: RX51: Use OneNAND sync read / write Tony Lindgren
2009-06-22 11:51 ` [PATCH 11/12] OMAP: IOMMU: function flush_iotlb_page is not flushing correct entry Tony Lindgren
2009-06-22 11:53 ` [PATCH 12/12] OMAP2/3: Initialize gpio debounce register Tony Lindgren
2009-06-23 13:57 ` [PATCH 13/12] OMAP: Fix IOMEM macro for assembly Tony Lindgren
2009-06-25 12:27 ` [PATCH 00/12] Omap fixes for 2.6.31 Russell King - ARM Linux
2009-06-25 12:35 ` Git pull request for omap-fixes for 2.6.31 (Re: [PATCH 00/12] Omap fixes for 2.6.31) Tony Lindgren
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=20090622114905.28477.48166.stgit@localhost \
--to=tony@atomide.com \
--cc=adrian.hunter@nokia.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-omap@vger.kernel.org \
/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