spl: x86: Correct the binman symbols for SPL
[platform/kernel/u-boot.git] / common / spl / spl.c
index 4bb9455..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
@@ -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;
 }