[PATCH] [RFC] i2c: stm32f2: FIXME: Disable I2C timing calculation

Marek Vasut marex at denx.de
Tue Mar 24 23:46:30 CET 2020


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 <marex at denx.de>
Cc: Nicolas Le Bayon <nicolas.le.bayon at st.com>
Cc: Patrick Delaunay <patrick.delaunay at st.com>
---
 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(&regs->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, &regs->timingr);
 
 	/* Enable I2C */
-- 
2.25.1



More information about the U-Boot mailing list