summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/picasso/i2c.c')
-rw-r--r--src/soc/amd/picasso/i2c.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/soc/amd/picasso/i2c.c b/src/soc/amd/picasso/i2c.c
index 40cf556b04..ebc833df2a 100644
--- a/src/soc/amd/picasso/i2c.c
+++ b/src/soc/amd/picasso/i2c.c
@@ -40,22 +40,13 @@ void i2c_set_bar(unsigned int bus, uintptr_t bar)
void soc_i2c_misc_init(unsigned int bus, const struct dw_i2c_bus_config *cfg)
{
- uint32_t pad_ctrl;
+ /* TODO: Picasso supports I2C RX pad configurations 3.3V, 1.8V and off, so make this
+ configurable. */
+ const struct i2c_pad_control ctrl = {
+ .rx_level = I2C_PAD_RX_3_3V,
+ };
- pad_ctrl = misc_read32(MISC_I2C_PAD_CTRL(bus));
-
- pad_ctrl &= ~I2C_PAD_CTRL_NG_MASK;
- pad_ctrl |= I2C_PAD_CTRL_NG_NORMAL;
-
- pad_ctrl &= ~I2C_PAD_CTRL_RX_SEL_MASK;
- pad_ctrl |= I2C_PAD_CTRL_RX_SEL_3_3V;
-
- pad_ctrl &= ~I2C_PAD_CTRL_FALLSLEW_MASK;
- pad_ctrl |= cfg->speed == I2C_SPEED_STANDARD ?
- I2C_PAD_CTRL_FALLSLEW_STD : I2C_PAD_CTRL_FALLSLEW_LOW;
- pad_ctrl |= I2C_PAD_CTRL_FALLSLEW_EN;
-
- misc_write32(MISC_I2C_PAD_CTRL(bus), pad_ctrl);
+ fch_i2c_pad_init(bus, cfg->speed, &ctrl);
}
const struct soc_i2c_ctrlr_info *soc_get_i2c_ctrlr_info(size_t *num_ctrlrs)