spl: x86: Correct the binman symbols for SPL
[platform/kernel/u-boot.git] / common / spl / spl.c
index c5360f3..4449074 100644 (file)
@@ -54,8 +54,8 @@ binman_sym_declare(ulong, u_boot_any, image_pos);
 binman_sym_declare(ulong, u_boot_any, size);
 
 #ifdef CONFIG_TPL
-binman_sym_declare(ulong, spl, image_pos);
-binman_sym_declare(ulong, spl, size);
+binman_sym_declare(ulong, u_boot_spl, image_pos);
+binman_sym_declare(ulong, u_boot_spl, size);
 #endif
 
 /* Define board data structure */
@@ -143,14 +143,14 @@ void spl_fixup_fdt(void *fdt_blob)
 ulong spl_get_image_pos(void)
 {
        return spl_phase() == PHASE_TPL ?
-               binman_sym(ulong, spl, image_pos) :
+               binman_sym(ulong, u_boot_spl, image_pos) :
                binman_sym(ulong, u_boot_any, image_pos);
 }
 
 ulong spl_get_image_size(void)
 {
        return spl_phase() == PHASE_TPL ?
-               binman_sym(ulong, spl, size) :
+               binman_sym(ulong, u_boot_spl, size) :
                binman_sym(ulong, u_boot_any, size);
 }
 
@@ -174,6 +174,11 @@ __weak void spl_board_prepare_for_optee(void *fdt)
 {
 }
 
+__weak const char *spl_board_loader_name(u32 boot_device)
+{
+       return NULL;
+}
+
 #if CONFIG_IS_ENABLED(OPTEE_IMAGE)
 __weak void __noreturn jump_to_image_optee(struct spl_image_info *spl_image)
 {
@@ -312,6 +317,7 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
 #endif
 
 __weak int spl_parse_board_header(struct spl_image_info *spl_image,
+                                 const struct spl_boot_device *bootdev,
                                  const void *image_header, size_t size)
 {
        return -EINVAL;
@@ -326,6 +332,7 @@ __weak int spl_parse_legacy_header(struct spl_image_info *spl_image,
 }
 
 int spl_parse_image_header(struct spl_image_info *spl_image,
+                          const struct spl_boot_device *bootdev,
                           const struct image_header *header)
 {
 #if CONFIG_IS_ENABLED(LOAD_FIT_FULL)
@@ -369,7 +376,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
                }
 #endif
 
-               if (!spl_parse_board_header(spl_image, (const void *)header, sizeof(*header)))
+               if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, sizeof(*header)))
                        return 0;
 
 #ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT
@@ -446,7 +453,7 @@ static inline int write_spl_handoff(void) { return 0; }
  * get_bootstage_id() - Get the bootstage ID to emit
  *
  * @start: true if this is for starting SPL, false for ending it
- * @return bootstage ID to use
+ * Return: bootstage ID to use
  */
 static enum bootstage_id get_bootstage_id(bool start)
 {
@@ -587,6 +594,12 @@ static struct spl_image_loader *spl_ll_find_loader(uint boot_device)
        return NULL;
 }
 
+__weak int spl_check_board_image(struct spl_image_info *spl_image,
+                                const struct spl_boot_device *bootdev)
+{
+       return 0;
+}
+
 static int spl_load_image(struct spl_image_info *spl_image,
                          struct spl_image_loader *loader)
 {
@@ -608,6 +621,9 @@ static int spl_load_image(struct spl_image_info *spl_image,
                }
        }
 #endif
+       if (!ret)
+               ret = spl_check_board_image(spl_image, &bootdev);
+
        return ret;
 }
 
@@ -617,7 +633,7 @@ static int spl_load_image(struct spl_image_info *spl_image,
  * @spl_image: Place to put the image details if successful
  * @spl_boot_list: List of boot devices to try
  * @count: Number of elements in spl_boot_list
- * @return 0 if OK, -ENODEV if there were no boot devices
+ * Return: 0 if OK, -ENODEV if there were no boot devices
  *     if CONFIG_SHOW_ERRORS is enabled, returns -ENXIO if there were
  *     devices but none worked
  */
@@ -883,7 +899,7 @@ __weak void spl_relocate_stack_check(void)
  * All of this is done using the same layout and alignments as done in
  * board_init_f_init_reserve() / board_init_f_alloc_reserve().
  *
- * @return new stack location, or 0 to use the same stack
+ * Return: new stack location, or 0 to use the same stack
  */
 ulong spl_relocate_stack_gd(void)
 {