]> git.sur5r.net Git - u-boot/blobdiff - board/renesas/r0p7734/r0p7734.c
mpc8xx: move common linker scripts into the CPU directory
[u-boot] / board / renesas / r0p7734 / r0p7734.c
index 80f4329e00cf4715931f0781e7c60ad8b4e75134..5687ad476625a22d7086a210aaff23e8c8503e5d 100644 (file)
@@ -2,29 +2,14 @@
  * Copyright (C) 2011 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  * Copyright (C) 2011 Renesas Solutions Corp.
  *
- * 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 <asm/io.h>
 #include <asm/processor.h>
 #include <netdev.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -55,6 +40,24 @@ int board_init(void)
        if (r & MSTPSR1_GETHER)
                writel((r & ~MSTPSR1_GETHER), MSTPCR1);
 #endif
+
+       return 0;
+}
+
+int board_late_init(void)
+{
+       u8 mac[6];
+
+       /* Read Mac Address and set*/
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       i2c_set_bus_num(CONFIG_SYS_I2C_MODULE);
+
+       /* Read MAC address */
+       i2c_read(0x50, 0x10, 0, mac, 6);
+
+       if (is_valid_ether_addr(mac))
+               eth_setenv_enetaddr("ethaddr", mac);
+
        return 0;
 }
 
@@ -75,4 +78,3 @@ int board_eth_init(bd_t *bis)
        return rc;
 }
 #endif
-