diff mbox series

[U-Boot,4/4] arm: zynq: use i2c cadence DM driver

Message ID 20180709050006.30056-5-luaraneda@gmail.com
State Rejected
Delegated to: Michal Simek
Headers show
Series arm: zynq: migrate to DM I2C driver | expand

Commit Message

Luis Araneda July 9, 2018, 5 a.m. UTC
Migrate most boards to the Cadence I2C driver and
use DM functions to read the MAC address from EEPROM

Additionally, remove the legacy eeprom command from
defconfig since it was only used to provide the functions
to read the MAC address

Boards ZC702 and ZC706 were not migrated because they have
I2C multiplexers and require extended validation and testing

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
---
 arch/arm/dts/zynq-syzygy-hub.dts  |  1 +
 arch/arm/dts/zynq-zybo.dts        | 10 ++++++++++
 board/xilinx/zynq/board.c         | 24 ++++++++++++++++++++----
 configs/syzygy_hub_defconfig      |  5 ++---
 configs/topic_miami_defconfig     |  5 ++---
 configs/topic_miamilite_defconfig |  5 ++---
 configs/topic_miamiplus_defconfig |  5 ++---
 configs/zynq_zybo_defconfig       |  6 ++----
 include/configs/syzygy_hub.h      |  2 --
 include/configs/zynq_zybo.h       |  1 -
 10 files changed, 41 insertions(+), 23 deletions(-)

Comments

Michal Simek July 20, 2018, 10:57 a.m. UTC | #1
On 9.7.2018 07:00, Luis Araneda wrote:
> Migrate most boards to the Cadence I2C driver and
> use DM functions to read the MAC address from EEPROM
> 
> Additionally, remove the legacy eeprom command from
> defconfig since it was only used to provide the functions
> to read the MAC address
> 
> Boards ZC702 and ZC706 were not migrated because they have
> I2C multiplexers and require extended validation and testing
> 
> Signed-off-by: Luis Araneda <luaraneda@gmail.com>
> ---
>  arch/arm/dts/zynq-syzygy-hub.dts  |  1 +
>  arch/arm/dts/zynq-zybo.dts        | 10 ++++++++++
>  board/xilinx/zynq/board.c         | 24 ++++++++++++++++++++----
>  configs/syzygy_hub_defconfig      |  5 ++---
>  configs/topic_miami_defconfig     |  5 ++---
>  configs/topic_miamilite_defconfig |  5 ++---
>  configs/topic_miamiplus_defconfig |  5 ++---
>  configs/zynq_zybo_defconfig       |  6 ++----
>  include/configs/syzygy_hub.h      |  2 --
>  include/configs/zynq_zybo.h       |  1 -
>  10 files changed, 41 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/arm/dts/zynq-syzygy-hub.dts b/arch/arm/dts/zynq-syzygy-hub.dts
> index a30d667146..d89e669b71 100644
> --- a/arch/arm/dts/zynq-syzygy-hub.dts
> +++ b/arch/arm/dts/zynq-syzygy-hub.dts
> @@ -15,6 +15,7 @@
>  	aliases {
>  		ethernet0 = &gem0;
>  		serial0 = &uart0;
> +		i2c0 = &i2c1;
>  		mmc0 = &sdhci0;
>  	};
>  

This can be separate patch.

> diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts
> index 3844822305..b5e0f3d9b3 100644
> --- a/arch/arm/dts/zynq-zybo.dts
> +++ b/arch/arm/dts/zynq-zybo.dts
> @@ -14,6 +14,8 @@
>  		ethernet0 = &gem0;
>  		serial0 = &uart1;
>  		spi0 = &qspi;
> +		i2c0 = &i2c0;
> +		i2c1 = &i2c1;
>  		mmc0 = &sdhci0;
>  	};
>  
> @@ -49,6 +51,14 @@
>  	};
>  };
>  
> +&i2c0 {
> +	status = "okay";
> +};
> +
> +&i2c1 {
> +	status = "okay";
> +};
> +

IIRC zybo has no connection from PS to i2c and it is done via PL.
And deal was that only things which are in PS part should be listed in
DTS file. It means this shouldn't be here.


