From 8199b88222f9657c8afeeff10199da0c4d1b6bbd Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 5 Jan 2021 00:03:20 +0100 Subject: soc/amd/common/block/smbus: always return SMBus MMIO in get_sm_mmio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old code was broken and register 0x90 didn't even exist any more in the config space of the SMBus PCI device, so just always return the MMIO base address of the SMBus controller. As far as I've seen, no board in tree uses this functionality at the moment. Change-Id: Ib80d5c928da6022427afb8ccc969fb2aac953c2d Signed-off-by: Felix Held Reported-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/49121 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/soc/amd/common/block/smbus/sm.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/soc/amd/common/block/smbus') diff --git a/src/soc/amd/common/block/smbus/sm.c b/src/soc/amd/common/block/smbus/sm.c index 28e662c650..80a11848f5 100644 --- a/src/soc/amd/common/block/smbus/sm.c +++ b/src/soc/amd/common/block/smbus/sm.c @@ -21,15 +21,13 @@ static void sm_init(struct device *dev) static u32 get_sm_mmio(struct device *dev) { - struct resource *res; - struct bus *pbus; - - pbus = get_pbus_smbus(dev); - res = find_resource(pbus->dev, 0x90); - if (res->base == SMB_BASE_ADDR) - return (uintptr_t)acpimmio_smbus; - - return (uintptr_t)acpimmio_asf; + /* + * Since SMBus and ASF controller are behind the same PCIe device, we don't know behind + * which controller a device is. We assume here that the devices are behind the SMBus + * controller. The proper solution would be to handle those as MMIO devices instead of + * PCI ones. + */ + return (uintptr_t)acpimmio_smbus; } static int lsmbus_recv_byte(struct device *dev) -- cgit v1.2.3