diff mbox

[U-Boot,v2,4/8] x86: quark: Lock HMBOUND register before jumping to kernel

Message ID 1441866030-17231-5-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Sept. 10, 2015, 6:20 a.m. UTC
When Linux kernel boots, it hangs at:

[    0.829408] Intel Quark side-band driver registered

This happens when Quark kernel Isolated Memory Region (IMR) driver
tries to lock an IMR register to protect kernel's text and rodata
sections. However in order to have IMR function correctly, HMBOUND
register must be locked otherwise the system just hangs.

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

Changes in v2: None

 arch/x86/cpu/quark/quark.c              | 3 +++
 arch/x86/include/asm/arch-quark/quark.h | 1 +
 2 files changed, 4 insertions(+)

Comments

Simon Glass Sept. 17, 2015, 6:53 p.m. UTC | #1
On 10 September 2015 at 00:20, Bin Meng <bmeng.cn@gmail.com> wrote:
> When Linux kernel boots, it hangs at:
>
> [    0.829408] Intel Quark side-band driver registered
>
> This happens when Quark kernel Isolated Memory Region (IMR) driver
> tries to lock an IMR register to protect kernel's text and rodata
> sections. However in order to have IMR function correctly, HMBOUND
> register must be locked otherwise the system just hangs.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2: None
>
>  arch/x86/cpu/quark/quark.c              | 3 +++
>  arch/x86/include/asm/arch-quark/quark.h | 1 +
>  2 files changed, 4 insertions(+)

Applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c
index 8d53fe3..3ddf079 100644
--- a/arch/x86/cpu/quark/quark.c
+++ b/arch/x86/cpu/quark/quark.c
@@ -288,5 +288,8 @@  void board_final_cleanup(void)
 	val &= ~0xff0000;
 	writel(val, &rcba->esd);
 
+	/* Lock HMBOUND for security */
+	msg_port_setbits(MSG_PORT_HOST_BRIDGE, HM_BOUND, HM_BOUND_LOCK);
+
 	return;
 }
diff --git a/arch/x86/include/asm/arch-quark/quark.h b/arch/x86/include/asm/arch-quark/quark.h
index eb3afbf..338c896 100644
--- a/arch/x86/include/asm/arch-quark/quark.h
+++ b/arch/x86/include/asm/arch-quark/quark.h
@@ -32,6 +32,7 @@ 
 
 /* Host Memory I/O Boundary */
 #define HM_BOUND		0x08
+#define HM_BOUND_LOCK		0x00000001
 
 /* Extended Configuration Space */
 #define HEC_REG			0x09