summaryrefslogtreecommitdiff
path: root/util/sconfig/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/sconfig/main.c')
-rw-r--r--util/sconfig/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 989f7471ff..824bc6c178 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -45,7 +45,11 @@ static struct device mainboard = {
.id = 0,
.chip = &mainboard,
.type = chip,
+#ifdef MAINBOARDS_HAVE_CHIP_H
.chiph_exists = 1,
+#else
+ .chiph_exists = 0,
+#endif
.children = &root
};
@@ -561,12 +565,14 @@ int main(int argc, char** argv) {
}
headers.next = 0;
+#ifdef MAINBOARDS_HAVE_CHIP_H
if (scan_mode == STATIC_MODE) {
headers.next = malloc(sizeof(struct header));
headers.next->name = malloc(strlen(mainboard)+12);
headers.next->next = 0;
sprintf(headers.next->name, "mainboard/%s", mainboard);
}
+#endif
FILE *filec = fopen(devtree, "r");
if (!filec) {
@@ -610,8 +616,11 @@ int main(int argc, char** argv) {
walk_device_tree(autogen, &root, inherit_subsystem_ids, NULL);
fprintf(autogen, "\n/* pass 0 */\n");
walk_device_tree(autogen, &root, pass0, NULL);
- fprintf(autogen, "\n/* pass 1 */\nstruct mainboard_config mainboard_info_0;\n"
- "struct device *last_dev = &%s;\n", lastdev->name);
+ fprintf(autogen, "\n/* pass 1 */\n"
+ "struct device *last_dev = &%s;\n", lastdev->name);
+#ifdef MAINBOARDS_HAVE_CHIP_H
+ fprintf(autogen, "struct mainboard_config mainboard_info_0;\n");
+#endif
walk_device_tree(autogen, &root, pass1, NULL);
} else if (scan_mode == BOOTBLOCK_MODE) {