public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 01/12] OMAP3: Update SDRC dram_init to always call make_cs1_contiguous()
Date: Wed, 9 Nov 2011 10:10:55 -0700	[thread overview]
Message-ID: <1320858666-17113-2-git-send-email-trini@ti.com> (raw)
In-Reply-To: <1320858666-17113-1-git-send-email-trini@ti.com>

We update the comment in make_cs1_contiguous() to be a little bit
more clear (it's been copy/pasted from other silicons) and then
explain in dram_init() why we need to always try this.

Note that in the previous behavior we were always calling this on
boards that never had cs1 populated anyhow so making sure we do
this always is fine and will correct things like omap3evm detecting
an invalid amount of memory (384MB).

Signed-off-by: Tom Rini <trini@ti.com>
---
 arch/arm/cpu/armv7/omap3/sdrc.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/sdrc.c b/arch/arm/cpu/armv7/omap3/sdrc.c
index 0dd1955..66ce33f 100644
--- a/arch/arm/cpu/armv7/omap3/sdrc.c
+++ b/arch/arm/cpu/armv7/omap3/sdrc.c
@@ -58,10 +58,9 @@ u32 is_mem_sdr(void)
 
 /*
  * make_cs1_contiguous -
- *  - For es2 and above remap cs1 behind cs0 to allow command line
- *    mem=xyz use all memory with out discontinuous support compiled in.
- *    Could do it at the ATAG, but there really is two banks...
- *  - Called as part of 2nd phase DDR init.
+ * - When we have CS1 populated we want to have it mapped after cs0 to allow
+ *   command line mem=xyz use all memory with out discontinuous support
+ *   compiled in.  We could do it in the ATAG, but there really is two banks...
  */
 void make_cs1_contiguous(void)
 {
@@ -207,16 +206,16 @@ int dram_init(void)
 
 	size0 = get_sdr_cs_size(CS0);
 	/*
-	 * If a second bank of DDR is attached to CS1 this is
-	 * where it can be started.  Early init code will init
-	 * memory on CS0.
+	 * We always need to have cs_cfg point at where the second
+	 * bank would be, if present.  Failure to do so can lead to
+	 * strange situations where memory isn't detected and
+	 * configured correctly.  CS0 will already have been setup
+	 * at this point.
 	 */
-	if ((sysinfo.mtype == DDR_COMBO) || (sysinfo.mtype == DDR_STACKED)) {
-		do_sdrc_init(CS1, NOT_EARLY);
-		make_cs1_contiguous();
+	make_cs1_contiguous();
+	do_sdrc_init(CS1, NOT_EARLY);
+	size1 = get_sdr_cs_size(CS1);
 
-		size1 = get_sdr_cs_size(CS1);
-	}
 	gd->ram_size = size0 + size1;
 
 	return 0;
-- 
1.7.0.4

  reply	other threads:[~2011-11-09 17:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 17:10 [U-Boot] [PATCH v3 0/12] Add more framework to OMAP3 SPL, port more boards Tom Rini
2011-11-09 17:10 ` Tom Rini [this message]
2011-11-09 17:10 ` [U-Boot] [PATCH v3 02/12] OMAP3: Add a helper function to set timings in SDRC Tom Rini
2011-11-09 17:10 ` [U-Boot] [PATCH v3 03/12] OMAP3: Change mem_ok to clear again after reading back Tom Rini
2011-11-09 17:10 ` [U-Boot] [PATCH v3 04/12] OMAP3: Remove get_mem_type prototype Tom Rini
2011-11-09 17:10 ` [U-Boot] [PATCH v3 05/12] OMAP3: Add optimal SDRC autorefresh control values Tom Rini
2011-11-10  6:20   ` Heiko Schocher
2011-11-10 21:32     ` Robert Hurdle
2011-11-17 21:44     ` Tom Rini
2011-11-09 17:11 ` [U-Boot] [PATCH v3 06/12] OMAP3: Suffix all Micron memory timing parts with their speed Tom Rini
2011-11-10  6:23   ` Heiko Schocher
2011-11-17 21:50     ` Tom Rini
2011-11-09 17:11 ` [U-Boot] [PATCH v3 07/12] OMAP3 SPL: Rework memory initalization and devkit8000 support Tom Rini
2011-11-09 17:11 ` [U-Boot] [PATCH v3 08/12] OMAP3 SPL: Add identify_nand_chip function Tom Rini
2011-11-10  6:25   ` Heiko Schocher
2011-11-17 22:36     ` Tom Rini
2011-11-09 17:11 ` [U-Boot] [PATCH v3 09/12] OMAP3: Add SPL support to Beagleboard Tom Rini
2011-11-10  6:28   ` Heiko Schocher
2011-11-10 14:34     ` Tom Rini
2011-11-10 14:46       ` Heiko Schocher
2011-11-09 17:11 ` [U-Boot] [PATCH v3 10/12] OMAP3: Add SPL support to omap3_evm Tom Rini
2011-11-09 17:11 ` [U-Boot] [PATCH v3 11/12] AM3517: Add SPL support Tom Rini
2011-11-09 17:11 ` [U-Boot] [PATCH v3 12/12] AM3517 CraneBoard: " Tom Rini

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=1320858666-17113-2-git-send-email-trini@ti.com \
    --to=trini@ti.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