[U-Boot] [PATCH 2/4] arm: zynq: migrate EEPROM MAC address options to kconfig

Luis Araneda luaraneda at gmail.com
Mon Jul 9 05:00:04 UTC 2018


Migrate boards to use the generic kconfig options to
read the MAC address

Signed-off-by: Luis Araneda <luaraneda at gmail.com>
---
 board/xilinx/zynq/board.c    | 7 +++----
 configs/syzygy_hub_defconfig | 4 +++-
 configs/zynq_zybo_defconfig  | 4 +++-
 include/configs/syzygy_hub.h | 1 -
 include/configs/zynq_zybo.h  | 1 -
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 1106f5c2a8..dcbf788918 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -75,10 +75,9 @@ int board_late_init(void)
 
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 {
-#if defined(CONFIG_ZYNQ_GEM_EEPROM_ADDR) && \
-    defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
-	if (eeprom_read(CONFIG_ZYNQ_GEM_EEPROM_ADDR,
-			CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET,
+#if defined(CONFIG_MAC_ADDR_IN_I2C_EEPROM)
+	if (eeprom_read(CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR,
+			CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START,
 			ethaddr, 6))
 		printf("I2C EEPROM MAC address read failed\n");
 #endif
diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig
index 6fb56afbe9..221349ba6f 100644
--- a/configs/syzygy_hub_defconfig
+++ b/configs/syzygy_hub_defconfig
@@ -39,7 +39,9 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_SYS_I2C_ZYNQ=y
 CONFIG_ZYNQ_I2C1=y
-CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA
+CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
+CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x57
+CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_PHY_MARVELL=y
diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
index 3dfc62162f..03958f399d 100644
--- a/configs/zynq_zybo_defconfig
+++ b/configs/zynq_zybo_defconfig
@@ -46,7 +46,9 @@ CONFIG_DM_GPIO=y
 CONFIG_SYS_I2C_ZYNQ=y
 CONFIG_ZYNQ_I2C0=y
 CONFIG_ZYNQ_I2C1=y
-CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA
+CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
+CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x50
+CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h
index 88ee772848..17938398c2 100644
--- a/include/configs/syzygy_hub.h
+++ b/include/configs/syzygy_hub.h
@@ -11,7 +11,6 @@
 #define __CONFIG_SYZYGY_HUB_H
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-#define CONFIG_ZYNQ_GEM_EEPROM_ADDR    0x57
 
 #define CONFIG_EXTRA_ENV_SETTINGS       \
 	"fit_image=fit.itb\0"		\
diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
index 547ecb68fd..c3abf41f76 100644
--- a/include/configs/zynq_zybo.h
+++ b/include/configs/zynq_zybo.h
@@ -11,7 +11,6 @@
 #define __CONFIG_ZYNQ_ZYBO_H
 
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
-#define CONFIG_ZYNQ_GEM_EEPROM_ADDR	0x50
 #define CONFIG_DISPLAY
 #define CONFIG_I2C_EDID
 
-- 
2.18.0



More information about the U-Boot mailing list