blob: 3d6487dd0d8c7d8757490c274c063268083bcb1f [file] [log] [blame]
Philip Oberfichtner62a09922022-07-26 15:04:50 +02001// 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 Rinidec7ea02024-05-20 13:35:03 -06007#include <linux/errno.h>
Philip Oberfichtner62a09922022-07-26 15:04:50 +02008#include <asm/arch/imx-regs.h>
9#include <asm/arch/sys_proto.h>
Philip Oberfichtner62a09922022-07-26 15:04:50 +020010#include <net.h>
11#include "dh_imx.h"
12
13int 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}