[PATCH v4 26/45] x86: Init video in SPL if enabled

Bin Meng bmeng.cn at gmail.com
Thu Jul 13 07:16:53 CEST 2023


Hi Simon,

On Mon, Jun 19, 2023 at 8:01 PM Simon Glass <sjg at chromium.org> wrote:
>
> When video is required in SPL, set this up ready for use. Ignore any
> problems since it may be that video is not actually available and we
> still want to continue on to U-Boot proper in that case.
>
> Make sure that the SPL banner is only shown once.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> (no changes since v1)
>
>  arch/x86/lib/spl.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c
> index b9d23e6bfe18..8d57f98f6c1f 100644
> --- a/arch/x86/lib/spl.c
> +++ b/arch/x86/lib/spl.c
> @@ -15,6 +15,7 @@
>  #include <malloc.h>
>  #include <spl.h>
>  #include <syscon.h>
> +#include <vesa.h>
>  #include <asm/cpu.h>
>  #include <asm/cpu_common.h>
>  #include <asm/fsp2/fsp_api.h>
> @@ -97,7 +98,8 @@ static int x86_spl_init(void)
>                 return ret;
>         }
>  #endif
> -       preloader_console_init();
> +       if (!IS_ENABLED(CONFIG_SPL_BOARD_INIT))

The preloader_console_init() has nothing to do with SPL_BOARD_INIT. If
the purpose is to make SPL banner only show once, I think we need
change somewhere else.

> +               preloader_console_init();
>  #if !defined(CONFIG_TPL) && !CONFIG_IS_ENABLED(CPU)
>         ret = print_cpuinfo();
>         if (ret) {
> @@ -257,4 +259,12 @@ void spl_board_init(void)
>  #ifndef CONFIG_TPL
>         preloader_console_init();
>  #endif
> +
> +       if (CONFIG_IS_ENABLED(VIDEO)) {
> +               struct udevice *dev;
> +
> +               /* Set up PCI video in SPL if required */
> +               uclass_first_device_err(UCLASS_PCI, &dev);
> +               uclass_first_device_err(UCLASS_VIDEO, &dev);
> +       }
>  }
> --

Regards,
Bin


More information about the U-Boot mailing list