u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Derald D. Woods <woods.technical@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] ARM: omap3: evm: Refactor 'board_eth_init'
Date: Sat, 16 Dec 2017 14:14:50 -0600	[thread overview]
Message-ID: <20171216201450.5770-4-woods.technical@gmail.com> (raw)
In-Reply-To: <20171216201450.5770-1-woods.technical@gmail.com>

This commit clears 'ethaddr' before calling 'smc911x_initialize' to
allow the SROM MAC address to be assigned properly.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
---
 board/ti/evm/evm.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 4d5ddff1e1..3a9680ffec 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -299,26 +299,12 @@ static void reset_net_chip(void)
 
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
 #if defined(CONFIG_SMC911X)
-#define STR_ENV_ETHADDR	"ethaddr"
-
-	struct eth_device *dev;
-	uchar eth_addr[6];
-
-	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
-
-	if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
-		dev = eth_get_dev_by_index(0);
-		if (dev) {
-			eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
-		} else {
-			printf("omap3evm: Couldn't get eth device\n");
-			rc = -1;
-		}
-	}
-#endif /* CONFIG_SMC911X */
-	return rc;
+	env_set("ethaddr", NULL);
+	return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#else
+	return 0;
+#endif
 }
 #endif /* CONFIG_CMD_NET */
 
-- 
2.15.1

  parent reply	other threads:[~2017-12-16 20:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-16 20:14 [U-Boot] [PATCH 0/3] ARM: omap3: evm: Add OF_CONTROL support Derald D. Woods
2017-12-16 20:14 ` [U-Boot] [PATCH 1/3] ARM: dts: omap3-evm: Add support for TMDSEVM{3530, 3730} Derald D. Woods
2018-01-02  0:47   ` [U-Boot] [U-Boot, " Tom Rini
2017-12-16 20:14 ` [U-Boot] [PATCH 2/3] ARM: dts: omap3-evm: Enable DM and devicetree " Derald D. Woods
2017-12-17  2:36   ` Derald D. Woods
2017-12-27 13:15     ` [U-Boot] [U-Boot, " Tom Rini
2017-12-27 15:22       ` Derald D. Woods
2017-12-27 15:37     ` [U-Boot] [PATCH v3 " Derald D. Woods
2017-12-27 15:40       ` [U-Boot] [PATCH v4 " Derald D. Woods
2018-01-02  0:47         ` [U-Boot] [U-Boot, v4, " Tom Rini
2017-12-16 20:14 ` Derald D. Woods [this message]
2018-01-02  0:47   ` [U-Boot] [U-Boot, 3/3] ARM: omap3: evm: Refactor 'board_eth_init' Tom Rini
2017-12-26  3:34 ` [U-Boot] [PATCH 0/3] ARM: omap3: evm: Add OF_CONTROL support Derald D. Woods
2017-12-26 16:14   ` Tom Rini
2017-12-26 17:08     ` Derald D. Woods

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=20171216201450.5770-4-woods.technical@gmail.com \
    --to=woods.technical@gmail.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;
as well as URLs for NNTP newsgroup(s).