diff mbox series

[U-Boot,v2,7/7] xilinx: common: Remove !DM_i2C code for reading mac from eeprom

Message ID 29b7819171b4deefdcec265274f04982e1339faf.1549360539.git.michal.simek@xilinx.com
State Accepted
Commit 027b1134b20b253b71de306738ed8d2d3f8ddc21
Delegated to: Michal Simek
Headers show
Series arm/arm64: i2c platform cleanup | expand

Commit Message

Michal Simek Feb. 5, 2019, 9:55 a.m. UTC
All platforms are converted to DM_I2C that's why there is no reason to
keep this code here.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2:
- Add dependency

 board/xilinx/common/board.c | 19 -------------------
 configs/zynq_zybo_defconfig |  1 -
 drivers/misc/Kconfig        |  1 +
 3 files changed, 1 insertion(+), 20 deletions(-)

Comments

Heiko Schocher Feb. 7, 2019, 7:03 a.m. UTC | #1
Hello Michal,

Am 05.02.2019 um 10:55 schrieb Michal Simek:
> All platforms are converted to DM_I2C that's why there is no reason to
> keep this code here.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Changes in v2:
> - Add dependency
> 
>   board/xilinx/common/board.c | 19 -------------------
>   configs/zynq_zybo_defconfig |  1 -
>   drivers/misc/Kconfig        |  1 +
>   3 files changed, 1 insertion(+), 20 deletions(-)

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
diff mbox series

Patch

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index b14f530c72c5..7e6340bad6d4 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -8,24 +8,6 @@ 
 #include <dm/uclass.h>
 #include <i2c.h>
 
-#if !defined(CONFIG_DM_I2C)
-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;
-}
-
-#else
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 {
 	int ret = -EINVAL;
@@ -54,4 +36,3 @@  int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 
 	return ret;
 }
-#endif
diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
index 64b635bfd68b..4ba329cd92bd 100644
--- a/configs/zynq_zybo_defconfig
+++ b/configs/zynq_zybo_defconfig
@@ -39,7 +39,6 @@  CONFIG_DFU_RAM=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
-CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xFA
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 704c8dd1955f..d6e677fba847 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -245,6 +245,7 @@  config SPL_I2C_EEPROM
 config ZYNQ_GEM_I2C_MAC_OFFSET
 	hex "Set the I2C MAC offset"
 	default 0x0
+	depends on DM_I2C
 	help
 	  Set the MAC offset for i2C.