]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/etin/debris/debris.c
mx25pdk: Remove CONFIG_SYS_GENERIC_BOARD
[karo-tx-uboot.git] / board / etin / debris / debris.c
index 67375e9feadd02dcade0cfd9383d355e03d142c9..0308fef6cf53be0ea748d5a15bfeced589070ca4 100644 (file)
@@ -2,29 +2,15 @@
  * (C) Copyright 2000
  * Sangmoon Kim, Etin Systems. dogoil@etinsys.com.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <mpc824x.h>
+#include <net.h>
 #include <pci.h>
 #include <i2c.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -53,7 +39,7 @@ int checkflash (void)
 }
 #endif
 
-long int initdram (int board_type)
+phys_size_t initdram (int board_type)
 {
        int m, row, col, bank, i;
        unsigned long start, end;
@@ -62,7 +48,7 @@ long int initdram (int board_type)
        uint32_t mear2 = 0, emear2 = 0, msar2 = 0, emsar2 = 0;
        uint8_t mber = 0;
 
-       i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
        if (i2c_reg_read (0x50, 2) != 0x04) return 0;   /* Memory type */
        m = i2c_reg_read (0x50, 5);     /* # of physical banks */
@@ -73,7 +59,7 @@ long int initdram (int board_type)
        CONFIG_READ_WORD(MCCR1, mccr1);
        mccr1 &= 0xffff0000;
 
-       start = CFG_SDRAM_BASE;
+       start = CONFIG_SYS_SDRAM_BASE;
        end = start + (1 << (col + row + 3) ) * bank - 1;
 
        for (i = 0; i < m; i++) {
@@ -172,8 +158,17 @@ void nvram_write(long dest, const void *src, size_t count)
 
 int misc_init_r(void)
 {
-       /* Write ethernet addr in NVRAM for VxWorks */
-       nvram_write(CFG_ENV_ADDR + CFG_NVRAM_VXWORKS_OFFS,
-                       (char*)&gd->bd->bi_enetaddr[0], 6);
+       uchar ethaddr[6];
+
+       if (eth_getenv_enetaddr("ethaddr", ethaddr))
+               /* Write ethernet addr in NVRAM for VxWorks */
+               nvram_write(CONFIG_ENV_ADDR + CONFIG_SYS_NVRAM_VXWORKS_OFFS,
+                               ethaddr, 6);
+
        return 0;
 }
+
+int board_eth_init(bd_t *bis)
+{
+       return pci_eth_init(bis);
+}