1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
8 #include <environment.h>
9 #include <i2c_eeprom.h>
12 static int get_ethaddr_from_eeprom(u8 *addr)
17 ret = uclass_first_device_err(UCLASS_I2C_EEPROM, &dev);
21 return i2c_eeprom_read(dev, 0, addr, 6);
24 int rk_board_late_init(void)
28 if (get_ethaddr_from_eeprom(ethaddr))
31 if (is_valid_ethaddr(ethaddr))
32 eth_env_set_enetaddr("ethaddr", ethaddr);