Merge with /home/wd/git/u-boot/master
[oweals/u-boot.git] / board / emk / top860 / top860.c
index d13be98e9eb0230b06d078cc165d27d0e0250d2e..84afaaa2b2a0011144a328ac070e75d385ff422a 100644 (file)
@@ -119,6 +119,20 @@ long int initdram (int board_type)
        return -(memctl->memc_or2 & 0xffff0000);
 }
 
+/*****************************************************************************
+ * prepare for FLASH detection
+ *****************************************************************************/
+void flash_preinit(void)
+{
+}
+
+/*****************************************************************************
+ * finalize FLASH setup
+ *****************************************************************************/
+void flash_afterinit(uint bank, ulong start, ulong size)
+{
+}
+
 /*****************************************************************************
  * otherinits after RAM is there and we are relocated to RAM
  * note: though this is an int function, nobody cares for the result!
@@ -126,52 +140,8 @@ long int initdram (int board_type)
 int misc_init_r (void)
 {
        /* read 'factory' part of EEPROM */
-       uchar buf[81];
-       uchar *p;
-       uint length;
-       uint addr;
-       uint len;
-
-       /* get length first */
-       addr = CFG_FACT_OFFSET;
-       if (eeprom_read (CFG_I2C_FACT_ADDR, addr, buf, 2)) {
-         bailout:
-               printf ("cannot read factory configuration\n");
-               printf ("be sure to set ethaddr yourself!\n");
-               return 0;
-       }
-       length = buf[0] + (buf[1] << 8);
-       addr += 2;
+       extern void read_factory_r (void);
+       read_factory_r ();
 
-       /* sanity check */
-       if (length < 20 || length > CFG_FACT_SIZE - 2)
-               goto bailout;
-
-       /* read lines */
-       while (length > 0) {
-               /* read one line */
-               len = length > 80 ? 80 : length;
-               if (eeprom_read (CFG_I2C_FACT_ADDR, addr, buf, len))
-                       goto bailout;
-               /* mark end of buffer */
-               buf[len] = 0;
-               /* search end of line */
-               for (p = buf; *p && *p != 0x0a; p++);
-               if (!*p)
-                       goto bailout;
-               *p++ = 0;
-               /* advance to next line start */
-               length -= p - buf;
-               addr += p - buf;
-               /*printf ("%s\n", buf); */
-               /* search for our specific entry */
-               if (!strncmp ((char *) buf, "[RLA/lan/Ethernet] ", 19)) {
-                       setenv ("ethaddr", buf + 19);
-               } else if (!strncmp ((char *) buf, "[BOARD/SERIAL] ", 15)) {
-                       setenv ("serial#", buf + 15);
-               } else if (!strncmp ((char *) buf, "[BOARD/TYPE] ", 13)) {
-                       setenv ("board_id", buf + 13);
-               }
-       }
        return (0);
 }