>  &qspi {
>  	u-boot,dm-pre-reloc;
>  	status = "okay";
> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> index dcbf788918..5b9ee10a90 100644
> --- a/board/xilinx/zynq/board.c
> +++ b/board/xilinx/zynq/board.c
> @@ -8,6 +8,7 @@
>  #include <dm/uclass.h>
>  #include <fdtdec.h>
>  #include <fpga.h>
> +#include <i2c.h>
>  #include <mmc.h>
>  #include <watchdog.h>
>  #include <wdt.h>
> @@ -76,10 +77,25 @@ int board_late_init(void)
>  int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
>  {
>  #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");
> +	int ret;
> +	struct udevice *bus, *dev;
> +
> +	ret = uclass_get_device_by_seq(UCLASS_I2C,
> +				       CONFIG_MAC_ADDR_I2C_EEPROM_BUS,
> +				       &bus);
> +	if (!ret)
> +		ret = i2c_get_chip(bus,
> +				   CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR,
> +				   1, &dev);
> +	if (!ret)
> +		ret = i2c_set_chip_offset_len(dev,
> +					      CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_LEN);
> +	if (!ret)
> +		ret = dm_i2c_read(dev,
> +				  CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START,
> +				  ethaddr, 6);
> +	if (ret)
> +		printf("I2C EEPROM MAC address read failed (%i)\n", ret);
>  #endif

In ZynqMP there is also call i2c_set_bus_num which is what you do above.

I don't think that make sense to duplicate this code in board files.
This should go to core. I think eeprom hasn't been converted to DM and
that's the thing which should happen first. Then calling sequence should
be the same in board files.


>  
>  	return 0;
> diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig
> index 221349ba6f..bcc3ecda49 100644
> --- a/configs/syzygy_hub_defconfig
> +++ b/configs/syzygy_hub_defconfig
> @@ -18,7 +18,6 @@ CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
>  CONFIG_SPL_STACK_R=y
>  CONFIG_SPL_OS_BOOT=y
>  CONFIG_SYS_PROMPT="Zynq> "
> -CONFIG_CMD_EEPROM=y

this will caused regression.

>  # CONFIG_CMD_FLASH is not set
>  CONFIG_CMD_FPGA_LOADBP=y
>  CONFIG_CMD_FPGA_LOADFS=y
> @@ -37,8 +36,8 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_GPIO=y
> -CONFIG_SYS_I2C_ZYNQ=y
> -CONFIG_ZYNQ_I2C1=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
>  CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
>  CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x57
>  CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
> diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
> index af5b92cd34..408a5485f3 100644
> --- a/configs/topic_miami_defconfig
> +++ b/configs/topic_miami_defconfig
> @@ -34,9 +34,8 @@ CONFIG_DFU_RAM=y
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_GPIO=y
> -CONFIG_SYS_I2C_ZYNQ=y
> -CONFIG_ZYNQ_I2C0=y
> -CONFIG_ZYNQ_I2C1=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_ZYNQ=y
>  CONFIG_SPI_FLASH=y

convert this board is fine. Mike: Are you ok with it?

> diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig
> index ad7ba04d85..ee5f512513 100644
> --- a/configs/topic_miamilite_defconfig
> +++ b/configs/topic_miamilite_defconfig
> @@ -34,9 +34,8 @@ CONFIG_DFU_RAM=y
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_GPIO=y
> -CONFIG_SYS_I2C_ZYNQ=y
> -CONFIG_ZYNQ_I2C0=y
> -CONFIG_ZYNQ_I2C1=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_ZYNQ=y
>  CONFIG_SPI_FLASH=y

convert this board is fine.

> diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig
> index 7455e86622..89512df26d 100644
> --- a/configs/topic_miamiplus_defconfig
> +++ b/configs/topic_miamiplus_defconfig
> @@ -33,9 +33,8 @@ CONFIG_DFU_RAM=y
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_GPIO=y
> -CONFIG_SYS_I2C_ZYNQ=y
> -CONFIG_ZYNQ_I2C0=y
> -CONFIG_ZYNQ_I2C1=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_ZYNQ=y
>  CONFIG_SPI_FLASH=y

ditto

> diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
> index 03958f399d..236bc4ff70 100644
> --- a/configs/zynq_zybo_defconfig
> +++ b/configs/zynq_zybo_defconfig
> @@ -19,7 +19,6 @@ CONFIG_SPL_OS_BOOT=y
>  CONFIG_SPL_SPI_LOAD=y
>  CONFIG_SYS_PROMPT="Zynq> "
>  CONFIG_CMD_THOR_DOWNLOAD=y
> -CONFIG_CMD_EEPROM=y

regression.

>  CONFIG_CMD_DFU=y
>  # CONFIG_CMD_FLASH is not set
>  CONFIG_CMD_FPGA_LOADBP=y
> @@ -43,9 +42,8 @@ CONFIG_DFU_RAM=y
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_GPIO=y
> -CONFIG_SYS_I2C_ZYNQ=y
> -CONFIG_ZYNQ_I2C0=y
> -CONFIG_ZYNQ_I2C1=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_CADENCE=y
>  CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
>  CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x50
>  CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
> diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h
> index 17938398c2..e31b77c0c0 100644
> --- a/include/configs/syzygy_hub.h
> +++ b/include/configs/syzygy_hub.h
> @@ -10,8 +10,6 @@
>  #ifndef __CONFIG_SYZYGY_HUB_H
>  #define __CONFIG_SYZYGY_HUB_H
>  
> -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
> -
>  #define CONFIG_EXTRA_ENV_SETTINGS       \
>  	"fit_image=fit.itb\0"		\
>  	"bitstream_image=download.bit\0"    \
> diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
> index c3abf41f76..f3b628cbac 100644
> --- a/include/configs/zynq_zybo.h
> +++ b/include/configs/zynq_zybo.h
> @@ -10,7 +10,6 @@
>  #ifndef __CONFIG_ZYNQ_ZYBO_H
>  #define __CONFIG_ZYNQ_ZYBO_H
>  
> -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
>  #define CONFIG_DISPLAY
>  #define CONFIG_I2C_EDID
>  
> 

as above.

Thanks,
Michal
Luis Araneda July 21, 2018, 7:20 a.m. UTC | #2
Hi Michal,

On Fri, Jul 20, 2018 at 6:57 AM Michal Simek <monstr@monstr.eu> wrote:
> On 9.7.2018 07:00, Luis Araneda wrote:
> > [...]
> > --- a/arch/arm/dts/zynq-syzygy-hub.dts
> > +++ b/arch/arm/dts/zynq-syzygy-hub.dts
> > @@ -15,6 +15,7 @@
> >       aliases {
> >               ethernet0 = &gem0;
> >               serial0 = &uart0;
> > +             i2c0 = &i2c1;
> >               mmc0 = &sdhci0;
> >       };
> >
>
> This can be separate patch.

Ok

> > diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts
> > index 3844822305..b5e0f3d9b3 100644
> > --- a/arch/arm/dts/zynq-zybo.dts
> > +++ b/arch/arm/dts/zynq-zybo.dts
> > @@ -14,6 +14,8 @@
> >               ethernet0 = &gem0;
> >               serial0 = &uart1;
> >               spi0 = &qspi;
> > +             i2c0 = &i2c0;
> > +             i2c1 = &i2c1;
> >               mmc0 = &sdhci0;
> >       };
> >
> > @@ -49,6 +51,14 @@
> >       };
> >  };
> >
> > +&i2c0 {
> > +     status = "okay";
> > +};
> > +
> > +&i2c1 {
> > +     status = "okay";
> > +};
> > +
>
> IIRC zybo has no connection from PS to i2c and it is done via PL.
> And deal was that only things which are in PS part should be listed in
> DTS file. It means this shouldn't be here.

