summaryrefslogtreecommitdiffstats
path: root/board/stx
diff options
context:
space:
mode:
authorBecky Bruce <beckyb@kernel.crashing.org>2010-12-17 17:17:56 -0600
committerKumar Gala <galak@kernel.crashing.org>2011-01-14 01:32:19 -0600
commit38dba0c2ff685e3f8276a236bd70eaa09c84ead5 (patch)
treefc3365f6bdd25dfe23f2ec8c02926907613c8520 /board/stx
parent6b1ef2a6a553c33e74c5e50c77b55d40af669be3 (diff)
downloadblackbird-obmc-uboot-38dba0c2ff685e3f8276a236bd70eaa09c84ead5.tar.gz
blackbird-obmc-uboot-38dba0c2ff685e3f8276a236bd70eaa09c84ead5.zip
mpc85xx boards: initdram() cleanup/bugfix
Correct initdram to use phys_size_t to represent the size of dram; instead of changing this all over the place, and correcting all the other random errors I've noticed, create a common initdram that is used by all non-corenet 85xx parts. Most of the initdram() functions were identical, with 2 common differences: 1) DDR tlbs for the fixed_sdram case were set up in initdram() on some boards, and were part of the tlb_table on others. I have changed them all over to the initdram() method - we shouldn't be accessing dram before this point so they don't need to be done sooner, and this seems cleaner. 2) Parts that require the DDR11 erratum workaround had different implementations - I have adopted the version from the Freescale errata document. It also looks like some of the versions were buggy, and, depending on timing, could have resulted in the DDR controller being disabled. This seems bad. The xpedite boards had a common/fsl_8xxx_ddr.c; with this change only the 517 board uses this so I have moved the ddr code into that board's directory in xpedite517x.c Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Tested-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/stx')
-rw-r--r--board/stx/stxgp3/stxgp3.c32
-rw-r--r--board/stx/stxssa/stxssa.c33
2 files changed, 0 insertions, 65 deletions
diff --git a/board/stx/stxgp3/stxgp3.c b/board/stx/stxgp3/stxgp3.c
index 1ed340efe7..de22bf5e0a 100644
--- a/board/stx/stxgp3/stxgp3.c
+++ b/board/stx/stxgp3/stxgp3.c
@@ -40,8 +40,6 @@
#include <spd_sdram.h>
#include <miiphy.h>
-long int fixed_sdram (void);
-
/*
* I/O Port configuration table
*
@@ -277,36 +275,6 @@ show_activity(int flag)
next_led_update += (get_tbclk() / 4);
}
-phys_size_t
-initdram (int board_type)
-{
- long dram_size = 0;
-
-#if defined(CONFIG_DDR_DLL)
- {
- volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
- 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
-
- dram_size = fsl_ddr_sdram();
- dram_size = setup_ddr_tlbs(dram_size / 0x100000);
- dram_size *= 0x100000;
-
-#if defined(CONFIG_DDR_ECC)
- /* Initialize and enable DDR ECC.
- */
- ddr_enable_ecc(dram_size);
-#endif
-
- return dram_size;
-}
-
#if defined(CONFIG_SYS_DRAM_TEST)
int testdram (void)
diff --git a/board/stx/stxssa/stxssa.c b/board/stx/stxssa/stxssa.c
index 6cd28a34b9..83ffcd2b92 100644
--- a/board/stx/stxssa/stxssa.c
+++ b/board/stx/stxssa/stxssa.c
@@ -41,8 +41,6 @@
#include <miiphy.h>
#include <netdev.h>
-long int fixed_sdram (void);
-
/*
* I/O Port configuration table
*
@@ -294,37 +292,6 @@ show_activity(int flag)
next_led_update += (get_tbclk() / 4);
}
-phys_size_t
-initdram (int board_type)
-{
- long dram_size = 0;
-
-#if defined(CONFIG_DDR_DLL)
- {
- volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
- 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
-
- dram_size = fsl_ddr_sdram();
- dram_size = setup_ddr_tlbs(dram_size / 0x100000);
- dram_size *= 0x100000;
-
-#if defined(CONFIG_DDR_ECC)
- /* Initialize and enable DDR ECC.
- */
- ddr_enable_ecc(dram_size);
-#endif
-
- return dram_size;
-}
-
-
#if defined(CONFIG_SYS_DRAM_TEST)
int testdram (void)
{
OpenPOWER on IntegriCloud