aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-07 09:58:18 -0600
committerBin Meng <bmeng@tinylab.org>2023-09-22 06:03:46 +0800
commit3ca9b86e2344ddea2dafc2c1edb24cf010149249 (patch)
tree28849b570e3a5b113a7937784276e738ced8e1fd /arch/x86
parent623b3e8f9718a1fbd612b3e42451859e9f98a947 (diff)
downloadu-boot-3ca9b86e2344ddea2dafc2c1edb24cf010149249.zip
u-boot-3ca9b86e2344ddea2dafc2c1edb24cf010149249.tar.gz
u-boot-3ca9b86e2344ddea2dafc2c1edb24cf010149249.tar.bz2
x86: broadwell: Avoid initing the CPU twice
When TPL has already set up the CPU, don't do it again. This existing code actually has this backwards, so fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/cpu/broadwell/cpu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/cpu/broadwell/cpu.c b/arch/x86/cpu/broadwell/cpu.c
index 560b1f7..cbd4a3b 100644
--- a/arch/x86/cpu/broadwell/cpu.c
+++ b/arch/x86/cpu/broadwell/cpu.c
@@ -11,6 +11,7 @@
#include <event.h>
#include <init.h>
#include <log.h>
+#include <spl.h>
#include <asm/cpu.h>
#include <asm/cpu_x86.h>
#include <asm/cpu_common.h>
@@ -67,12 +68,11 @@ int arch_cpu_init(void)
{
post_code(POST_CPU_INIT);
-#ifdef CONFIG_TPL
/* Do a mini-init if TPL has already done the full init */
- return x86_cpu_reinit_f();
-#else
- return x86_cpu_init_f();
-#endif
+ if (IS_ENABLED(CONFIG_TPL) && spl_phase() != PHASE_TPL)
+ return x86_cpu_reinit_f();
+ else
+ return x86_cpu_init_f();
}
int checkcpu(void)