summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2021-01-27 13:49:26 +0800
committerPatrick Georgi <pgeorgi@google.com>2021-01-28 09:25:52 +0000
commitdb11fa46ad4611d32e56e7b16c4b1cb6057404da (patch)
treef8bb7c0baf0d3bcf81b4d15e155ecea01964b611 /src/soc/amd
parentef5c235541a630fd5e6ab90c3913db55313e64d2 (diff)
soc/amd/common: Handle I2C resource only if base address is defined
Change-Id: I767ad58f442bc5561bda4dd1de2d9593c8434615 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49959 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/lpc/lpc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/lpc/lpc.c b/src/soc/amd/common/block/lpc/lpc.c
index 0be5b740eb..b3f0e2d670 100644
--- a/src/soc/amd/common/block/lpc/lpc.c
+++ b/src/soc/amd/common/block/lpc/lpc.c
@@ -125,11 +125,13 @@ static void lpc_read_resources(struct device *dev)
res->size = 0x00001000;
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+#ifdef I2C_BASE_ADDRESS
/* I2C devices */
res = new_resource(dev, 4);
res->base = I2C_BASE_ADDRESS;
res->size = I2C_DEVICE_SIZE * I2C_DEVICE_COUNT;
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+#endif
compact_resources(dev);
}