summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>2012-03-02 12:58:33 +0900
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>2012-05-28 09:12:53 +0900
commitd74055596833ecf9c73babc97d9818093679e26c (patch)
tree1d0a9189f1b622351a802ae01490e8fd8bafcd45 /board
parent1379c51ea5cbffe68016d61d37108750db26fc33 (diff)
sh: r0p7734: Add support I2C controller
This read MAC address from Serial EEPROM and set. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'board')
-rw-r--r--board/renesas/r0p7734/r0p7734.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/board/renesas/r0p7734/r0p7734.c b/board/renesas/r0p7734/r0p7734.c
index 80f4329e00c..c1bde549ae8 100644
--- a/board/renesas/r0p7734/r0p7734.c
+++ b/board/renesas/r0p7734/r0p7734.c
@@ -25,6 +25,7 @@
#include <asm/io.h>
#include <asm/processor.h>
#include <netdev.h>
+#include <i2c.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -55,6 +56,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 +94,3 @@ int board_eth_init(bd_t *bis)
return rc;
}
#endif
-