From 13101a7be09d9db8a8e3a784a262a6d122ff3503 Mon Sep 17 00:00:00 2001 From: Justin TerAvest Date: Wed, 24 Jan 2018 14:23:12 -0700 Subject: soc/amd/stoneyridge: Add I2C devicetree support. This commit establishes the stoneyridge implementation for i2c entries in the devicetree.cb file. BUG=b:72121803 Change-Id: I0d923609bd8fce94c9aee401a5ae2811281b60e5 Signed-off-by: Justin TerAvest Reviewed-on: https://review.coreboot.org/23405 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Aaron Durbin --- src/soc/amd/stoneyridge/chip.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/soc/amd/stoneyridge/chip.c') diff --git a/src/soc/amd/stoneyridge/chip.c b/src/soc/amd/stoneyridge/chip.c index d447ffa8ab..d3a8bc4044 100644 --- a/src/soc/amd/stoneyridge/chip.c +++ b/src/soc/amd/stoneyridge/chip.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,10 @@ #include #include +/* Supplied by i2c.c */ +extern struct device_operations stoneyridge_i2c_mmio_ops; +extern const char *i2c_acpi_name(const struct device *dev); + struct device_operations cpu_bus_ops = { .read_resources = DEVICE_NOOP, .set_resources = DEVICE_NOOP, @@ -79,6 +84,9 @@ static void enable_dev(device_t dev) dev->ops = &cpu_bus_ops; else if (dev->path.type == DEVICE_PATH_PCI) sb_enable(dev); + else if (dev->path.type == DEVICE_PATH_MMIO) + if (i2c_acpi_name(dev) != NULL) + dev->ops = &stoneyridge_i2c_mmio_ops; } static void soc_init(void *chip_info) -- cgit v1.2.3