spl: x86: Correct the binman symbols for SPL
[platform/kernel/u-boot.git] / include / spl.h
index 9fc5ac6..8ceb3c0 100644 (file)
@@ -29,6 +29,7 @@ struct image_header;
 
 struct blk_desc;
 struct image_header;
+struct spl_boot_device;
 
 /*
  * u_boot_first_phase() - check if this is the first U-Boot phase
@@ -268,8 +269,8 @@ struct spl_load_info {
  */
 binman_sym_extern(ulong, u_boot_any, image_pos);
 binman_sym_extern(ulong, u_boot_any, size);
-binman_sym_extern(ulong, spl, image_pos);
-binman_sym_extern(ulong, spl, size);
+binman_sym_extern(ulong, u_boot_spl, image_pos);
+binman_sym_extern(ulong, u_boot_spl, size);
 
 /**
  * spl_get_image_pos() - get the image position of the next phase
@@ -340,6 +341,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
  * Returns 0 on success.
  */
 int spl_load_legacy_img(struct spl_image_info *spl_image,
+                       struct spl_boot_device *bootdev,
                        struct spl_load_info *load, ulong header);
 
 /**
@@ -438,6 +440,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image);
  * Return: 0 if a header was correctly parsed, -ve on error
  */
 int spl_parse_image_header(struct spl_image_info *spl_image,
+                          const struct spl_boot_device *bootdev,
                           const struct image_header *header);
 
 void spl_board_prepare_for_linux(void);
@@ -460,6 +463,17 @@ int spl_board_ubi_load_image(u32 boot_device);
 int spl_board_boot_device(u32 boot_device);
 
 /**
+ * spl_board_loader_name() - Return a name for the loader
+ *
+ * This is a weak function which might be overridden by the board code. With
+ * that a board specific value for the device where the U-Boot will be loaded
+ * from can be set. By default it returns NULL.
+ *
+ * @boot_device:       ID of the device which SPL wants to load U-Boot from.
+ */
+const char *spl_board_loader_name(u32 boot_device);
+
+/**
  * jump_to_image_linux() - Jump to a Linux kernel from SPL
  *
  * This jumps into a Linux kernel using the information in @spl_image.
@@ -541,7 +555,9 @@ struct spl_image_loader {
 static inline const char *spl_loader_name(const struct spl_image_loader *loader)
 {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-       return loader->name;
+       const char *name;
+       name = spl_board_loader_name(loader->boot_device);
+       return name ?: loader->name;
 #else
        return NULL;
 #endif
@@ -574,18 +590,22 @@ static inline const char *spl_loader_name(const struct spl_image_loader *loader)
 
 /* SPL FAT image functions */
 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);
 int spl_load_image_fat_os(struct spl_image_info *spl_image,
+                         struct spl_boot_device *bootdev,
                          struct blk_desc *block_dev, int partition);
 
 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
 
 /* SPL EXT image functions */
 int spl_load_image_ext(struct spl_image_info *spl_image,
+                      struct spl_boot_device *bootdev,
                       struct blk_desc *block_dev, int partition,
                       const char *filename);
 int spl_load_image_ext_os(struct spl_image_info *spl_image,
+                         struct spl_boot_device *bootdev,
                          struct blk_desc *block_dev, int partition);
 
 /**