aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/emulation/qemu-i440fx
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/emulation/qemu-i440fx')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/Kconfig3
-rw-r--r--src/mainboard/emulation/qemu-i440fx/Makefile.inc3
-rw-r--r--src/mainboard/emulation/qemu-i440fx/exit_car.S18
-rw-r--r--src/mainboard/emulation/qemu-i440fx/romstage.c16
4 files changed, 38 insertions, 2 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig
index 78ca2d9d64..23526f96d9 100644
--- a/src/mainboard/emulation/qemu-i440fx/Kconfig
+++ b/src/mainboard/emulation/qemu-i440fx/Kconfig
@@ -12,7 +12,8 @@ config BOARD_SPECIFIC_OPTIONS
select BOARD_ROMSIZE_KB_256
select MAINBOARD_HAS_NATIVE_VGA_INIT
select MAINBOARD_FORCE_NATIVE_VGA_INIT
- select NO_CAR_GLOBAL_MIGRATION
+ select POSTCAR_STAGE
+ select POSTCAR_CONSOLE
config MAINBOARD_DIR
string
diff --git a/src/mainboard/emulation/qemu-i440fx/Makefile.inc b/src/mainboard/emulation/qemu-i440fx/Makefile.inc
index 8c19afc128..e3ca3002ff 100644
--- a/src/mainboard/emulation/qemu-i440fx/Makefile.inc
+++ b/src/mainboard/emulation/qemu-i440fx/Makefile.inc
@@ -3,3 +3,6 @@ ramstage-y += fw_cfg.c
romstage-y += fw_cfg.c
romstage-y += memory.c
ramstage-y += memory.c
+postcar-y += memory.c
+postcar-y += fw_cfg.c
+postcar-y += exit_car.S
diff --git a/src/mainboard/emulation/qemu-i440fx/exit_car.S b/src/mainboard/emulation/qemu-i440fx/exit_car.S
new file mode 100644
index 0000000000..06f1256768
--- /dev/null
+++ b/src/mainboard/emulation/qemu-i440fx/exit_car.S
@@ -0,0 +1,18 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+.text
+.global chipset_teardown_car
+chipset_teardown_car:
+ /* There's no CAR to tear down */
+ ret
diff --git a/src/mainboard/emulation/qemu-i440fx/romstage.c b/src/mainboard/emulation/qemu-i440fx/romstage.c
index e31394c282..e1d4f62708 100644
--- a/src/mainboard/emulation/qemu-i440fx/romstage.c
+++ b/src/mainboard/emulation/qemu-i440fx/romstage.c
@@ -23,11 +23,25 @@
asmlinkage void car_stage_entry(void)
{
+ struct postcar_frame pcf;
+
console_init();
cbmem_recovery(0);
timestamp_add_now(TS_START_ROMSTAGE);
- run_ramstage();
+ /**
+ * The LZMA decoder needs about 4 KiB stack.
+ * Leave 1 KiB stack for general postcar code.
+ */
+ if (postcar_frame_init(&pcf, 5 * KiB))
+ die("Unable to initialize postcar frame.\n");
+
+ /**
+ * Run postcar to tear down CAR and load relocatable ramstage.
+ * There's no CAR on qemu, but for educational purposes and
+ * testing the postcar stage is used on qemu, too.
+ */
+ run_postcar_phase(&pcf);
}