Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79177?usp=email )
Change subject: [WIP] soc/amd/genoa: add I2C pad control support ......................................................................
[WIP] soc/amd/genoa: add I2C pad control support
Still need to find out for sure which type of pad control register is used for I2C4 and I2C5.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ibc14a6de60be84460418703472293814e9a51379 --- M src/soc/amd/genoa/Kconfig M src/soc/amd/genoa/chip.h M src/soc/amd/genoa/i2c.c 3 files changed, 14 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/79177/1
diff --git a/src/soc/amd/genoa/Kconfig b/src/soc/amd/genoa/Kconfig index cbf0ddd..bca6ed4 100644 --- a/src/soc/amd/genoa/Kconfig +++ b/src/soc/amd/genoa/Kconfig @@ -21,6 +21,8 @@ select SOC_AMD_COMMON_BLOCK_DATA_FABRIC_EXTENDED_MMIO select SOC_AMD_COMMON_BLOCK_HAS_ESPI select SOC_AMD_COMMON_BLOCK_I2C + select SOC_AMD_COMMON_BLOCK_I2C_PAD_CTRL + select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL select SOC_AMD_COMMON_BLOCK_IOMMU select SOC_AMD_COMMON_BLOCK_LPC select SOC_AMD_COMMON_BLOCK_MCAX diff --git a/src/soc/amd/genoa/chip.h b/src/soc/amd/genoa/chip.h index bca40af..5713a72 100644 --- a/src/soc/amd/genoa/chip.h +++ b/src/soc/amd/genoa/chip.h @@ -14,6 +14,7 @@
u8 i2c_scl_reset; struct dw_i2c_bus_config i2c[I2C_CTRLR_COUNT]; + struct i2c_pad_control i2c_pad[I2C_CTRLR_COUNT]; };
#endif diff --git a/src/soc/amd/genoa/i2c.c b/src/soc/amd/genoa/i2c.c index 76c1049..0a1f4fb 100644 --- a/src/soc/amd/genoa/i2c.c +++ b/src/soc/amd/genoa/i2c.c @@ -38,7 +38,17 @@
void soc_i2c_misc_init(unsigned int bus, const struct dw_i2c_bus_config *cfg) { - /* TODO: write I2C pad control registers */ + const struct soc_amd_genoa_config *config = config_of_soc(); + + if (bus >= ARRAY_SIZE(config->i2c_pad)) + return; + + /* The I/O pads of I2C0..3 are the new I23C pads and the I/O pads of I2C4..5 still are + the same I2C pads as in Picasso and Cezanne. TODO: verify if this is true */ + if (bus <= 3) + fch_i23c_pad_init(bus, cfg->speed, &config->i2c_pad[bus]); + else + fch_i2c_pad_init(bus, cfg->speed, &config->i2c_pad[bus]); }
const struct soc_i2c_ctrlr_info *soc_get_i2c_ctrlr_info(size_t *num_ctrlrs)