arm: zynq: migrate to DM I2C driver
Subsystems (3)
cover arm: zynq: migrate to DM I2C driver
This series migrate most zynq boards to using the
Cadence DM I2C driver
The first patch adds kconfig options to generalize the concept of reading the MAC address from an I2C EEPROM. Then the zynq and zynqmp boards were migrated with patches two and three to use the options
Finally, the last patch migrates the boards to the Cadence I2C driver. The boards ZC702 and ZC706 were not migrated because they have I2C multiplexers and I don't have a board with a multiplexer to perform testing and validation
I ran a round of reproducible builds on master and another one after the third patch for all zynq and zynqmp boards, and the same binaries where generated for all boards
All commits were tested on a Digilent Zybo board
Luis Araneda (4):
drivers/misc: add options to read MAC address from EEPROM
arm: zynq: migrate EEPROM MAC address options to kconfig
arm64: zynqmp: migrate EEPROM MAC address options to kconfig
arm: zynq: use i2c cadence DM driver
arch/arm/dts/zynq-syzygy-hub.dts | 1 + arch/arm/dts/zynq-zybo.dts | 10 ++++++ board/xilinx/zynq/board.c | 27 ++++++++++++---- board/xilinx/zynqmp/zynqmp.c | 10 +++--- configs/syzygy_hub_defconfig | 9 +++--- configs/topic_miami_defconfig | 5 ++- configs/topic_miamilite_defconfig | 5 ++- configs/topic_miamiplus_defconfig | 5 ++- 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 ++- configs/zynq_zybo_defconfig | 10 +++--- drivers/misc/Kconfig | 32 +++++++++++++++---- include/configs/syzygy_hub.h | 3 -- include/configs/xilinx_zynqmp_zcu102.h | 2 -- include/configs/xilinx_zynqmp_zcu106.h | 2 -- include/configs/xilinx_zynqmp_zcu111.h | 2 -- include/configs/zynq_zybo.h | 2 -- 20 files changed, 98 insertions(+), 52 deletions(-)
Signature · 1 line
2.18.0
PATCH 1/4 drivers/misc: add options to read MAC address from EEPROM
Add generic kconfig options to read MAC address(es) from an EEPROM connected to an I2C bus
The SYS_I2C_EEPROM_* options can't be used because they depend on I2C_EEPROM, which requires a DM driver, and not all boards have DM I2C drivers yet
--- drivers/misc/Kconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/misc/Kconfig +26 -0
@@ -272,6 +272,32 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW endif +config MAC_ADDR_IN_I2C_EEPROM + bool "MAC address in I2C EEPROM" + help + Read MAC address(es) from an EEPROM + connected to an I2C bus + +if MAC_ADDR_IN_I2C_EEPROM + +config MAC_ADDR_I2C_EEPROM_BUS + int "I2C bus connected to the EEPROM device" + default 0 + +config MAC_ADDR_I2C_EEPROM_CHIP_ADDR + hex "Chip address of the EEPROM device" + default 0 + +config MAC_ADDR_I2C_EEPROM_DATA_ADDR_LEN + int "Length in bytes of EEPROM data addresses" + default 1 + +config MAC_ADDR_I2C_EEPROM_DATA_ADDR_START + hex "Start address of MAC data in EEPROM" + default 0 + +endif + config GDSYS_RXAUI_CTRL bool "Enable gdsys RXAUI control driver" depends on MISC
Signature · 1 line
2.18.0
PATCH 2/4 arm: zynq: migrate EEPROM MAC address options to kconfig
In reply to Luis AranedaMigrate boards to use the generic kconfig options to read the MAC address
--- 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(-)
board/xilinx/zynq/board.c +3 -4
@@ -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
configs/syzygy_hub_defconfig +3 -1
@@ -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
configs/zynq_zybo_defconfig +3 -1
@@ -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
include/configs/syzygy_hub.h +0 -1
@@ -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" \
include/configs/zynq_zybo.h +0 -1
@@ -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
Signature · 1 line
2.18.0
PATCH 3/4 arm64: zynqmp: migrate EEPROM MAC address options to kconfig
In reply to Luis AranedaMigrate 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
--- 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(-)
board/xilinx/zynqmp/zynqmp.c +4 -6
@@ -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
configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +4 -1
@@ -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
configs/xilinx_zynqmp_zcu102_revA_defconfig +4 -1
@@ -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
configs/xilinx_zynqmp_zcu102_revB_defconfig +4 -1
@@ -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
configs/xilinx_zynqmp_zcu106_revA_defconfig +4 -1
@@ -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
configs/xilinx_zynqmp_zcu111_revA_defconfig +4 -1
@@ -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
drivers/misc/Kconfig +0 -6
@@ -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
include/configs/xilinx_zynqmp_zcu102.h +0 -2
@@ -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
include/configs/xilinx_zynqmp_zcu106.h +0 -2
@@ -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>
include/configs/xilinx_zynqmp_zcu111.h +0 -2
@@ -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>
Signature · 1 line
2.18.0
PATCH 4/4 arm: zynq: use i2c cadence DM driver
In reply to Luis AranedaMigrate 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
--- 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(-)
arch/arm/dts/zynq-syzygy-hub.dts +1 -0
@@ -15,6 +15,7 @@ aliases { ethernet0 = &gem0; serial0 = &uart0; + i2c0 = &i2c1; mmc0 = &sdhci0; };
arch/arm/dts/zynq-zybo.dts +10 -0
@@ -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";
board/xilinx/zynq/board.c +20 -4
@@ -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 ;
configs/syzygy_hub_defconfig +2 -3
@@ -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
configs/topic_miami_defconfig +2 -3
@@ -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
configs/topic_miamilite_defconfig +2 -3
@@ -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
configs/topic_miamiplus_defconfig +2 -3
@@ -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
configs/zynq_zybo_defconfig +2 -4
@@ -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
include/configs/syzygy_hub.h +0 -2
@@ -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" \
include/configs/zynq_zybo.h +0 -1
@@ -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
Signature · 1 line
2.18.0
PATCH 4/4 arm: zynq: use i2c cadence DM driver
Quoted 29 lines · Luis Araneda
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 <[email protected]>--- 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(-)arch/arm/dts/zynq-syzygy-hub.dts +0
-0
arch/arm/dts/zynq-syzygy-hub.dts line 21
Quoted 7 lines
arch/arm/dts/zynq-syzygy-hub.dts +1
-0@@ -15,6 +15,7 @@ aliases { ethernet0 = &gem0; serial0 = &uart0; + i2c0 = &i2c1; mmc0 = &sdhci0; };
This can be separate patch.
Quoted 15 lines
arch/arm/dts/zynq-zybo.dts +2
-0@@ -14,6 +14,8 @@ ethernet0 = &gem0; serial0 = &uart1; spi0 = &qspi; + i2c0 = &i2c0; + i2c1 = &i2c1; mmc0 = &sdhci0; };@@ -49,6 +51,14 @@ };
arch/arm/dts/zynq-zybo.dts line 61
Quoted 10 lines
arch/arm/dts/zynq-zybo.dts +8
-0}; +&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.
Quoted 33 lines
arch/arm/dts/zynq-zybo.dts +0
-0&qspi { u-boot,dm-pre-reloc; status = "okay";board/xilinx/zynq/board.c +11
-4@@ -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);
board/xilinx/zynq/board.c int board_late_init(void) · line 99
Quoted 10 lines
board/xilinx/zynq/board.c +9
-0+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.
configs/syzygy_hub_defconfig CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" · line 21
Quoted 11 lines
board/xilinx/zynq/board.c +0
-0return 0 ;configs/syzygy_hub_defconfig +0
-1@@ -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.
Quoted 20 lines
configs/syzygy_hub_defconfig +2
-2# 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=0xFAconfigs/topic_miami_defconfig +0
-0@@ -34,9 +34,8 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y
configs/topic_miami_defconfig CONFIG_DFU_RAM=y · line 41
Quoted 10 lines
configs/topic_miami_defconfig +2
-3CONFIG_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?
Quoted 6 lines
configs/topic_miamilite_defconfig +0
-0@@ -34,9 +34,8 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y
configs/topic_miamilite_defconfig CONFIG_DFU_RAM=y · line 41
Quoted 10 lines
configs/topic_miamilite_defconfig +2
-3CONFIG_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.
Quoted 6 lines
configs/topic_miamiplus_defconfig +0
-0@@ -33,9 +33,8 @@ CONFIG_DFU_RAM=y CONFIG_FPGA_XILINX=y
configs/topic_miamiplus_defconfig CONFIG_DFU_RAM=y · line 40
Quoted 10 lines
configs/topic_miamiplus_defconfig +2
-3CONFIG_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
configs/zynq_zybo_defconfig CONFIG_SPL_OS_BOOT=y · line 22
Quoted 9 lines
configs/zynq_zybo_defconfig +0
-1@@ -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.
Quoted 34 lines
configs/zynq_zybo_defconfig +2
-3CONFIG_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=0xFAinclude/configs/syzygy_hub.h +0
-2@@ -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" \include/configs/zynq_zybo.h +0
-0
include/configs/zynq_zybo.h line 15
Quoted 7 lines
include/configs/zynq_zybo.h +0
-1@@ -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
Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180720/d7e19702/attachment.sig>
PATCH 4/4 arm: zynq: use i2c cadence DM driver
Hi Michal,
Quoted 14 lines · Michal Simek
arch/arm/dts/zynq-syzygy-hub.dts line 21
Quoted 11 lines · Luis Araneda
[...]
arch/arm/dts/zynq-syzygy-hub.dts +1
-0@@ -15,6 +15,7 @@ aliases { ethernet0 = &gem0; serial0 = &uart0; + i2c0 = &i2c1; mmc0 = &sdhci0; };This can be separate patch.
Ok
Quoted 17 lines
Quoted 17 lines
arch/arm/dts/zynq-zybo.dts +2
-0@@ -14,6 +14,8 @@ ethernet0 = &gem0; serial0 = &uart1; spi0 = &qspi; + i2c0 = &i2c0; + i2c1 = &i2c1; mmc0 = &sdhci0; };@@ -49,6 +51,14 @@ }; };
Quoted 12 lines
arch/arm/dts/zynq-zybo.dts line 61
Quoted 8 lines
arch/arm/dts/zynq-zybo.dts +8
-0+&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.
Quoted 46 lines
Quoted 33 lines
arch/arm/dts/zynq-zybo.dts +0
-0&qspi { u-boot,dm-pre-reloc; status = "okay";board/xilinx/zynq/board.c +11
-4@@ -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);board/xilinx/zynq/board.c int board_late_init(void) · line 99
Quoted 10 lines
board/xilinx/zynq/board.c +9
-0+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_numwhich is what you do above.
Quoted 4 lines
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.
Quoted 9 lines
configs/syzygy_hub_defconfig CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" · line 21
Quoted 7 lines
configs/syzygy_hub_defconfig +0
-1@@ -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=ythis will caused regression.
Is it because someone could have been using the command?
Thanks,
Luis Araneda.
cover arm: zynq: migrate to DM I2C driver
In reply to Luis AranedaQuoted 38 lines · Luis Araneda
This series migrate most zynq boards to using the
Cadence DM I2C driverThe first patch adds kconfig options to generalize the concept of reading the MAC address from an I2C EEPROM. Then the zynq and zynqmp boards were migrated with patches two and three to use the options
Finally, the last patch migrates the boards to the Cadence I2C driver. The boards ZC702 and ZC706 were not migrated because they have I2C multiplexers and I don't have a board with a multiplexer to perform testing and validation
I ran a round of reproducible builds on master and another one after the third patch for all zynq and zynqmp boards, and the same binaries where generated for all boards
All commits were tested on a Digilent Zybo board
Luis Araneda (4):
drivers/misc: add options to read MAC address from EEPROM
arm: zynq: migrate EEPROM MAC address options to kconfig
arm64: zynqmp: migrate EEPROM MAC address options to kconfig
arm: zynq: use i2c cadence DM driverarch/arm/dts/zynq-syzygy-hub.dts | 1 + arch/arm/dts/zynq-zybo.dts | 10 ++++++ board/xilinx/zynq/board.c | 27 ++++++++++++---- board/xilinx/zynqmp/zynqmp.c | 10 +++--- configs/syzygy_hub_defconfig | 9 +++--- configs/topic_miami_defconfig | 5 ++- configs/topic_miamilite_defconfig | 5 ++- configs/topic_miamiplus_defconfig | 5 ++- 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 ++-
Quoted 9 lines
configs/zynq_zybo_defconfig | 10 +++--- drivers/misc/Kconfig | 32 +++++++++++++++---- include/configs/syzygy_hub.h | 3 -- include/configs/xilinx_zynqmp_zcu102.h | 2 -- include/configs/xilinx_zynqmp_zcu106.h | 2 -- include/configs/xilinx_zynqmp_zcu111.h | 2 -- include/configs/zynq_zybo.h | 2 -- 20 files changed, 98 insertions(+), 52 deletions(-)
Please take a look at
https://lists.denx.de/pipermail/u-boot/2016-November/274068.html which was the series which should replace all these boards setting in a generic way. Unfortunately I don't know why it didn't go through.
And then regarding DM i2c. Driver is in the driver for a while but for i2c muxes support it requires all subbusses to be listed in DTS file which is not what it is common in Linux dt binding. That's why some work needs to be done in this area to convert all platforms.
Thanks,
Michal
cover arm: zynq: migrate to DM I2C driver
Hi Michal,
Quoted 4 lines · Michal Simek
Please take a look at
https://lists.denx.de/pipermail/u-boot/2016-November/274068.html which was the series which should replace all these boards setting in a generic way. Unfortunately I don't know why it didn't go through.
The last version of that series [1] (v6, 28 patches) has the state "Changes Requested" on patchwork, and it even has some TODOs. It's a generic way of reading a MAC address from an EEPROM with helper functions.
I'm not proposing something as generic and elaborated as that series, but an improvement to what is used today.
I sent this series to move some legacy options to Kconfig. Additionally, the Zybo Z7 has its MAC address stored on an SPI FLASH, which will likely require a new Kconfig option (MAC_ADDR_IN_SPI_FLASH) eventually. Something that [1] doesn't cover (from what I read).
It just occurred to me that what I'm really doing in the fourth patch is reading the MAC address from a generic memory connected to I2C, because it's a generic memory read operation (device address, memory address, read operation). So I think the name of the Kconfigs could be CONFIG_MAC_ADDR_IN_I2C_MEMORY instead of CONFIG_MAC_ADDR_IN_I2C_EEPROM. It can even be more generic like CONFIG_MAC_ADDR_IN_I2C. What do yo think?
Quoted 4 lines
And then regarding DM i2c. Driver is in the driver for a while but for i2c muxes support it requires all subbusses to be listed in DTS file which is not what it is common in Linux dt binding. That's why some work needs to be done in this area to convert all platforms.
Yes, I realize that I2C muxes are a pending issue, but that's why I only migrated the boards that are not using I2C muxes. From my point of view, it's less work to be done when porting
Anyway, I just wanted to improve the current state of the code, I don't need these changes for what I'm doing. So if you like to wait for [1] to be merged, it's fine with me and we can drop this series, otherwise, please review it so I can make changes if necessary.
[1] https://lists.denx.de/pipermail/u-boot/2017-May/291401.html
Thanks,
Luis Araneda.
cover arm: zynq: migrate to DM I2C driver
Quoted 37 lines · Luis Araneda
Hi Michal,
Quoted 4 lines · Michal Simek
Please take a look at
https://lists.denx.de/pipermail/u-boot/2016-November/274068.html which was the series which should replace all these boards setting in a generic way. Unfortunately I don't know why it didn't go through.The last version of that series [1] (v6, 28 patches) has the state "Changes Requested" on patchwork, and it even has some TODOs. It's a generic way of reading a MAC address from an EEPROM with helper functions.
I'm not proposing something as generic and elaborated as that series, but an improvement to what is used today.I sent this series to move some legacy options to
Kconfig. Additionally, the Zybo Z7 has its MAC address stored on an SPI FLASH, which will likely require a newKconfigoption (MAC_ADDR_IN_SPI_FLASH) eventually. Something that [1] doesn't cover (from what I read).It just occurred to me that what I'm really doing in the fourth patch is reading the MAC address from a generic memory connected to I2C, because it's a generic memory read operation (device address, memory address, read operation). So I think the name of the Kconfigs could be
CONFIG_MAC_ADDR_IN_I2C_MEMORYinstead ofCONFIG_MAC_ADDR_IN_I2C_EEPROM. It can even be more generic likeCONFIG_MAC_ADDR_IN_I2C. What do yo think?Quoted 4 lines
And then regarding DM i2c. Driver is in the driver for a while but for i2c muxes support it requires all subbusses to be listed in DTS file which is not what it is common in Linux dt binding. That's why some work needs to be done in this area to convert all platforms.
Yes, I realize that I2C muxes are a pending issue, but that's why I only migrated the boards that are not using I2C muxes. From my point of view, it's less work to be done when porting
Quoted 6 lines
Anyway, I just wanted to improve the current state of the code, I don't need these changes for what I'm doing. So if you like to wait for [1] to be merged, it's fine with me and we can drop this series, otherwise, please review it so I can make changes if necessary.
[1] https://lists.denx.de/pipermail/u-boot/2017-May/291401.html
I have no problem to move ZYNQ_GEM_EEPROM_ADDR to Kconfig without changing the name.
Oliver: Any comment about your patch series?
And I would let Joe to handle that mac address reading.
That v6 series contains a lot of patches which have been acked. The biggest problem was about sunxi which is something what can be ignored. If Oliver doesn't want to send v7 then I would recommend you simply take his v6 version and that patches which are required and just send them again. I think it won't take so much time because a lot of things were already done.
Thanks,
Michal
Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180720/483b2e05/attachment.sig>
cover arm: zynq: migrate to DM I2C driver
Hi,
Quoted 8 lines · Michal Simek
Quoted 6 lines · Luis Araneda
[...]
Anyway, I just wanted to improve the current state of the code, I don't need these changes for what I'm doing. So if you like to wait for [1] to be merged, it's fine with me and we can drop this series, otherwise, please review it so I can make changes if necessary.
Quoted 4 lines
Quoted 1 line
[1] https://lists.denx.de/pipermail/u-boot/2017-May/291401.html
I have no problem to move
ZYNQ_GEM_EEPROM_ADDRtoKconfigwithout changing the name.
Ok, I'll send one patch moving ZYNQ_GEM_EEPROM_ADDR to Kconfig, maintaining its name and I'm dropping my proposal for a generic option.
Thanks,
Luis Araneda.
cover arm: zynq: migrate to DM I2C driver
In reply to Michal SimekHi all,
Quoted 8 lines · Michal Simek
Quoted 7 lines · Luis Araneda
Hi Michal,
Quoted 4 lines · Michal Simek
Please take a look at
https://lists.denx.de/pipermail/u-boot/2016-November/274068.html which was the series which should replace all these boards setting in a generic way. Unfortunately I don't know why it didn't go through.
Neither do I :) some of them where 'done' as far as I remember, but it has been a while and I have somewhat forgotten about them a little. They have been used in production since then however for us.
There are plans to work on our u-boot again in the next few months and my intention was to pick up the ones that did not get merged.
Quoted 8 lines
Quoted 8 lines
The last version of that series [1] (v6, 28 patches) has the state "Changes Requested" on patchwork, and it even has some TODOs. It's a generic way of reading a MAC address from an EEPROM with helper functions.
I'm not proposing something as generic and elaborated as that series, but an improvement to what is used today.
Quoted 4 lines
Quoted 4 lines
I sent this series to move some legacy options to
Kconfig. Additionally, the Zybo Z7 has its MAC address stored on an SPI FLASH, which will likely require a newKconfigoption (MAC_ADDR_IN_SPI_FLASH) eventually. Something that [1] doesn't cover (from what I read).
No, I did not have SPI memory available at the time, and was sort of waiting for the generic EEPROM framework to progress (that died).
Having said that, adding SPI eeprom would have been trivial.
Quoted 8 lines
Quoted 8 lines
It just occurred to me that what I'm really doing in the fourth patch is reading the MAC address from a generic memory connected to I2C, because it's a generic memory read operation (device address, memory address, read operation). So I think the name of the Kconfigs could be
CONFIG_MAC_ADDR_IN_I2C_MEMORYinstead ofCONFIG_MAC_ADDR_IN_I2C_EEPROM. It can even be more generic likeCONFIG_MAC_ADDR_IN_I2C. What do yo think?
Well I think the generic memory framework did make sense at the time, and didn't compulab merge something like this at some point?
Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
And then regarding DM i2c. Driver is in the driver for a while but for i2c muxes support it requires all subbusses to be listed in DTS file which is not what it is common in Linux dt binding. That's why some work needs to be done in this area to convert all platforms.
Yes, I realize that I2C muxes are a pending issue, but that's why I only migrated the boards that are not using I2C muxes. From my point of view, it's less work to be done when porting
Anyway, I just wanted to improve the current state of the code, I don't need these changes for what I'm doing. So if you like to wait for [1] to be merged, it's fine with me and we can drop this series, otherwise, please review it so I can make changes if necessary.
Quoted 6 lines
Quoted 1 line
[1] https://lists.denx.de/pipermail/u-boot/2017-May/291401.html
I have no problem to move
ZYNQ_GEM_EEPROM_ADDRtoKconfigwithout changing the name.Oliver: Any comment about your patch series?
What I just wrote above :)
Quoted 8 lines
And I would let Joe to handle that mac address reading.
That v6 series contains a lot of patches which have been acked. The biggest problem was about sunxi which is something what can be ignored. If Oliver doesn't want to send v7 then I would recommend you simply take his v6 version and that patches which are required and just send them again. I think it won't take so much time because a lot of things were already done.
I don't mind starting to work on a v7; i think one of the issues I ran into was turn around time which took quite a while. I may even have v7 locally actually! I'll see what can be done within the comming period; but again, we are going to update/add more support to our u-boot so I should be working on this again soon-ish.
Quoted 5 lines
Thanks,
Michal