summaryrefslogtreecommitdiff
path: root/board/xilinx/common/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/xilinx/common/board.c')
-rw-r--r--board/xilinx/common/board.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
new file mode 100644
index 0000000000..7e813d8564
--- /dev/null
+++ b/board/xilinx/common/board.c
@@ -0,0 +1,25 @@
+// 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)
+{
+#if defined(CONFIG_ZYNQ_GEM_EEPROM_ADDR) && \
+ defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET) && \
+ defined(CONFIG_ZYNQ_EEPROM_BUS)
+ i2c_set_bus_num(CONFIG_ZYNQ_EEPROM_BUS);
+
+ if (eeprom_read(CONFIG_ZYNQ_GEM_EEPROM_ADDR,
+ CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET,
+ ethaddr, 6))
+ printf("I2C EEPROM MAC address read failed\n");
+#endif
+
+ return 0;
+}