1 // SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/imx-regs.h>
11 #include <asm/arch/sys_proto.h>
23 #define MAC_FUSE_MX6_OFFSET 0x620
24 #define MAC_FUSE_MX7_OFFSET 0x640
26 void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
28 struct imx_mac_fuse *fuse;
32 offset = is_mx6() ? MAC_FUSE_MX6_OFFSET : MAC_FUSE_MX7_OFFSET;
33 fuse = (struct imx_mac_fuse *)(ulong)(OCOTP_BASE_ADDR + offset);
34 has_second_mac = is_mx7() || is_mx6sx() || is_mx6ul() || is_mx6ull() || is_imx8mp();
36 if (has_second_mac && dev_id == 1) {
37 u32 value = readl(&fuse->mac_addr2);
44 value = readl(&fuse->mac_addr1);
49 u32 value = readl(&fuse->mac_addr1);
54 value = readl(&fuse->mac_addr0);