The PS has I2C peripherals. For the Zybo in particular, there are two
I2Cs, which must be routed through the PL to be connected to the
EEPROM and HDMI port respectively. That means that if the PL is not
programmed, the I2C driver binds and works properly but the SCL and
SDA signals of the I2C peripherals are not connected to anything.
So, I'm not sure if the rule is applicable here, because the I2Cs are
in PS, but to properly use them you have to program the PL.

Besides, adding the aliases and nodes was the only way I could find to
make the driver work (bind) automatically. If I don't add the aliases,
the I2C devices are not assigned a bus (-1), and if I don't add the
nodes, the driver does not bind.

If the I2C nodes don't belong in the .dts file, and I'm using DM
(which will eventually be mandatory), does that means I would have to
bind the driver manually to obtain the current functionality without
DM? I suppose that's possible (don't know how). It sounds like the
functionality provided by device-tree overlays.

> >  &qspi {
> >       u-boot,dm-pre-reloc;
> >       status = "okay";
> > diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> > index dcbf788918..5b9ee10a90 100644
> > --- a/board/xilinx/zynq/board.c
> > +++ b/board/xilinx/zynq/board.c
> > @@ -8,6 +8,7 @@
> >  #include <dm/uclass.h>
> >  #include <fdtdec.h>
> >  #include <fpga.h>
> > +#include <i2c.h>
> >  #include <mmc.h>
> >  #include <watchdog.h>
> >  #include <wdt.h>
> > @@ -76,10 +77,25 @@ int board_late_init(void)
> >  int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
> >  {
> >  #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");
> > +     int ret;
> > +     struct udevice *bus, *dev;
> > +
> > +     ret = uclass_get_device_by_seq(UCLASS_I2C,
> > +                                    CONFIG_MAC_ADDR_I2C_EEPROM_BUS,
> > +                                    &bus);
> > +     if (!ret)
> > +             ret = i2c_get_chip(bus,
> > +                                CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR,
> > +                                1, &dev);
> > +     if (!ret)
> > +             ret = i2c_set_chip_offset_len(dev,
> > +                                           CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_LEN);
> > +     if (!ret)
> > +             ret = dm_i2c_read(dev,
> > +                               CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START,
> > +                               ethaddr, 6);
> > +     if (ret)
> > +             printf("I2C EEPROM MAC address read failed (%i)\n", ret);
> >  #endif
>
> In ZynqMP there is also call i2c_set_bus_num which is what you do above.
>
> I don't think that make sense to duplicate this code in board files.
> This should go to core. I think eeprom hasn't been converted to DM and
> that's the thing which should happen first. Then calling sequence should
> be the same in board files.

Ok. I'm assuming that you are referring to the eeprom command? because
I found the i2c_eeprom driver (CONFIG_I2C_EEPROM), which is using DM.
But, I'm not sure if we can use it because it has the same problems of
the I2C nodes above, and this is even worse, as the driver won't bind
unless the PL is programmed first.

> > --- a/configs/syzygy_hub_defconfig
> > +++ b/configs/syzygy_hub_defconfig
> > @@ -18,7 +18,6 @@ CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
> >  CONFIG_SPL_STACK_R=y
> >  CONFIG_SPL_OS_BOOT=y
> >  CONFIG_SYS_PROMPT="Zynq> "
> > -CONFIG_CMD_EEPROM=y
>
> this will caused regression.

Is it because someone could have been using the command?


Thanks,

Luis Araneda.
diff mbox series

Patch

diff --git a/arch/arm/dts/zynq-syzygy-hub.dts b/arch/arm/dts/zynq-syzygy-hub.dts
index a30d667146..d89e669b71 100644
--- a/arch/arm/dts/zynq-syzygy-hub.dts
+++ b/arch/arm/dts/zynq-syzygy-hub.dts
@@ -15,6 +15,7 @@ 
 	aliases {
 		ethernet0 = &gem0;
 		serial0 = &uart0;
+		i2c0 = &i2c1;
 		mmc0 = &sdhci0;
 	};
 
diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts
index 3844822305..b5e0f3d9b3 100644
--- a/arch/arm/dts/zynq-zybo.dts
+++ b/arch/arm/dts/zynq-zybo.dts
@@ -14,6 +14,8 @@ 
 		ethernet0 = &gem0;
 		serial0 = &uart1;
 		spi0 = &qspi;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
 		mmc0 = &sdhci0;
 	};
 
@@ -49,6 +51,14 @@ 
 	};
 };
 
