From patchwork Tue Mar 24 22:46:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 244223 List-Id: U-Boot discussion From: marex at denx.de (Marek Vasut) Date: Tue, 24 Mar 2020 23:46:30 +0100 Subject: [PATCH] [RFC] i2c: stm32f2: FIXME: Disable I2C timing calculation Message-ID: <20200324224630.151909-1-marex@denx.de> WARNING: This is NOT a fix, but rather a bug report / notice of a problem. Disable the I2C timing calculation. The calculation is adding 1 second (!) to the SPL boot time only to calculate I2C timing parameters, that is not acceptable. Moreover, it is exercising the memory allocator massively. Is there no simplified timing parameter calculation which could replace that horribleness ? Signed-off-by: Marek Vasut Cc: Nicolas Le Bayon Cc: Patrick Delaunay --- drivers/i2c/stm32f7_i2c.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c index 7d046c1a1e..d549fd0058 100644 --- a/drivers/i2c/stm32f7_i2c.c +++ b/drivers/i2c/stm32f7_i2c.c @@ -743,20 +743,25 @@ static int stm32_i2c_hw_config(struct stm32_i2c_priv *i2c_priv) struct stm32_i2c_timings t; int ret; u32 timing = 0; - + /* This calculation adds 1 second to SPL boot time */ +#if 0 ret = stm32_i2c_setup_timing(i2c_priv, &t); if (ret) return ret; - +#endif /* Disable I2C */ clrbits_le32(®s->cr1, STM32_I2C_CR1_PE); /* Timing settings */ +#if 0 timing |= STM32_I2C_TIMINGR_PRESC(t.presc); timing |= STM32_I2C_TIMINGR_SCLDEL(t.scldel); timing |= STM32_I2C_TIMINGR_SDADEL(t.sdadel); timing |= STM32_I2C_TIMINGR_SCLH(t.sclh); timing |= STM32_I2C_TIMINGR_SCLL(t.scll); +#else +timing = 0x10d09b90; +#endif writel(timing, ®s->timingr); /* Enable I2C */