aboutsummaryrefslogtreecommitdiff
path: root/common/spl/spl_sata.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_sata.c')
-rw-r--r--common/spl/spl_sata.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index adfce1d..f0af9f3 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -17,13 +17,23 @@
#include <fat.h>
#include <image.h>
+#ifndef CONFIG_SYS_SATA_FAT_BOOT_PARTITION
+#define CONFIG_SYS_SATA_FAT_BOOT_PARTITION 1
+#endif
+
+#ifndef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#endif
+
static int spl_sata_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
- int err;
+ int err = 0;
struct blk_desc *stor_dev;
+#if !defined(CONFIG_DM_SCSI) && !defined(CONFIG_AHCI)
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);
@@ -43,9 +53,13 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
#endif
{
- err = spl_load_image_fat(spl_image, stor_dev,
+ err = -ENOSYS;
+
+ if (IS_ENABLED(CONFIG_SPL_FS_FAT)) {
+ err = spl_load_image_fat(spl_image, stor_dev,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
- CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+ }
}
if (err) {
puts("Error loading sata device\n");