diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2022-12-22 09:25:07 +0100 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-12-23 15:55:40 +0000 |
commit | a1a3be1df84fd76c9195dff182e77fe391101c7f (patch) | |
tree | d9396268347d11d5f45925f66eb35b775cc95cb0 /src | |
parent | 4d75dbd1c1d6362c002a26a5c4e6de74b2816cdf (diff) |
mb/siemens/mc_apl7: Init I2C controller before PTN3460 is initialized
When PTN3460_EARLY_INIT is selected, the PTN3460 (DP-2-LVDS-bridge) will
be initialized before all devices are initialized. This is necessary to
get a valid EDID data set into the PTN3460 before the graphic controller
is initialized in order to be able to show a splash screen.
For ptn3460_init() to work properly the I2C bus this bridge is connected
to needs to be initialized. As this I2C bus initialization would be done
too late in the normal flow, it needs to be called here explicitly
before ptn3460_init() to initialize the I2C bus with the needed
conditions. Otherwise the default I2C settings of the controller will be
used which results in a clock rate too high for this mainboard.
Test=Measure I2C bus signals and make sure that the clock is <= 400 kHz.
Change-Id: I1775fb7c2d29f765224d0e7c7ff9fcd4dbf847c5
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71226
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/i2c/ptn3460/ptn3460.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/i2c/ptn3460/ptn3460.c b/src/drivers/i2c/ptn3460/ptn3460.c index 46719dc5e6..3ea41ba22c 100644 --- a/src/drivers/i2c/ptn3460/ptn3460.c +++ b/src/drivers/i2c/ptn3460/ptn3460.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <console/console.h> +#include <device/device.h> #include <device/i2c_bus.h> #include <types.h> #include <bootstate.h> @@ -170,7 +171,9 @@ static void ptn3460_early_init(void *unused) printk(BIOS_ERR, "Failed to find the PTN3460 device!\n"); return; } - + /* Initialize the I2C controller before it is used. */ + if (ptn_dev->bus && ptn_dev->bus->dev->ops && ptn_dev->bus->dev->ops->init) + ptn_dev->bus->dev->ops->init(ptn_dev->bus->dev); ptn3460_init(ptn_dev); } |