From 34cf5619f929775efd819468ba6036e637cfbd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 11 Mar 2019 20:34:26 +0200 Subject: device/pci_ops: Reuse romstage PCI config for ramstage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By changing the signatures we do not need to define PCI config accessors separately for ramstage. Change-Id: I9364cb34fe8127972c772516a0a0b1d281c5ed00 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/31685 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/include/device/pci_type.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/include/device/pci_type.h') diff --git a/src/include/device/pci_type.h b/src/include/device/pci_type.h index 3f72c5f167..27d35589cc 100644 --- a/src/include/device/pci_type.h +++ b/src/include/device/pci_type.h @@ -25,4 +25,15 @@ typedef u32 pci_devfn_t; #define PCI_DEV_INVALID (0xffffffffU) +#if 1 +/* FIXME: For most of the time in ramstage, we get valid device pointer + * from calling the driver entry points. The assert should only be used + * with searches like pcidev_behind(), and only if caller does not make + * the check themselves. + */ +#define PCI_BDF(dev) pcidev_assert((dev)) +#else +#define PCI_BDF(dev) pcidev_bdf((dev)) +#endif + #endif /* DEVICE_PCI_TYPE_H */ -- cgit v1.2.3