summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorFabio Estevam <festevam@denx.de>2023-04-26 13:04:58 -0300
committerStefano Babic <sbabic@denx.de>2023-05-02 10:57:32 +0200
commitea99d227f95f6849d5523e8d327b1805bb828254 (patch)
tree74d8d39456f3dc884aa64e056b8623a036d4e0f5 /board
parenta1bc4f1937a04e70f45f3ac87aee0f168b5e7bef (diff)
downloadu-boot-ea99d227f95f6849d5523e8d327b1805bb828254.tar.gz
smegw01: Read the second MAC address
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>
Diffstat (limited to 'board')
-rw-r--r--board/storopack/smegw01/smegw01.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/board/storopack/smegw01/smegw01.c b/board/storopack/smegw01/smegw01.c
index e648b196b9..20c09700bf 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;
}