[U-Boot] [PATCH 2/4] arm: pxa: always init ethaddr for LP-8x4x
Marek Vasut
marex at denx.de
Sat Dec 14 18:12:14 CET 2013
On Saturday, December 14, 2013 at 04:39:00 PM, Sergei Ianovich wrote:
> On Sat, 2013-12-14 at 13:30 +0100, Marek Vasut wrote:
> > On Saturday, December 14, 2013 at 06:41:58 AM, Sergei Ianovich wrote:
> > > I always used tftp in my test, so the first dm9000 on LP-8x4x was
> > > always properly initialized. However, if the boot doesn't include
> > > network related commands, linux will not find a valid MAC and will
> > > complain.
> >
> > Please pass the ethernet address via DT, will that not work for you ?
>
> This will require a custom dtb object for every device recompiled every
> time kernel is upgraded. The current way is to set once per device in
> U-Boot environment variable, which doesn't need to change if kernel
> changes.
>
> I strongly believe the current way is easier.
I disagree :)
IF you set 'ethaddr' variable in U-Boot THEN
U-Boot will patch this 'ethaddr' value into your DT. The /aliases/ethernet0
node will be augmented with a new property 'local-mac-address', which will
contain the MAC address from 'ethaddr' . The kernel will use this as the MAC
address for that particular ethernet interface afterwards.
NOTE: It is very important to have the alias set, it has to point to your
ethernet device. A good example in Linux's arch/arm/boot/dts/imx28.dtsi, which
even has two ethernet interfaces. Notice each of them has an alias.
NOTE: If you have two interfaces, then 'eth1addr' is patches into
/aliases/ethernet1 etc.
The only problem here is the non-DT kernel. Do you need to support that? Is
there no other way to pass MAC address of an ethernet interface to Linux but
programming it into the ethernet interface itself ?
Best regards,
Marek Vasut
More information about the U-Boot
mailing list