summaryrefslogtreecommitdiff
path: root/board/etin
diff options
context:
space:
mode:
Diffstat (limited to 'board/etin')
-rw-r--r--board/etin/debris/debris.c62
1 files changed, 20 insertions, 42 deletions
diff --git a/board/etin/debris/debris.c b/board/etin/debris/debris.c
index fe075f1..f7851b3 100644
--- a/board/etin/debris/debris.c
+++ b/board/etin/debris/debris.c
@@ -52,50 +52,28 @@ int checkflash (void)
long int initdram (int board_type)
{
- int i, cnt;
- volatile uchar * base= CFG_SDRAM_BASE;
- volatile ulong * addr;
- ulong save[32];
- ulong val, ret = 0;
-
- for (i=0, cnt=(CFG_MAX_RAM_SIZE / sizeof(long)) >> 1; cnt > 0; cnt >>= 1) {
- addr = (volatile ulong *)base + cnt;
- save[i++] = *addr;
- *addr = ~cnt;
- }
-
- addr = (volatile ulong *)base;
- save[i] = *addr;
- *addr = 0;
-
- if (*addr != 0) {
- *addr = save[i];
- goto Done;
- }
+ long size;
+#if 0
+ long new_bank0_end;
+ long mear1;
+ long emear1;
+#endif
- for (cnt = 1; cnt <= CFG_MAX_RAM_SIZE / sizeof(long); cnt <<= 1) {
- addr = (volatile ulong *)base + cnt;
- val = *addr;
- *addr = save[--i];
- if (val != ~cnt) {
-/* ulong new_bank0_end = cnt * sizeof(long) - 1;
- ulong mear1 = mpc824x_mpc107_getreg(MEAR1);
- ulong emear1 = mpc824x_mpc107_getreg(EMEAR1);
- mear1 = (mear1 & 0xFFFFFF00) |
- ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT);
- emear1 = (emear1 & 0xFFFFFF00) |
- ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT);
- mpc824x_mpc107_setreg(MEAR1, mear1);
- mpc824x_mpc107_setreg(EMEAR1, emear1);*/
-
- ret = cnt * sizeof(long);
- goto Done;
- }
- }
+ size = get_ram_size(CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE);
+
+#if 0
+ new_bank0_end = size - 1;
+ mear1 = mpc824x_mpc107_getreg(MEAR1);
+ emear1 = mpc824x_mpc107_getreg(EMEAR1);
+ mear1 = (mear1 & 0xFFFFFF00) |
+ ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT);
+ emear1 = (emear1 & 0xFFFFFF00) |
+ ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT);
+ mpc824x_mpc107_setreg(MEAR1, mear1);
+ mpc824x_mpc107_setreg(EMEAR1, emear1);
+#endif
- ret = CFG_MAX_RAM_SIZE;
-Done:
- return ret;
+ return (size);
}
/*