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>
9#include <common.h>
10#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}