soc/intel/skylake: Use common I2C devfn mapping
Replace platform-specific i2c.c with common implementation. Defines SOC_I2C_DEVFN(n) macro and uses existing CONFIG_SOC_INTEL_I2C_DEV_MAX Kconfig. Change-Id: I9ae46e252c599e4ee82a60c03a8d83f874a8da98 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91264 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Guvendik, Bora <bora.guvendik@intel.com>
This commit is contained in:
parent
7f922438be
commit
f703f2800c
4 changed files with 4 additions and 49 deletions
|
|
@ -59,6 +59,7 @@ config SOC_INTEL_COMMON_SKYLAKE_BASE
|
|||
select SOC_INTEL_COMMON_BLOCK_UART
|
||||
select SOC_INTEL_COMMON_BLOCK_XHCI_ELOG
|
||||
select SOC_INTEL_COMMON_FEATURE
|
||||
select SOC_INTEL_COMMON_FEATURE_I2C_DEVFN
|
||||
select SOC_INTEL_COMMON_FEATURE_UART_DEVICES
|
||||
select SOC_INTEL_COMMON_FSP_RESET
|
||||
select SOC_INTEL_COMMON_PCH_CLIENT
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ subdirs-y += ../../../cpu/intel/microcode
|
|||
subdirs-y += ../../../cpu/intel/turbo
|
||||
|
||||
bootblock-y += bootblock/bootblock.c
|
||||
bootblock-y += i2c.c
|
||||
bootblock-y += bootblock/pch.c
|
||||
bootblock-y += bootblock/report_platform.c
|
||||
bootblock-y += gpio.c
|
||||
|
|
@ -21,12 +20,10 @@ bootblock-y += lpc.c
|
|||
verstage-y += gpio.c
|
||||
verstage-y += gspi.c
|
||||
verstage-y += pmutil.c
|
||||
verstage-y += i2c.c
|
||||
verstage-y += spi.c
|
||||
|
||||
romstage-y += gpio.c
|
||||
romstage-y += gspi.c
|
||||
romstage-y += i2c.c
|
||||
romstage-y += me.c
|
||||
romstage-y += pcie_rp.c
|
||||
romstage-y += pmutil.c
|
||||
|
|
@ -41,7 +38,6 @@ ramstage-y += fadt.c
|
|||
ramstage-y += finalize.c
|
||||
ramstage-y += gpio.c
|
||||
ramstage-y += gspi.c
|
||||
ramstage-y += i2c.c
|
||||
ramstage-y += graphics.c
|
||||
ramstage-y += irq.c
|
||||
ramstage-y += lockdown.c
|
||||
|
|
@ -67,7 +63,6 @@ smm-y += xhci.c
|
|||
|
||||
postcar-y += gspi.c
|
||||
postcar-y += spi.c
|
||||
postcar-y += i2c.c
|
||||
|
||||
ifeq ($(CONFIG_SKYLAKE_SOC_PCH_H),y)
|
||||
ifeq ($(CONFIG_MAINBOARD_SUPPORTS_SKYLAKE_CPU),y)
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <device/device.h>
|
||||
#include <intelblocks/cfg.h>
|
||||
#include <drivers/i2c/designware/dw_i2c.h>
|
||||
#include <soc/pci_devs.h>
|
||||
|
||||
int dw_i2c_soc_devfn_to_bus(unsigned int devfn)
|
||||
{
|
||||
switch (devfn) {
|
||||
case PCH_DEVFN_I2C0:
|
||||
return 0;
|
||||
case PCH_DEVFN_I2C1:
|
||||
return 1;
|
||||
case PCH_DEVFN_I2C2:
|
||||
return 2;
|
||||
case PCH_DEVFN_I2C3:
|
||||
return 3;
|
||||
case PCH_DEVFN_I2C4:
|
||||
return 4;
|
||||
case PCH_DEVFN_I2C5:
|
||||
return 5;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dw_i2c_soc_bus_to_devfn(unsigned int bus)
|
||||
{
|
||||
switch (bus) {
|
||||
case 0:
|
||||
return PCH_DEVFN_I2C0;
|
||||
case 1:
|
||||
return PCH_DEVFN_I2C1;
|
||||
case 2:
|
||||
return PCH_DEVFN_I2C2;
|
||||
case 3:
|
||||
return PCH_DEVFN_I2C3;
|
||||
case 4:
|
||||
return PCH_DEVFN_I2C4;
|
||||
case 5:
|
||||
return PCH_DEVFN_I2C5;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -193,3 +193,6 @@
|
|||
#define PCI_DEVFN_UART2 PCH_DEVFN_UART2
|
||||
|
||||
#endif
|
||||
|
||||
/* for common code */
|
||||
#define SOC_I2C_DEVFN(n) PCH_DEVFN_I2C##n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue