
On Tue, 2019-04-30 at 09:20 +0200, Heiko Schocher wrote:
Am 12.04.2019 um 21:19 schrieb Trent Piepho:
These options only apply when not using DM_I2C. When using device trees, the dt will enable and control the speeds of the I2C controller(s) and these configuration options have no effect.
So disable them in DM_I2C mode. Otherwise they show up as decoys, and make it look like one is enabling I2C controllers and setting the speed when really it's doing nothing.
arm: + wandboard
+board/wandboard/wandboard.c: In function 'board_init': +board/wandboard/wandboard.c:466:15: error: 'CONFIG_SYS_MXC_I2C1_SPEED' undeclared (first use in this function); did you mean 'CONFIG_SYS_MMC_ENV_DEV'?
- setup_i2c(1, CONFIG_SYS_MXC_I2C1_SPEED, 0x7f, &mx6dl_i2c2_pad_info);
^~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG_SYS_MMC_ENV_DEV
+board/wandboard/wandboard.c:466:15: note: each undeclared identifier is reported only once for each function it appears in +board/wandboard/wandboard.c:469:16: error: 'CONFIG_SYS_MXC_I2C2_SPEED' undeclared (first use in this function); did you mean 'CONFIG_SYS_MXC_I2C1_SPEED'?
- setup_i2c(2, CONFIG_SYS_MXC_I2C2_SPEED, 0x7f, &mx6q_i2c3_pad_info);
^~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG_SYS_MXC_I2C1_SPEED
+make[2]: *** [board/wandboard/wandboard.o] Error 1 +make[1]: *** [board/wandboard] Error 2 +make: *** [sub-make] Error 2
Please check.
This is caused by a conflict with "imx6: wandboard: convert to DM_I2C", which was applied after I sent my patch.
I'm not sure if that commit is correct. Copying Anatolij.
It's the only place where non-DM_I2C code uses the kconfig based configuration of I2C. If we look at the code in question:
setup_i2c(1, CONFIG_SYS_MXC_I2C1_SPEED, 0x7f, &mx6dl_i2c2_pad_info);
Seems a bit odd bus 1 is being configured with i2c*2* pad info? But let's take a look at setup_i2c().
int setup_i2c(unsigned i2c_index, int speed, int slave_addr, struct i2c_pads_info *p) { .... /* Enable i2c clock */ ret = enable_i2c_clk(1, i2c_index); if (ret) goto err_clk;
/* Make sure bus is idle */ ret = force_idle_bus(p); if (ret) goto err_idle;
#ifndef CONFIG_DM_I2C bus_i2c_init(i2c_index, speed, slave_addr, force_idle_bus, p); #endif return 0;
err_idle: err_clk: gpio_free(p->scl.gp); err_req: gpio_free(p->sda.gp);
return ret; }
Nothing in the elided section uses "speed". It's only used in the bus_i2c_init() call, and that call is not made when using DM_I2C!
So while the wandboard code references CONFIG_SYS_MXC_I2C1_SPEED when using DM_i2C, it's never used by anything.
So I believe I'm still correct, even after the wandboard change that CONFIG_SYS_MXC_I2C1_SPEED et al are decoys that aren't used.