aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3/common.c
diff options
context:
space:
mode:
authorKeerthy <j-keerthy@ti.com>2020-02-12 13:55:06 +0530
committerLokesh Vutla <lokeshvutla@ti.com>2020-03-03 13:08:14 +0530
commitd154252fc9bbc48c0cfb4b8e655ac6ea40ad166a (patch)
treec8a2d2e2c4c8079b63b863b2bb49c5eda696f951 /arch/arm/mach-k3/common.c
parent6dce1cfa56ab269c2df67ba71d4905d9f54f95e6 (diff)
downloadu-boot-d154252fc9bbc48c0cfb4b8e655ac6ea40ad166a.zip
u-boot-d154252fc9bbc48c0cfb4b8e655ac6ea40ad166a.tar.gz
u-boot-d154252fc9bbc48c0cfb4b8e655ac6ea40ad166a.tar.bz2
armv7R: K3: Add support for jumping to firmware
MCU Domain rf50 is currently shutting down after loading the ATF. Load elf firmware and jump to firmware post loading ATF. ROM doesn't enable ATCM memory, so make sure that firmware that is being loaded doesn't use ATCM memory or override SPL. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'arch/arm/mach-k3/common.c')
-rw-r--r--arch/arm/mach-k3/common.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index a4c99f1..b2d25ed 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -132,8 +132,10 @@ __weak void start_non_linux_remote_cores(void)
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
{
+ typedef void __noreturn (*image_entry_noargs_t)(void);
struct ti_sci_handle *ti_sci = get_ti_sci_handle();
- int ret;
+ u32 loadaddr = 0;
+ int ret, size;
/* Release all the exclusive devices held by SPL before starting ATF */
ti_sci->ops.dev_ops.release_exclusive_devices(ti_sci);
@@ -144,6 +146,9 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
init_env();
start_non_linux_remote_cores();
+ size = load_firmware("name_mcur5f0_0fw", "addr_mcur5f0_0load",
+ &loadaddr);
+
/*
* It is assumed that remoteproc device 1 is the corresponding
@@ -159,13 +164,18 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
ret = rproc_start(1);
if (ret)
panic("%s: ATF failed to start on rproc (%d)\n", __func__, ret);
+ if (!(size > 0 && valid_elf_image(loadaddr))) {
+ debug("Shutting down...\n");
+ release_resources_for_core_shutdown();
+
+ while (1)
+ asm volatile("wfe");
+ }
- debug("Releasing resources...\n");
- release_resources_for_core_shutdown();
+ image_entry_noargs_t image_entry =
+ (image_entry_noargs_t)load_elf_image_phdr(loadaddr);
- debug("Finalizing core shutdown...\n");
- while (1)
- asm volatile("wfe");
+ image_entry();
}
#endif