summaryrefslogtreecommitdiff
path: root/board/dhelectronics/common/dh_imx.h
diff options
context:
space:
mode:
authorPhilip Oberfichtner <pro@denx.de>2022-07-26 15:04:50 +0200
committerTom Rini <trini@konsulko.com>2022-08-12 16:10:49 -0400
commit386f921cee3de9200bdd920cccd72fb3bc9a262a (patch)
tree8b75955275b042bf37f5f4e7c475e0cc832f6409 /board/dhelectronics/common/dh_imx.h
parent24291741f660d058573089d5e83e2f8aefc4661f (diff)
board: dhelectronics: Implement common MAC address functions
This is a starting point for unifying duplicate code in the DH board files. The functions for setting up MAC addresses are very similar for the i.MX6, i.MX8 and stm32mp1 based boards. All pre-existing implementations follow the same logic: (1) Check if ethaddr is already set in the environment (2) If not, try to get it from a board specific location (e.g. fuse) (3) If not, try to get it from eeprom After this commit, (1) and (3) are implemented as common functions, ready to be used by board specific files. Furthermore there is an implementation of (2) for imx based boards. Signed-off-by: Philip Oberfichtner <pro@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'board/dhelectronics/common/dh_imx.h')
-rw-r--r--board/dhelectronics/common/dh_imx.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/board/dhelectronics/common/dh_imx.h b/board/dhelectronics/common/dh_imx.h
new file mode 100644
index 00000000000..284f8637fb8
--- /dev/null
+++ b/board/dhelectronics/common/dh_imx.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright 2022 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
+ */
+
+/*
+ * dh_imx_get_mac_from_fuse - Get MAC address from fuse and write it to env
+ *
+ * @enetaddr: buffer where address is to be stored
+ * Return: 0 if OK, other value on error
+ */
+int dh_imx_get_mac_from_fuse(unsigned char *enetaddr);