soc/intel/common/block/smbus: Define __SIMPLE_DEVICE__

Change-Id: I93f7918763d87f8fb50f39f9469694e73aeff37b
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52455
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
This commit is contained in:
Angel Pons 2021-04-17 12:08:15 +02:00 committed by Patrick Georgi
parent 60be9dbbc7
commit 24f4623384
1 changed files with 3 additions and 7 deletions

View File

@ -1,5 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#define __SIMPLE_DEVICE__
#include <arch/io.h> #include <arch/io.h>
#include <device/pci_ops.h> #include <device/pci_ops.h>
#include <device/device.h> #include <device/device.h>
@ -101,13 +103,7 @@ static void tco_enable_bar(void)
{ {
uint32_t reg32; uint32_t reg32;
uint16_t tcobase; uint16_t tcobase;
#if defined(__SIMPLE_DEVICE__) const pci_devfn_t dev = PCH_DEV_SMBUS;
int devfn = PCH_DEVFN_SMBUS;
pci_devfn_t dev = PCI_DEV(0, PCI_SLOT(devfn), PCI_FUNC(devfn));
#else
struct device *dev;
dev = PCH_DEV_SMBUS;
#endif
/* Disable TCO in SMBUS Device first before changing Base Address */ /* Disable TCO in SMBUS Device first before changing Base Address */
reg32 = pci_read_config32(dev, TCOCTL); reg32 = pci_read_config32(dev, TCOCTL);