ppc4xx: Fix SDRAM inititialization of multiple 405 based board ports

This patch fixes a problem introdiced with patch
bbeff30c [ppc4xx: Remove superfluous dram_init() call or replace it by
initdram()].

The boards affected are:
- PCI405
- PPChameleonEVB
- quad100hd
- taihu
- zeus

Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Stefan Roese
2008-09-10 16:53:47 +02:00
parent 61737c59a3
commit 7bf5ecfa50
7 changed files with 10 additions and 98 deletions

View File

@@ -78,15 +78,6 @@ int checkboard(void)
return 0;
}
/*************************************************************************
* phys_size_t initdram
*
************************************************************************/
phys_size_t initdram(int board)
{
return CFG_SDRAM_SIZE_PER_BANK * CFG_SDRAM_BANKS; /* 128Mbytes */
}
static int do_sw_stat(cmd_tbl_t* cmd_tp, int flags, int argc, char *argv[])
{
char stat;

View File

@@ -203,31 +203,6 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
phys_size_t initdram (int board_type)
{
unsigned long val;
mtdcr(memcfga, mem_mb0cf);
val = mfdcr(memcfgd);
#if 0 /* test-only */
for (;;) {
NAND_DISABLE_CE(1);
udelay(100);
NAND_ENABLE_CE(1);
udelay(100);
}
#endif
#if 0
printf("\nmb0cf=%x\n", val); /* test-only */
printf("strap=%x\n", mfdcr(strap)); /* test-only */
#endif
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
}
/* ------------------------------------------------------------------------- */
int testdram (void)
{
/* TODO: XXX XXX XXX */

View File

@@ -356,37 +356,6 @@ int checkboard (void)
return 0;
}
/* ------------------------------------------------------------------------- */
phys_size_t initdram (int board_type)
{
unsigned long val;
mtdcr(memcfga, mem_mb0cf);
val = mfdcr(memcfgd);
#if 0
printf("\nmb0cf=%x\n", val); /* test-only */
printf("strap=%x\n", mfdcr(strap)); /* test-only */
#endif
#if 0 /* test-only: all PCI405 version must report 16mb */
return (4*1024*1024 << ((val & 0x000e0000) >> 17));
#else
return (16*1024*1024);
#endif
}
/* ------------------------------------------------------------------------- */
int testdram (void)
{
/* TODO: XXX XXX XXX */
printf ("test: 16 MB - ok\n");
return (0);
}
/* ------------------------------------------------------------------------- */
int wpeeprom(int wp)
{

View File

@@ -86,8 +86,3 @@ int checkboard(void)
return 0;
}
phys_size_t initdram(int board_type)
{
return CFG_SDRAM_SIZE;
}

View File

@@ -190,29 +190,6 @@ int checkboard(void)
return (0);
}
static u32 detect_sdram_size(void)
{
u32 val;
u32 size;
mfsdram(mem_mb0cf, val);
size = (4 << 20) << ((val & 0x000e0000) >> 17);
/*
* Check if 2nd bank is enabled too
*/
mfsdram(mem_mb1cf, val);
if (val & 1)
size += (4 << 20) << ((val & 0x000e0000) >> 17);
return size;
}
phys_size_t initdram (int board_type)
{
return detect_sdram_size();
}
static int default_env_var(char *buf, char *var)
{
char *ptr;