From patchwork Tue Mar 22 13:25:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram X-Patchwork-Id: 652611 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2MDPInG022509 for ; Tue, 22 Mar 2011 13:25:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755980Ab1CVNZR (ORCPT ); Tue, 22 Mar 2011 09:25:17 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56215 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754189Ab1CVNZQ (ORCPT ); Tue, 22 Mar 2011 09:25:16 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p2MDPAVF016833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Mar 2011 08:25:12 -0500 Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p2MDP790004979; Tue, 22 Mar 2011 18:55:08 +0530 (IST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by psplinux050.india.ti.com (8.13.1/8.13.1) with ESMTP id p2MDP7N4017885; Tue, 22 Mar 2011 18:55:07 +0530 Received: (from a0875517@localhost) by psplinux050.india.ti.com (8.13.1/8.13.1/Submit) id p2MDP6Eu017882; Tue, 22 Mar 2011 18:55:06 +0530 From: Sriramakrishnan A G To: linux-omap@vger.kernel.org Cc: srk@ti.com, tony@atomide.com Subject: [PATCH] omap3: am3517evm : Read MAC address from E-Fuses Date: Tue, 22 Mar 2011 18:55:06 +0530 Message-Id: <1300800306-17846-1-git-send-email-srk@ti.com> X-Mailer: git-send-email 1.6.2.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Mar 2011 13:25:18 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 77541cf..177c65d 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -128,7 +128,17 @@ static void am3517_disable_ethernet_int(void) static void am3517_evm_ethernet_init(struct emac_platform_data *pdata) { - unsigned int regval; + u32 regval, mac_lo, mac_hi; + + mac_lo = omap_ctrl_readl(AM35XX_CONTROL_FUSE_EMAC_LSB); + mac_hi = omap_ctrl_readl(AM35XX_CONTROL_FUSE_EMAC_MSB); + + pdata->mac_addr[0] = (u_int8_t)((mac_hi & 0xFF0000) >> 16); + pdata->mac_addr[1] = (u_int8_t)((mac_hi & 0xFF00) >> 8); + pdata->mac_addr[2] = (u_int8_t)((mac_hi & 0xFF) >> 0); + pdata->mac_addr[3] = (u_int8_t)((mac_lo & 0xFF0000) >> 16); + pdata->mac_addr[4] = (u_int8_t)((mac_lo & 0xFF00) >> 8); + pdata->mac_addr[5] = (u_int8_t)((mac_lo & 0xFF) >> 0); pdata->ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET; pdata->ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET; diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index c2804c1..8b6cc4f 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -198,6 +198,8 @@ /* AM35XX only CONTROL_GENERAL register offsets */ #define AM35XX_CONTROL_MSUSPENDMUX_6 (OMAP2_CONTROL_GENERAL + 0x0038) +#define AM35XX_CONTROL_FUSE_EMAC_LSB (OMAP2_CONTROL_GENERAL + 0x0110) +#define AM35XX_CONTROL_FUSE_EMAC_MSB (OMAP2_CONTROL_GENERAL + 0x0114) #define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310) #define AM35XX_CONTROL_DEVCONF3 (OMAP2_CONTROL_GENERAL + 0x0314) #define AM35XX_CONTROL_CBA_PRIORITY (OMAP2_CONTROL_GENERAL + 0x0320)