mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Weitzel <j.weitzel@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3 v2] gpmc: Add reset to gpmc_generic_init
Date: Thu, 19 Jul 2012 09:58:18 +0200	[thread overview]
Message-ID: <1342684698-3123-1-git-send-email-j.weitzel@phytec.de> (raw)
In-Reply-To: <20120718221003.GR30009@pengutronix.de>

Add reset to gpmc_generic_init as proposed by TRM.
This also fixes some strange timing issue while GPMC Initialization for
NAND OMAP4460

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
v2: fix timeout endless loop

 arch/arm/mach-omap/gpmc.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap/gpmc.c b/arch/arm/mach-omap/gpmc.c
index 399f68a..b3fa56c 100644
--- a/arch/arm/mach-omap/gpmc.c
+++ b/arch/arm/mach-omap/gpmc.c
@@ -28,6 +28,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <clock.h>
 #include <init.h>
 #include <io.h>
 #include <mach/silicon.h>
@@ -48,13 +49,22 @@
  */
 void gpmc_generic_init(unsigned int cfg)
 {
+	uint64_t start;
 	unsigned int reg = GPMC_REG(CONFIG7_0);
 	char x = 0;
 
 	debug("gpmccfg=%x\n", cfg);
 	/* Generic Configurations */
+	/* reset gpmc */
+	start = get_time_ns();
 	/* No idle, L3 clock free running */
-	writel(0x10, GPMC_REG(SYS_CONFIG));
+	writel(0x12, GPMC_REG(SYS_CONFIG));
+	while (!readl(GPMC_REG(SYS_STATUS)))
+		if (is_timeout(start, MSECOND)) {
+			printf("timeout on gpmc reset\n");
+			break;
+		}
+
 	/* No Timeout */
 	writel(0x00, GPMC_REG(TIMEOUT_CONTROL));
 	/* No IRQs */
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-07-19  7:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 12:37 [PATCH 0/3] omap gpmc nand autodetect Jan Weitzel
2012-07-18 12:37 ` [PATCH 1/3] OMAP GPMC NAND: use buswidth from GPMC Jan Weitzel
2012-07-18 22:11   ` Sascha Hauer
2012-07-19  7:54     ` [PATCH 1/3 v2] " Jan Weitzel
2012-07-19  8:31     ` [PATCH 1/3] " Jan Weitzel
2012-07-19 13:09       ` Sascha Hauer
2012-07-18 12:37 ` [PATCH 2/3] gpmc: Add reset to gpmc_generic_init Jan Weitzel
2012-07-18 22:10   ` Sascha Hauer
2012-07-19  7:58     ` Jan Weitzel [this message]
2012-07-20  7:20       ` [PATCH 2/3 v2] " Sascha Hauer
2012-07-18 12:37 ` [RFC 3/3] mtd omap nand: reconfigure buswidth Jan Weitzel

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=1342684698-3123-1-git-send-email-j.weitzel@phytec.de \
    --to=j.weitzel@phytec.de \
    --cc=barebox@lists.infradead.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