Convert CONFIG_SPL_FS_LOAD_PAYLOAD_NAME et al to Kconfig
[platform/kernel/u-boot.git] / common / spl / spl_fat.c
index aa371ab..5b27054 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <log.h>
 #include <spl.h>
 #include <asm/u-boot.h>
 #include <fat.h>
@@ -54,6 +55,7 @@ static ulong spl_fit_read(struct spl_load_info *load, ulong file_offset,
 }
 
 int spl_load_image_fat(struct spl_image_info *spl_image,
+                      struct spl_boot_device *bootdev,
                       struct blk_desc *block_dev, int partition,
                       const char *filename)
 {
@@ -75,7 +77,7 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
                err = file_fat_read(filename, (void *)CONFIG_SYS_LOAD_ADDR, 0);
                if (err <= 0)
                        goto end;
-               err = spl_parse_image_header(spl_image,
+               err = spl_parse_image_header(spl_image, bootdev,
                                (struct image_header *)CONFIG_SYS_LOAD_ADDR);
                if (err == -EAGAIN)
                        return err;
@@ -93,7 +95,7 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
 
                return spl_load_simple_fit(spl_image, &load, 0, header);
        } else {
-               err = spl_parse_image_header(spl_image, header);
+               err = spl_parse_image_header(spl_image, bootdev, header);
                if (err)
                        goto end;
 
@@ -111,8 +113,9 @@ end:
        return (err <= 0);
 }
 
-#ifdef CONFIG_SPL_OS_BOOT
+#if CONFIG_IS_ENABLED(OS_BOOT)
 int spl_load_image_fat_os(struct spl_image_info *spl_image,
+                         struct spl_boot_device *bootdev,
                          struct blk_desc *block_dev, int partition)
 {
        int err;
@@ -133,7 +136,7 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
                }
                file = env_get("falcon_image_file");
                if (file) {
-                       err = spl_load_image_fat(spl_image, block_dev,
+                       err = spl_load_image_fat(spl_image, bootdev, block_dev,
                                                 partition, file);
                        if (err != 0) {
                                puts("spl: falling back to default\n");
@@ -159,11 +162,12 @@ defaults:
                return -1;
        }
 
-       return spl_load_image_fat(spl_image, block_dev, partition,
+       return spl_load_image_fat(spl_image, bootdev, block_dev, partition,
                        CONFIG_SPL_FS_LOAD_KERNEL_NAME);
 }
 #else
 int spl_load_image_fat_os(struct spl_image_info *spl_image,
+                         struct spl_boot_device *bootdev,
                          struct blk_desc *block_dev, int partition)
 {
        return -ENOSYS;