- fprintf(staticc, "\n/* pass 0 */\n");
- walk_device_tree(staticc, &root, pass0, NULL);
- fprintf(staticc, "\n/* pass 1 */\nstruct mainboard_config mainboard_info_0;\nstruct device *last_dev = &%s;\n", lastdev->name);
- walk_device_tree(staticc, &root, pass1, NULL);
+ 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);
+ walk_device_tree(autogen, &root, pass1, NULL);
+
+ } else if (scan_mode == BOOTBLOCK_MODE) {
+ h = &headers;
+ while (h->next) {
+ h = h->next;
+ fprintf(autogen, "#include \"%s/bootblock.c\"\n", h->name);
+ }
+
+ fprintf(autogen, "\n#if CONFIG_HAS_MAINBOARD_BOOTBLOCK\n");
+ fprintf(autogen, "#include \"mainboard/%s/bootblock.c\"\n", mainboard);
+ fprintf(autogen, "#else\n");
+ fprintf(autogen, "static unsigned long init_mainboard(int bsp_cpu)\n{\n");
+ fprintf(autogen, "\tif (! bsp_cpu) return 0;\n");
+ h = &headers;
+ while (h->next) {
+ h = h->next;
+ translate_name(h->name, 0);
+ fprintf(autogen, "\tinit_%s();\n", h->name);
+ }
+
+ fprintf(autogen, "\treturn 0;\n}\n");
+ fprintf(autogen, "#endif\n");
+
+ } else if (scan_mode == KCONFIG_MODE) {
+ fprintf(autogen, "\nconfig MAINBOARD_DIR\n\tstring\n");
+ fprintf(autogen, "\tdefault %s\n", mainboard);
+
+ fprintf(autogen, "\nconfig MAINBOARD_DEVTREE\n\tdef_bool y\n");
+ h = &headers;
+ while (h->next) {
+ h = h->next;
+ translate_name(h->name, 1);
+ fprintf(autogen, "\tselect %s\n", h->name);
+ }
+ }