diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-04-17 12:30:12 +0200 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2021-04-19 10:45:15 +0000 |
commit | 0db4b27c7d88304313042ab69e5db680afbd3e4e (patch) | |
tree | aa196d6eab16d90f7e7524f1288041ca7574799f /src/soc/intel/baytrail | |
parent | 5595a20f393387e28adea87c65d650a2de227fca (diff) |
soc/intel/baytrail/pmutil.c: Define __SIMPLE_DEVICE__
Change-Id: I0d5fa4451b356970cf9843a76d0fa4d2af4307da
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52460
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Diffstat (limited to 'src/soc/intel/baytrail')
-rw-r--r-- | src/soc/intel/baytrail/pmutil.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/soc/intel/baytrail/pmutil.c b/src/soc/intel/baytrail/pmutil.c index 7ab61ac7cf..d00166047d 100644 --- a/src/soc/intel/baytrail/pmutil.c +++ b/src/soc/intel/baytrail/pmutil.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#define __SIMPLE_DEVICE__ + #include <stdint.h> #include <acpi/acpi.h> #include <acpi/acpi_pm.h> @@ -17,29 +19,9 @@ #include <soc/pm.h> #include <security/vboot/vbnv.h> -#if defined(__SIMPLE_DEVICE__) - -static const pci_devfn_t pcu_dev = PCI_DEV(0, PCU_DEV, 0); - -static inline pci_devfn_t get_pcu_dev(void) -{ - return pcu_dev; -} - -#else /* __SIMPLE_DEVICE__ */ - -static struct device *pcu_dev; -static struct device *get_pcu_dev(void) -{ - if (pcu_dev == NULL) - pcu_dev = pcidev_on_root(PCU_DEV, 0); - return pcu_dev; -} -#endif /* __SIMPLE_DEVICE__ */ - uint16_t get_pmbase(void) { - return pci_read_config16(get_pcu_dev(), ABASE) & 0xfff8; + return pci_read_config16(PCI_DEV(0, PCU_DEV, 0), ABASE) & 0xfff8; } static void print_num_status_bits(int num_bits, uint32_t status, const char *const bit_names[]) |