public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Larry Johnson <lrj@acm.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] ppc4xx: Add CFG_MEM_TOP_HIDE to Denali SPD-based SDRAM setup
Date: Sun, 30 Mar 2008 20:33:04 -0500	[thread overview]
Message-ID: <47F03F50.8040003@acm.org> (raw)

Signed-off-by: Larry Johnson <lrj@acm.org>
--- 
 cpu/ppc4xx/denali_spd_ddr2.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/cpu/ppc4xx/denali_spd_ddr2.c b/cpu/ppc4xx/denali_spd_ddr2.c
index 60f89c9..e20c9eb 100644
--- a/cpu/ppc4xx/denali_spd_ddr2.c
+++ b/cpu/ppc4xx/denali_spd_ddr2.c
@@ -1093,10 +1093,10 @@ long int initdram(int board_type)
 
 	program_ddr0_06(dimm_ranks, iic0_dimm_addr, num_dimm_banks, sdram_freq);
 
-	/*------------------------------------------------------------------
+	/*
 	 * TODO: tFAW not found in SPD.  Value of 13 taken from Sequoia
-	 * board SDRAM, but may be overly concervate.
-	 *-----------------------------------------------------------------*/
+	 * board SDRAM, but may be overly conservative.
+	 */
 	mtsdram(DDR0_07, DDR0_07_NO_CMD_INIT_ENCODE(0) |
 		DDR0_07_TFAW_ENCODE(13) |
 		DDR0_07_AUTO_REFRESH_MODE_ENCODE(1) |
@@ -1181,26 +1181,29 @@ long int initdram(int board_type)
 	denali_wait_for_dlllock();
 
 #if defined(CONFIG_DDR_DATA_EYE)
-	/* -----------------------------------------------------------+
-	 * Perform data eye search if requested.
-	 * ----------------------------------------------------------*/
-	program_tlb(0, CFG_SDRAM_BASE, dram_size, TLB_WORD2_I_ENABLE);
+	/*
+	 * Map the first 1 MiB of memory in the TLB, and perform the data eye
+	 * search.
+	 */
+	program_tlb(0, CFG_SDRAM_BASE, TLB_1MB_SIZE, TLB_WORD2_I_ENABLE);
 	denali_core_search_data_eye();
 	denali_sdram_register_dump();
-	remove_tlb(CFG_SDRAM_BASE, dram_size);
+	remove_tlb(CFG_SDRAM_BASE, TLB_1MB_SIZE);
 #endif
 
 #if defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC)
 	program_tlb(0, CFG_SDRAM_BASE, dram_size, 0);
 	sync();
-	eieio();
 	/* Zero the memory */
 	debug("Zeroing SDRAM...");
-	dcbz_area(CFG_SDRAM_BASE, dram_size);
+#if defined(CFG_MEM_TOP_HIDE)
+	dcbz_area(CFG_SDRAM_BASE, dram_size - CFG_MEM_TOP_HIDE);
+#else
+#error Please define CFG_MEM_TOP_HIDE (see README) in your board config file
+#endif
 	dflush();
 	debug("Completed\n");
 	sync();
-	eieio();
 	remove_tlb(CFG_SDRAM_BASE, dram_size);
 
 #if defined(CONFIG_DDR_ECC)
@@ -1211,7 +1214,6 @@ long int initdram(int board_type)
 		u32 val;
 
 		sync();
-		eieio();
 		/* Clear error status */
 		mfsdram(DDR0_00, val);
 		mtsdram(DDR0_00, val | DDR0_00_INT_ACK_ALL);
@@ -1229,7 +1231,6 @@ long int initdram(int board_type)
 		print_mcsr();
 #endif
 		sync();
-		eieio();
 	}
 #endif /* defined(CONFIG_DDR_ECC) */
 #endif /* defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC) */

             reply	other threads:[~2008-03-31  1:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31  1:33 Larry Johnson [this message]
2008-03-31 10:24 ` [U-Boot-Users] [PATCH] ppc4xx: Add CFG_MEM_TOP_HIDE to Denali SPD-based SDRAM setup Stefan Roese

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=47F03F50.8040003@acm.org \
    --to=lrj@acm.org \
    --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