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