From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/3] ARM: boards: Add MyirTech MYD-YA15XC-T development board support
Date: Thu, 31 Aug 2023 12:41:24 +0300 [thread overview]
Message-ID: <CAP1tNvQAWvbFSYe1MPa7f7RRB5PDOFP1EVvNF+ma3+dM5jPSdg@mail.gmail.com> (raw)
In-Reply-To: <aa20d72f-8cb6-7b51-9ae6-2f8d15d6c690@pengutronix.de>
> > +struct id_eeprom {
> > + u8 hrcw_primary[0x10];
> > + u8 pn[64];
> > + u8 sn[64];
> > + u8 mac0[6];
> > + u8 mac1[6];
> > +} __packed;
>
> You could describe this as nvmem-cells in the DT and you'd automatically
> get the MAC addresses assigned.
...
> > + if (!is_valid_ether_addr(eeprom.mac0)) {
> > + int i, j;
> > +
> > + /* Make fixed MAC-address based on serial number */
> > + memcpy(eeprom.mac0, str, sizeof(eeprom.mac0));
> > + for (i = sizeof(eeprom.mac0); i < len; i++)
> > + for (j = 0; j < sizeof(eeprom.mac0); j++)
> > + eeprom.mac0[j] ^= str[i];
> > + }
> > +
> > + eth_register_ethaddr(0, eeprom.mac0);
> You could check if the nvmem cell exists and only do the fixup
> if it doesn't. Check Marco's recent Debix patches for an example
> of how to call nvmem from board code.
I can't find a way to know if an MAC address that was automatically
assigned via nvmem is valid.
So in this case we always need to use eth_register_ethaddr() manually?
next prev parent reply other threads:[~2023-08-31 9:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 10:47 [PATCH 1/3] memory: Add driver for FMC2 External Bus Interface on STM32MP SoCs Alexander Shiyan
2023-08-30 10:47 ` [PATCH 2/3] mtd: nand: Add driver for NAND controller " Alexander Shiyan
2023-08-30 10:47 ` [PATCH 3/3] ARM: boards: Add MyirTech MYD-YA15XC-T development board support Alexander Shiyan
2023-08-30 14:41 ` Ahmad Fatoum
2023-08-31 6:40 ` Alexander Shiyan
2023-09-04 7:17 ` Sascha Hauer
2023-08-31 9:41 ` Alexander Shiyan [this message]
2023-09-05 8:25 ` Ahmad Fatoum
2023-09-11 16:01 ` Ahmad Fatoum
2023-09-11 16:09 ` Ahmad Fatoum
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=CAP1tNvQAWvbFSYe1MPa7f7RRB5PDOFP1EVvNF+ma3+dM5jPSdg@mail.gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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