aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/fsp_baytrail/lpss.c
diff options
context:
space:
mode:
authorUwe Poeche <uwe.poeche@siemens.com>2019-09-24 09:44:58 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-10-24 07:50:02 +0000
commited309e58b0d44f7757f7144a995ca95a94e8a52a (patch)
treeb49fc915988eb5bc310bbd956cd5d7d1ece5c024 /src/soc/intel/fsp_baytrail/lpss.c
parent285975dbba8c7f3bbb9f9950e79a30bb983d5123 (diff)
soc/intel/fsp_baytrail: use designware I2C driver
Refactor I2C driver for fsp_baytrail to match the coreboot supported I2C bus device structure. The internal I2C controllers are now handled by the generic PCI driver approach and generic I2C access is enabled. As orientation for the I2C code the actual solution from soc/intel/apollolake I2C was taken. All the I2C specific parts were removed from lpss.c and have been implemented in the I2C driver. Future merge to soc/intel/common/block/i2c/i2c.c would be possible. With this patch I2C chip devices can now be used in devicetree. TEST=Booted siemens/tcu3 and verified that access to PTN3460 worked. Change-Id: I3b87bd7c27e4c1afcce7cd4225cca02599f43c60 Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36062 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Diffstat (limited to 'src/soc/intel/fsp_baytrail/lpss.c')
-rw-r--r--src/soc/intel/fsp_baytrail/lpss.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/soc/intel/fsp_baytrail/lpss.c b/src/soc/intel/fsp_baytrail/lpss.c
index 154a70ad19..2ad6fb3804 100644
--- a/src/soc/intel/fsp_baytrail/lpss.c
+++ b/src/soc/intel/fsp_baytrail/lpss.c
@@ -89,20 +89,6 @@ static void dev_ctl_reg(struct device *dev, int *iosf_reg, int *nvs_index)
switch (dev->path.pci.devfn) {
SET_IOSF_REG(SIO_DMA1);
break;
- SET_IOSF_REG(I2C1);
- break;
- SET_IOSF_REG(I2C2);
- break;
- SET_IOSF_REG(I2C3);
- break;
- SET_IOSF_REG(I2C4);
- break;
- SET_IOSF_REG(I2C5);
- break;
- SET_IOSF_REG(I2C6);
- break;
- SET_IOSF_REG(I2C7);
- break;
SET_IOSF_REG(SIO_DMA2);
break;
SET_IOSF_REG(PWM1);
@@ -118,33 +104,6 @@ static void dev_ctl_reg(struct device *dev, int *iosf_reg, int *nvs_index)
}
}
-static void i2c_disable_resets(struct device *dev)
-{
- /* Release the I2C devices from reset. */
- static const struct reg_script ops[] = {
- REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x804, 0x3),
- REG_SCRIPT_END,
- };
-
-#define CASE_I2C(name_) \
- case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC)
-
- switch (dev->path.pci.devfn) {
- CASE_I2C(I2C1):
- CASE_I2C(I2C2):
- CASE_I2C(I2C3):
- CASE_I2C(I2C4):
- CASE_I2C(I2C5):
- CASE_I2C(I2C6):
- CASE_I2C(I2C7):
- printk(BIOS_DEBUG, "Releasing I2C device from reset.\n");
- reg_script_run_on_dev(dev, ops);
- break;
- default:
- return;
- }
-}
-
static void lpss_init(struct device *dev)
{
struct soc_intel_fsp_baytrail_config *config = config_of(dev);
@@ -160,7 +119,6 @@ static void lpss_init(struct device *dev)
return;
}
dev_enable_snoop_and_pm(dev, iosf_reg);
- i2c_disable_resets(dev);
if (config->PcdLpssSioEnablePciMode == LPSS_PCI_MODE_DISABLE)
dev_enable_acpi_mode(dev, iosf_reg, nvs_index);
@@ -178,13 +136,6 @@ static struct device_operations device_ops = {
static const unsigned short pci_device_ids[] = {
SIO_DMA1_DEVID,
- I2C1_DEVID,
- I2C2_DEVID,
- I2C3_DEVID,
- I2C4_DEVID,
- I2C5_DEVID,
- I2C6_DEVID,
- I2C7_DEVID,
SIO_DMA2_DEVID,
PWM1_DEVID,
PWM2_DEVID,