blob: 7f451bad59c7f8b6cd0ee5b194b60e1acadbaccd [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
7#include <asm/arch/imx-regs.h>
8#include <asm/arch/sys_proto.h>
Tom Riniabb9a042024-05-18 20:20:43 -06009#include <common.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}