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

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@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

We don't need SPL_ATF_TEXT_BASE since we can get the bl31 entry from spl_image.entry_point.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
common/spl/Kconfig | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 85f8d66..3a74ca3 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -694,12 +694,6 @@ config SPL_ATF_SUPPORT is loaded by SPL(which is considered as BL2 in ATF terminology). More detail at: https://github.com/ARM-software/arm-trusted-firmware
-config SPL_ATF_TEXT_BASE - depends on SPL_ATF_SUPPORT - hex "ATF BL31 base address" - help - This is the base address in memory for ATF BL31 text and entry point. - config SPL_OPTEE_SUPPORT bool "Support OP-TEE Trusted OS" depends on ARM

We don't need SPL_ATF_TEXT_BASE since we can get the bl31 entry from spl_image.entry_point.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
common/spl/Kconfig | 6 ------ 1 file changed, 6 deletions(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

After update bl31_entry(), we don't need CONFIG_SPL_ATF_TEXT_BASE.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
configs/firefly-rk3399_defconfig | 1 - configs/lion-rk3368_defconfig | 1 - 2 files changed, 2 deletions(-)
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig index eead166..d9dc887 100644 --- a/configs/firefly-rk3399_defconfig +++ b/configs/firefly-rk3399_defconfig @@ -15,7 +15,6 @@ CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SPL_ATF_SUPPORT=y -CONFIG_SPL_ATF_TEXT_BASE=0x00010000 CONFIG_FASTBOOT=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_CMD_FASTBOOT=y diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig index 73547f8..9735f17 100644 --- a/configs/lion-rk3368_defconfig +++ b/configs/lion-rk3368_defconfig @@ -29,7 +29,6 @@ CONFIG_TPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SPL_ATF_SUPPORT=y -CONFIG_SPL_ATF_TEXT_BASE=0x10000 CONFIG_TPL=y CONFIG_TPL_BOOTROM_SUPPORT=y CONFIG_TPL_DRIVERS_MISC_SUPPORT=y

After update bl31_entry(), we don't need CONFIG_SPL_ATF_TEXT_BASE.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
configs/firefly-rk3399_defconfig | 1 - configs/lion-rk3368_defconfig | 1 - 2 files changed, 2 deletions(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Kever,
On 7 Sep 2017, at 09:00, Kever Yang kever.yang@rock-chips.com wrote:
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.
Just as a heads-up, I also have a patch in my queue (i.e. to submit this week) that integrates as IH_OS_ARM_TRUSTED_FIRMWARE and adds the option to pass a pointer to the FDT as a platform-parameter.
I’ll copy you, so we can then figure out how to best merge your and my changes and apply those at the same time.
Regards, Philipp.
Signed-off-by: Kever Yang kever.yang@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

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@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(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
participants (3)
-
Dr. Philipp Tomsich
-
Kever Yang
-
Philipp Tomsich