From patchwork Thu Nov 10 16:16:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 81719 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp847869qge; Thu, 10 Nov 2016 09:36:10 -0800 (PST) X-Received: by 10.194.26.133 with SMTP id l5mr5513660wjg.4.1478799370469; Thu, 10 Nov 2016 09:36:10 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id k64si29113736wme.23.2016.11.10.09.36.10; Thu, 10 Nov 2016 09:36:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A5AFEB383C; Thu, 10 Nov 2016 18:35:53 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N7x4nTaQ2vwt; Thu, 10 Nov 2016 18:35:53 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86B8FB384F; Thu, 10 Nov 2016 18:35:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5675BB3824 for ; Thu, 10 Nov 2016 17:16:41 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h4jvlHNhXGia for ; Thu, 10 Nov 2016 17:16:41 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by theia.denx.de (Postfix) with ESMTPS id 16E1BA7535 for ; Thu, 10 Nov 2016 17:16:39 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id f82so41655398wmf.1 for ; Thu, 10 Nov 2016 08:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=VggMdejrY1KgXr8X1Qx6ZLEZ/ejwAVnzIceAmI3ZZiU=; b=eVFl6DczPnM6FvCPL5SCPS1zAX3Rq+YgREimKRJs/ADj839/xvrhfHMHgZzse9xzrP A0HRNYavYUMAHqba9Lvnioo2tz992dXAoPsscxYaCQVx3p9AnyA1EzuHcf9gHYlaNsyc 9zJviPn7Y9yxksEPgGlfzI4lCiYf5Zydj1DWFL/GD79gt7pf9gE2YP2IBPIOIZSJYlbj Zo8kVLyQal16WVrf5iksh+Ahb1eh4ZtePzyMwwQjGD3JmYATvO1hCcwZDxF7SyE/e65U y4a8fsF29bsBXPqGQ5KvGR/W7FcyooZ/ZAXcc23LFJDHqrL4YwRBgvUpjht1TUSjaj3g wYfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VggMdejrY1KgXr8X1Qx6ZLEZ/ejwAVnzIceAmI3ZZiU=; b=JPKT+NwDEjvsYLilWX2kSZ6dHWgmN0LkdXsB9eMVKZdeCrK59dkSpd3L5MIwK3RvZz Fn+nD8fz2fj3X550367NSh1NBzb+unoPd+Lc3LjBPnTnneWexx5FWiC5eIMsBQsu0riT LKssTYGHQolWbzKCRMYt8zX7QMnuUcD9Kd0numMRfgYql6IjR/aQVX8f4ULIRiDK3fiF vLBhj1r4ayadXIRnHQgCoo498RmV6ydVuU0t69RAzgsB9RSLNTRlJXxGId69BEUZGyZW grAcupqfOVJRgo6jrmTkwarmi3kuQds4yi2AEh9MJebfo5KpIFVTb7y6L3MbNTGcvd8a TXIA== X-Gm-Message-State: ABUngve3r1pe5E2AzAKatFHUtb2T1+iyOoWsB+Tj72KbalYZCFemMwnsdXgFU6N483UinG6h X-Received: by 10.28.167.77 with SMTP id q74mr6667828wme.21.1478794598532; Thu, 10 Nov 2016 08:16:38 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id n6sm6254459wjg.30.2016.11.10.08.16.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 08:16:37 -0800 (PST) From: Fabien Parent To: u-boot@lists.denx.de Date: Thu, 10 Nov 2016 17:16:35 +0100 Message-Id: <20161110161635.7275-1-fparent@baylibre.com> X-Mailer: git-send-email 2.10.2 X-Mailman-Approved-At: Thu, 10 Nov 2016 18:35:40 +0100 Cc: Tom Rini Subject: [U-Boot] [PATCH] davinci: omapl138_lcdk: keep booting even when MAC address is invalid X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If the MAC address specified on the EEPROM is invalid (multicast or zero address), then u-boot fails to boot. Having a bad MAC address in the EEPROM should not prevent the system from booting. This commit changes the error path to just print an error messages in case of bad MAC address. Signed-off-by: Fabien Parent --- board/davinci/da8xxevm/omapl138_lcdk.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.10.2 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot Reviewed-by: Tom Rini diff --git a/board/davinci/da8xxevm/omapl138_lcdk.c b/board/davinci/da8xxevm/omapl138_lcdk.c index 9783b2a..9c1a483 100644 --- a/board/davinci/da8xxevm/omapl138_lcdk.c +++ b/board/davinci/da8xxevm/omapl138_lcdk.c @@ -333,15 +333,17 @@ int misc_init_r(void) get_mac_addr(addr); } - if (is_multicast_ethaddr(addr) || is_zero_ethaddr(addr)) { + if (!is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr)) { + sprintf((char *)tmp, "%02x:%02x:%02x:%02x:%02x:%02x", + addr[0], addr[1], addr[2], addr[3], addr[4], + addr[5]); + + setenv("ethaddr", (char *)tmp); + } else { printf("Invalid MAC address read.\n"); - return -EINVAL; } - sprintf((char *)tmp, "%02x:%02x:%02x:%02x:%02x:%02x", addr[0], - addr[1], addr[2], addr[3], addr[4], addr[5]); - - setenv("ethaddr", (char *)tmp); } + #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII /* Select RMII fucntion through the expander */ if (rmii_hw_init())