[PATCH 1/1] spl: initialize PCI before booting from SATA

Simon Glass sjg at chromium.org
Mon Jul 24 00:58:18 CEST 2023


Hi Heinrich,

On Sat, 22 Jul 2023 at 15:56, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> Many SATA controllers are PCI bus devices. Before calling scsi_scan() we
> must bind the PCI devices.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  common/spl/spl_sata.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
> index 32746ce9f3..060da49006 100644
> --- a/common/spl/spl_sata.c
> +++ b/common/spl/spl_sata.c
> @@ -61,6 +61,8 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
>         struct blk_desc *stor_dev;
>
>         /* try to recognize storage devices immediately */
> +       if (IS_ENABLED(CONFIG_SPL_PCI))
> +               pci_init();

error checking?

>         scsi_scan(false);
>         stor_dev = blk_get_devnum_by_uclass_id(UCLASS_SCSI, 0);
>         if (!stor_dev)
> --
> 2.40.1
>

Regards,
Simon


More information about the U-Boot mailing list