From: Michael Walle <michael@walle.cc>
To: u-boot@lists.denx.de
Subject: [PATCH v2] drivers: net: fsl_enetc: Pass on primary MAC address to Linux
Date: Wed, 11 Dec 2019 14:16:45 +0100 [thread overview]
Message-ID: <4eaa684f1752316eec333ee1743c7537@walle.cc> (raw)
In-Reply-To: <CA+h21hpH6PZnT9L4FuGEBiivSZ4duJv-sWn3qJHKU5T6jDiUUw@mail.gmail.com>
Hi Vladimir,
Am 2019-12-11 13:46, schrieb Vladimir Oltean:
> Hi Michael,
>
> On Wed, 11 Dec 2019 at 00:48, Michael Walle <michael@walle.cc> wrote:
>>
>> Am 2019-12-10 15:55, schrieb Alex Marginean:
>> > Passes on the primary address used by u-boot to Linux. The code does a
>> > DT
>> > fix-up for ENETC PFs and sets the primary MAC address in IERB. The
>> > address
>> > in IERB is restored on ENETC PCI functions at FLR.
>>
>>
>> I don't get the reason why this is done in a proprietary way. What is
>> the
>> difference between any other network interface whose hardware address
>> is
>> set up in the generic u-boot code.
>>
>> Also, shouldn't write_hwaddr callback be implemented instead of the
>> enetc_set_ierb_primary_mac()?
>>
>
> At the moment, the Linux driver ignored the device tree and only reads
> the POR values of the SIPMAR registers. The reset value of those comes
> from the IERB space, which U-Boot is configuring. So it would be good
> if that behavior keeps working.
>
> It would also be good if the Linux driver called of_get_mac_address,
> so it needs the device tree binding for that. That's why both fixups
> are performed, and why the generic function is not used.
yes, but u-boot already sets the mac-address/local-mac-address property
in the device tree already in a generic way, see fdt_fixup_ethernet().
> As for the write_hwaddr callback instead of
> enetc_set_primary_mac_addr, that is valid but I suppose it is outside
> the scope of this patch. That function is related to the runtime MAC
> address and not to the MAC passed to Linux.
according to the comment in eth-uclass.c this is not for (u-boot)
runtime:
/*
* Devices need to write the hwaddr even if not started so that Linux
* will have access to the hwaddr that u-boot stored for the device.
* This is accomplished by attempting to probe each device and calling
* their write_hwaddr() operation.
*/
and the runtime mac address for u-boot is already set enetc_start().
-michael
next prev parent reply other threads:[~2019-12-11 13:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 14:55 [PATCH v2] drivers: net: fsl_enetc: Pass on primary MAC address to Linux Alex Marginean
2019-12-10 22:47 ` Michael Walle
2019-12-11 12:46 ` Vladimir Oltean
2019-12-11 13:16 ` Michael Walle [this message]
2019-12-11 15:37 ` Alexandru Marginean
2019-12-11 17:03 ` Michael Walle
2019-12-11 21:01 ` Alexandru Marginean
2019-12-12 12:12 ` Michael Walle
2019-12-12 14:16 ` Alexandru Marginean
2019-12-11 13:04 ` Alexandru Marginean
2019-12-11 13:20 ` Michael Walle
2020-01-27 6:02 ` Priyanka Jain
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=4eaa684f1752316eec333ee1743c7537@walle.cc \
--to=michael@walle.cc \
--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