i2c, mxc: switch to new multibus/multiadapter framework
Subsystems (3)
v2 cover i2c, mxc: switch to new multibus/multiadapter framework
This serie is composed of three patches:
- one to fix the i2c init on the generic board
- one to port the i2c mxc driver to new subsystem
- one to update all configurations with i2c mxc driver
This serie was tested with success on armadeus apf27.
Difference between v2 and v1:
- change title of the serie
- use define for speed and slave for each i2c bus
- sort i2c driver list
- define mxc function as static
- remove CONFIG_I2C_MULTI_BUS in config using i2c mxc
Philippe Reynes (3):
i2c: fix init on generic board
i2c: move to new subsystem
i2c: update config using mxc driver to new subsystem
README | 11 +++ arch/arm/cpu/armv7/mx5/clock.c | 2 +- arch/arm/cpu/armv7/mx6/clock.c | 2 +- arch/arm/imx-common/Makefile | 2 +- common/board_f.c | 4 + drivers/i2c/Makefile | 2 +- drivers/i2c/mxc_i2c.c | 137 +++++++++++++++++++++---------------- include/configs/apf27.h | 11 ++-- include/configs/flea3.h | 9 +-- include/configs/imx31_phycore.h | 7 +- include/configs/m53evk.h | 7 +- include/configs/mx25pdk.h | 7 +- include/configs/mx35pdk.h | 7 +- include/configs/mx53ard.h | 7 +- include/configs/mx53evk.h | 7 +- include/configs/mx53loco.h | 7 +- include/configs/mx53smd.h | 7 +- include/configs/mx6qsabreauto.h | 4 +- include/configs/nitrogen6x.h | 4 +- include/configs/titanium.h | 4 +- include/configs/vf610twr.h | 7 +- include/configs/woodburn_common.h | 7 +- 22 files changed, 143 insertions(+), 119 deletions(-)
Signature · 1 line
1.7.4.4
PATCH v2 1/3 i2c: fix init on generic board
--- common/board_f.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
common/board_f.c +4 -0
@@ -249,7 +249,11 @@ void dram_init_banksize(void)static int init_func_i2c (void ) {puts ("I2C: " ); +#ifdef CONFIG_SYS_I2C +i2c_init_all (); +#else i2c_init (CONFIG_SYS_I2C_SPEED ,CONFIG_SYS_I2C_SLAVE ); +#endif puts ("ready\n" );return 0 ; }
Signature · 1 line
1.7.4.4
PATCH v2 2/3 i2c: move to new subsystem
In reply to Philippe Reynes--- README | 11 +++ arch/arm/cpu/armv7/mx5/clock.c | 2 +- arch/arm/cpu/armv7/mx6/clock.c | 2 +- arch/arm/imx-common/Makefile | 2 +- drivers/i2c/Makefile | 2 +- drivers/i2c/mxc_i2c.c | 137 +++++++++++++++++++++++----------------- 6 files changed, 93 insertions(+), 63 deletions(-)
README +11 -0
@@ -1995,6 +1995,17 @@ CBFS (Coreboot Filesystem) support - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0 - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1 + - drivers/i2c/i2c_mxc.c + - activate this driver with CONFIG_SYS_I2C_MXC + - define speed for bus 1 with CONFIG_SYS_MXC_I2C1_SPEED + - define slave for bus 1 with CONFIG_SYS_MXC_I2C1_SLAVE + - define speed for bus 2 with CONFIG_SYS_MXC_I2C2_SPEED + - define slave for bus 2 with CONFIG_SYS_MXC_I2C2_SLAVE + - define speed for bus 3 with CONFIG_SYS_MXC_I2C3_SPEED + - define slave for bus 3 with CONFIG_SYS_MXC_I2C3_SLAVE + If thoses defines are not set, default value is 100000 + for speed, and 0 for slave. + additional defines: CONFIG_SYS_NUM_I2C_BUSES
arch/arm/cpu/armv7/mx5/clock.c +1 -1
@@ -94,7 +94,7 @@ void enable_usboh3_clk(bool enable) MXC_CCM_CCGR2_USBOH3_60M(cg)); } -#ifdef CONFIG_I2C_MXC +#ifdef CONFIG_SYS_I2C_MXC /* i2c_num can be from 0, to 1 for i.MX51 and 2 for i.MX53 */ int enable_i2c_clk (unsigned char enable,unsigned i2c_num) {
arch/arm/cpu/armv7/mx6/clock.c +1 -1
@@ -48,7 +48,7 @@ void enable_usboh3_clk(unsigned char enable) } -#ifdef CONFIG_I2C_MXC +#ifdef CONFIG_SYS_I2C_MXC /* i2c_num can be from 0 - 2 */ int enable_i2c_clk (unsigned char enable,unsigned i2c_num) {
arch/arm/imx-common/Makefile +1 -1
@@ -16,7 +16,7 @@ COBJS-y = iomux-v3.o endif ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) COBJS-y += timer.o cpu.o speed.o -COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o +COBJS-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o endif ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) COBJS-y += misc.o
drivers/i2c/Makefile +1 -1
@@ -14,7 +14,6 @@ COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o COBJS-$(CONFIG_DW_I2C) += designware_i2c.o COBJS-$(CONFIG_I2C_MVTWSI) += mvtwsi.o COBJS-$(CONFIG_I2C_MV) += mv_i2c.o -COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o COBJS-$(CONFIG_I2C_MXS) += mxs_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
@@ -29,6 +28,7 @@ COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o COBJS-$(CONFIG_SYS_I2C) += i2c_core.o COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o COBJS-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o +COBJS-$(CONFIG_SYS_I2C_MXC) += mxc_i2c.o COBJS-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o COBJS-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o COBJS-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
drivers/i2c/mxc_i2c.c +78 -59
187 lines not on this page · raw message
Signature · 1 line
1.7.4.4
PATCH v2 2/3 i2c: move to new subsystem
Hi Philippe,
Quoted 10 lines · Philippe Reynes
Signed-off-by Philippe Reynes <[email protected]>--- README | 11 +++ arch/arm/cpu/armv7/mx5/clock.c | 2 +- arch/arm/cpu/armv7/mx6/clock.c | 2 +- arch/arm/imx-common/Makefile | 2 +- drivers/i2c/Makefile | 2 +- drivers/i2c/mxc_i2c.c | 137 +++++++++++++++++++++++----------------- 6 files changed, 93 insertions(+), 63 deletions(-)
As this affects MXC, not i2c as a whole, the patch summary should have an "mxc:" tag prepended to the "i2c:" one.
Amicalement,
Signature · 1 line
Albert.
PATCH v2 3/3 i2c: update config using mxc driver to new subsystem
In reply to Philippe Reynes--- include/configs/apf27.h | 11 ++++++----- include/configs/flea3.h | 9 ++++----- include/configs/imx31_phycore.h | 7 +++---- include/configs/m53evk.h | 7 +++---- include/configs/mx25pdk.h | 7 +++---- include/configs/mx35pdk.h | 7 +++---- include/configs/mx53ard.h | 7 +++---- include/configs/mx53evk.h | 7 +++---- include/configs/mx53loco.h | 7 +++---- include/configs/mx53smd.h | 7 +++---- include/configs/mx6qsabreauto.h | 4 ++-- include/configs/nitrogen6x.h | 4 ++-- include/configs/titanium.h | 4 ++-- include/configs/vf610twr.h | 7 +++---- include/configs/woodburn_common.h | 7 +++---- 15 files changed, 46 insertions(+), 56 deletions(-)
include/configs/apf27.h +6 -5
@@ -321,11 +321,12 @@*/ #ifdef CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE IMX_I2C1_BASE -#define CONFIG_SYS_I2C_SPEED 100000/* 100 kHz */ -#define CONFIG_SYS_I2C_SLAVE 0x7F +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_MXC_I2C1_SPEED 100000/* 100 kHz */ +#define CONFIG_SYS_MXC_I2C1_SLAVE 0x7F +#define CONFIG_SYS_MXC_I2C2_SPEED 100000/* 100 kHz */ +#define CONFIG_SYS_MXC_I2C2_SLAVE 0x7F#define CONFIG_SYS_I2C_NOPROBES { }#ifdef CONFIG_CMD_EEPROM
include/configs/flea3.h +4 -5
@@ -50,11 +50,10 @@/* * Hardware drivers */ -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C3_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 -#define CONFIG_SYS_I2C_SLAVE 0xfe +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 2/* I2C3 */ +#define CONFIG_SYS_MXC_I2C3_SLAVE 0xfe#define CONFIG_MXC_SPI #define CONFIG_MXC_GPIO
include/configs/imx31_phycore.h +3 -4
@@ -35,11 +35,10 @@* Hardware drivers */ -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C2_BASE_ADDR +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 1/* I2C2 */ #define CONFIG_SYS_I2C_CLK_OFFSET I2C2_CLK_OFFSET -#define CONFIG_SYS_I2C_SPEED 100000#define CONFIG_MXC_UART #define CONFIG_MXC_UART_BASE UART1_BASE
include/configs/m53evk.h +3 -4
@@ -161,10 +161,9 @@* I2C */ #ifdef CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C2_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 1/* I2C2 */ #endif /*
include/configs/mx25pdk.h +3 -4
@@ -111,10 +111,9 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE IMX_I2C_BASE -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 0/* I2C1 */ /* RTC */ #define CONFIG_RTC_IMXDI
include/configs/mx35pdk.h +3 -4
@@ -41,10 +41,9 @@/* * Hardware drivers */ -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C1_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 0/* I2C1 */ #define CONFIG_MXC_SPI #define CONFIG_MXC_GPIO
include/configs/mx53ard.h +3 -4
@@ -44,10 +44,9 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C2_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 1/* I2C2 */ /* MMC Configs */ #define CONFIG_FSL_ESDHC
include/configs/mx53evk.h +3 -4
@@ -37,10 +37,9 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C2_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 1/* I2C2 */ /* PMIC Configs */ #define CONFIG_POWER
include/configs/mx53loco.h +3 -4
@@ -71,10 +71,9 @@#define CONFIG_MXC_USB_FLAGS 0/* I2C Configs */ -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C1_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 0/* I2C1 */ /* PMIC Controller */ #define CONFIG_POWER
include/configs/mx53smd.h +3 -4
@@ -34,10 +34,9 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C2_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 1/* I2C2 */ /* MMC Configs */ #define CONFIG_FSL_ESDHC
include/configs/mx6qsabreauto.h +2 -2
@@ -36,8 +36,8 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_MXC +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000#endif /* __MX6QSABREAUTO_CONFIG_H */
include/configs/nitrogen6x.h +2 -2
@@ -52,8 +52,8 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_MXC +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000/* OCOTP Configs */
include/configs/titanium.h +2 -2
@@ -41,8 +41,8 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_I2C_MULTI_BUS -#define CONFIG_I2C_MXC +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000/* MMC Configs */
include/configs/vf610twr.h +3 -4
@@ -70,10 +70,9 @@/* I2C Configs */ #define CONFIG_CMD_I2C -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C0_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 0#define CONFIG_BOOTDELAY 3
include/configs/woodburn_common.h +3 -4
@@ -45,10 +45,9 @@/* * Hardware drivers */ -#define CONFIG_HARD_I2C -#define CONFIG_I2C_MXC -#define CONFIG_SYS_I2C_BASE I2C1_BASE_ADDR -#define CONFIG_SYS_I2C_SPEED 100000 +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_MXC +#define CONFIG_SYS_SPD_BUS_NUM 0#define CONFIG_MXC_SPI #define CONFIG_MXC_GPIO
Signature · 1 line
1.7.4.4