~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 7f451bad59c7f8b6cd0ee5b194b60e1acadbaccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2022 Marek Vasut <marex@denx.de>
 * Copyright 2022 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
 */

#include <asm/arch/imx-regs.h>
#include <asm/arch/sys_proto.h>
#include <common.h>
#include <net.h>
#include "dh_imx.h"

int dh_imx_get_mac_from_fuse(unsigned char *enetaddr)
{
	/*
	 * If IIM fuses contain valid MAC address, use it.
	 * The IIM MAC address fuses are NOT programmed by default.
	 */
	imx_get_mac_from_fuse(0, enetaddr);
	if (!is_valid_ethaddr(enetaddr))
		return -EINVAL;

	return 0;
}