mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-22 11:13:07 +00:00
386f921cee
This is a starting point for unifying duplicate code in the DH board files. The functions for setting up MAC addresses are very similar for the i.MX6, i.MX8 and stm32mp1 based boards. All pre-existing implementations follow the same logic: (1) Check if ethaddr is already set in the environment (2) If not, try to get it from a board specific location (e.g. fuse) (3) If not, try to get it from eeprom After this commit, (1) and (3) are implemented as common functions, ready to be used by board specific files. Furthermore there is an implementation of (2) for imx based boards. Signed-off-by: Philip Oberfichtner <pro@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
28 lines
799 B
C
28 lines
799 B
C
/* SPDX-License-Identifier: GPL-2.0+
|
|
*
|
|
* Copyright 2022 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
|
|
*/
|
|
|
|
/*
|
|
* dh_mac_is_in_env - Check if MAC address is already set
|
|
*
|
|
* @env: name of environment variable
|
|
* Return: true if MAC is set, false otherwise
|
|
*/
|
|
bool dh_mac_is_in_env(const char *env);
|
|
|
|
/*
|
|
* dh_get_mac_from_eeprom - Get MAC address from eeprom and write it to enetaddr
|
|
*
|
|
* @enetaddr: buffer where address is to be stored
|
|
* @alias: alias for EEPROM device tree node
|
|
* Return: 0 if OK, other value on error
|
|
*/
|
|
int dh_get_mac_from_eeprom(unsigned char *enetaddr, const char *alias);
|
|
|
|
/*
|
|
* dh_setup_mac_address - Try to get MAC address from various locations and write it to env
|
|
*
|
|
* Return: 0 if OK, other value on error
|
|
*/
|
|
int dh_setup_mac_address(void);
|