summaryrefslogtreecommitdiff
path: root/board/ti
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2014-02-18 07:31:56 -0500
committerTom Rini <trini@ti.com>2014-03-04 09:42:07 -0500
commit8feb37b9beefd4ba38227a837b6d7b3f5821b90c (patch)
treeacfa052cba151a4235987e20cfe4cad0a625035e /board/ti
parenta35ad51efe363abdc72473b32aea2c1bb271995f (diff)
downloadu-boot-imx-8feb37b9beefd4ba38227a837b6d7b3f5821b90c.zip
u-boot-imx-8feb37b9beefd4ba38227a837b6d7b3f5821b90c.tar.gz
u-boot-imx-8feb37b9beefd4ba38227a837b6d7b3f5821b90c.tar.bz2
ARM: DRA7xx: add support for reading cpsw 2nd mac 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 correct the bit masking of mac id read from the efuse. Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Diffstat (limited to 'board/ti')
-rw-r--r--board/ti/dra7xx/evm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 7990e79..c6c4fd1 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -216,6 +216,21 @@ int board_eth_init(bd_t *bis)
if (is_valid_ether_addr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
+
+ mac_lo = readl((*ctrl)->control_core_mac_id_1_lo);
+ mac_hi = readl((*ctrl)->control_core_mac_id_1_hi);
+ mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
+ mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+ mac_addr[2] = mac_hi & 0xFF;
+ mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
+ mac_addr[4] = (mac_lo & 0xFF00) >> 8;
+ mac_addr[5] = mac_lo & 0xFF;
+
+ if (!getenv("eth1addr")) {
+ if (is_valid_ether_addr(mac_addr))
+ eth_setenv_enetaddr("eth1addr", mac_addr);
+ }
+
ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33);
ctrl_val |= 0x22;
writel(ctrl_val, (*ctrl)->control_core_control_io1);