SPL: Add struct spl_boot_device parameter into spl_parse_board_header()
Add parameter spl_boot_device to spl_parse_board_header(), which allows
the implementations to see from which device we are booting and do
boot-device-specific checks of the image header.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index e9f6c5f..1f3a144 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -31,6 +31,7 @@
#endif
static int spl_sata_load_image_raw(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev,
struct blk_desc *stor_dev, unsigned long sector)
{
struct image_header *header;
@@ -45,7 +46,7 @@
if (count == 0)
return -EIO;
- ret = spl_parse_image_header(spl_image, header);
+ ret = spl_parse_image_header(spl_image, bootdev, header);
if (ret)
return ret;
@@ -90,18 +91,18 @@
#if CONFIG_IS_ENABLED(OS_BOOT)
if (spl_start_uboot() ||
- spl_load_image_fat_os(spl_image, stor_dev,
+ spl_load_image_fat_os(spl_image, bootdev, stor_dev,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
#endif
{
err = -ENOSYS;
if (IS_ENABLED(CONFIG_SPL_FS_FAT)) {
- err = spl_load_image_fat(spl_image, stor_dev,
+ err = spl_load_image_fat(spl_image, bootdev, stor_dev,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
} else if (IS_ENABLED(CONFIG_SPL_SATA_RAW_U_BOOT_USE_SECTOR)) {
- err = spl_sata_load_image_raw(spl_image, stor_dev,
+ err = spl_sata_load_image_raw(spl_image, bootdev, stor_dev,
CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR);
}
}