aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3/j721e_init.c
diff options
context:
space:
mode:
authorKeerthy <j-keerthy@ti.com>2020-02-12 13:55:04 +0530
committerLokesh Vutla <lokeshvutla@ti.com>2020-03-03 13:08:14 +0530
commit3ab34bc028e532f5b748104bd65392a575608411 (patch)
tree5ed3b0cdd6100cf1f48f2e5db28de11f940cdfeb /arch/arm/mach-k3/j721e_init.c
parent805b3cac1e0cae04d16ab893f5cffb446ec74c9c (diff)
downloadu-boot-3ab34bc028e532f5b748104bd65392a575608411.zip
u-boot-3ab34bc028e532f5b748104bd65392a575608411.tar.gz
u-boot-3ab34bc028e532f5b748104bd65392a575608411.tar.bz2
arm: k3: Add support for loading non linux remote cores
Add MAIN domain R5FSS0 remoteproc support from spl. This enables loading the elf firmware in SPL and starting the remotecore. In order to start the core, there should be a file with path "/lib/firmware/j7-main-r5f0_0-fw" under filesystem of respective boot mode. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> [Guard start_non_linux_remote_cores under CONFIG_FS_LOADER] Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Diffstat (limited to 'arch/arm/mach-k3/j721e_init.c')
-rw-r--r--arch/arm/mach-k3/j721e_init.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index f7f7398..13f3791 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -18,6 +18,7 @@
#include <dm.h>
#include <dm/uclass-internal.h>
#include <dm/pinctrl.h>
+#include <remoteproc.h>
#ifdef CONFIG_SPL_BUILD
#ifdef CONFIG_K3_LOAD_SYSFW
@@ -295,3 +296,36 @@ void release_resources_for_core_shutdown(void)
}
}
#endif
+
+#ifdef CONFIG_SYS_K3_SPL_ATF
+void start_non_linux_remote_cores(void)
+{
+ int size = 0, ret;
+ u32 loadaddr = 0;
+
+ size = load_firmware("name_mainr5f0_0fw", "addr_mainr5f0_0load",
+ &loadaddr);
+ if (size <= 0)
+ goto err_load;
+
+ /* assuming remoteproc 2 is aliased for the needed remotecore */
+ ret = rproc_load(2, loadaddr, size);
+ if (ret) {
+ printf("Firmware failed to start on rproc (%d)\n", ret);
+ goto err_load;
+ }
+
+ ret = rproc_start(2);
+ if (ret) {
+ printf("Firmware init failed on rproc (%d)\n", ret);
+ goto err_load;
+ }
+
+ printf("Remoteproc 2 started successfully\n");
+
+ return;
+
+err_load:
+ rproc_reset(2);
+}
+#endif