util/sconfig: Move default includes out of emit_chips()
This should make it easier to add more includes.
Change-Id: Ib4a25352901408c2b36de4972391df742a0d8037
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41744
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 3e3bd17..0d8f7f8 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -889,9 +889,6 @@
{
struct chip *tmp = chip;
- fprintf(fil, "#include <device/device.h>\n");
- fprintf(fil, "#include <device/pci.h>\n");
-
while (chip) {
if (chip->chiph_exists)
fprintf(fil, "#include \"%s/chip.h\"\n", chip->name);
@@ -1347,6 +1344,9 @@
fprintf(autohead, "#define __STATIC_DEVICE_TREE_H\n\n");
fprintf(autohead, "#include <device/device.h>\n\n");
+ fprintf(autogen, "#include <device/device.h>\n");
+ fprintf(autogen, "#include <device/pci.h>\n\n");
+
emit_chips(autogen);
walk_device_tree(autogen, autohead, &base_root_dev, inherit_subsystem_ids);