All of lore.kernel.org
 help / color / mirror / Atom feed
From: abdellatif.elkhlifi@arm.com
To: meta-arm@lists.yoctoproject.org, Ross.Burton@arm.com
Cc: nd@arm.com, Satish Kumar <satish.kumar01@arm.com>
Subject: [PATCH][HONISTER 12/13] arm-bsp/u-boot: identify which bank to load kernel from
Date: Mon,  6 Dec 2021 13:25:12 +0000	[thread overview]
Message-ID: <20211206132513.20172-13-abdellatif.elkhlifi@arm.com> (raw)
In-Reply-To: <20211206132513.20172-1-abdellatif.elkhlifi@arm.com>

From: Satish Kumar <satish.kumar01@arm.com>

Secure enclave, based on the firmware update state of the
system, decides the boot bank. In this commit, u-boot
identifies the selected boot bank and loads the kernel
from it.

Change-Id: Ifcef126dc79c7808b30ef0319d83482d2d29fd13
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
---
 ...0-identify-which-bank-to-load-kernel.patch | 66 +++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot_%.bbappend      |  1 +
 2 files changed, 67 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0032-arm-corstone1000-identify-which-bank-to-load-kernel.patch

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0032-arm-corstone1000-identify-which-bank-to-load-kernel.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0032-arm-corstone1000-identify-which-bank-to-load-kernel.patch
new file mode 100644
index 0000000..80fc6d3
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0032-arm-corstone1000-identify-which-bank-to-load-kernel.patch
@@ -0,0 +1,66 @@
+Upstream-Status: Pending [Not submitted to upstream yet]
+Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
+
+From abc455d29aa9c983c6af2fa75870a7ee95da2496 Mon Sep 17 00:00:00 2001
+From: Satish Kumar <satish.kumar01@arm.com>
+Date: Wed, 1 Dec 2021 19:17:57 +0000
+Subject: [PATCH] arm: corstone1000: identify which bank to load kernel from
+
+Secure enclave, based on the firmware update state of the
+system, decides the boot bank. In this commit, u-boot
+identifies the selected boot bank and loads the kernel
+from it.
+
+Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
+---
+ configs/corstone1000_defconfig |  2 +-
+ include/configs/corstone1000.h | 18 ++++++++++++++----
+ 2 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
+index 0b9ead461b..3c00e13ceb 100644
+--- a/configs/corstone1000_defconfig
++++ b/configs/corstone1000_defconfig
+@@ -29,7 +29,7 @@ CONFIG_CMD_BOOTEFI_HELLO=y
+ CONFIG_CMD_NVEDIT_EFI=y
+ # CONFIG_CMD_LOADS is not set
+ CONFIG_CMD_USB=y
+-# CONFIG_CMD_ITEST is not set
++CONFIG_CMD_ITEST=y
+ # CONFIG_CMD_SETEXPR is not set
+ CONFIG_CMD_DHCP=y
+ # CONFIG_CMD_NFS is not set
+diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
+index baa0720fb5..7c6f66c891 100644
+--- a/include/configs/corstone1000.h
++++ b/include/configs/corstone1000.h
+@@ -97,12 +97,22 @@
+ 				BOOTENV                         \
+ 				"usb_pgood_delay=250\0"         \
+ 				"fdt_addr_r=0x82000000\0"		\
+-				"kernel_addr=0x083EE000\0"		\
+-				"kernel_addr_r=0x88200000\0"	\
++				"boot_bank_flag=0x08002000\0"		\
++				"kernel_addr_bank_0=0x083EE000\0"			\
++				"kernel_addr_bank_1=0x0936E000\0"			\
++				"retrieve_kernel_load_addr="				\
++					"if itest.l *${boot_bank_flag} == 0; then "	\
++					    "setenv kernel_addr $kernel_addr_bank_0;"	\
++					"else "						\
++					    "setenv kernel_addr $kernel_addr_bank_1;"	\
++					"fi;"						\
++					"\0"							\
++				"kernel_addr_r=0x88200000\0"				\
+ 				"fdt_high=0xffffffff\0"
+ #define CONFIG_BOOTCOMMAND					\
+-				"echo Loading Kernel to memory ... ;"   \
+-				"loadm $kernel_addr $kernel_addr_r 0xc00000;" \
++				"run retrieve_kernel_load_addr;" \
++				"echo Loading kernel from $kernel_addr to memory ... ;" \
++				"loadm $kernel_addr $kernel_addr_r 0xc00000;"		\
+ 				"usb start; usb reset;" \
+ 				"run distro_bootcmd;" \
+ 				"bootefi $kernel_addr_r $fdtcontroladdr;"
+-- 
+2.17.1
+
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
index 9e9fc48..dc54fdf 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -43,6 +43,7 @@ SRC_URI:append:corstone1000 = " \
       file://0029-corstone1000-set-CONFIG_PSCI_RESET.patch \
       file://0030-arm-bsp-u-boot-corstone1000-Implement-autoboot-script.patch \
       file://0031-corstone1000-change-base-address-of-kernel-in-the-fl.patch \
+      file://0032-arm-corstone1000-identify-which-bank-to-load-kernel.patch \
       "
 
 #
-- 
2.17.1



  parent reply	other threads:[~2021-12-06 13:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 13:25 [PATCH][HONISTER 00/13] backport "corstone1000: platform specific patches for u-boot, trusted firmware-a, trusted firmware-m" abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 01/13] arm-toolchain: upgrade gcc-arm-none-eabi (GNU-RM) to 10.3-2021.10 abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 02/13] arm-bsp/imgtool: upgrade imgtool to 1.8.0 abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 03/13] arm-bsp/u-boot: corstone1000: Enable SMM gateway abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 04/13] arm-bsp/u-boot: corstone1000: Fix ISP1760 EFI boot issue abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 05/13] arm-bsp/u-boot: corstone1000: Enable PSCI Reset abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 06/13] arm-bsp/trusted firmware-a: corstone1000: implement EFI reset system abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 07/13] arm-bsp/u-boot: corstone1000: Implement autoboot storage device selection abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 08/13] arm-bsp/trusted-firmware-m: corstone1000: firmware update changes abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 09/13] arm-bsp/trusted-firmware-a: patch to change flash base address of FIP abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 10/13] arm-bsp/u-boot: patch to change kernel flash address abdellatif.elkhlifi
2021-12-06 13:25 ` [PATCH][HONISTER 11/13] arm-bsp/trusted-firmware-a: patch to identify which bank to load fip from abdellatif.elkhlifi
2021-12-06 13:25 ` abdellatif.elkhlifi [this message]
2021-12-06 13:25 ` [PATCH][HONISTER 13/13] kas: corstone1000: update SE binary sizes abdellatif.elkhlifi
2021-12-06 21:45 ` [PATCH][HONISTER 00/13] backport "corstone1000: platform specific patches for u-boot, trusted firmware-a, trusted firmware-m" Jon Mason

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=20211206132513.20172-13-abdellatif.elkhlifi@arm.com \
    --to=abdellatif.elkhlifi@arm.com \
    --cc=Ross.Burton@arm.com \
    --cc=meta-arm@lists.yoctoproject.org \
    --cc=nd@arm.com \
    --cc=satish.kumar01@arm.com \
    /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.