From patchwork Mon Mar 13 13:04:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 95219 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp1164493qgd; Mon, 13 Mar 2017 06:10:13 -0700 (PDT) X-Received: by 10.223.171.239 with SMTP id s102mr26936158wrc.23.1489410613114; Mon, 13 Mar 2017 06:10:13 -0700 (PDT) Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f21si606193wrf.78.2017.03.13.06.10.12; Mon, 13 Mar 2017 06:10:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id 96FAAC21C53; Mon, 13 Mar 2017 13:07:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A53E4C21C65; Mon, 13 Mar 2017 13:06:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 32D12C21C56; Mon, 13 Mar 2017 13:05:59 +0000 (UTC) Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by lists.denx.de (Postfix) with ESMTPS id B2747C21C67 for ; Mon, 13 Mar 2017 13:05:54 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2DD4tZi030133; Mon, 13 Mar 2017 08:04:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1489410295; bh=jnoXpJt1H8R80jXBUb5NH6LIZgp+htk2/FaGdTzcNG4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qaSg+3ppB9/eQ6b1hW2dVyjB9VEzCx2RQjsoyuMD73+UqtMH2dwYmAhmjAzG8S1QE NROjFlCMBqRprG2CdEv3ujz56Kdnz0F1VuyF/rAc6TP8vPJQh3zCUEXQwO++cBftgL fyg/qXHRe7520T6FnlyuK7ilyi/NPYSCOneOvvrg= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2DD4t5v002286; Mon, 13 Mar 2017 08:04:55 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Mon, 13 Mar 2017 08:04:54 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2DD4YjS003968; Mon, 13 Mar 2017 08:04:53 -0500 From: Roger Quadros To: Date: Mon, 13 Mar 2017 15:04:32 +0200 Message-ID: <1489410273-10159-10-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489410273-10159-1-git-send-email-rogerq@ti.com> References: <1489410273-10159-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [u-boot PATCH v4 09/10] ARM: k2g: setup PRU ethernet MAC addresses X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" PRU ethernet MAC address range is present in the board EEPROM. Parse it and setup eth?addr environment variables. Signed-off-by: Roger Quadros Reviewed-by: Lokesh Vutla Reviewed-by: Tom Rini --- arch/arm/mach-keystone/Kconfig | 2 ++ board/ti/ks2_evm/board_k2g.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig index e1962c7..67f5fa0 100644 --- a/arch/arm/mach-keystone/Kconfig +++ b/arch/arm/mach-keystone/Kconfig @@ -15,6 +15,8 @@ config TARGET_K2L_EVM config TARGET_K2G_EVM bool "TI Keystone 2 Galileo EVM" + select BOARD_LATE_INIT + select TI_I2C_BOARD_DETECT endchoice diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index 40edbaa..a738dd2 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -12,6 +12,7 @@ #include #include #include "mux-k2g.h" +#include "../common/board_detect.h" #define SYS_CLK 24000000 @@ -149,6 +150,24 @@ int board_early_init_f(void) } #endif +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init(void) +{ +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_TI_I2C_BOARD_DETECT) + int rc; + + rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS, + CONFIG_EEPROM_CHIP_ADDRESS); + if (rc) + printf("ti_i2c_eeprom_init failed %d\n", rc); + + board_ti_set_ethaddr(1); +#endif + + return 0; +} +#endif + #ifdef CONFIG_SPL_BUILD void spl_init_keystone_plls(void) {