From db11fa46ad4611d32e56e7b16c4b1cb6057404da Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Wed, 27 Jan 2021 13:49:26 +0800 Subject: soc/amd/common: Handle I2C resource only if base address is defined Change-Id: I767ad58f442bc5561bda4dd1de2d9593c8434615 Signed-off-by: Zheng Bao Reviewed-on: https://review.coreboot.org/c/coreboot/+/49959 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/soc/amd/common/block/lpc/lpc.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- cgit v1.2.3