From: Bin Meng Date: Wed, 3 Jun 2015 09:20:05 +0800 Subject: [U-Boot] [PATCH v2 4/5] x86: coreboot: Control I/O port 0xb2 writing via device tree In-Reply-To: <1433294406-24035-1-git-send-email-bmeng.cn@gmail.com> References: <1433294406-24035-1-git-send-email-bmeng.cn@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changes in v2: - Use a config option in the device tree instead of deleting the codes arch/x86/cpu/coreboot/coreboot.c | 12 +++++++++--- arch/x86/dts/qemu-x86_q35.dts | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index c3dfd28..c4cac04 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -74,9 +75,14 @@ void board_final_cleanup(void) mtrr_close(&state); } - /* Issue SMI to Coreboot to lock down ME and registers */ - printf("Finalizing Coreboot\n"); - outb(0xcb, 0xb2); + if (!fdtdec_get_config_bool(gd->fdt_blob, "u-boot,no-apm-finalize")) { + /* + * Issue SMI to coreboot to lock down ME and registers + * when allowed via device tree + */ + printf("Finalizing coreboot\n"); + outb(0xcb, 0xb2); + } } int misc_init_r(void) diff --git a/arch/x86/dts/qemu-x86_q35.dts b/arch/x86/dts/qemu-x86_q35.dts index 6c89283..02a483c 100644 --- a/arch/x86/dts/qemu-x86_q35.dts +++ b/arch/x86/dts/qemu-x86_q35.dts @@ -15,6 +15,7 @@ config { silent_console = <0>; + u-boot,no-apm-finalize; }; chosen { -- 1.8.2.1