cpu/x86/smm/pci_resource_store: Store DEV/VEN ID
[coreboot2.git] / src / mainboard / emulation / qemu-i440fx / bootmode.c
blob12990b2552ac898942a9c7f0115cc67ac6c0e6ad
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <bootmode.h>
4 #include <console/console.h>
5 #include "fw_cfg.h"
7 /*
8 * Enable recovery mode with fw_cfg option to qemu:
9 * -fw_cfg name=opt/cros/recovery,string=1
11 int get_recovery_mode_switch(void)
13 FWCfgFile f;
15 if (!fw_cfg_check_file(&f, "opt/cros/recovery")) {
16 uint8_t rec_mode;
17 if (f.size != 1) {
18 printk(BIOS_ERR, "opt/cros/recovery invalid size %d\n", f.size);
19 return 0;
21 fw_cfg_get(f.select, &rec_mode, f.size);
22 if (rec_mode == '1') {
23 printk(BIOS_INFO, "Recovery is enabled.\n");
24 return 1;
28 return 0;