[U-Boot] [PATCH 1/3] spl: update bl31_entry() with new name and parameter

Kever Yang kever.yang at rock-chips.com
Thu Sep 7 07:00:00 UTC 2017


Rename the bl31_entry() function with 'spl_' prefix and add one
parameter for bl31 entry address since we can get it from spl_image header.

Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---

 common/spl/spl.c     | 2 +-
 common/spl/spl_atf.c | 4 ++--
 include/spl.h        | 6 +++++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 6ff390c..1d8bbb2 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -427,7 +427,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 
 	if (CONFIG_IS_ENABLED(ATF_SUPPORT)) {
 		debug("loaded - jumping to U-Boot via ATF BL31.\n");
-		bl31_entry();
+		spl_bl31_entry((void *)spl_image.entry_point);
 	}
 
 	if (CONFIG_IS_ENABLED(OPTEE_SUPPORT)) {
diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
index 6e8f928..2f6fff9 100644
--- a/common/spl/spl_atf.c
+++ b/common/spl/spl_atf.c
@@ -82,13 +82,13 @@ void raw_write_daif(unsigned int daif)
 	__asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
 }
 
-void bl31_entry(void)
+void spl_bl31_entry(void *entry_addr)
 {
 	struct bl31_params *bl31_params;
 	void (*entry)(struct bl31_params *params, void *plat_params) = NULL;
 
 	bl31_params = bl2_plat_get_bl31_params();
-	entry = (void *)CONFIG_SPL_ATF_TEXT_BASE;
+	entry = entry_addr;
 
 	raw_write_daif(SPSR_EXCEPTION_MASK);
 	dcache_disable();
diff --git a/include/spl.h b/include/spl.h
index 13d46ed..d21a3d2 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -267,7 +267,11 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr);
 int spl_mmc_load_image(struct spl_image_info *spl_image,
 		       struct spl_boot_device *bootdev);
 
-void bl31_entry(void);
+/**
+ * spl_bl31_entry - entry function for ATF bl31
+ * @entry_addr - entry address of bl31 text
+ */
+void spl_bl31_entry(void *entry_addr);
 
 /**
  * spl_optee_entry - entry function for optee
-- 
1.9.1



More information about the U-Boot mailing list