summaryrefslogtreecommitdiffstats
path: root/board/ti/am335x/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/ti/am335x/board.c')
-rw-r--r--board/ti/am335x/board.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 57217688d6..7609a18368 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -544,12 +544,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs = 0x208,
.sliver_reg_ofs = 0xd80,
- .phy_id = 0,
+ .phy_addr = 0,
},
{
.slave_reg_ofs = 0x308,
.sliver_reg_ofs = 0xdc0,
- .phy_id = 1,
+ .phy_addr = 1,
},
};
@@ -602,6 +602,21 @@ int board_eth_init(bd_t *bis)
}
#ifdef CONFIG_DRIVER_TI_CPSW
+
+ mac_lo = readl(&cdev->macid1l);
+ mac_hi = readl(&cdev->macid1h);
+ mac_addr[0] = mac_hi & 0xFF;
+ mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+ mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
+ mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
+ mac_addr[4] = mac_lo & 0xFF;
+ mac_addr[5] = (mac_lo & 0xFF00) >> 8;
+
+ if (!getenv("eth1addr")) {
+ if (is_valid_ether_addr(mac_addr))
+ eth_setenv_enetaddr("eth1addr", mac_addr);
+ }
+
if (read_eeprom(&header) < 0)
puts("Could not get board ID.\n");
OpenPOWER on IntegriCloud