board: shc: convert to DM_I2C
Subsystems (3)
PATCH 1/11 board: shc: convert to DM_I2C
Conversion to DM_I2C is mandatory, rework to remove use of legacy I2C API.
---
Cc: Heiko Schocher <[email protected]>
Cc: Tom Rini <[email protected]>
--- board/bosch/shc/board.c | 22 +++++++++++----------- configs/am335x_shc_defconfig | 4 +++- configs/am335x_shc_ict_defconfig | 4 +++- configs/am335x_shc_netboot_defconfig | 4 +++- configs/am335x_shc_sdboot_defconfig | 4 +++- 5 files changed, 23 insertions(+), 15 deletions(-)
board/bosch/shc/board.c +11 -11
@@ -34,6 +34,7 @@#include <asm/emif.h> #include <asm/gpio.h> #include <i2c.h> +#include <i2c_eeprom.h> #include <miiphy.h> #include <cpsw.h> #include <linux/delay.h>
@@ -51,21 +52,21 @@ static int shc_eeprom_valid;/* * Read header information from EEPROM into global structure. */ -#define EEPROM_ADDR 0x50static int read_eeprom (void ) { +struct udevice *dev; +int ret; +/* Check if baseboard eeprom is available */ -if (i2c_probe (EEPROM_ADDR )) { -puts ("Could not probe the EEPROM; something fundamentally wrong on the I2C bus.\n" ); -return -ENODEV ; + ret =uclass_first_device_err (UCLASS_I2C_EEPROM , &dev); +if (ret) { +puts ("Could not find EEPROM.\n" ); +return ret; } -/* read the eeprom using i2c */ -if (i2c_read (EEPROM_ADDR ,0 ,2 , (uchar *)&header, -sizeof (header))) { -puts ("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\n" ); -return -EIO ; - } + ret =i2c_eeprom_read (dev,0 , (uint8_t *)&header,sizeof (header)); +if (ret) +return ret;if (header.magic !=HDR_MAGIC ) { printf("Incorrect magic number (0x%x) in EEPROM\n",
@@ -445,7 +446,6 @@ int board_init(void)#if defined(CONFIG_HW_WATCHDOG )hw_watchdog_init ();#endif -i2c_init (CONFIG_SYS_I2C_SPEED ,CONFIG_SYS_I2C_SLAVE );if (read_eeprom () <0 )puts ("EEPROM Content Invalid.\n" );
configs/am335x_shc_defconfig +3 -1
@@ -66,10 +66,12 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_SLAVE=0x1 CONFIG_SYS_I2C_SPEED=400000 +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_MMC_OMAP_HS=y CONFIG_HSMMC2_8BIT=y CONFIG_PHY_ADDR_ENABLE=y
configs/am335x_shc_ict_defconfig +3 -1
@@ -64,10 +64,12 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_SLAVE=0x1 CONFIG_SYS_I2C_SPEED=400000 +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_MMC_OMAP_HS=y CONFIG_HSMMC2_8BIT=y CONFIG_PHY_ADDR_ENABLE=y
configs/am335x_shc_netboot_defconfig +3 -1
@@ -67,10 +67,12 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_SLAVE=0x1 CONFIG_SYS_I2C_SPEED=400000 +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_MMC_OMAP_HS=y CONFIG_HSMMC2_8BIT=y CONFIG_PHY_ADDR_ENABLE=y
configs/am335x_shc_sdboot_defconfig +3 -1
@@ -66,10 +66,12 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_SLAVE=0x1 CONFIG_SYS_I2C_SPEED=400000 +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y CONFIG_MMC_OMAP_HS=y CONFIG_HSMMC2_8BIT=y CONFIG_PHY_ADDR_ENABLE=y
Signature · 1 line
2.25.1
PATCH 2/11 board: chiliboard: convert to DM_I2C
Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.
---
Cc: Marcin Niestroj <[email protected]>
Cc: Tom Rini <[email protected]>
--- configs/chiliboard_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/chiliboard_defconfig +1 -1
@@ -53,7 +53,7 @@ CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_BE=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_MISC=y CONFIG_MMC_OMAP_HS=y
Signature · 1 line
2.25.1
PATCH 3/11 board: cm-t43: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.
---
Cc: Nikita Kiryanov <[email protected]>
Cc: Tom Rini <[email protected]>
--- board/compulab/cm_t43/cm_t43.c | 2 -- configs/cm_t43_defconfig | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-)
board/compulab/cm_t43/cm_t43.c +0 -2
@@ -48,8 +48,6 @@ int board_init(void) gd->bd->bi_boot_params =CFG_SYS_SDRAM_BASE +0x100 ;gpmc_init ();set_i2c_pin_mux (); -i2c_init (CONFIG_SYS_I2C_SPEED ,CONFIG_SYS_I2C_SLAVE ); -i2c_probe (TPS65218_CHIP_PM );return 0 ; }
configs/cm_t43_defconfig +2 -1
@@ -38,6 +38,7 @@ CONFIG_SPL_SYS_MALLOC_SIZE=0x800000 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x480 CONFIG_SPL_FS_EXT4=y CONFIG_SPL_I2C=y +# CONFIG_SPL_DM_I2C is not set CONFIG_SPL_MTD=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_NAND_DRIVERS=y
@@ -72,7 +73,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_VERSION_VARIABLE=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_SYS_RX_ETH_BUFFER=64 -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_MMC_OMAP_HS=y CONFIG_HSMMC2_8BIT=y
Signature · 1 line
2.25.1
PATCH 4/11 board: igep003x: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.
---
Cc: Javier Martínez Canillas <[email protected]>
Cc: Tom Rini <[email protected]>
--- configs/am335x_igep003x_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/am335x_igep003x_defconfig +1 -1
@@ -76,7 +76,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_MMC_OMAP_HS=y CONFIG_MTD=y
Signature · 1 line
2.25.1
PATCH 5/11 board: sl50: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.
---
Cc: Enric Balletbo i Serra <[email protected]>
Cc: Tom Rini <[email protected]>
--- configs/am335x_sl50_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/am335x_sl50_defconfig +1 -1
@@ -66,7 +66,7 @@ CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_BE=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_EEPROM_ADDR=0x50 CONFIG_MMC_OMAP_HS=y
Signature · 1 line
2.25.1
PATCH 6/11 board: rut: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.
---
Cc: Enrico Leto <[email protected]>
Cc: Tom Rini <[email protected]>
--- configs/rut_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configs/rut_defconfig +1 -1
@@ -90,7 +90,7 @@ CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000 -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y # CONFIG_SPL_DM_MMC is not set CONFIG_MMC_OMAP_HS=y
Signature · 1 line
2.25.1
PATCH 7/11 board: novena: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C to disable board removal warning. Convert EEPROM and IT6251 access to use DM_I2C API.
---
Cc: Marek Vasut <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>
--- board/kosagi/novena/novena.c | 10 +-- board/kosagi/novena/video.c | 140 +++++++++++++++++++---------------- configs/novena_defconfig | 2 +- 3 files changed, 81 insertions(+), 71 deletions(-)
board/kosagi/novena/novena.c +5 -5
@@ -137,23 +137,23 @@ struct novena_eeprom_data {int misc_init_r (void ) {struct novena_eeprom_data data; -uchar *datap = (uchar *)&data; +uint8_t *datap = (uint8_t *)&data;const char *signature ="Novena" ; +struct udevice *eeprom;int ret;/* If 'ethaddr' is already set, do nothing. */ if (env_get ("ethaddr" ))return 0 ; -/* EEPROM is at bus 2. */ - ret =i2c_set_bus_num (2 ); +/* EEPROM is at bus 2, address 0x56 */ + ret =i2c_get_chip_for_busnum (2 ,0x56 ,1 , &eeprom);if (ret) {puts ("Cannot select EEPROM I2C bus.\n" );return 0 ; } -/* EEPROM is at address 0x56. */ - ret =eeprom_read (0x56 ,0 , datap,sizeof (data)); + ret =dm_i2c_read (eeprom,0 , datap,sizeof (data));if (ret) {puts ("Cannot read I2C EEPROM.\n" );return 0 ;
board/kosagi/novena/video.c +75 -65
261 lines not on this page · raw message
configs/novena_defconfig +1 -1
@@ -67,7 +67,7 @@ CONFIG_NETCONSOLE=y CONFIG_BOUNCE_BUFFER=y CONFIG_DWC_AHSATA=y CONFIG_LBA48=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y CONFIG_FSL_USDHC=y
Signature · 1 line
2.25.1
Re: [PATCH 07/11] board: novena: convert to DM_I2C
Quoted 9 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, enableDM_I2Cto disable board removal warning. Convert EEPROM and IT6251 access to useDM_I2CAPI.Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Marek Vasut <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>
Thanks !
PATCH 8/11 board: vining_2000: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C to disable board removal warning.
---
Cc: Silvio Fricke <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>
--- board/softing/vining_2000/vining_2000.c | 25 ------------------------- configs/vining_2000_defconfig | 4 +--- 2 files changed, 1 insertion(+), 28 deletions(-)
board/softing/vining_2000/vining_2000.c +0 -25
@@ -18,7 +18,6 @@#include <asm/gpio.h> #include <asm/mach-imx/iomux-v3.h> #include <asm/io.h> -#include <asm/mach-imx/mxc_i2c.h> #include <asm/sections.h> #include <env.h> #include <linux/bitops.h>
@@ -27,7 +26,6 @@#include <config.h> #include <fsl_esdhc_imx.h> #include <mmc.h> -#include <i2c.h> #include <miiphy.h> #include <netdev.h> #include <power/pmic.h>
@@ -53,10 +51,6 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_HIGH | \ PAD_CTL_SRE_FAST) -#define I2C_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | \ - PAD_CTL_PKE | PAD_CTL_ODE | PAD_CTL_SPEED_MED | \ - PAD_CTL_DSE_40ohm) -#define USDHC_CLK_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \ PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST)
@@ -120,21 +114,6 @@ eth_fail:return ret; } -#define PC MUX_PAD_CTRL(I2C_PAD_CTRL) -/* I2C1 for PMIC */ -static struct i2c_pads_info i2c_pad_info1 = { - .scl = { - .i2c_mode =MX6_PAD_GPIO1_IO00__I2C1_SCL |PC , - .gpio_mode =MX6_PAD_GPIO1_IO00__GPIO1_IO_0 |PC , - .gp =IMX_GPIO_NR (1 ,0 ), - }, - .sda = { - .i2c_mode =MX6_PAD_GPIO1_IO01__I2C1_SDA |PC , - .gpio_mode =MX6_PAD_GPIO1_IO01__GPIO1_IO_1 |PC , - .gp =IMX_GPIO_NR (1 ,1 ), - }, -}; -static struct pmic *pfuze_init (unsigned char i2cbus) {struct pmic *p;
@@ -400,10 +379,6 @@ int board_init(void)/* Address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ; -#ifdef CONFIG_SYS_I2C_MXC -setup_i2c (0 ,CONFIG_SYS_I2C_SPEED ,0x7f , &i2c_pad_info1); -#endif -return board_net_init (); }
configs/vining_2000_defconfig +1 -3
@@ -12,8 +12,6 @@ CONFIG_ENV_OFFSET=0x80000 CONFIG_MX6SX=y CONFIG_MX6_DDRCAL=y CONFIG_TARGET_SOFTING_VINING_2000=y -CONFIG_SYS_I2C_MXC_I2C1=y -CONFIG_SYS_I2C_MXC_I2C3=y CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="imx6sx-softing-vining-2000" CONFIG_SPL_TEXT_BASE=0x00908000
@@ -70,7 +68,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_USE_ETHPRIME=y CONFIG_ETHPRIME="FEC" CONFIG_BOUNCE_BUFFER=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y CONFIG_SUPPORT_EMMC_RPMB=y
Signature · 1 line
2.25.1
PATCH v2 8/11 board: vining_2000: convert to DM_I2C
Conversion to DM_I2C is mandatory, enable DM_I2C to disable board removal warning.
---
Cc: Silvio Fricke <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Heiko Schocher <[email protected]>
Cc: Tom Rini <[email protected]>
---
Changes in v2:
do not remove CONFIG_SYS_I2C_MXC_I2C* to fix build warnings/errors
board/softing/vining_2000/vining_2000.c | 25 ------------------------- configs/vining_2000_defconfig | 2 +- 2 files changed, 1 insertion(+), 26 deletions(-)
board/softing/vining_2000/vining_2000.c +0 -25
@@ -18,7 +18,6 @@#include <asm/gpio.h> #include <asm/mach-imx/iomux-v3.h> #include <asm/io.h> -#include <asm/mach-imx/mxc_i2c.h> #include <asm/sections.h> #include <env.h> #include <linux/bitops.h>
@@ -27,7 +26,6 @@#include <config.h> #include <fsl_esdhc_imx.h> #include <mmc.h> -#include <i2c.h> #include <miiphy.h> #include <netdev.h> #include <power/pmic.h>
@@ -53,10 +51,6 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_HIGH | \ PAD_CTL_SRE_FAST) -#define I2C_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | \ - PAD_CTL_PKE | PAD_CTL_ODE | PAD_CTL_SPEED_MED | \ - PAD_CTL_DSE_40ohm) -#define USDHC_CLK_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \ PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST)
@@ -120,21 +114,6 @@ eth_fail:return ret; } -#define PC MUX_PAD_CTRL(I2C_PAD_CTRL) -/* I2C1 for PMIC */ -static struct i2c_pads_info i2c_pad_info1 = { - .scl = { - .i2c_mode =MX6_PAD_GPIO1_IO00__I2C1_SCL |PC , - .gpio_mode =MX6_PAD_GPIO1_IO00__GPIO1_IO_0 |PC , - .gp =IMX_GPIO_NR (1 ,0 ), - }, - .sda = { - .i2c_mode =MX6_PAD_GPIO1_IO01__I2C1_SDA |PC , - .gpio_mode =MX6_PAD_GPIO1_IO01__GPIO1_IO_1 |PC , - .gp =IMX_GPIO_NR (1 ,1 ), - }, -}; -static struct pmic *pfuze_init (unsigned char i2cbus) {struct pmic *p;
@@ -400,10 +379,6 @@ int board_init(void)/* Address of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM +0x100 ; -#ifdef CONFIG_SYS_I2C_MXC -setup_i2c (0 ,CONFIG_SYS_I2C_SPEED ,0x7f , &i2c_pad_info1); -#endif -return board_net_init (); }
configs/vining_2000_defconfig +1 -1
@@ -70,7 +70,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_USE_ETHPRIME=y CONFIG_ETHPRIME="FEC" CONFIG_BOUNCE_BUFFER=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y CONFIG_SUPPORT_EMMC_RPMB=y
Signature · 1 line
2.25.1
PATCH 9/11 board: sniper: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C to disable board removal warning. Also enable OF_UPSTREAM since we do not have a default device tree.
---
Cc: Paul Kocialkowski <[email protected]>
Cc: Tom Rini <[email protected]>
--- arch/arm/mach-omap2/omap3/Kconfig | 1 + configs/sniper_defconfig | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/omap3/Kconfig +1 -0
@@ -115,6 +115,7 @@ config TARGET_SNIPER select OMAP3_GPIO_5 select OMAP3_GPIO_6 imply CMD_DM + imply OF_UPSTREAM endchoice
configs/sniper_defconfig +4 -2
@@ -7,6 +7,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x400 CONFIG_NR_DRAM_BANKS=2 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4020ff00 +CONFIG_DEFAULT_DEVICE_TREE="ti/omap/omap3-sniper" CONFIG_SPL_TEXT_BASE=0x40200000 CONFIG_TARGET_SNIPER=y CONFIG_SPL_STACK=0x4020fffc
@@ -32,12 +33,13 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y # CONFIG_CMD_SETEXPR is not set +CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -CONFIG_SYS_I2C_LEGACY=y +# CONFIG_TI_SYSC is not set +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_SPEED=400000 CONFIG_TWL4030_INPUT=y CONFIG_MMC_OMAP_HS=y CONFIG_CONS_INDEX=3 -CONFIG_OF_LIBFDT=y
Signature · 1 line
2.25.1
Re: [PATCH 09/11] board: sniper: convert to DM_I2C
Hi,
Quoted 4 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, enableDM_I2Cto disable board removal warning. Also enableOF_UPSTREAMsince we do not have a default device tree.
Thanks for looking into this, but I already submitted a similar patch just a few days ago, with additional cleanups!
See https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Cheers,
Paul
Quoted 52 lines
Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Paul Kocialkowski <[email protected]>
Cc: Tom Rini <[email protected]>--- arch/arm/mach-omap2/omap3/Kconfig | 1 + configs/sniper_defconfig | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-)arch/arm/mach-omap2/omap3/Kconfig +1
-0@@ -115,6 +115,7 @@ config TARGET_SNIPER select OMAP3_GPIO_5 select OMAP3_GPIO_6 imply CMD_DM + imply OF_UPSTREAM endchoiceconfigs/sniper_defconfig +4
-2@@ -7,6 +7,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x400 CONFIG_NR_DRAM_BANKS=2 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4020ff00 +CONFIG_DEFAULT_DEVICE_TREE="ti/omap/omap3-sniper" CONFIG_SPL_TEXT_BASE=0x40200000 CONFIG_TARGET_SNIPER=y CONFIG_SPL_STACK=0x4020fffc@@ -32,12 +33,13 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y # CONFIG_CMD_SETEXPR is not set +CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y -CONFIG_SYS_I2C_LEGACY=y +# CONFIG_TI_SYSC is not set +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_SPEED=400000 CONFIG_TWL4030_INPUT=y CONFIG_MMC_OMAP_HS=y CONFIG_CONS_INDEX=3 -CONFIG_OF_LIBFDT=ySignature · 1 line
2.25.1
Signature · 6 lines
Paul Kocialkowski, Independent contractor - sys-base - https://www.sys-base.io/ Free software developer - https://www.paulk.fr/ Expertise in multimedia, graphics and embedded hardware support with Linux.
PATCH 10/11 board: cm_fx6: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C to fix board removal warning. Convert EEPROM access to use DM_I2C API.
---
Cc: Nikita Kiryanov <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>
--- board/compulab/cm_fx6/cm_fx6.c | 3 ++- board/compulab/common/Makefile | 2 +- board/compulab/common/eeprom.c | 14 +++++--------- board/compulab/common/eeprom.h | 2 +- configs/cm_fx6_defconfig | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-)
board/compulab/cm_fx6/cm_fx6.c +2 -1
@@ -14,6 +14,7 @@#include <env.h> #include <fsl_esdhc_imx.h> #include <init.h> +#include <i2c.h> #include <miiphy.h> #include <mtd_node.h> #include <net.h>
@@ -256,7 +257,7 @@ static int cm_fx6_setup_one_i2c(int busnum, struct i2c_pads_info *pads) {int ret; - ret =setup_i2c (busnum,CONFIG_SYS_I2C_SPEED ,0x7f , pads); + ret =setup_i2c (busnum,I2C_SPEED_STANDARD_RATE ,0x7f , pads);if (ret)printf ("Warning: I2C%d setup failed: %d\n" , busnum, ret);
board/compulab/common/Makefile +1 -1
@@ -5,5 +5,5 @@ # Author: Igor Grinberg <[email protected]> obj-y += common.o -obj-$(CONFIG_$(SPL_)SYS_I2C_LEGACY) += eeprom.o +obj-$(CONFIG_$(SPL_)DM_I2C) += eeprom.o obj-$(CONFIG_SMC911X) += omap3_smc911x.o
board/compulab/common/eeprom.c +5 -9
@@ -34,19 +34,15 @@ static int cl_eeprom_layout; /* Implicitly LAYOUT_INVALID */static int cl_eeprom_read (uint offset,uchar *buf,int len) { +struct udevice *eeprom;int res; -unsigned int current_i2c_bus =i2c_get_bus_num (); - res =i2c_set_bus_num (cl_eeprom_bus); -if (res <0 ) + res =i2c_get_chip_for_busnum (cl_eeprom_bus,CONFIG_SYS_I2C_EEPROM_ADDR , +CONFIG_SYS_I2C_EEPROM_ADDR_LEN , &eeprom); +if (res)return res; - res =i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR , offset, -CONFIG_SYS_I2C_EEPROM_ADDR_LEN , buf, len); - -i2c_set_bus_num (current_i2c_bus); - -return res; +return dm_i2c_read (eeprom, offset, (uint8_t *)buf, len); }static int cl_eeprom_setup (uint eeprom_bus)
board/compulab/common/eeprom.h +1 -1
@@ -10,7 +10,7 @@#define _EEPROM_#include <errno.h> -#if CONFIG_IS_ENABLED (SYS_I2C_LEGACY ) +#if CONFIG_IS_ENABLED (DM_I2C )int cl_eeprom_read_mac_addr (uchar *buf,uint eeprom_bus);u32 cl_eeprom_get_board_rev (uint eeprom_bus);int cl_eeprom_get_product_name (uchar *buf,uint eeprom_bus);
configs/cm_fx6_defconfig +1 -1
@@ -80,7 +80,7 @@ CONFIG_BOUNCE_BUFFER=y CONFIG_DWC_AHSATA=y # CONFIG_DWC_AHSATA_AHCI is not set CONFIG_LBA48=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y CONFIG_SYS_MXC_I2C3_SPEED=400000
Signature · 1 line
2.25.1
Re: [PATCH 10/11] board: cm_fx6: convert to DM_I2C
Hello Anatolij,
Quoted 8 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, enableDM_I2Cto fix board removal warning. Convert EEPROM access to useDM_I2CAPI.Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Nikita Kiryanov <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>
Quoted 7 lines
--- board/compulab/cm_fx6/cm_fx6.c | 3 ++- board/compulab/common/Makefile | 2 +- board/compulab/common/eeprom.c | 14 +++++--------- board/compulab/common/eeprom.h | 2 +- configs/cm_fx6_defconfig | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-)
This patch breaks world build ... could you take a look?
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
Re: [PATCH 10/11] board: cm_fx6: convert to DM_I2C
Hello Heiko,
Quoted 19 lines · On Wed, 7 Aug 2024 13:16:21 +0200 Heiko Schocher [email protected] wrote:
Hello Anatolij,
Quoted 8 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, enableDM_I2Cto fix board removal warning. Convert EEPROM access to useDM_I2CAPI.Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Nikita Kiryanov <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>Quoted 7 lines
--- board/compulab/cm_fx6/cm_fx6.c | 3 ++- board/compulab/common/Makefile | 2 +- board/compulab/common/eeprom.c | 14 +++++--------- board/compulab/common/eeprom.h | 2 +- configs/cm_fx6_defconfig | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-)
Quoted 3 lines
This patch breaks world build ... could you take a look?
I've sent a v2 patch to fix this. Thanks!
--
Anatolij
Re: [PATCH 10/11] board: cm_fx6: convert to DM_I2C
Hello Anatolij,
Quoted 24 lines · Anatolij Gustschin
Hello Heiko,
Quoted 19 lines · On Wed, 7 Aug 2024 13:16:21 +0200 Heiko Schocher [email protected] wrote:
Hello Anatolij,
Quoted 15 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, enableDM_I2Cto fix board removal warning. Convert EEPROM access to useDM_I2CAPI.Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Nikita Kiryanov <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>--- board/compulab/cm_fx6/cm_fx6.c | 3 ++- board/compulab/common/Makefile | 2 +- board/compulab/common/eeprom.c | 14 +++++--------- board/compulab/common/eeprom.h | 2 +- configs/cm_fx6_defconfig | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-)
Quoted 5 lines
Quoted 3 lines
This patch breaks world build ... could you take a look?
I've sent a v2 patch to fix this. Thanks!
Thanks!
Applied to my local tree.. wait for response/fix from Fedor for another i2c patch ... than I start another round...
bye,
Heiko
Quoted 4 lines
--
Anatolij
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
PATCH v2 10/11 board: cm_fx6: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C to fix board removal warning. Convert EEPROM access to use DM_I2C API.
---
Cc: Nikita Kiryanov <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Heiko Schocher <[email protected]>
Cc: Tom Rini <[email protected]>
---
Changes in v2: fix trimslice build errors
board/compulab/cm_fx6/cm_fx6.c | 3 ++- board/compulab/common/Makefile | 8 +++++++- board/compulab/common/eeprom.c | 14 +++++--------- board/compulab/common/eeprom.h | 2 +- configs/cm_fx6_defconfig | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-)
board/compulab/cm_fx6/cm_fx6.c +2 -1
@@ -14,6 +14,7 @@#include <env.h> #include <fsl_esdhc_imx.h> #include <init.h> +#include <i2c.h> #include <miiphy.h> #include <mtd_node.h> #include <net.h>
@@ -256,7 +257,7 @@ static int cm_fx6_setup_one_i2c(int busnum, struct i2c_pads_info *pads) {int ret; - ret =setup_i2c (busnum,CONFIG_SYS_I2C_SPEED ,0x7f , pads); + ret =setup_i2c (busnum,I2C_SPEED_STANDARD_RATE ,0x7f , pads);if (ret)printf ("Warning: I2C%d setup failed: %d\n" , busnum, ret);
board/compulab/common/Makefile +7 -1
@@ -4,6 +4,12 @@ # # Author: Igor Grinberg <[email protected]> +CL_EEPROM=y + +ifdef CONFIG_TARGET_TRIMSLICE +CL_EEPROM= +endif + obj-y += common.o -obj-$(CONFIG_$(SPL_)SYS_I2C_LEGACY) += eeprom.o +obj-$(CL_EEPROM) += eeprom.o obj-$(CONFIG_SMC911X) += omap3_smc911x.o
board/compulab/common/eeprom.c +5 -9
@@ -34,19 +34,15 @@ static int cl_eeprom_layout; /* Implicitly LAYOUT_INVALID */static int cl_eeprom_read (uint offset,uchar *buf,int len) { +struct udevice *eeprom;int res; -unsigned int current_i2c_bus =i2c_get_bus_num (); - res =i2c_set_bus_num (cl_eeprom_bus); -if (res <0 ) + res =i2c_get_chip_for_busnum (cl_eeprom_bus,CONFIG_SYS_I2C_EEPROM_ADDR , +CONFIG_SYS_I2C_EEPROM_ADDR_LEN , &eeprom); +if (res)return res; - res =i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR , offset, -CONFIG_SYS_I2C_EEPROM_ADDR_LEN , buf, len); - -i2c_set_bus_num (current_i2c_bus); - -return res; +return dm_i2c_read (eeprom, offset, (uint8_t *)buf, len); }static int cl_eeprom_setup (uint eeprom_bus)
board/compulab/common/eeprom.h +1 -1
@@ -10,7 +10,7 @@#define _EEPROM_#include <errno.h> -#if CONFIG_IS_ENABLED (SYS_I2C_LEGACY ) +#if !CONFIG_IS_ENABLED (TARGET_TRIMSLICE )int cl_eeprom_read_mac_addr (uchar *buf,uint eeprom_bus);u32 cl_eeprom_get_board_rev (uint eeprom_bus);int cl_eeprom_get_product_name (uchar *buf,uint eeprom_bus);
configs/cm_fx6_defconfig +1 -1
@@ -80,7 +80,7 @@ CONFIG_BOUNCE_BUFFER=y CONFIG_DWC_AHSATA=y # CONFIG_DWC_AHSATA_AHCI is not set CONFIG_LBA48=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y CONFIG_SYS_MXC_I2C3_SPEED=400000
Signature · 1 line
2.25.1
Re: [PATCH v2 10/11] board: cm_fx6: convert to DM_I2C
Hi Anatolij,
Quoted 4 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, enableDM_I2Cto fix board removal warning. Convert EEPROM access to useDM_I2CAPI.
Quoted 8 lines
Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Nikita Kiryanov <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Heiko Schocher <[email protected]>
Cc: Tom Rini <[email protected]>
---
Changes in v2: fix trimslice build errors
Thanks
PATCH 11/11 board: vf610twr: convert to DM_I2C
In reply to Anatolij GustschinConversion to DM_I2C is mandatory, enable DM_I2C to disable board removal warning.
---
Cc: Alison Wang <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Tom Rini <[email protected]>
--- configs/vf610twr_defconfig | 2 +- configs/vf610twr_nand_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
configs/vf610twr_defconfig +1 -1
@@ -47,7 +47,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_VYBRID_GPIO=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y CONFIG_FSL_ESDHC_IMX=y CONFIG_MTD=y
configs/vf610twr_nand_defconfig +1 -1
@@ -48,7 +48,7 @@ CONFIG_ENV_IS_IN_NAND=y CONFIG_ENV_RANGE=0x80000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_VYBRID_GPIO=y -CONFIG_SYS_I2C_LEGACY=y +CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y CONFIG_FSL_ESDHC_IMX=y CONFIG_MTD=y
Signature · 1 line
2.25.1
Hello Anatolij,
Quoted 7 lines · Anatolij Gustschin
Conversion to
DM_I2Cis mandatory, rework to remove use of legacy I2C API.Signed-off-by Anatolij Gustschin <[email protected]>---
Cc: Heiko Schocher <[email protected]>
Cc: Tom Rini <[email protected]>
Quoted 7 lines
--- board/bosch/shc/board.c | 22 +++++++++++----------- configs/am335x_shc_defconfig | 4 +++- configs/am335x_shc_ict_defconfig | 4 +++- configs/am335x_shc_netboot_defconfig | 4 +++- configs/am335x_shc_sdboot_defconfig | 4 +++- 5 files changed, 23 insertions(+), 15 deletions(-)
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]