Patches by Stephan Linz, 30 Jan 2004:
[oweals/u-boot.git] / board / lwmon / lwmon.c
index cf824082cfe0d31c7a89d736dc1831a0667c9c27..6776dbf4740f3ec36eb592eeddcc533d6a1857d1 100644 (file)
@@ -246,7 +246,7 @@ long int initdram (int board_type)
        udelay (1);                             /* 0x80006106 */
        memctl->memc_mcr = MCR_OP_RUN | MCR_MB_CS3 | MCR_MLCF (1) | MCR_MAD (0x06);
 
-       memctl->memc_mamr |= MAMR_PTBE; /* refresh enabled */
+       memctl->memc_mamr |= MAMR_PTAE; /* refresh enabled */
 
        udelay (200);
 
@@ -276,11 +276,11 @@ long int initdram (int board_type)
 
        if (size8 < size9) {            /* leave configuration at 9 columns */
                size_b0 = size9;
-               memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTBE;
+               memctl->memc_mamr = CFG_MAMR_9COL | MAMR_PTAE;
                udelay (500);
        } else {                        /* back to 8 columns            */
                size_b0 = size8;
-               memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTBE;
+               memctl->memc_mamr = CFG_MAMR_8COL | MAMR_PTAE;
                udelay (500);
        }
 
@@ -326,42 +326,10 @@ static long int dram_size (long int mamr_value, long int *base, long int maxsize
 {
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
        volatile memctl8xx_t *memctl = &immr->im_memctl;
-       volatile long int *addr;
-       ulong cnt, val;
-       ulong save[32];                         /* to make test non-destructive */
-       unsigned char i = 0;
 
        memctl->memc_mamr = mamr_value;
 
-       for (cnt = maxsize / sizeof (long); cnt > 0; cnt >>= 1) {
-               addr = base + cnt;              /* pointer arith! */
-
-               save[i++] = *addr;
-               *addr = ~cnt;
-       }
-
-       /* write 0 to base address */
-       addr = base;
-       save[i] = *addr;
-       *addr = 0;
-
-       /* check at base address */
-       if ((val = *addr) != 0) {
-               *addr = save[i];
-               return (0);
-       }
-
-       for (cnt = 1; cnt <= maxsize / sizeof (long); cnt <<= 1) {
-               addr = base + cnt;              /* pointer arith! */
-
-               val = *addr;
-               *addr = save[--i];
-
-               if (val != (~cnt)) {
-                       return (cnt * sizeof (long));
-               }
-       }
-       return (maxsize);
+       return (get_ram_size(base, maxsize));
 }
 
 /* ------------------------------------------------------------------------- */
@@ -371,14 +339,14 @@ static long int dram_size (long int mamr_value, long int *base, long int maxsize
 #endif
 
 /***********************************************************************
-F* Function:     int board_pre_init (void) P*A*Z*
+F* Function:     int board_early_init_f (void) P*A*Z*
  *
 P* Parameters:   none
 P*
 P* Returnvalue:  int
 P*                - 0 is always returned.
  *
-Z* Intention:    This function is the board_pre_init() method implementation
+Z* Intention:    This function is the board_early_init_f() method implementation
 Z*               for the lwmon board.
 Z*               Disable Ethernet TENA on Port B.
  *
@@ -386,7 +354,7 @@ D* Design:       wd@denx.de
 C* Coding:       wd@denx.de
 V* Verification: dzu@denx.de
  ***********************************************************************/
-int board_pre_init (void)
+int board_early_init_f (void)
 {
        volatile immap_t *immr = (immap_t *) CFG_IMMR;
 
@@ -1073,11 +1041,11 @@ static int key_pressed(void)
 #endif /* CONFIG_MODEM_SUPPORT */
 
 #ifdef CONFIG_POST
-/* 
+/*
  * Returns 1 if keys pressed to start the power-on long-running tests
  * Called from board_init_f().
  */
-int post_hotkeys_pressed(gd_t *gd)
+int post_hotkeys_pressed(void)
 {
        uchar kbd_data[KEYBD_DATALEN];
        uchar val;