All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Casanova <detlev.casanova@collabora.com>
To: u-boot@lists.denx.de, Marek Vasut <marek.vasut@mailbox.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>,
	Ramon Fried <rfried.dev@gmail.com>, Tom Rini <trini@konsulko.com>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Kever Yang <kever.yang@rock-chips.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Jonas Karlman <jonas@kwiboo.se>, Simon Glass <sjg@chromium.org>,
	Fabio Estevam <festevam@denx.de>
Subject: Re: [PATCH v2 1/3] net: eth-uclass: Introduce NET_PREFER_ROM_MAC_ADDR
Date: Tue, 23 Apr 2024 09:35:40 -0400	[thread overview]
Message-ID: <12429900.O9o76ZdvQC@arisu> (raw)
In-Reply-To: <38f2306f-4c82-4bc4-b2ee-6051dc55a4c2@mailbox.org>

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

On Monday, April 22, 2024 3:47:21 P.M. EDT Marek Vasut wrote:
> On 4/22/24 3:56 PM, Detlev Casanova wrote:
> > On some boards, a MAC address is set based on the CPU ID or other
> > information. This is usually done in the misc_init_r() function.
> > 
> > This becomes a problem for net devices that are probed after the call to
> > misc_init_r(), for example, when the ethernet is on a PCI port, which
> > needs to be enumerated.
> > 
> > In this case, misc_init_r() will set the ethaddr variable, then, when
> > the ethernet device is probed, if it has a ROM address, u-boot will warn
> > about a MAC address mismatch and use the misc_init_r() address instead
> > of the one in ROM.
> > 
> > The operating system later will most likely use the ROM MAC address,
> > which can be confusing.
> > 
> > To avoid that, this commit introduces NET_PREFER_ROM_MAC_ADDR that can
> > be set for boards that have such an interface.
> > 
> > Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> 
> Won't the system pick ROM MAC if $ethaddr is not set ?

Yes, and in the case of rockchip, misc_init_r() will set an $ethaddr based on 
the cpuid, which makes the eth driver use that instead of the ROM one.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-04-23 13:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 13:56 [PATCH v2 0/3] Introduce NET_PREFER_ROM_MAC_ADDR config Detlev Casanova
2024-04-22 13:56 ` [PATCH v2 1/3] net: eth-uclass: Introduce NET_PREFER_ROM_MAC_ADDR Detlev Casanova
2024-04-22 19:47   ` Marek Vasut
2024-04-23 13:35     ` Detlev Casanova [this message]
2024-04-23 13:44       ` Marek Vasut
2024-04-22 13:56 ` [PATCH v2 2/3] configs/rock5b: Set NET_PREFER_ROM_MAC_ADDR to y Detlev Casanova
2024-04-22 19:47   ` Marek Vasut
2024-04-22 13:56 ` [PATCH v2 3/3] net: eth-uclass: Add driver source possibility Detlev Casanova

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=12429900.O9o76ZdvQC@arisu \
    --to=detlev.casanova@collabora.com \
    --cc=festevam@denx.de \
    --cc=joe.hershberger@ni.com \
    --cc=jonas@kwiboo.se \
    --cc=kever.yang@rock-chips.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marek.vasut@mailbox.org \
    --cc=philipp.tomsich@vrull.eu \
    --cc=rfried.dev@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.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.