public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: dirk.behme at googlemail.com <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH-OMAP3 v2] OMAP3: Fix error in gpmc_init
Date: Mon, 10 Nov 2008 20:57:38 +0100	[thread overview]
Message-ID: <49189233.0407560a.71cf.ffffd54c@mx.google.com> (raw)

Fix error in gpmc_init() introduced with readl/writel conversion. Use base
addresses + offset, not offset only. Minor clean up by removing unused code.

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>

---

Changes in v2:

- Correct patch header style.

v2 of this patch makes previous version v1 obsolete.

Jean-Christophe: Would be nice if you could handle this patch with priority 
as it prevents BeagleBoard from starting. Thanks!

 cpu/arm_cortexa8/omap3/mem.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Index: u-boot-arm/cpu/arm_cortexa8/omap3/mem.c
===================================================================
--- u-boot-arm.orig/cpu/arm_cortexa8/omap3/mem.c
+++ u-boot-arm/cpu/arm_cortexa8/omap3/mem.c
@@ -233,18 +233,15 @@ void enable_gpmc_config(u32 *gpmc_config
 void gpmc_init(void)
 {
 	/* putting a blanket check on GPMC based on ZeBu for now */
-	u32 mux = 0, mwidth;
 	u32 *gpmc_config = NULL;
 	u32 *gpmc_base = (u32 *)GPMC_BASE;
+	u32 *gpmc_cs_base = (u32 *)GPMC_CONFIG_CS0_BASE;
 	u32 base = 0;
 	u32 size = 0;
 	u32 f_off = CONFIG_SYS_MONITOR_LEN;
 	u32 f_sec = 0;
 	u32 config = 0;
 
-	mux = BIT9;
-	mwidth = get_gpmc0_width();
-
 	/* global settings */
 	writel(0, gpmc_base + OFFS(GPMC_IRQENABLE)); /* isr's sources masked */
 	writel(0, gpmc_base + OFFS(GPMC_TIMEOUT_CONTROL));/* timeout disable */
@@ -256,7 +253,7 @@ void gpmc_init(void)
 	/* Disable the GPMC0 config set by ROM code
 	 * It conflicts with our MPDB (both at 0x08000000)
 	 */
-	writel(0, GPMC_CONFIG_CS0 + GPMC_CONFIG7);
+	writel(0, gpmc_cs_base + OFFS(GPMC_CONFIG7));
 	sdelay(1000);
 
 #if defined(CONFIG_CMD_NAND)	/* CS 0 */
@@ -280,7 +277,7 @@ void gpmc_init(void)
 
 #if defined(CONFIG_CMD_ONENAND)
 	gpmc_config = gpmc_onenand;
-	onenand_cs_base = (u32 *)(GPMC_CONFIG_CS0 +
+	onenand_cs_base = (u32 *)(GPMC_CONFIG_CS0_BASE +
 				  (GPMC_CS * GPMC_CONFIG_WIDTH));
 	base = PISMO1_ONEN_BASE;
 	size = PISMO1_ONEN_SIZE;

             reply	other threads:[~2008-11-10 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-10 19:57 dirk.behme at googlemail.com [this message]
2008-11-16  8:21 ` [U-Boot] [PATCH-OMAP3 v2] OMAP3: Fix error in gpmc_init Jean-Christophe PLAGNIOL-VILLARD

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=49189233.0407560a.71cf.ffffd54c@mx.google.com \
    --to=dirk.behme@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /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