aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3/common.c
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2018-11-02 19:51:05 +0530
committerTom Rini <trini@konsulko.com>2018-11-16 16:51:58 -0500
commita3501a4a44b8cf52d31d9ab93e0f89fd85a3f7a7 (patch)
tree9edd7fdaff5ec9bb4cd95b20ade537aa5afb868e /arch/arm/mach-k3/common.c
parent890b2e750d1eeebdb54b9f0f7b19d1c563f87a7a (diff)
downloadu-boot-a3501a4a44b8cf52d31d9ab93e0f89fd85a3f7a7.zip
u-boot-a3501a4a44b8cf52d31d9ab93e0f89fd85a3f7a7.tar.gz
u-boot-a3501a4a44b8cf52d31d9ab93e0f89fd85a3f7a7.tar.bz2
armv7R: K3: am654: Add support to start ATF from R5 SPL
Considering the boot time requirements, Cortex-A core should be able to start immediately after SPL on R5. Add support for the same. Reviewed-by: Tom Rini <trini@konsulko.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.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
new file mode 100644
index 0000000..cc89d4a
--- /dev/null
+++ b/arch/arm/mach-k3/common.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * K3: Common Architecture initialization
+ *
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+ * Lokesh Vutla <lokeshvutla@ti.com>
+ */
+
+#include <common.h>
+#include <spl.h>
+#include "common.h"
+#include <dm.h>
+#include <remoteproc.h>
+
+#ifdef CONFIG_SYS_K3_SPL_ATF
+void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
+{
+ int ret;
+
+ /*
+ * It is assumed that remoteproc device 1 is the corresponding
+ * cortex A core which runs ATF. Make sure DT reflects the same.
+ */
+ ret = rproc_dev_init(1);
+ if (ret) {
+ printf("%s: ATF failed to Initialize on rproc: ret= %d\n",
+ __func__, ret);
+ hang();
+ }
+
+ ret = rproc_load(1, spl_image->entry_point, 0x200);
+ if (ret) {
+ printf("%s: ATF failed to load on rproc: ret= %d\n",
+ __func__, ret);
+ hang();
+ }
+
+ /* Add an extra newline to differentiate the ATF logs from SPL*/
+ printf("Starting ATF on ARM64 core...\n\n");
+
+ ret = rproc_start(1);
+ if (ret) {
+ printf("%s: ATF failed to start on rproc: ret= %d\n",
+ __func__, ret);
+ hang();
+ }
+
+ debug("ATF started. Wait indefiniely\n");
+ while (1)
+ asm volatile("wfe");
+}
+#endif