diff options
author | Tom Rini <trini@konsulko.com> | 2019-02-15 21:21:28 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-02-15 21:21:28 -0500 |
commit | d391c13c99a2b48c98cef6df4479247cd4e62f9d (patch) | |
tree | 6e5c9790db8a4743cc74f1de52c549bc0dcc006b /board/xilinx/common/board.c | |
parent | e35171e94efdd0fa6c63083a682d452a2403bea1 (diff) | |
parent | 91d7e0c47f51e73cd8357f023ffc7c217a3c7291 (diff) |
Merge tag 'xilinx-for-v2019.04-rc2' of git://git.denx.de/u-boot-microblaze
Xilinx changes for v2019.04-rc2
xilinx:
- Start to use distro boot commands first
- Setup fdtfile on ZynqMP
- Move mac addr eeprom read to common location
- Convert to OF_SEPARATE
- Switch all board to DM_I2C
- Some DT syncs
i2c:
- Remove !DM_I2C zynq driver
versal:
- Enable some more features
- Add mini configurations
Diffstat (limited to 'board/xilinx/common/board.c')
-rw-r--r-- | board/xilinx/common/board.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c new file mode 100644 index 0000000000..7e6340bad6 --- /dev/null +++ b/board/xilinx/common/board.c @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2014 - 2019 Xilinx, Inc. + * Michal Simek <michal.simek@xilinx.com> + */ + +#include <common.h> +#include <dm/uclass.h> +#include <i2c.h> + +int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) +{ + int ret = -EINVAL; + +#if defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET) + struct udevice *dev; + ofnode eeprom; + + eeprom = ofnode_get_chosen_node("xlnx,eeprom"); + if (!ofnode_valid(eeprom)) + return -ENODEV; + + debug("%s: Path to EEPROM %s\n", __func__, + ofnode_get_chosen_prop("xlnx,eeprom")); + + ret = uclass_get_device_by_ofnode(UCLASS_I2C_EEPROM, eeprom, &dev); + if (ret) + return ret; + + ret = dm_i2c_read(dev, CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET, ethaddr, 6); + if (ret) + debug("%s: I2C EEPROM MAC address read failed\n", __func__); + else + debug("%s: I2C EEPROM MAC %pM\n", __func__, ethaddr); +#endif + + return ret; +} |