summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/device/device.h11
-rw-r--r--tests/include/static.h7
2 files changed, 13 insertions, 5 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index d83cfe4075..1fc5e62bdc 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -6,6 +6,7 @@
#include <device/path.h>
#include <device/pci_type.h>
#include <smbios.h>
+#include <static.h>
#include <types.h>
struct fw_config;
@@ -387,11 +388,11 @@ static inline DEVTREE_CONST void *config_of(const struct device *dev)
devtree_die();
}
-/* config_of_soc() either returns a non-NULL pointer or dies in the config_of() call. */
-static inline DEVTREE_CONST void *config_of_soc(void)
-{
- return config_of(pcidev_on_root(0, 0));
-}
+/*
+ * Returns pointer to config structure of root device (B:D:F = 0:00:0) defined by
+ * sconfig in static.{h/c}.
+ */
+#define config_of_soc() __pci_0_00_0_config
void enable_static_device(struct device *dev);
void enable_static_devices(struct device *bus);
diff --git a/tests/include/static.h b/tests/include/static.h
new file mode 100644
index 0000000000..4799e2c453
--- /dev/null
+++ b/tests/include/static.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * static.h is generated by util/sconfig during a coreboot build. Since this file might be
+ * included by other header files that are part of the unit tests, this dummy file is added to
+ * make the test infrastructure happy.
+ */