Linux-Amlogic Archive mirror
 help / color / mirror / Atom feed
From: Christian Hewitt <christianshewitt@gmail.com>
To: u-boot@lists.denx.de, u-boot-amlogic@groups.io,
	linux-amlogic@lists.infradead.org
Subject: [PATCH v2 2/2] board: amlogic: add meson_generate_serial_ethaddr fallback to p200
Date: Sun, 24 Mar 2024 15:19:05 +0000	[thread overview]
Message-ID: <20240324151905.3817732-3-christianshewitt@gmail.com> (raw)
In-Reply-To: <20240324151905.3817732-1-christianshewitt@gmail.com>

Add a fall-back method to generate ethaddr from CPU serial on p200 boards
if the MAC cannot be read from efuse. This prevents random MAC addresses
on the WeTek Hub/Play2 boards.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 board/amlogic/p200/p200.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/amlogic/p200/p200.c b/board/amlogic/p200/p200.c
index 7c432f9d281..3061f7a6b3c 100644
--- a/board/amlogic/p200/p200.c
+++ b/board/amlogic/p200/p200.c
@@ -30,6 +30,8 @@ int misc_init_r(void)
 					  mac_addr, EFUSE_MAC_SIZE);
 		if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
 			eth_env_set_enetaddr("ethaddr", mac_addr);
+		else
+			meson_generate_serial_ethaddr();
 	}
 
 	if (!env_get("serial#")) {
-- 
2.34.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  parent reply	other threads:[~2024-03-24 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24 15:19 [PATCH v2 0/2] ARM: dts: fix Ethernet and random MAC's on WeTek Hub/Play2 Christian Hewitt
2024-03-24 15:19 ` [PATCH v2 1/2] ARM: dts: fix Ethernet " Christian Hewitt
2024-03-24 15:19 ` Christian Hewitt [this message]
2024-03-25  8:18 ` [PATCH v2 0/2] ARM: dts: fix Ethernet and random MAC's " Neil Armstrong

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=20240324151905.3817732-3-christianshewitt@gmail.com \
    --to=christianshewitt@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=u-boot-amlogic@groups.io \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).