From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: Marek Vasut <marex@nabladev.com>,
"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>,
Peng Fan <peng.fan@nxp.com>,
Sam Protsenko <semen.protsenko@linaro.org>,
Tom Rini <trini@konsulko.com>, u-boot <u-boot@dh-electronics.com>
Subject: RE: [PATCH] board: dhelectronics: imx: Use second Ethernet MAC also from fuse
Date: Tue, 31 Mar 2026 09:19:35 +0000 [thread overview]
Message-ID: <61267e12e816481bb7192bb0a5a7b752@dh-electronics.com> (raw)
In-Reply-To: <03fd5ca1-6581-4c50-8d50-2cfae6d98683@nabladev.com>
From: Marek Vasut <marex@nabladev.com>
Sent: Saturday, March 28, 2026 12:12 AM
> On 3/27/26 11:02 PM, Christoph Niedermaier wrote:
>> From: Marek Vasut <marex@nabladev.com>
>> Sent: Monday, March 23, 2026 6:21 PM
>>> On 3/23/26 5:49 PM, Christoph Niedermaier wrote:
>>>
>>> [...]
>>>
>>>>> As for the rest, it really boils down to the ordering of fallbacks, it
>>>>> is either:
>>>>>
>>>>> A)
>>>>> fuse1
>>>>> eeprom1
>>>>> fuse0+1
>>>>> eeprom0+1
>>>>>
>>>>> or
>>>>>
>>>>> B)
>>>>> fuse1
>>>>> fuse0+1
>>>>> eeprom1
>>>>> eeprom0+1
>>>>>
>>>>> The following ordering, which is the ordering introduced by this patch,
>>>>> is confusing:
>>>>>
>>>>> fuse1
>>>>> eeprom1
>>>>> eeprom0+1
>>>>> fuse0+1
>>>>>
>>>>> So please pick either A) or B) above. I do not see any particular
>>>>> advantage of either of the other, except maybe B) improves boot time in
>>>>> case both fuse blocks are blown, because it avoids the EEPROM I2C access.
>>>>
>>>> The prevention of I2C access is only a one time effect, because then the
>>>> MAC addresses will provided by the environment.
>>>
>>> Which increases the system boot time, which is undesired.
>>
>> If a customer sequentially fuse only the first MAC address from a MAC address
>> pool. Then the second MAC address of the SoM is the same MAC address as the MAC
>> address from the next SoM's first MAC address. That is very bad. With the A)
>> it can be avoided, because the second MAC address then is taken from the EEPROM.
>
> This edge case can be fixed on first boot in a boot script. Read out the
> fuse using "setexpr var *addr", detect whether the fuse is empty using
> "if test ...", and if it empty, then populate its content with EEPROM
> content. This saves you one extra I2C operation on every boot afterward.
With the right order all typical scenarios can be covered and also the
"edge case" is avoided.
>> If I had to choose between reducing the boot time once and preventing potential
>> duplicate MAC addresses, I would say that preventing potential duplicate MAC
>> addresses is the better option. Furthermore, the issue of duplicate MAC addresses
>> in the system is not a hypothetical scenario, it has already occurred in practice.
>>
>>>> If I remove the eeprom0+1, because it was for prototype configurations,
>>>> my preferred order would be:
>>>>
>>>> fuse1
>>>> eeprom1
>>>> fuse0+1
>>> eeprom0 can not be removed, that breaks backward compatibility. And the
>>> ordering of fuse-eeprom-fuse is confusing and has the boot time increase
>>> downside of A).
>>
>> For which SoM should backward compatibility be maintained here. There is
>> no SoM at the customer's site where it is required. For rev.200 the EEPROM
>> ID page is used, for rev.100 only some internal SoM prototypes with two
>> Ethernet interfaces had only the first EEPROM populated. It's not worth
>> keeping that code.
>
> So yes, eeprom0 can not be removed, because it also contains the WLP.
Will do this in V2.
>>> I would say B) is the way to go, it should also cover your requirements,
>>> keeps the boot time low if both fuse banks are fused (which can be fixed
>>> even on existing hardware, simply read out eeprom content and fuse it
>>> into fuse bank 1), and it retains the priority ordering (env, fuse,
>>> eeprom) without mixing it up.
>>
>> The case that only the first MAC address is fused and not the second one is
>> a special case, but if this happens, with the order A) above you can prevent
>> duplicate MAC addresses from appearing in the system. In addition, if you want
>> to fix it, it's dangerous to fuse the second MAC address at the customer's
>> location, because if something goes wrong during the fusing, the device must
>> be replaced on-site. This can also be avoided with order A).
> If this is a special case, then please convert it into a common case, so
> the generic code upstream can be kept that, generic.
>
> If this special case can not be converted to common case, then add local
> patch to handle that specific device.
I'll try to implement that in V2.
Regards
Christoph
next prev parent reply other threads:[~2026-03-31 9:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 10:29 [PATCH] board: dhelectronics: imx: Use second Ethernet MAC also from fuse Christoph Niedermaier
2026-03-20 13:41 ` Peng Fan (OSS)
2026-03-20 14:41 ` Christoph Niedermaier
2026-03-20 15:00 ` Peng Fan
2026-03-20 18:22 ` Marek Vasut
2026-03-21 20:55 ` Christoph Niedermaier
2026-03-21 23:40 ` Marek Vasut
2026-03-23 10:07 ` Christoph Niedermaier
2026-03-23 14:58 ` Marek Vasut
2026-03-23 16:49 ` Christoph Niedermaier
2026-03-23 17:20 ` Marek Vasut
2026-03-27 22:02 ` Christoph Niedermaier
2026-03-27 23:11 ` Marek Vasut
2026-03-31 9:19 ` Christoph Niedermaier [this message]
2026-03-23 17:34 ` Marek Vasut
2026-03-26 13:34 ` Christoph Niedermaier
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=61267e12e816481bb7192bb0a5a7b752@dh-electronics.com \
--to=cniedermaier@dh-electronics.com \
--cc=marex@nabladev.com \
--cc=patrice.chotard@foss.st.com \
--cc=peng.fan@nxp.com \
--cc=semen.protsenko@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@dh-electronics.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