U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien Parent <fparent@baylibre.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] davinci: omapl138_lcdk: keep booting even when MAC address is invalid
Date: Thu, 10 Nov 2016 17:16:35 +0100	[thread overview]
Message-ID: <20161110161635.7275-1-fparent@baylibre.com> (raw)

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 <fparent@baylibre.com>
---
 board/davinci/da8xxevm/omapl138_lcdk.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

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())
-- 
2.10.2

             reply	other threads:[~2016-11-10 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 16:16 Fabien Parent [this message]
2016-11-10 19:11 ` [U-Boot] [PATCH] davinci: omapl138_lcdk: keep booting even when MAC address is invalid Tom Rini
2016-11-13 20:59 ` [U-Boot] " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161110161635.7275-1-fparent@baylibre.com \
    --to=fparent@baylibre.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox