From: Fabio Estevam <festevam@gmail.com>
To: sbabic@denx.de
Cc: eduard@lionizers.com, u-boot@lists.denx.de,
Fabio Estevam <festevam@denx.de>
Subject: [PATCH v2 11/13] smegw01: Read the second MAC address
Date: Fri, 21 Apr 2023 07:56:54 -0300 [thread overview]
Message-ID: <20230421105656.1062558-11-festevam@gmail.com> (raw)
In-Reply-To: <20230421105656.1062558-1-festevam@gmail.com>
From: Fabio Estevam <festevam@denx.de>
Currently, only the first MAC address is read from the fuses.
The second MAC address is not read and Linux assigns a random one.
To prevent this behavior, read the second MAC address from the fuses
and store it into the eth1addr environment variable so that it
can be passed to Linux.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v1:
- Fixed typo in the Subject "smegw01".
board/storopack/smegw01/smegw01.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/board/storopack/smegw01/smegw01.c b/board/storopack/smegw01/smegw01.c
index e786429476..605253ead3 100644
--- a/board/storopack/smegw01/smegw01.c
+++ b/board/storopack/smegw01/smegw01.c
@@ -82,6 +82,7 @@ int board_init(void)
int board_late_init(void)
{
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
+ unsigned char eth1addr[6];
imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
@@ -93,6 +94,11 @@ int board_late_init(void)
*/
clrsetbits_le16(&wdog->wcr, 0, 0x10);
+ /* Get the second MAC address */
+ imx_get_mac_from_fuse(1, eth1addr);
+ if (!env_get("eth1addr") && is_valid_ethaddr(eth1addr))
+ eth_env_set_enetaddr("eth1addr", eth1addr);
+
return 0;
}
--
2.38.1
next prev parent reply other threads:[~2023-04-21 10:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 10:56 [PATCH v2 01/13] smegw01: Enable setting additional boot params Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 02/13] smegw01: Select CONFIG_CMD_SQUASHFS Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 03/13] smegw01: Select bootcount support Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 04/13] smegw01: Add altbootcmd Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 05/13] smegw01: Run altbootcmd in the case of failure Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 06/13] smegw01: Only commit to new partition if update was successful Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 7/7] smegw01: Enable EMMC boot from multiple partitions Fabio Estevam
2023-04-21 18:10 ` Pali Rohár
2023-04-24 11:09 ` Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 08/13] smegw01: Change default boot device to eMMC Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 09/13] smegw01: Switch to fitImage Fabio Estevam
2023-04-21 10:56 ` [PATCH v2 10/13] smegw01: Add lockdown U-Boot env support Fabio Estevam
2023-04-21 10:56 ` Fabio Estevam [this message]
2023-04-21 10:56 ` [PATCH v2 12/13] smegw01: Disable additional boot menu options Fabio Estevam
2023-04-21 10:56 ` [PATCH 13/13] smegw01: Fix fallback to altbootcmd Fabio Estevam
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=20230421105656.1062558-11-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=eduard@lionizers.com \
--cc=festevam@denx.de \
--cc=sbabic@denx.de \
--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