From 5b6bc28ead0674ed9c9b7afa35f35828aad07cda Mon Sep 17 00:00:00 2001 From: Josua Mayer Date: Mon, 4 Sep 2023 12:42:06 +0200 Subject: [PATCH] spl: sata: support boot without ahci or scsi Use non-ahci sata_get_dev and sata_initialize to access sata from spl in absence of CONFIG_AHCI and CONFIG_SCSI. Signed-off-by: Josua Mayer --- common/spl/spl_sata.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index aeaf03daf95f..1701614a7d4f 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -57,14 +57,20 @@ static int spl_sata_load_image(struct spl_image_info *spl_image, { int err; struct blk_desc *stor_dev; - +#ifndef CONFIG_AHCI + err = sata_initialize(); +#else err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE); +#endif if (err) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT printf("spl: sata init failed: err - %d\n", err); #endif return err; } else { +#ifndef CONFIG_AHCI + stor_dev = sata_get_dev(CONFIG_SPL_SATA_BOOT_DEVICE); +#endif #ifdef CONFIG_SCSI /* try to recognize storage devices immediately */ scsi_scan(false);