From 4f87ae1d4a3a597f1260534001bd99160cc8ca99 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Thu, 18 Mar 2021 23:16:29 -0600 Subject: soc/amd/common/block/i2c: Move SoC agnostic parts into common The logic behind I2C bus initialization, I2C MMIO base address getter and setter, I2C bus ACPI name resolution are identical for all the AMD SoCs. Hence moving all the SoC agnotic parts of the driver into the common driver and just configure the SoC specific parts into individual I2C drivers. BUG=None TEST=Build Dalboz and Grunt. Boot to OS in Dalboz. Ensure that the I2C peripherals are detected as earlier in Dalboz. Verify some I2C peripheral functionality like trackpad and touchscreen. Change-Id: Ic9c99ec769d7d8ad7e1e566fdf42a5206657183d Signed-off-by: Karthikeyan Ramasubramanian Suggested-by: Kyosti Malkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/51509 Reviewed-by: Furquan Shaikh Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/include/soc/iomap.h | 3 ++- src/soc/amd/picasso/include/soc/southbridge.h | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/soc/amd/picasso/include') diff --git a/src/soc/amd/picasso/include/soc/iomap.h b/src/soc/amd/picasso/include/soc/iomap.h index bde1008a75..5b75ecb466 100644 --- a/src/soc/amd/picasso/include/soc/iomap.h +++ b/src/soc/amd/picasso/include/soc/iomap.h @@ -39,7 +39,8 @@ */ #define I2C_MASTER_DEV_COUNT 4 #define I2C_MASTER_START_INDEX 2 -#define I2C_SLAVE_DEV_COUNT 1 +#define I2C_PERIPHERAL_DEV_COUNT 1 +#define I2C_CTRLR_COUNT (I2C_MASTER_DEV_COUNT + I2C_PERIPHERAL_DEV_COUNT) #if ENV_X86 diff --git a/src/soc/amd/picasso/include/soc/southbridge.h b/src/soc/amd/picasso/include/soc/southbridge.h index 60fd6f9686..49e4948495 100644 --- a/src/soc/amd/picasso/include/soc/southbridge.h +++ b/src/soc/amd/picasso/include/soc/southbridge.h @@ -181,12 +181,6 @@ void enable_aoac_devices(void); void wait_for_aoac_enabled(unsigned int dev); void sb_clk_output_48Mhz(void); -/* Initialize all the i2c buses that are marked with early init. */ -void i2c_soc_early_init(void); - -/* Initialize all the i2c buses that are not marked with early init. */ -void i2c_soc_init(void); - /* Allow the board to change the default I2C pad configuration */ void mainboard_i2c_override(int bus, uint32_t *pad_settings); -- cgit v1.2.3