| // SPDX-License-Identifier: GPL-2.0+ |
| * Peng Fan <peng.fan@nxp.com> |
| #include <asm/arch/imx-regs.h> |
| #include <asm/arch/sys_proto.h> |
| #define MAC_FUSE_MX6_OFFSET 0x620 |
| #define MAC_FUSE_MX7_OFFSET 0x640 |
| void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) |
| struct imx_mac_fuse *fuse; |
| offset = is_mx6() ? MAC_FUSE_MX6_OFFSET : MAC_FUSE_MX7_OFFSET; |
| fuse = (struct imx_mac_fuse *)(ulong)(OCOTP_BASE_ADDR + offset); |
| has_second_mac = is_mx7() || is_mx6sx() || is_mx6ul() || is_mx6ull(); |
| if (has_second_mac && dev_id == 1) { |
| u32 value = readl(&fuse->mac_addr2); |
| value = readl(&fuse->mac_addr1); |
| u32 value = readl(&fuse->mac_addr1); |
| value = readl(&fuse->mac_addr0); |