public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use	dev->enetaddr as fall back
Date: Tue, 17 Jan 2012 17:17:41 +0100	[thread overview]
Message-ID: <4F159F25.50308@de.bosch.com> (raw)
In-Reply-To: <20120117095251.D480117133E4@gemini.denx.de>

Dear Wolfgang and all,

On 17.01.2012 10:52, Wolfgang Denk wrote:
> Dear Zach Sadecki,
> 
> In message <4F149CCB.6070307@itwatchdogs.com> you wrote:
>> This patch will also fix a problem with mx28 boards that are depending 
>> on the OCOTP bits to set the MAC address (like the Denx m28 board).  Now 
>> it simply fails with a "Warning: failed to set MAC address" if there's 
>> no environment variable instead of using the OCOTP bits like it should.  
>> This patch will fix that.
> 
> But there _should_ always be a warning message if the environment
> variable is missing.

Let's see if I can summarize the issue:

If I understood correctly, we are talking about

http://git.denx.de/?p=u-boot.git;a=commitdiff;h=7616e7850804c7c69e0a22c179dfcba9e8f3f587

and there

int eth_initialize(bd_t *bis)
{
...
-  eth_getenv_enetaddr_by_index(eth_number, env_enetaddr);

versus

+int eth_write_hwaddr(...)
+{
...
+ if (!eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr))
+   return -1;

I.e. the unconditional call of eth_getenv_enetaddr_by_index() was
replaced by a return -1 if the environment variable is missing
(resulting in "Warning: failed to set MAC address"? Btw: That's wrong?
It should be "Warning: failed to get MAC address from the environment"?)


Now, Eric's patch [1] (which needs an update of the commit message, 
sure, but was acked by the author of the original patch [2]) tries to 
re-introduce the original behavior:

+ eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);

So, what I understand for i.MXxx, Zach and Eric are talking about:

If the environment variable is missing, the system can use the OCOTP
bits to set the MAC address. If the return -1 is removed by using Eric's
patch.

And for overo:

 From Philip's mail, on an overo based product that uses the SMSC911x
ethernet chip, if the environment variable is missing, the MAC address
is set via EEPROM connected to the SMSC911x chip.


I.e. on these systems, with Eric's patch, we get a correct MAC address,
even if the environment variable is missing. This sounds like a good 
option (?).

The question is then: Do we want a "Warning: failed to set MAC address"
message, even if the MAC is set correctly? But not from the environment
variable, but somehow read from the HW?

I know you will correct what I missed in this summary ;)

Best regards

Dirk

[1] http://lists.denx.de/pipermail/u-boot/2011-August/098686.html

[2] http://lists.denx.de/pipermail/u-boot/2011-August/098690.html

  reply	other threads:[~2012-01-17 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16 21:55 [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back Zach Sadecki
2012-01-17  9:52 ` Wolfgang Denk
2012-01-17 16:17   ` Dirk Behme [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-17  5:33 Eric Miao
2011-08-17  6:22 ` Simon Glass
2012-01-11 12:23   ` Dirk Behme
2012-01-12  5:12     ` Simon Glass
2012-01-12  7:48       ` Stefan Roese
2012-01-12  7:55 ` Stefan Roese
2012-01-13 19:19 ` Wolfgang Denk
2012-01-16  7:03   ` Eric Miao
2012-01-16  7:08     ` Eric Miao
2012-01-16 14:08   ` Philip Balister
2012-01-16 16:00     ` Wolfgang Denk

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=4F159F25.50308@de.bosch.com \
    --to=dirk.behme@de.bosch.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