
Migrate boards to use the generic kconfig options to read the MAC address
Additionally, remove the ZYNQ_GEM_I2C_MAC_OFFSET kconfig option, since no boards is using it now
Signed-off-by: Luis Araneda luaraneda@gmail.com --- board/xilinx/zynqmp/zynqmp.c | 10 ++++------ configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 5 ++++- configs/xilinx_zynqmp_zcu102_revA_defconfig | 5 ++++- configs/xilinx_zynqmp_zcu102_revB_defconfig | 5 ++++- configs/xilinx_zynqmp_zcu106_revA_defconfig | 5 ++++- configs/xilinx_zynqmp_zcu111_revA_defconfig | 5 ++++- drivers/misc/Kconfig | 6 ------ include/configs/xilinx_zynqmp_zcu102.h | 2 -- include/configs/xilinx_zynqmp_zcu106.h | 2 -- include/configs/xilinx_zynqmp_zcu111.h | 2 -- 10 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 81c10fcf8a..1f7b3a4c48 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -372,13 +372,11 @@ int board_early_init_r(void)
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 defined(CONFIG_MAC_ADDR_IN_I2C_EEPROM) + i2c_set_bus_num(CONFIG_MAC_ADDR_I2C_EEPROM_BUS);
- if (eeprom_read(CONFIG_ZYNQ_GEM_EEPROM_ADDR, - CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET, + 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/xilinx_zynqmp_zcu102_rev1_0_defconfig b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig index 49a14d87a8..a693663cbe 100644 --- a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +++ b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig @@ -63,7 +63,10 @@ CONFIG_SYS_I2C_ZYNQ=y CONFIG_ZYNQ_I2C0=y CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y -CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 +CONFIG_MAC_ADDR_IN_I2C_EEPROM=y +CONFIG_MAC_ADDR_I2C_EEPROM_BUS=5 +CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x54 +CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0x20 CONFIG_DM_MMC=y CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y diff --git a/configs/xilinx_zynqmp_zcu102_revA_defconfig b/configs/xilinx_zynqmp_zcu102_revA_defconfig index 05dad41acb..2c271fc691 100644 --- a/configs/xilinx_zynqmp_zcu102_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revA_defconfig @@ -62,7 +62,10 @@ CONFIG_SYS_I2C_ZYNQ=y CONFIG_ZYNQ_I2C0=y CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y -CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 +CONFIG_MAC_ADDR_IN_I2C_EEPROM=y +CONFIG_MAC_ADDR_I2C_EEPROM_BUS=5 +CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x54 +CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig index b3711b43e8..c28654c5a6 100644 --- a/configs/xilinx_zynqmp_zcu102_revB_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig @@ -62,7 +62,10 @@ CONFIG_SYS_I2C_ZYNQ=y CONFIG_ZYNQ_I2C0=y CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y -CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 +CONFIG_MAC_ADDR_IN_I2C_EEPROM=y +CONFIG_MAC_ADDR_I2C_EEPROM_BUS=5 +CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x54 +CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_zynqmp_zcu106_revA_defconfig b/configs/xilinx_zynqmp_zcu106_revA_defconfig index e644914070..97841eefa4 100644 --- a/configs/xilinx_zynqmp_zcu106_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu106_revA_defconfig @@ -59,7 +59,10 @@ CONFIG_SYS_I2C_ZYNQ=y CONFIG_ZYNQ_I2C0=y CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y -CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 +CONFIG_MAC_ADDR_IN_I2C_EEPROM=y +CONFIG_MAC_ADDR_I2C_EEPROM_BUS=5 +CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x54 +CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/configs/xilinx_zynqmp_zcu111_revA_defconfig b/configs/xilinx_zynqmp_zcu111_revA_defconfig index c88ba522c7..18e7b2ce49 100644 --- a/configs/xilinx_zynqmp_zcu111_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu111_revA_defconfig @@ -53,7 +53,10 @@ CONFIG_SYS_I2C_ZYNQ=y CONFIG_ZYNQ_I2C0=y CONFIG_ZYNQ_I2C1=y CONFIG_MISC=y -CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 +CONFIG_MAC_ADDR_IN_I2C_EEPROM=y +CONFIG_MAC_ADDR_I2C_EEPROM_BUS=5 +CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x54 +CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0x20 CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ZYNQ=y diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index ff694871bf..0c98dce73b 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -223,12 +223,6 @@ config SPL_I2C_EEPROM This option is an SPL-variant of the I2C_EEPROM option. See the help of I2C_EEPROM for details.
-config ZYNQ_GEM_I2C_MAC_OFFSET - hex "Set the I2C MAC offset" - default 0x0 - help - Set the MAC offset for i2C. - if I2C_EEPROM
config SYS_I2C_EEPROM_ADDR diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h index ad6bc3d1bf..4a40d416a2 100644 --- a/include/configs/xilinx_zynqmp_zcu102.h +++ b/include/configs/xilinx_zynqmp_zcu102.h @@ -36,8 +36,6 @@ #define CONFIG_PCA953X
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#define CONFIG_ZYNQ_EEPROM_BUS 5 -#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54
#define CONFIG_SPD_EEPROM #define CONFIG_DDR_SPD diff --git a/include/configs/xilinx_zynqmp_zcu106.h b/include/configs/xilinx_zynqmp_zcu106.h index cc2d145ddd..16ac1d0dc6 100644 --- a/include/configs/xilinx_zynqmp_zcu106.h +++ b/include/configs/xilinx_zynqmp_zcu106.h @@ -36,8 +36,6 @@ #define CONFIG_PCA953X
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#define CONFIG_ZYNQ_EEPROM_BUS 5 -#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54
#include <configs/xilinx_zynqmp.h>
diff --git a/include/configs/xilinx_zynqmp_zcu111.h b/include/configs/xilinx_zynqmp_zcu111.h index 8f8cb4f087..f8f52ef639 100644 --- a/include/configs/xilinx_zynqmp_zcu111.h +++ b/include/configs/xilinx_zynqmp_zcu111.h @@ -39,8 +39,6 @@ #define CONFIG_PCA953X
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#define CONFIG_ZYNQ_EEPROM_BUS 5 -#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54
#include <configs/xilinx_zynqmp.h>