diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2014-02-18 07:31:55 -0500 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-03-04 09:42:06 -0500 |
commit | a35ad51efe363abdc72473b32aea2c1bb271995f (patch) | |
tree | ffa09039574c8d49ae48f1780bb296f28d831b61 /board/ti/am335x/board.c | |
parent | 4cdd7fda913df76e1267827b71d451e1c07af441 (diff) |
ARM: AM335x: add support for reading cpsw 2nd mac address from efuse
Adding support for reading cpsw 2nd mac address from efuse and pass it
to kernel via dtb which will be used in dual emac mode of cpsw.
Also adding mii command support to am335x common config.
Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Diffstat (limited to 'board/ti/am335x/board.c')
-rw-r--r-- | board/ti/am335x/board.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 862f966e7c..7609a18368 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -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"); |