From: Becky Bruce <beckyb@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 01/12] mpc8540eval: Split initdram() into initdram() and sdram_init()
Date: Mon, 13 Dec 2010 15:06:41 -0600 [thread overview]
Message-ID: <1292274412-11340-2-git-send-email-beckyb@kernel.crashing.org> (raw)
In-Reply-To: <1292274412-11340-1-git-send-email-beckyb@kernel.crashing.org>
Modeled after the MPC8540DS code; this will allow us to use a common
initdram() once that is available. There should be no functional
change.
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
board/mpc8540eval/mpc8540eval.c | 64 +++++++++++++++++++++-----------------
1 files changed, 35 insertions(+), 29 deletions(-)
diff --git a/board/mpc8540eval/mpc8540eval.c b/board/mpc8540eval/mpc8540eval.c
index 054d644..f1ab360 100644
--- a/board/mpc8540eval/mpc8540eval.c
+++ b/board/mpc8540eval/mpc8540eval.c
@@ -64,41 +64,15 @@ int checkboard (void)
return (0);
}
-phys_size_t initdram (int board_type)
+void sdram_init(void)
{
- long dram_size = 0;
-
-#if !defined(CONFIG_RAM_AS_FLASH)
+#if !defined(CONFIG_RAM_AS_FLASH) /* LocalBus is not emulating flash */
volatile fsl_lbc_t *lbc = LBC_BASE_ADDR;
+ volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
sys_info_t sysinfo;
uint temp_lbcdll = 0;
-#endif
-#if !defined(CONFIG_RAM_AS_FLASH) || defined(CONFIG_DDR_DLL)
- volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-#endif
-#if defined(CONFIG_DDR_DLL)
- uint temp_ddrdll = 0;
- /* Work around to stabilize DDR DLL */
- temp_ddrdll = gur->ddrdllcr;
- gur->ddrdllcr = ((temp_ddrdll & 0xff) << 16) | 0x80000000;
- asm("sync;isync;msync");
-#endif
-
-#if defined(CONFIG_SPD_EEPROM)
- dram_size = fsl_ddr_sdram();
- dram_size = setup_ddr_tlbs(dram_size / 0x100000);
- dram_size *= 0x100000;
-#else
- dram_size = fixed_sdram ();
-#endif
-
-#if defined(CONFIG_SYS_RAMBOOT)
- return dram_size;
-#endif
-
-#if !defined(CONFIG_RAM_AS_FLASH) /* LocalBus is not emulating flash */
get_sys_info(&sysinfo);
/* if localbus freq is less than 66MHz,we use bypass mode,otherwise use DLL */
if(sysinfo.freqSystemBus/(CONFIG_SYS_LBC_LCRR & LCRR_CLKDIV) < 66000000) {
@@ -132,6 +106,38 @@ phys_size_t initdram (int board_type)
lbc->mrtpr = CONFIG_SYS_LBC_MRTPR;
asm("sync");
#endif
+}
+
+phys_size_t initdram(int board_type)
+{
+ long dram_size = 0;
+
+#if !defined(CONFIG_RAM_AS_FLASH) || defined(CONFIG_DDR_DLL)
+ volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+#endif
+
+#if defined(CONFIG_DDR_DLL)
+ uint temp_ddrdll = 0;
+
+ /* Work around to stabilize DDR DLL */
+ temp_ddrdll = gur->ddrdllcr;
+ gur->ddrdllcr = ((temp_ddrdll & 0xff) << 16) | 0x80000000;
+ asm("sync;isync;msync");
+#endif
+
+#if defined(CONFIG_SPD_EEPROM)
+ dram_size = fsl_ddr_sdram();
+ dram_size = setup_ddr_tlbs(dram_size / 0x100000);
+ dram_size *= 0x100000;
+#else
+ dram_size = fixed_sdram();
+#endif
+
+#if defined(CONFIG_SYS_RAMBOOT)
+ return dram_size;
+#endif
+
+ sdram_init();
#if defined(CONFIG_DDR_ECC)
{
--
1.5.6.5
next prev parent reply other threads:[~2010-12-13 21:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 21:06 [U-Boot] [PATCH v2 00/12] Go to common initdram() on 85xx-based boards Becky Bruce
2010-12-13 21:06 ` Becky Bruce [this message]
2010-12-13 21:06 ` [U-Boot] [PATCH V2 02/12] tqm85xx: create fixed_sdram() to do sdram setup Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 03/12] mpc85xx/tlb.c: Allow platforms to specify wimge bits Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 04/12] socrates: rename sdram_setup fixed_sdram() Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 05/12] mpc8569mds: Remove unnecessary CONFIG_SYS_LBC_SDRAM_BASE definition Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 06/12] PM854: rename CONFIG_SYS_LBC_SDRAM_BASE CONFIG_SYS_LBC_BASE Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 07/12] PM856: Rename " Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 08/12] MPC8568/MPC8569: Remove CONFIG_DDR_DLL define Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 09/12] mpc85xx boards: initdram() cleanup/bugfix Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 10/12] 85xx boards: Rename CONFIG_DDR_DLL to CONFIG_SYS_FSL_ERRATUM_DDR_MSYNC_IN Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 11/12] mpc85xx: rename sdram_init() lbc_sdram_init() Becky Bruce
2010-12-13 21:06 ` [U-Boot] [PATCH V2 12/12] MPC8xxx DDR: align informational prints Becky Bruce
2010-12-14 2:12 ` [U-Boot] [PATCH V2 09/12] mpc85xx boards: initdram() cleanup/bugfix Paul Gortmaker
2010-12-14 16:38 ` Becky Bruce
2010-12-15 23:25 ` Paul Gortmaker
2010-12-15 23:27 ` Becky Bruce
2010-12-14 4:21 ` [U-Boot] [PATCH V2 08/12] MPC8568/MPC8569: Remove CONFIG_DDR_DLL define Kumar Gala
2010-12-14 4:28 ` [U-Boot] [PATCH V2 07/12] PM856: Rename CONFIG_SYS_LBC_SDRAM_BASE CONFIG_SYS_LBC_BASE Kumar Gala
2010-12-14 4:28 ` [U-Boot] [PATCH V2 06/12] PM854: rename " Kumar Gala
2010-12-14 4:21 ` [U-Boot] [PATCH V2 05/12] mpc8569mds: Remove unnecessary CONFIG_SYS_LBC_SDRAM_BASE definition Kumar Gala
2010-12-14 4:21 ` [U-Boot] [PATCH V2 04/12] socrates: rename sdram_setup fixed_sdram() Kumar Gala
2010-12-14 4:19 ` [U-Boot] [PATCH V2 03/12] mpc85xx/tlb.c: Allow platforms to specify wimge bits Kumar Gala
2010-12-14 4:28 ` [U-Boot] [PATCH V2 01/12] mpc8540eval: Split initdram() into initdram() and sdram_init() Kumar Gala
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=1292274412-11340-2-git-send-email-beckyb@kernel.crashing.org \
--to=beckyb@kernel.crashing.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