From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heinrich Schuchardt Date: Fri, 6 Apr 2018 07:43:22 +0200 Subject: [U-Boot] [RFC] efi_loader: support for CONFIG_ARMV7_NONSEC Message-ID: <20180406054322.11541-1-xypron.glpk@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Booting with SMP fails on the Allwinner A20 CPU. https://gist.github.com/xypron/2524ba898d6905d959c744c2b05da196 When executing bootefi we need to * copy the Power State Coordination Interface (PSCI) code to its destination address * switch between our hypervisor mode (HYP) and the supervisor mode (SVC) of the payload (http://linux-sunxi.org/PSCI) This patch is incomplete. It is just meant to indicate where we could change the entry point. With the patch iPXE cannot get a network address. Possibly a better moment for switching to SVC is ExitBootServices. We also have to consider switching modes at EFI_ENTRY and EFI_EXIT. Signed-off-by: Heinrich Schuchardt --- cmd/bootefi.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 85f7b42e76..af5adf8b29 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -17,8 +17,10 @@ #include #include #include +#include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -176,8 +178,19 @@ static efi_status_t efi_do_enter( { efi_status_t ret = EFI_LOAD_ERROR; - if (entry) - ret = entry(image_handle, st); + if (entry) { +#ifdef CONFIG_ARMV7_NONSEC + if (armv7_boot_nonsec()) { + armv7_init_nonsec(); + secure_ram_addr(_do_nonsec_entry)(entry, + (uintptr_t)image_handle, + (uintptr_t)st, 0); + } else +#endif + { + ret = entry(image_handle, st); + } + } st->boottime->exit(image_handle, ret, 0, NULL); return ret; } -- 2.14.2