diff --git a/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c b/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c
index 8676c44..6f06daf 100644
--- a/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c
+++ b/board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c
@@ -16,6 +16,8 @@
 #include <miiphy.h>
 
 #include "lpddr4_timing.h"
+#include "../common/dh_common.h"
+#include "../common/dh_imx.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -75,95 +77,68 @@
 	set_clk_enet(ENET_125MHZ);
 }
 
-static int setup_mac_address_from_eeprom(char *alias, char *env, bool odd)
+static int dh_imx8_setup_ethaddr(void)
 {
 	unsigned char enetaddr[6];
-	struct udevice *dev;
-	int ret, offset;
 
-	offset = fdt_path_offset(gd->fdt_blob, alias);
-	if (offset < 0) {
-		printf("%s: No eeprom0 path offset\n", __func__);
-		return offset;
-	}
+	if (dh_mac_is_in_env("ethaddr"))
+		return 0;
 
-	ret = uclass_get_device_by_of_offset(UCLASS_I2C_EEPROM, offset, &dev);
-	if (ret) {
-		printf("Cannot find EEPROM!\n");
-		return ret;
-	}
+	if (!dh_imx_get_mac_from_fuse(enetaddr))
+		goto out;
 
-	ret = i2c_eeprom_read(dev, 0xfa, enetaddr, 0x6);
-	if (ret) {
-		printf("Error reading configuration EEPROM!\n");
-		return ret;
-	}
+	if (!dh_get_mac_from_eeprom(enetaddr, "eeprom0"))
+		goto out;
+
+	return -ENXIO;
+
+out:
+	return eth_env_set_enetaddr("ethaddr", enetaddr);
+}
+
+static int dh_imx8_setup_eth1addr(void)
+{
+	unsigned char enetaddr[6];
+
+	if (dh_mac_is_in_env("eth1addr"))
+		return 0;
+
+	if (!dh_imx_get_mac_from_fuse(enetaddr))
+		goto increment_out;
+
+	if (!dh_get_mac_from_eeprom(enetaddr, "eeprom1"))
+		goto out;
 
 	/*
 	 * Populate second ethernet MAC from first ethernet EEPROM with MAC
 	 * address LSByte incremented by 1. This is only used on SoMs without
 	 * second ethernet EEPROM, i.e. early prototypes.
 	 */
-	if (odd)
-		enetaddr[5]++;
+	if (!dh_get_mac_from_eeprom(enetaddr, "eeprom0"))
+		goto increment_out;
 
-	eth_env_set_enetaddr(env, enetaddr);
+	return -ENXIO;
 
-	return 0;
+increment_out:
+	enetaddr[5]++;
+
+out:
+	return eth_env_set_enetaddr("eth1addr", enetaddr);
 }
 
-static void setup_mac_address(void)
+int dh_setup_mac_address(void)
 {
-	unsigned char enetaddr[6];
-	bool skip_eth0 = false;
-	bool skip_eth1 = false;
 	int ret;
 
-	ret = eth_env_get_enetaddr("ethaddr", enetaddr);
-	if (ret)	/* ethaddr is already set */
-		skip_eth0 = true;
-
-	ret = eth_env_get_enetaddr("eth1addr", enetaddr);
-	if (ret)	/* eth1addr is already set */
-		skip_eth1 = true;
+	ret = dh_imx8_setup_ethaddr();
+	if (ret)
+		printf("%s: Unable to setup ethaddr! ret = %d\n", __func__, ret);
 
-	/* Both MAC addresses are already set in U-Boot environment. */
-	if (skip_eth0 && skip_eth1)
-		return;
+	ret = dh_imx8_setup_eth1addr();
+	if (ret)
+		printf("%s: Unable to setup eth1addr! ret = %d\n", __func__, ret);
 
-	/*
-	 * 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)) {
-		if (!skip_eth0)
-			eth_env_set_enetaddr("ethaddr", enetaddr);
-		/*
-		 * The LSbit of MAC address in fuses is always 0, use the
-		 * next consecutive MAC address for the second ethernet.
-		 */
-		enetaddr[5]++;
-		if (!skip_eth1)
-			eth_env_set_enetaddr("eth1addr", enetaddr);
-		return;
-	}
-
-	/* Use on-SoM EEPROMs with pre-programmed MAC address. */
-	if (!skip_eth0) {
-		/* We cannot do much more if this returns -ve . */
-		setup_mac_address_from_eeprom("eeprom0", "ethaddr", false);
-	}
-
-	if (!skip_eth1) {
-		ret = setup_mac_address_from_eeprom("eeprom1", "eth1addr",
-						    false);
-		if (ret) {	/* Second EEPROM might not be populated. */
-			/* We cannot do much more if this returns -ve . */
-			setup_mac_address_from_eeprom("eeprom0", "eth1addr",
-						      true);
-		}
-	}
+	return ret;
 }
 
 int board_init(void)
@@ -176,7 +151,7 @@
 
 int board_late_init(void)
 {
-	setup_mac_address();
+	dh_setup_mac_address();
 	return 0;
 }
 
