summaryrefslogtreecommitdiff
path: root/board/dhelectronics/common/dh_imx.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-08-12 21:39:15 -0400
committerTom Rini <trini@konsulko.com>2022-08-12 21:41:07 -0400
commit8f9eee8275cf475f6d9435e85aa2d04b61b3cd75 (patch)
tree1e09bcb44c8e3bc72f3a8315616ec49057e3e49d /board/dhelectronics/common/dh_imx.c
parent6fc212779c990ff27a430e370bfb8fac01ddde7f (diff)
parentecf1d2741d95f5f84e31dc1d0bef149d8ff1f0a3 (diff)
Merge branch '2022-08-12-assorted-updates'
- Clean up some code with the DH electronics boards, remove a few boards that have had their removal ack'd, update Azure CI hosts for macOS and Ubuntu, and migrate a few more symbols to Kconfig.
Diffstat (limited to 'board/dhelectronics/common/dh_imx.c')
-rw-r--r--board/dhelectronics/common/dh_imx.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/dhelectronics/common/dh_imx.c b/board/dhelectronics/common/dh_imx.c
new file mode 100644
index 00000000000..7f451bad59c
--- /dev/null
+++ b/board/dhelectronics/common/dh_imx.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2022 Marek Vasut <marex@denx.de>
+ * Copyright 2022 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
+ */
+
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
+#include <common.h>
+#include <net.h>
+#include "dh_imx.h"
+
+int dh_imx_get_mac_from_fuse(unsigned char *enetaddr)
+{
+ /*
+ * If IIM fuses contain valid MAC address, use it.
+ * The IIM MAC address fuses are NOT programmed by default.
+ */
+ imx_get_mac_from_fuse(0, enetaddr);
+ if (!is_valid_ethaddr(enetaddr))
+ return -EINVAL;
+
+ return 0;
+}