[Concept,10/12] x86: qemu: Enable MTRR setup for x86_64 no-SPL
Commit Message
From: Simon Glass <simon.glass@canonical.com>
The x86_64 no-SPL build does not programme MTRRs because
gd->arch.has_mtrr is never set to true. In the SPL-based flow,
SPL sets up the MTRRs during its init and they persist into U-Boot
proper. Without SPL, nothing sets them up.
Set has_mtrr in x86_cpu_init_f() for x86_64, and extend the
arch_cpu_init() guard in the QEMU board code to also cover
X86_16BIT_INIT so that it is called in the no-SPL path.
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
arch/x86/cpu/qemu/qemu.c | 4 +++-
arch/x86/cpu/x86_64/cpu.c | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
@@ -108,14 +108,16 @@ void qemu_chipset_init(void)
}
}
-#if CONFIG_IS_ENABLED(X86_32BIT_INIT)
+#if CONFIG_IS_ENABLED(X86_32BIT_INIT) || CONFIG_IS_ENABLED(X86_16BIT_INIT)
int arch_cpu_init(void)
{
post_code(POST_CPU_INIT);
return x86_cpu_init_f();
}
+#endif
+#if CONFIG_IS_ENABLED(X86_32BIT_INIT)
int checkcpu(void)
{
return 0;
@@ -61,6 +61,8 @@ int x86_cpu_reinit_f(void)
int x86_cpu_init_f(void)
{
+ gd->arch.has_mtrr = true;
+
return 0;
}