[PATCH v4 03/20] x86: coreboot: Rearrange arch_cpu_init()

Bin Meng bmeng.cn at gmail.com
Tue Sep 19 09:19:24 CEST 2023


On Thu, Aug 24, 2023 at 5:11 AM Simon Glass <sjg at chromium.org> wrote:
>
> 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 at chromium.org>
> ---
>
> (no changes since v1)
>
>  arch/x86/cpu/coreboot/coreboot.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
> index 835b2c77746..c2ceaa9a56c 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();

nits: not aligned

> +       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)
> --

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

Regards,
Bin


More information about the U-Boot mailing list