Philip Oberfichtner | 62a0992 | 2022-07-26 15:04:50 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright 2022 Marek Vasut <marex@denx.de> |
| 4 | * Copyright 2022 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de> |
| 5 | */ |
| 6 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 7 | #include <linux/errno.h> |
Philip Oberfichtner | 62a0992 | 2022-07-26 15:04:50 +0200 | [diff] [blame] | 8 | #include <asm/arch/imx-regs.h> |
| 9 | #include <asm/arch/sys_proto.h> |
Philip Oberfichtner | 62a0992 | 2022-07-26 15:04:50 +0200 | [diff] [blame] | 10 | #include <net.h> |
| 11 | #include "dh_imx.h" |
| 12 | |
| 13 | int dh_imx_get_mac_from_fuse(unsigned char *enetaddr) |
| 14 | { |
| 15 | /* |
| 16 | * If IIM fuses contain valid MAC address, use it. |
| 17 | * The IIM MAC address fuses are NOT programmed by default. |
| 18 | */ |
| 19 | imx_get_mac_from_fuse(0, enetaddr); |
| 20 | if (!is_valid_ethaddr(enetaddr)) |
| 21 | return -EINVAL; |
| 22 | |
| 23 | return 0; |
| 24 | } |