All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sanjeev Premi <premi@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] omap3evm: Set environment variable 'ethaddr'
Date: Fri, 2 Sep 2011 18:13:53 +0530	[thread overview]
Message-ID: <1314967433-14199-1-git-send-email-premi@ti.com> (raw)

It is now responsibility of the board specific init
code to set the environment variable corresponding
to the MAC address.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---

 Tested on omap3evm at against latest master at:
 bd061a5 : Merge branch 'master' of git://git.denx.de/u-boot-sh

 board/ti/evm/evm.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 30c1c57..07db40c 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -216,7 +216,17 @@ int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
 #ifdef CONFIG_SMC911X
+	struct eth_device *dev;
+
 	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+
+	dev = eth_get_dev_by_index(0);
+	if (dev) {
+		eth_setenv_enetaddr("ethaddr", dev->enetaddr);
+	} else {
+		printf("omap3evm: Couldn't get eth device\n");
+		rc = -1;
+	}
 #endif
 	return rc;
 }
-- 
1.7.0.4

             reply	other threads:[~2011-09-02 12:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 12:43 Sanjeev Premi [this message]
2011-09-02 13:43 ` [U-Boot] [PATCH] omap3evm: Set environment variable 'ethaddr' Wolfgang Denk
2011-09-02 13:51   ` Premi, Sanjeev
2011-09-02 22:07     ` Wolfgang Denk
2011-09-03  7:28       ` Premi, Sanjeev

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=1314967433-14199-1-git-send-email-premi@ti.com \
    --to=premi@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.