dm: i2c: Add I2C support for i.CoreM6
Subsystems (3)
cover dm: i2c: Add I2C support for i.CoreM6
From: Jagan Teki <[email protected]>
This series add I2C support for i.CoreM6 and it is on top of [1] with u-boot-imx/master branch.
[1] [PATCH v7 00/21] imx6: Add Engicam i.CoreM6 QDL support
Jagan Teki (4):
i2c: Kconfig: Add SYS_I2C_MXC entry
i2c: mxc: Print hex instead of decimal for bus address
i2c: mxc: Make 'no gpio pinctrl state' print as debug
imx6: icorem6: Add I2C support
arch/arm/cpu/armv7/mx6/Kconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 2 ++ configs/imx6qdl_icore_nand_defconfig | 2 ++ drivers/i2c/Kconfig | 8 ++++++++ drivers/i2c/mxc_i2c.c | 2 +- 5 files changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/4 i2c: Kconfig: Add SYS_I2C_MXC entry
Added kconfig for SYS_I2C_MXC driver.
--- drivers/i2c/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/i2c/Kconfig +8 -0
@@ -109,6 +109,14 @@ config SYS_I2C_INTEL the I2C API meaning that any I2C operations will immediately fail for now. +config SYS_I2C_MXC + bool "NXP i.MX I2C driver" + depends on MX6 + help + Add support for the NXP i.MX I2C driver. This supports upto for bus + channels and operating on standard mode upto 100 kbits/s and fast + mode upto 400 kbits/s. + config SYS_I2C_ROCKCHIP bool "Rockchip I2C driver" depends on DM_I2C
Signature · 1 line
2.7.4
PATCH 2/4 i2c: mxc: Print hex instead of decimal for bus address
In reply to Jagan TekiFrom: Jagan Teki <[email protected]>
Better to print the hex value for bus address instead of decimal, for more readbility on bus addressing.
Before:
------
U-Boot> i2c dev 1
Setting bus to 1
i2c bus 1 at 35274752, no gpio pinctrl state.
After:
------
U-Boot> i2c dev 1
Setting bus to 1
i2c bus 1 at 0x21a4000, no gpio pinctrl state.
--- drivers/i2c/mxc_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/mxc_i2c.c +1 -1
@@ -775,7 +775,7 @@ static int mxc_i2c_probe(struct udevice *bus)*/ ret =fdt_find_string (fdt, node,"pinctrl-names" ,"gpio" );if (ret <0 ) { -dev_info (dev,"i2c bus %d@%lu, no gpio pinctrl state.\n" , bus->seq, i2c_bus->base); +dev_info (dev,"i2c bus %d at 0x%2lx, no gpio pinctrl state.\n" , bus->seq, i2c_bus->base); }else { ret = gpio_request_by_name_nodev(fdt, node, "scl-gpios", 0, &i2c_bus->scl_gpio,
Signature · 1 line
2.7.4
PATCH 3/4 i2c: mxc: Make 'no gpio pinctrl state' print as debug
In reply to Jagan TekiFrom: Jagan Teki <[email protected]>
Some I2C bus devicetree nodes, doesn't require to have gpio pinctrl so replace the dev_info to debug so the print never comes on the console and for bus that uses gpio pinctrl anyway have dev_err.
Before:
------
U-Boot> i2c dev 1
Setting bus to 1
i2c bus 1 at 0x21a4000, no gpio pinctrl state.
After:
------
U-Boot> i2c dev 1
Setting bus to 1
--- drivers/i2c/mxc_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/mxc_i2c.c +1 -1
@@ -775,7 +775,7 @@ static int mxc_i2c_probe(struct udevice *bus)*/ ret =fdt_find_string (fdt, node,"pinctrl-names" ,"gpio" );if (ret <0 ) { -dev_info (dev,"i2c bus %d@0x%2lx, no gpio pinctrl state.\n" , bus->seq, i2c_bus->base); +debug ("i2c bus %d at 0x%2lx, no gpio pinctrl state.\n" , bus->seq, i2c_bus->base); }else { ret = gpio_request_by_name_nodev(fdt, node, "scl-gpios", 0, &i2c_bus->scl_gpio,
Signature · 1 line
2.7.4
PATCH 4/4 imx6: icorem6: Add I2C support
In reply to Jagan TekiFrom: Jagan Teki <[email protected]>
Add I2C support for Engicam i.CoreM6 qdl board.
icorem6qdl> i2c bus
Bus 0: i2c at 021a0000 Bus 1: i2c at 021a4000 Bus 2: i2c at 021a8000
icorem6qdl> i2c dev 2
Setting bus to 2
icorem6qdl> i2c speed 100000
Setting bus speed to 100000 Hz
icorem6qdl> i2c probe
Valid chip addresses: 2C
icorem6qdl> i2c md 2C 0xff
00ff: 00 00 00 00 0f f0 01 64 ff ff 00 00 00 00 00 00 .......d........
--- arch/arm/cpu/armv7/mx6/Kconfig | 1 + configs/imx6qdl_icore_mmc_defconfig | 2 ++ configs/imx6qdl_icore_nand_defconfig | 2 ++ 3 files changed, 5 insertions(+)
arch/arm/cpu/armv7/mx6/Kconfig +1 -0
@@ -102,6 +102,7 @@ config TARGET_MX6Q_ICORE select DM select DM_ETH select DM_GPIO + select DM_I2C select DM_MMC select DM_THERMAL select SUPPORT_SPL
configs/imx6qdl_icore_mmc_defconfig +2 -0
@@ -16,6 +16,7 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_BMP=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_MEMTEST=y
@@ -32,6 +33,7 @@ CONFIG_MXC_UART=y CONFIG_IMX_THERMAL=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_SYS_I2C_MXC=y CONFIG_VIDEO_IPUV3=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y
configs/imx6qdl_icore_nand_defconfig +2 -0
@@ -16,6 +16,7 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_BMP=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_MEMTEST=y
@@ -28,6 +29,7 @@ CONFIG_NAND_MXS=y CONFIG_IMX_THERMAL=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y +CONFIG_SYS_I2C_MXC=y CONFIG_VIDEO_IPUV3=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y
Signature · 1 line
2.7.4