Commit f2653e8dd92229328480da35c26e6f9fbfec4381

Authored by Bin Meng
Committed by Simon Glass
1 parent 683b09d783

x86: coreboot: Control I/O port 0xb2 writing via device tree

Writing 0xcb to I/O port 0xb2 (Advanced Power Management Control) causes
U-Boot to hang on QEMU q35 target. We introduce a config option in the
device tree "u-boot,no-apm-finalize" under /config node if we don't want
to do that.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 10 additions and 3 deletions Side-by-side Diff

arch/x86/cpu/coreboot/coreboot.c
... ... @@ -7,6 +7,7 @@
7 7 */
8 8  
9 9 #include <common.h>
  10 +#include <fdtdec.h>
10 11 #include <netdev.h>
11 12 #include <asm/io.h>
12 13 #include <asm/msr.h>
... ... @@ -74,9 +75,14 @@
74 75 mtrr_close(&state);
75 76 }
76 77  
77   - /* Issue SMI to Coreboot to lock down ME and registers */
78   - printf("Finalizing Coreboot\n");
79   - outb(0xcb, 0xb2);
  78 + if (!fdtdec_get_config_bool(gd->fdt_blob, "u-boot,no-apm-finalize")) {
  79 + /*
  80 + * Issue SMI to coreboot to lock down ME and registers
  81 + * when allowed via device tree
  82 + */
  83 + printf("Finalizing coreboot\n");
  84 + outb(0xcb, 0xb2);
  85 + }
80 86 }
81 87  
82 88 int misc_init_r(void)
arch/x86/dts/qemu-x86_q35.dts
... ... @@ -15,6 +15,7 @@
15 15  
16 16 config {
17 17 silent_console = <0>;
  18 + u-boot,no-apm-finalize;
18 19 };
19 20  
20 21 chosen {