aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-19 21:00:04 -0600
committerBin Meng <bmeng@tinylab.org>2023-09-22 06:03:46 +0800
commit2c6b979ec163afe72211eca571daee352a030c85 (patch)
tree3b91b25899df2a98d1e4b7fd6915d57d528297ad
parent04ecda0e1dffef40028d2dc66e7d47b7dcc7b4a5 (diff)
downloadu-boot-2c6b979ec163afe72211eca571daee352a030c85.zip
u-boot-2c6b979ec163afe72211eca571daee352a030c85.tar.gz
u-boot-2c6b979ec163afe72211eca571daee352a030c85.tar.bz2
x86: coreboot: Rearrange arch_cpu_init()
Init errors in SPL are currently ignored by this function. Change the code to init the CPU, reporting an error if something is wrong. After that, look for the coreboot table. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--arch/x86/cpu/coreboot/coreboot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index 835b2c7..da43d66 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -21,7 +21,14 @@
int arch_cpu_init(void)
{
- int ret = get_coreboot_info(&lib_sysinfo);
+ int ret;
+
+ ret = IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
+ x86_cpu_init_f();
+ if (ret)
+ return ret;
+
+ ret = get_coreboot_info(&lib_sysinfo);
if (ret != 0) {
printf("Failed to parse coreboot tables.\n");
return ret;
@@ -29,8 +36,7 @@ int arch_cpu_init(void)
timestamp_init();
- return IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
- x86_cpu_init_f();
+ return 0;
}
int checkcpu(void)