+&i2c0 {
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
 &qspi {
 	u-boot,dm-pre-reloc;
 	status = "okay";
diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index dcbf788918..5b9ee10a90 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -8,6 +8,7 @@ 
 #include <dm/uclass.h>
 #include <fdtdec.h>
 #include <fpga.h>
+#include <i2c.h>
 #include <mmc.h>
 #include <watchdog.h>
 #include <wdt.h>
@@ -76,10 +77,25 @@  int board_late_init(void)
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 {
 #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");
+	int ret;
+	struct udevice *bus, *dev;
+
+	ret = uclass_get_device_by_seq(UCLASS_I2C,
+				       CONFIG_MAC_ADDR_I2C_EEPROM_BUS,
+				       &bus);
+	if (!ret)
+		ret = i2c_get_chip(bus,
+				   CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR,
+				   1, &dev);
+	if (!ret)
+		ret = i2c_set_chip_offset_len(dev,
+					      CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_LEN);
+	if (!ret)
+		ret = dm_i2c_read(dev,
+				  CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START,
+				  ethaddr, 6);
+	if (ret)
+		printf("I2C EEPROM MAC address read failed (%i)\n", ret);
 #endif
 
 	return 0;
diff --git a/configs/syzygy_hub_defconfig b/configs/syzygy_hub_defconfig
index 221349ba6f..bcc3ecda49 100644
--- a/configs/syzygy_hub_defconfig
+++ b/configs/syzygy_hub_defconfig
@@ -18,7 +18,6 @@  CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd"
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="Zynq> "
-CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
@@ -37,8 +36,8 @@  CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
-CONFIG_SYS_I2C_ZYNQ=y
-CONFIG_ZYNQ_I2C1=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
 CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x57
 CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
index af5b92cd34..408a5485f3 100644
--- a/configs/topic_miami_defconfig
+++ b/configs/topic_miami_defconfig
@@ -34,9 +34,8 @@  CONFIG_DFU_RAM=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
-CONFIG_SYS_I2C_ZYNQ=y
-CONFIG_ZYNQ_I2C0=y
-CONFIG_ZYNQ_I2C1=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig
index ad7ba04d85..ee5f512513 100644
--- a/configs/topic_miamilite_defconfig
+++ b/configs/topic_miamilite_defconfig
@@ -34,9 +34,8 @@  CONFIG_DFU_RAM=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
-CONFIG_SYS_I2C_ZYNQ=y
-CONFIG_ZYNQ_I2C0=y
-CONFIG_ZYNQ_I2C1=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig
index 7455e86622..89512df26d 100644
--- a/configs/topic_miamiplus_defconfig
+++ b/configs/topic_miamiplus_defconfig
@@ -33,9 +33,8 @@  CONFIG_DFU_RAM=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
-CONFIG_SYS_I2C_ZYNQ=y
-CONFIG_ZYNQ_I2C0=y
-CONFIG_ZYNQ_I2C1=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_SPI_FLASH=y
diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
index 03958f399d..236bc4ff70 100644
--- a/configs/zynq_zybo_defconfig
+++ b/configs/zynq_zybo_defconfig
@@ -19,7 +19,6 @@  CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_PROMPT="Zynq> "
 CONFIG_CMD_THOR_DOWNLOAD=y
-CONFIG_CMD_EEPROM=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADBP=y
@@ -43,9 +42,8 @@  CONFIG_DFU_RAM=y
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
-CONFIG_SYS_I2C_ZYNQ=y
-CONFIG_ZYNQ_I2C0=y
-CONFIG_ZYNQ_I2C1=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MAC_ADDR_IN_I2C_EEPROM=y
 CONFIG_MAC_ADDR_I2C_EEPROM_CHIP_ADDR=0x50
 CONFIG_MAC_ADDR_I2C_EEPROM_DATA_ADDR_START=0xFA
diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h
index 17938398c2..e31b77c0c0 100644
--- a/include/configs/syzygy_hub.h
+++ b/include/configs/syzygy_hub.h
@@ -10,8 +10,6 @@ 
 #ifndef __CONFIG_SYZYGY_HUB_H
 #define __CONFIG_SYZYGY_HUB_H
 
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-
 #define CONFIG_EXTRA_ENV_SETTINGS       \
 	"fit_image=fit.itb\0"		\
 	"bitstream_image=download.bit\0"    \
diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
index c3abf41f76..f3b628cbac 100644
--- a/include/configs/zynq_zybo.h
+++ b/include/configs/zynq_zybo.h
@@ -10,7 +10,6 @@ 
 #ifndef __CONFIG_ZYNQ_ZYBO_H
 #define __CONFIG_ZYNQ_ZYBO_H
 
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
 #define CONFIG_DISPLAY
 #define CONFIG_I2C_EDID