spl: atf: call bl31_entry function before jump to u-boot
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 16 Sep 2019 01:09:02 +0000 (10:09 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 06:13:47 +0000 (15:13 +0900)
Call bl31_entry function before jump to u-boot in board_init_r.
This patch is added because of Dignsys's ATF patches.
In future, if find generic solution with fit-images node, will be
reverted.

Change-Id: I2a506207674aed8180d542a659d389c479d13b63
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
common/spl/spl.c
common/spl/spl_atf.c
include/spl.h

index 4840d1d36707bbea20d2ff0214942d2f77c14b75..502904b7734099c58bd2a337b86289a179c1934c 100644 (file)
@@ -728,6 +728,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
                debug("Failed to stash bootstage: err=%d\n", ret);
 #endif
 
+       /* FIXME: This is workaround to use ATF for Tizen
+        * If find generic solution to use ATF, will remove this code.
+        * It has dependent with Dignsys's patch.
+        */
+       if (IS_ENABLED(CONFIG_SPL_ATF))
+               bl31_entry(CONFIG_SPL_ATF_TEXT_BASE, CONFIG_SYS_TEXT_BASE, NULL);
+
        debug("loaded - jumping to U-Boot...\n");
        spl_board_prepare_for_boot();
        jump_to_image_no_args(&spl_image);
index 345f1613c6f1487a8eb3b6c3cbfb3ba5204c54c7..d929290953209cf8c8278ee54a240150f9fde20d 100644 (file)
@@ -85,8 +85,9 @@ static inline void raw_write_daif(unsigned int daif)
 
 typedef void (*atf_entry_t)(struct bl31_params *params, void *plat_params);
 
-static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry,
-                      uintptr_t bl33_entry, uintptr_t fdt_addr)
+
+void bl31_entry(uintptr_t bl31_entry, uintptr_t bl33_entry,
+                      uintptr_t fdt_addr)
 {
        struct bl31_params *bl31_params;
        atf_entry_t  atf_entry = (atf_entry_t)bl31_entry;
index b72dfc7e3d4909d5c8a6a33d1868008cf2fe8b80..69655f5bdb3d5dee939eed2b928ab4a483af9b2e 100644 (file)
@@ -601,4 +601,6 @@ void spl_perform_fixups(struct spl_image_info *spl_image);
 struct image_header *spl_get_load_buffer(ssize_t offset, size_t size);
 
 void spl_save_restore_data(void);
+void bl31_entry(uintptr_t bl31_entry, uintptr_t bl33_entry,
+                      uintptr_t fdt_addr);
 #endif