All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 04/10] armv7R: K3: am654: Add support to start ATF from R5 SPL
Date: Fri, 2 Nov 2018 19:51:05 +0530	[thread overview]
Message-ID: <20181102142111.19766-5-lokeshvutla@ti.com> (raw)
In-Reply-To: <20181102142111.19766-1-lokeshvutla@ti.com>

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>
---
 arch/arm/mach-k3/Kconfig  |  7 ++++++
 arch/arm/mach-k3/Makefile |  1 +
 arch/arm/mach-k3/common.c | 52 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+)
 create mode 100644 arch/arm/mach-k3/common.c

diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index 9f5e8e5ee4..e677a2e01b 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -58,5 +58,12 @@ config SYS_K3_BOOT_CORE_ID
 	int
 	default 16
 
+config SYS_K3_SPL_ATF
+	bool "Start Cortex-A from SPL"
+	depends on SPL && CPU_V7R
+	help
+	  Enabling this will try to start Cortex-A (typically with ATF)
+	  after SPL from R5.
+
 source "board/ti/am65x/Kconfig"
 endif
diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile
index 619733fb87..406dda3b02 100644
--- a/arch/arm/mach-k3/Makefile
+++ b/arch/arm/mach-k3/Makefile
@@ -6,3 +6,4 @@
 obj-$(CONFIG_SOC_K3_AM6) += am6_init.o
 obj-$(CONFIG_ARM64) += arm64-mmu.o
 obj-$(CONFIG_CPU_V7R) += r5_mpu.o
+obj-y += common.o
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
new file mode 100644
index 0000000000..cc89d4a296
--- /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
-- 
2.19.1

  parent reply	other threads:[~2018-11-02 14:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 14:21 [U-Boot] [PATCH v4 00/10] arm: am654: Add r5 support for am654-evm Lokesh Vutla
2018-11-02 14:21 ` [U-Boot] [PATCH v4 01/10] ram: Introduce K3 AM654 DDR Sub System driver Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 02/10] armv7R: K3: am654: Enable MPU regions Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 03/10] armv7R: K3: am654: Add support for generating build targets Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` Lokesh Vutla [this message]
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, 04/10] armv7R: K3: am654: Add support to start ATF from R5 SPL Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 05/10] armv7R: K3: am654: Add support for triggering ddr init from SPL Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 06/10] board: ti: am654: r5: Add initial support for am654 Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 07/10] arm: dts: k3: Sync dts from Linux Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot,v4,07/10] " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 08/10] armv7r: dts: am654: Add initial support Lokesh Vutla
2018-11-02 20:30   ` Tom Rini
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 09/10] configs: am65x_evm_r5: " Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini
2018-11-02 14:21 ` [U-Boot] [PATCH v4 10/10] board: ti: am65x: Update README to add R5 build support Lokesh Vutla
2018-11-17 13:34   ` [U-Boot] [U-Boot, v4, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181102142111.19766-5-lokeshvutla@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.