From: Tom Rini Date: Tue, 18 Feb 2014 07:31:56 -0500 Subject: [U-Boot] [PATCH 05/10] ARM: DRA7xx: add support for reading cpsw 2nd mac from efuse In-Reply-To: <1392726721-12169-1-git-send-email-trini@ti.com> References: <1392726721-12169-1-git-send-email-trini@ti.com> Message-ID: <1392726721-12169-5-git-send-email-trini@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Mugunthan V N 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 Signed-off-by: Mugunthan V N --- board/ti/dra7xx/evm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 9d72d2e..fd29624 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -215,6 +215,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); -- 1.7.9.5