summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/stm32/i2c-stm32f0.c2
-rw-r--r--common/cbi.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/chip/stm32/i2c-stm32f0.c b/chip/stm32/i2c-stm32f0.c
index ad4df85bdd..70f08aff95 100644
--- a/chip/stm32/i2c-stm32f0.c
+++ b/chip/stm32/i2c-stm32f0.c
@@ -135,7 +135,7 @@ static void i2c_set_freq_port(const struct i2c_port_t *p,
*
* @param p the I2c port
*/
-static void i2c_init_port(const struct i2c_port_t *p)
+void i2c_init_port(const struct i2c_port_t *p)
{
int port = p->port;
enum stm32_i2c_clk_src src = I2C_CLK_SRC_48MHZ;
diff --git a/common/cbi.c b/common/cbi.c
index d8feee3189..1206e3e4fa 100644
--- a/common/cbi.c
+++ b/common/cbi.c
@@ -141,13 +141,19 @@ static int do_read_board_info(void)
return EC_SUCCESS;
}
+void i2c_init_port(const struct i2c_port_t *p);
+
static int read_board_info(void)
{
if (cached_read_result == EC_ERROR_CBI_CACHE_INVALID) {
cached_read_result = do_read_board_info();
- if (cached_read_result)
+ if (cached_read_result) {
+ int rv = i2c_unwedge(I2C_PORT_EEPROM);
+ CPRINTS("I2C-4 unwedged (%d)", rv);
+ i2c_init_port(&i2c_ports[4]);
/* On error (I2C or bad contents), retry a read */
cached_read_result = do_read_board_info();
+ }
}
/* Else, we already tried and know the result. Return the cached
* error code immediately to avoid wasteful reads. */