From a4c61ffde3ae4f1b7228d2ecd40fbb8f3703d76c Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Thu, 16 May 2019 13:03:53 +0300 Subject: spl: sata: add default partition and image name Add sensible defaults for the FAT partition selection and the main U-Boot image file name. This allows spl_sata to build when the board headers does not select them explicitly. Signed-off-by: Baruch Siach Signed-off-by: Stefan Roese --- common/spl/spl_sata.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common') diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index adfce1d527..b08efc8419 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -17,6 +17,14 @@ #include #include +#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) { -- cgit v1.2.1 From ab2d415e9bbab64431e6475fbb5a5c62303f8163 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Thu, 16 May 2019 13:03:54 +0300 Subject: spl: sata: fix build with DM_SCSI The init_sata() routine is only present when DM_SCSI is not enabled. Don't call init_sata() when DM_SCSI is enabled. The code will fall back to scsi_scan() in this case. Signed-off-by: Baruch Siach Signed-off-by: Stefan Roese --- common/spl/spl_sata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index b08efc8419..2fb46108a5 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -28,10 +28,12 @@ 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); -- cgit v1.2.1 From 760ef309cb63a3e22ebeecb9080f1034be1560f5 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Thu, 16 May 2019 13:03:55 +0300 Subject: spl: sata: don't force FS_FAT support Allow the code to build when FS_FAT is not enabled, and thus spl_load_image_fat() is not provided. A subsequent patch should add alternative raw access U-Boot main image load method. Signed-off-by: Baruch Siach Signed-off-by: Stefan Roese --- common/spl/spl_sata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c index 2fb46108a5..f0af9f38d1 100644 --- a/common/spl/spl_sata.c +++ b/common/spl/spl_sata.c @@ -53,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"); -- cgit v1.2.1