Skip to contentSkip to conversation

spl: atf: add support for LOAD_IMAGE_V2

PATCH Superseded Michael Walle 3 participants 30 messages Nov 18, 2020 – Dec 7, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Newer TF-A versions provide a new image loading protocol. This is used on (newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31 directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream version of the OP-TEE Trusted OS.

Changes since v1:
- removed firmware entry from loadable, suggested by Michal
- use kernel-doc function annotation format
- new patch "board: sl28: remove u-boot from loadable DT node"

Michael Walle (9):
treewide: use CONFIG_IS_ENABLED() for ARMV8_SEC_FIRMWARE_SUPPORT
spl: atf: move storage for bl31_params into function
spl: atf: provide a bl2_plat_get_bl31_params_default()
spl: atf: remove helper structure from common header
spl: atf: add support for LOAD_IMAGE_V2
armv8: layerscape: don't initialize GIC in SPL
board: sl28: remove u-boot from loadable DT node
board: sl28: add ATF support (bl31)
board: sl28: add OP-TEE Trusted OS support (bl32)

 arch/arm/cpu/armv8/cpu-dt.c                   |   2 +-
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c       |   8 +-
 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S  |   2 +
 arch/arm/cpu/armv8/fsl-layerscape/ppa.c       |   2 +-
 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  |  80 ++++++++++-
 arch/arm/lib/bootm-fdt.c                      |   2 +-
 arch/arm/lib/psci-dt.c                        |   6 +-
 board/kontron/sl28/Kconfig                    |  33 +++++
 board/kontron/sl28/Makefile                   |   6 +-
 board/kontron/sl28/sl28.c                     |   7 +
 board/kontron/sl28/spl_atf.c                  |  54 ++++++++
 common/spl/Kconfig                            |   9 ++
 common/spl/spl_atf.c                          | 129 ++++++++++++++++--
 include/atf_common.h                          |  42 ++++--
 include/spl.h                                 |  78 +++++++++--
 15 files changed, 410 insertions(+), 50 deletions(-)
 create mode 100644 board/kontron/sl28/spl_atf.c
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/9 treewide: use CONFIG_IS_ENABLED() for ARMV8_SEC_FIRMWARE_SUPPORT

There is SPL_ARMV8_SEC_FIRMWARE_SUPPORT and ARMV8_SEC_FIRMWARE_SUPPORT. Thus use CONFIG_IS_ENABLED() instead of the simple #ifdef.

---
 arch/arm/cpu/armv8/cpu-dt.c             | 2 +-
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 8 ++++----
 arch/arm/cpu/armv8/fsl-layerscape/ppa.c | 2 +-
 arch/arm/lib/bootm-fdt.c                | 2 +-
 arch/arm/lib/psci-dt.c                  | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/cpu/armv8/cpu-dt.c +1 -1
index 97d4473a68..61c38b17cb 100644
@@ -9,7 +9,7 @@
 #include <asm/system.h>
 #include <asm/armv8/sec_firmware.h>
 
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 int psci_update_dt(void *fdt)
 {
 	/*
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +4 -4
index 6d3391db3b..598ee2ffa2 100644
@@ -26,7 +26,7 @@
 #endif
 #include <fsl_sec.h>
 #include <asm/arch-fsl-layerscape/soc.h>
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 #include <asm/armv8/sec_firmware.h>
 #endif
 #include <asm/arch/speed.h>
@@ -81,7 +81,7 @@ void ft_fixup_cpu(void *blob)
 						    "device_type", "cpu", 4);
 	}
 
-#if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && \
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT) && \
 	defined(CONFIG_SEC_FIRMWARE_ARMV8_PSCI)
 	int node;
 	u32 psci_ver;
@@ -383,7 +383,7 @@ static void fdt_fixup_msi(void *blob)
 }
 #endif
 
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 /* Remove JR node used by SEC firmware */
 void fdt_fixup_remove_jr(void *blob)
 {
@@ -488,7 +488,7 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
 	else {
 		ccsr_sec_t __iomem *sec;
 
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 		fdt_fixup_remove_jr(blob);
 		fdt_fixup_kaslr(blob);
 #endif
arch/arm/cpu/armv8/fsl-layerscape/ppa.c +1 -1
index 1ddb267093..2285296ea0 100644
@@ -16,7 +16,7 @@
 #elif defined(CONFIG_FSL_LSCH2)
 #include <asm/arch/immap_lsch2.h>
 #endif
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 #include <asm/armv8/sec_firmware.h>
 #endif
 #ifdef CONFIG_CHAIN_OF_TRUST
arch/arm/lib/bootm-fdt.c +1 -1
index 02a49a8e10..fe46a7d7c9 100644
@@ -63,7 +63,7 @@ int arch_fixup_fdt(void *blob)
 #endif
 
 #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV8_PSCI) || \
-	defined(CONFIG_SEC_FIRMWARE_ARMV8_PSCI)
+	CONFIG_IS_ENABLED(SEC_FIRMWARE_ARMV8_PSCI)
 	ret = psci_update_dt(blob);
 	if (ret)
 		return ret;
arch/arm/lib/psci-dt.c +3 -3
index 0ed29a43f1..903b335704 100644
@@ -10,7 +10,7 @@
 #include <linux/sizes.h>
 #include <linux/kernel.h>
 #include <asm/psci.h>
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 #include <asm/armv8/sec_firmware.h>
 #endif
 
@@ -64,7 +64,7 @@ int fdt_psci(void *fdt)
 		return nodeoff;
 
 init_psci_node:
-#ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 	psci_ver = sec_firmware_support_psci_version();
 #elif defined(CONFIG_ARMV7_PSCI_1_0) || defined(CONFIG_ARMV8_PSCI)
 	psci_ver = ARM_PSCI_VER_1_0;
@@ -85,7 +85,7 @@ init_psci_node:
 			return tmp;
 	}
 
-#ifndef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
+#if !CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT)
 	/*
 	 * The Secure firmware framework isn't able to support PSCI version 0.1.
 	 */
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 1/9 treewide: use CONFIG_IS_ENABLED() for ARMV8_SEC_FIRMWARE_SUPPORT

Quoted 5 lines · Michael Walle

There is SPL_ARMV8_SEC_FIRMWARE_SUPPORT and ARMV8_SEC_FIRMWARE_SUPPORT. Thus use CONFIG_IS_ENABLED() instead of the simple #ifdef.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/1160ffd2/attachment.sig>
#3 lore raw

PATCH v2 2/9 spl: atf: move storage for bl31_params into function

In reply to Michael Walle

There is no need to have the storage available globally. This is also a preparation for LOAD_IMAGE_V2 support. That will introduce a similar generator function which also has its own storage.

---
 common/spl/spl_atf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
common/spl/spl_atf.c +2 -3
index 9bd25f6b32..df0a198d55 100644
@@ -18,13 +18,12 @@
 #include <spl.h>
 #include <asm/cache.h>
 
-static struct bl2_to_bl31_params_mem bl31_params_mem;
-static struct bl31_params *bl2_to_bl31_params;
-
 __weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
 						    uintptr_t bl33_entry,
 						    uintptr_t fdt_addr)
 {
+	static struct bl2_to_bl31_params_mem bl31_params_mem;
+	struct bl31_params *bl2_to_bl31_params;
 	struct entry_point_info *bl32_ep_info;
 	struct entry_point_info *bl33_ep_info;
 
Signature · 1 line
2.20.1
#4 lore raw

PATCH v2 2/9 spl: atf: move storage for bl31_params into function

Quoted 6 lines · Michael Walle

There is no need to have the storage available globally. This is also a preparation for LOAD_IMAGE_V2 support. That will introduce a similar generator function which also has its own storage.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/6c50b0b4/attachment.sig>
#5 lore raw

PATCH v2 3/9 spl: atf: provide a bl2_plat_get_bl31_params_default()

In reply to Michael Walle

Move the actual implementation of the bl2_plat_get_bl31_params() to its own function. The weak function will just call the default implementation. This has the advantage that board code can still call the original implementation if it just want to modify minor things.

---
 common/spl/spl_atf.c | 14 +++++++++++---
 include/spl.h        | 43 +++++++++++++++++++++++++++++++------------
 2 files changed, 42 insertions(+), 15 deletions(-)
common/spl/spl_atf.c +11 -3
index df0a198d55..63af6a6207 100644
@@ -18,9 +18,9 @@
 #include <spl.h>
 #include <asm/cache.h>
 
-__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
-						    uintptr_t bl33_entry,
-						    uintptr_t fdt_addr)
+struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
+						     uintptr_t bl33_entry,
+						     uintptr_t fdt_addr)
 {
 	static struct bl2_to_bl31_params_mem bl31_params_mem;
 	struct bl31_params *bl2_to_bl31_params;
@@ -77,6 +77,14 @@ __weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
 	return bl2_to_bl31_params;
 }
 
+__weak struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
+						    uintptr_t bl33_entry,
+						    uintptr_t fdt_addr)
+{
+	return bl2_plat_get_bl31_params_default(bl32_entry, bl33_entry,
+						fdt_addr);
+}
+
 static inline void raw_write_daif(unsigned int daif)
 {
 	__asm__ __volatile__("msr DAIF, %0\n\t" : : "r" (daif) : "memory");
include/spl.h +31 -12

56 lines not on this page · raw message

Signature · 1 line
2.20.1
#6 lore raw

PATCH v2 3/9 spl: atf: provide a bl2_plat_get_bl31_params_default()

Quoted 6 lines · Michael Walle

Move the actual implementation of the bl2_plat_get_bl31_params() to its own function. The weak function will just call the default implementation. This has the advantage that board code can still call the original implementation if it just want to modify minor things.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/f5027161/attachment.sig>
#7 lore raw

PATCH v2 4/9 spl: atf: remove helper structure from common header

In reply to Michael Walle

bl2_to_bl31_params_mem is just an implementation detail of the SPL ATF support and is not needed anywhere else. Move it from the header to the actual module.

---
 common/spl/spl_atf.c | 11 +++++++++++
 include/atf_common.h | 14 --------------
 2 files changed, 11 insertions(+), 14 deletions(-)
common/spl/spl_atf.c +11 -0
index 63af6a6207..51b45d5dc6 100644
@@ -18,6 +18,17 @@
 #include <spl.h>
 #include <asm/cache.h>
 
+/* Holds all the structures we need for bl31 parameter passing */
+struct bl2_to_bl31_params_mem {
+	struct bl31_params bl31_params;
+	struct atf_image_info bl31_image_info;
+	struct atf_image_info bl32_image_info;
+	struct atf_image_info bl33_image_info;
+	struct entry_point_info bl33_ep_info;
+	struct entry_point_info bl32_ep_info;
+	struct entry_point_info bl31_ep_info;
+};
+
 struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
 						     uintptr_t bl33_entry,
 						     uintptr_t fdt_addr)
include/atf_common.h +0 -14
index fd5454c55b..e173a10ca9 100644
@@ -162,20 +162,6 @@ struct bl31_params {
 	struct atf_image_info *bl33_image_info;
 };
 
-/*******************************************************************************
- * This structure represents the superset of information that is passed to
- * BL31, e.g. while passing control to it from BL2, bl31_params
- * and other platform specific params
- ******************************************************************************/
-struct bl2_to_bl31_params_mem {
-	struct bl31_params bl31_params;
-	struct atf_image_info bl31_image_info;
-	struct atf_image_info bl32_image_info;
-	struct atf_image_info bl33_image_info;
-	struct entry_point_info bl33_ep_info;
-	struct entry_point_info bl32_ep_info;
-	struct entry_point_info bl31_ep_info;
-};
 
 #endif /*__ASSEMBLY__ */
 
Signature · 1 line
2.20.1
#8 lore raw

PATCH v2 4/9 spl: atf: remove helper structure from common header

Quoted 6 lines · Michael Walle

bl2_to_bl31_params_mem is just an implementation detail of the SPL ATF support and is not needed anywhere else. Move it from the header to the actual module.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/55f907b5/attachment.sig>
#9 lore raw

PATCH v2 5/9 spl: atf: add support for LOAD_IMAGE_V2

In reply to Michael Walle

Newer platforms use the LOAD_IMAGE_V2 parameter passing method. Add support for it.

---
 common/spl/Kconfig   |  9 ++++
 common/spl/spl_atf.c | 99 ++++++++++++++++++++++++++++++++++++++++++--
 include/atf_common.h | 30 ++++++++++++++
 include/spl.h        | 35 ++++++++++++++++
 4 files changed, 169 insertions(+), 4 deletions(-)
common/spl/Kconfig +9 -0
index d8086bd9e8..6d980be0b7 100644
@@ -1276,6 +1276,15 @@ config SPL_ATF
 	  is loaded by SPL (which is considered as BL2 in ATF terminology).
 	  More detail at: https://github.com/ARM-software/arm-trusted-firmware
 
+config SPL_ATF_LOAD_IMAGE_V2
+	bool "Use the new LOAD_IMAGE_V2 parameter passing"
+	depends on SPL_ATF
+	help
+	  Some platforms use the newer LOAD_IMAGE_V2 parameter passing.
+
+	  If you want to load a bl31 image from the SPL and need the new
+	  method, say Y.
+
 config SPL_ATF_NO_PLATFORM_PARAM
         bool "Pass no platform parameter"
 	depends on SPL_ATF
common/spl/spl_atf.c +95 -4

123 lines not on this page · raw message

include/atf_common.h +30 -0
index e173a10ca9..d69892fac6 100644
@@ -14,8 +14,14 @@
 #define ATF_PARAM_EP		0x01
 #define ATF_PARAM_IMAGE_BINARY	0x02
 #define ATF_PARAM_BL31		0x03
+#define ATF_PARAM_BL_PARAMS	0x05
 
 #define ATF_VERSION_1	0x01
+#define ATF_VERSION_2	0x02
+
+#define ATF_BL31_IMAGE_ID	0x03
+#define ATF_BL32_IMAGE_ID	0x04
+#define ATF_BL33_IMAGE_ID	0x05
 
 #define ATF_EP_SECURE	0x0
 #define ATF_EP_NON_SECURE	0x1
@@ -121,6 +127,9 @@ struct atf_image_info {
 	struct param_header h;
 	uintptr_t image_base;   /* physical address of base of image */
 	uint32_t image_size;    /* bytes read from image file */
+#if CONFIG_IS_ENABLED(ATF_LOAD_IMAGE_V2)
+	uint32_t image_max_size;
+#endif
 };
 
 /*****************************************************************************
@@ -162,6 +171,27 @@ struct bl31_params {
 	struct atf_image_info *bl33_image_info;
 };
 
+/* BL image node in the BL image execution sequence */
+struct bl_params_node {
+	unsigned int image_id;
+	struct atf_image_info *image_info;
+	struct entry_point_info *ep_info;
+	struct bl_params_node *next_params_info;
+};
+
+/*
+ * BL image head node in the BL image execution sequence
+ * It is also used to pass information to next BL image.
+ */
+struct bl_params {
+	struct param_header h;
+	struct bl_params_node *head;
+};
+
+#define for_each_bl_params_node(bl_params, node) \
+	for ((node) = (bl_params)->head; \
+	     (node); \
+	     (node) = (node)->next_params_info)
 
 #endif /*__ASSEMBLY__ */
 
include/spl.h +35 -0
index fd928377f0..374a295fa3 100644
@@ -564,6 +564,41 @@ struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
 struct bl31_params *bl2_plat_get_bl31_params_default(uintptr_t bl32_entry,
 						     uintptr_t bl33_entry,
 						     uintptr_t fdt_addr);
+
+/**
+ * bl2_plat_get_bl31_params_v2() - return params for bl31
+ * @bl32_entry:	address of BL32 executable (secure)
+ * @bl33_entry:	address of BL33 executable (non secure)
+ * @fdt_addr:	address of Flat Device Tree
+ *
+ * This function does the same as bl2_plat_get_bl31_params() except that is is
+ * used for the new LOAD_IMAGE_V2 option, which uses a slightly different
+ * method to pass the parameters.
+ *
+ * Return: bl31 params structure pointer
+ */
+struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,
+					      uintptr_t bl33_entry,
+					      uintptr_t fdt_addr);
+
+/**
+ * bl2_plat_get_bl31_params_v2_default() - prepare params for bl31.
+ * @bl32_entry:	address of BL32 executable (secure)
+ * @bl33_entry:	address of BL33 executable (non secure)
+ * @fdt_addr:	address of Flat Device Tree
+ *
+ * This is the default implementation of bl2_plat_get_bl31_params_v2(). It
+ * prepares the linked list of the bl31 params, populates the image types and
+ * set the entry points for bl32 and bl33 (if available).
+ *
+ * NOTE: The memory is statically allocated, thus this function should be
+ * called only once. All subsequent calls will overwrite any changes.
+ *
+ * Return: bl31 params structure pointer
+ */
+struct bl_params *bl2_plat_get_bl31_params_v2_default(uintptr_t bl32_entry,
+						      uintptr_t bl33_entry,
+						      uintptr_t fdt_addr);
 /**
  * spl_optee_entry - entry function for optee
  *
Signature · 1 line
2.20.1
#10 lore raw

PATCH v2 5/9 spl: atf: add support for LOAD_IMAGE_V2

Quoted 4 lines · Michael Walle

Newer platforms use the LOAD_IMAGE_V2 parameter passing method. Add support for it.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/4c7d843f/attachment.sig>
#11 lore raw

PATCH v2 6/9 armv8: layerscape: don't initialize GIC in SPL

In reply to Michael Walle

The BL31 expects the GIC to be uninitialized. Thus, if we are loading the BL31 by the SPL we must not initialize it. If u-boot is loaded by the SPL directly, it will initialize the GIC again (in the same lowlevel_init()).

This was tested on a custom board with SPL loading the BL31 and jumping to u-boot as BL33 as well as loading u-boot directly by the SPL. In case the ATF BL1/BL2 is used, this patch won't change anything, because no SPL is used at all.

---
 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S +2 -0
index a519f6ed67..d8803738f1 100644
@@ -192,6 +192,7 @@ ENTRY(lowlevel_init)
 #endif
 
 	/* Initialize GIC Secure Bank Status */
+#if !defined(CONFIG_SPL_BUILD)
 #if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
 	branch_if_slave x0, 1f
 	bl	get_gic_offset
@@ -205,6 +206,7 @@ ENTRY(lowlevel_init)
 	bl	gic_init_secure_percpu
 #endif
 #endif
+#endif
 
 100:
 	branch_if_master x0, x1, 2f
Signature · 1 line
2.20.1
#12 lore raw

PATCH v2 6/9 armv8: layerscape: don't initialize GIC in SPL

Quoted 11 lines · Michael Walle

The BL31 expects the GIC to be uninitialized. Thus, if we are loading the BL31 by the SPL we must not initialize it. If u-boot is loaded by the SPL directly, it will initialize the GIC again (in the same lowlevel_init()).

This was tested on a custom board with SPL loading the BL31 and jumping to u-boot as BL33 as well as loading u-boot directly by the SPL. In case the ATF BL1/BL2 is used, this patch won't change anything, because no SPL is used at all.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/d17b5c1e/attachment.sig>
#13 lore raw

PATCH v2 7/9 board: sl28: remove u-boot from loadable DT node

In reply to Michael Walle

It is not needed. Remove it.

---
 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +0 -3
index 2375549c6e..87e14d6ae6 100644
@@ -80,21 +80,18 @@
 				conf-1 {
 					description = "fsl-ls1028a-kontron-sl28";
 					firmware = "uboot";
-					loadables = "uboot";
 					fdt = "fdt-1";
 				};
 
 				conf-2 {
 					description = "fsl-ls1028a-kontron-sl28-var3";
 					firmware = "uboot";
-					loadables = "uboot";
 					fdt = "fdt-2";
 				};
 
 				conf-3 {
 					description = "fsl-ls1028a-kontron-sl28-var4";
 					firmware = "uboot";
-					loadables = "uboot";
 					fdt = "fdt-3";
 				};
 			};
Signature · 1 line
2.20.1
#14 lore raw

PATCH v2 7/9 board: sl28: remove u-boot from loadable DT node

Quoted 3 lines · Michael Walle

It is not needed. Remove it.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/5e926f21/attachment.sig>
#15 lore raw

PATCH v2 7/9 board: sl28: remove u-boot from loadable DT node

In reply to Michael Walle
Quoted 3 lines · Michael Walle

It is not needed. Remove it.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/7549f5cf/attachment.sig>
#16 lore raw

PATCH v2 8/9 board: sl28: add ATF support (bl31)

In reply to Michael Walle

Add support to load the bl31 part of the ARM Trusted Firmware by the SPL.

---
 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 41 +++++++++++++-
 board/kontron/sl28/Kconfig                    | 10 ++++
 board/kontron/sl28/Makefile                   |  6 ++-
 board/kontron/sl28/spl_atf.c                  | 54 +++++++++++++++++++
 4 files changed, 109 insertions(+), 2 deletions(-)
 create mode 100644 board/kontron/sl28/spl_atf.c
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +40 -1
index 87e14d6ae6..54ef0b4258 100644
@@ -16,7 +16,7 @@
 		ethernet3 = &enetc6;
 	};
 
-	binman {
+	binman: binman {
 		filename = "u-boot.rom";
 		pad-byte = <0xff>;
 
@@ -99,6 +99,45 @@
 	};
 };
 
+#ifdef CONFIG_SL28_SPL_LOADS_ATF_BL31
+&binman {
+	fit {
+		images {
+			bl31 {
+				description = "ARM Trusted Firmware (bl31)";
+				type = "firmware";
+				arch = "arm";
+				os = "arm-trusted-firmware";
+				compression = "none";
+				load = <CONFIG_SL28_BL31_ENTRY_ADDR>;
+				entry = <CONFIG_SL28_BL31_ENTRY_ADDR>;
+
+				blob-ext {
+					filename = "bl31.bin";
+				};
+			};
+		};
+
+		configurations {
+			conf-1 {
+				firmware = "bl31";
+				loadables = "uboot";
+			};
+
+			conf-2 {
+				firmware = "bl31";
+				loadables = "uboot";
+			};
+
+			conf-3 {
+				firmware = "bl31";
+				loadables = "uboot";
+			};
+		};
+	};
+};
+#endif
+
 &i2c0 {
 	rtc: rtc at 32 {
 	};
board/kontron/sl28/Kconfig +10 -0
index cdec39be01..aba49fc115 100644
@@ -15,4 +15,14 @@ config SYS_CONFIG_NAME
 config SYS_TEXT_BASE
 	default 0x96000000
 
+config SL28_SPL_LOADS_ATF_BL31
+	bool "SPL loads BL31 of the ARM Trusted Firmware"
+	select SPL_ATF
+	select SPL_ATF_LOAD_IMAGE_V2
+	select ARMV8_SEC_FIRMWARE_SUPPORT
+	select SEC_FIRMWARE_ARMV8_PSCI
+	help
+	  Enable this to load a BL31 image by the SPL. You have to
+	  provde a bl31.bin in u-boot's root directory.
+
 endif
board/kontron/sl28/Makefile +5 -1
index 74d8012f0f..5d220f0744 100644
@@ -5,4 +5,8 @@ obj-y += sl28.o cmds.o
 endif
 
 obj-y += common.o ddr.o
-obj-$(CONFIG_SPL_BUILD) += spl.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_SPL_ATF) += spl_atf.o
+endif
board/kontron/sl28/spl_atf.c new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.20.1
#17 lore raw

PATCH v2 8/9 board: sl28: add ATF support (bl31)

Quoted 4 lines · Michael Walle

Add support to load the bl31 part of the ARM Trusted Firmware by the SPL.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/ef3afbaa/attachment.sig>
#18 lore raw

PATCH v2 9/9 board: sl28: add OP-TEE Trusted OS support (bl32)

In reply to Michael Walle

Add support to load the OP-TEE Trusted OS by the SPL.

---
 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 36 +++++++++++++++++++
 board/kontron/sl28/Kconfig                    | 23 ++++++++++++
 board/kontron/sl28/sl28.c                     |  7 ++++
 3 files changed, 66 insertions(+)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +36 -0
index 54ef0b4258..65d5684973 100644
@@ -138,6 +138,42 @@
 };
 #endif
 
+#ifdef CONFIG_SL28_SPL_LOADS_OPTEE_BL32
+&binman {
+	fit {
+		images {
+			bl32 {
+				description = "OP-TEE Trusted OS (bl32)";
+				type = "firmware";
+				arch = "arm";
+				os = "tee";
+				compression = "none";
+				load = <CONFIG_SL28_BL32_ENTRY_ADDR>;
+				entry = <CONFIG_SL28_BL32_ENTRY_ADDR>;
+
+				blob-ext {
+					filename = "tee.bin";
+				};
+			};
+		};
+
+		configurations {
+			conf-1 {
+				loadables = "uboot", "bl32";
+			};
+
+			conf-2 {
+				loadables = "uboot", "bl32";
+			};
+
+			conf-3 {
+				loadables = "uboot", "bl32";
+			};
+		};
+	};
+};
+#endif
+
 &i2c0 {
 	rtc: rtc at 32 {
 	};
board/kontron/sl28/Kconfig +23 -0
index aba49fc115..4078ef186b 100644
@@ -25,4 +25,27 @@ config SL28_SPL_LOADS_ATF_BL31
 	  Enable this to load a BL31 image by the SPL. You have to
 	  provde a bl31.bin in u-boot's root directory.
 
+if SL28_SPL_LOADS_ATF_BL31
+
+config SL28_BL31_ENTRY_ADDR
+	hex "Entry point of the BL31 image"
+	default 0xfbe00000
+
+endif
+
+config SL28_SPL_LOADS_OPTEE_BL32
+	bool "SPL loads OP-TEE Trusted OS as BL32"
+	depends on SL28_SPL_LOADS_ATF_BL31
+	help
+	  Enable this to load a BL32 image by the SPL. You have to
+	  provde a tee.bin in u-boot's root directory.
+
+if SL28_SPL_LOADS_OPTEE_BL32
+
+config SL28_BL32_ENTRY_ADDR
+	hex "Entry point of the BL32 image"
+	default 0xfc000000
+
+endif
+
 endif
board/kontron/sl28/sl28.c +7 -0
index b18127c4d1..34f17b486b 100644
@@ -50,6 +50,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	u64 base[CONFIG_NR_DRAM_BANKS];
 	u64 size[CONFIG_NR_DRAM_BANKS];
 	int nbanks = CONFIG_NR_DRAM_BANKS;
+	int node;
 	int i;
 
 	ft_cpu_setup(blob, bd);
@@ -64,5 +65,11 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 
 	fdt_fixup_icid(blob);
 
+	if (CONFIG_IS_ENABLED(SL28_SPL_LOADS_OPTEE_BL32)) {
+		node = fdt_node_offset_by_compatible(blob, -1, "linaro,optee-tz");
+		if (node)
+			fdt_set_node_status(blob, node, FDT_STATUS_OKAY, 0);
+	}
+
 	return 0;
 }
Signature · 1 line
2.20.1
#19 lore raw

PATCH v2 9/9 board: sl28: add OP-TEE Trusted OS support (bl32)

Quoted 3 lines · Michael Walle

Add support to load the OP-TEE Trusted OS by the SPL.

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201207/570fbe17/attachment.sig>
#20 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

In reply to Michael Walle

Hi,

Quoted 7 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on (newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31 directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f

Author:     Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100
Commit:     Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Remove build option LOAD_IMAGE_V2

The code of LOAD_IMAGE_V2=0 has been removed.

Change-Id Iea03e5bebb90c66889bdb23f85c07d0c9717fffe

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous one and also if current implemenation is origin or also not full v2.

And these patches are not breaking boot on zynqmp that's why not big deal for me.

Thanks,
Michal

#21 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 23 lines

Hi,

Quoted 9 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31 directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f

Author:     Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100
Commit:     Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100
Quoted 9 lines

Remove build option LOAD_IMAGE_V2

The code of LOAD_IMAGE_V2=0 has been removed.

Change-Id Iea03e5bebb90c66889bdb23f85c07d0c9717fffe

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 5 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

The last non-nxp commit there was from around March 2018..

Quoted 2 lines

And these patches are not breaking boot on zynqmp that's why not big deal for me.

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

-michael

#22 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Quoted 47 lines · Michael Walle

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 23 lines

Hi,

Quoted 9 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31 directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f Author:???? Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100 Commit:???? Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Quoted 9 lines

??? Remove build option LOAD_IMAGE_V2

??? The code of LOAD_IMAGE_V2=0 has been removed.

??? Change-Id: Iea03e5bebb90c66889bdb23f85c07d0c9717fffe ??? Co-authored-by: Antonio Nino Diaz <[email protected]> ??? Signed-off-by: Antonio Nino Diaz <[email protected]>

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 5 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

Quoted 8 lines

The last non-nxp commit there was from around March 2018..

Quoted 2 lines

And these patches are not breaking boot on zynqmp that's why not big deal for me.

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

Please get this reviewed by people who are using current blX code. As I said this series is not breaking our flow on xilinx zynqmp soc but maybe your code is more or less duplication of what's there now. Or maybe if there is any NXP private way it should be handled differently as I do for zynqmp.

Thanks,
Michal

#23 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Am 2020-11-20 12:15, schrieb Michal Simek:

Quoted 52 lines · Michael Walle
Quoted 51 lines

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 24 lines

Hi,

Quoted 10 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31
directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f Author:???? Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100 Commit:???? Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Quoted 9 lines

??? Remove build option LOAD_IMAGE_V2

??? The code of LOAD_IMAGE_V2=0 has been removed.

??? Change-Id: Iea03e5bebb90c66889bdb23f85c07d0c9717fffe ??? Co-authored-by: Antonio Nino Diaz <[email protected]> ??? Signed-off-by: Antonio Nino Diaz <[email protected]>

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 6 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous
one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

The last non-nxp commit there was from around March 2018..

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

And these patches are not breaking boot on zynqmp that's why not big deal for me.

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

Please get this reviewed by people who are using current blX code.

What do you mean by blX code? Nobody is using this flow for now, i.e.
spl -> bl31 -> u-boot
For the LOAD_IMAGE_V2 case.

NXP is using bl1 -> bl2 -> bl3 -> u-boot.

Quoted 4 lines

As I said this series is not breaking our flow on xilinx zynqmp soc but maybe your code is more or less duplication of what's there now. Or maybe if there is any NXP private way it should be handled differently as I do for zynqmp.

The code is split into the generic v2 handling and layerscape LS1028A specific stuff, hence the _default() function which is used in the board files and then arch specific parameters are applied. Also I don't know wether unifying the
bl2_plat_get_bl31_params_default() and bl2_plat_get_bl31_params_v2_default()
is worth it. If that is what you mean by "more or less a duplication".

-michael

#24 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Quoted 55 lines · Michael Walle

Am 2020-11-20 12:15, schrieb Michal Simek:

Quoted 54 lines · Michael Walle
Quoted 53 lines

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 23 lines

Hi,

Quoted 9 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31 directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f Author:???? Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100 Commit:???? Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Quoted 9 lines

??? Remove build option LOAD_IMAGE_V2

??? The code of LOAD_IMAGE_V2=0 has been removed.

??? Change-Id: Iea03e5bebb90c66889bdb23f85c07d0c9717fffe ??? Co-authored-by: Antonio Nino Diaz <[email protected]> ??? Signed-off-by: Antonio Nino Diaz <[email protected]>

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 5 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

The last non-nxp commit there was from around March 2018..

Quoted 2 lines

And these patches are not breaking boot on zynqmp that's why not big deal for me.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

Please get this reviewed by people who are using current blX code.

What do you mean by blX code? Nobody is using this flow for now, i.e. ? spl -> bl31 -> u-boot

As I said I am not quite sure about it. I see that rockchip guys are using ATF and they also call that code in ATF. They should know which version the use.
Definitely check with them to ack your patches.

Thanks,
Michal

#25 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Am 2020-11-20 14:16, schrieb Michal Simek:

Quoted 66 lines · Michael Walle
Quoted 65 lines

Am 2020-11-20 12:15, schrieb Michal Simek:

Quoted 64 lines · Michael Walle
Quoted 62 lines

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 25 lines

Hi,

Quoted 11 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 ->
u-boot. With this series it is possible that U-Boot SPL loads the bl31
directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f Author:???? Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100 Commit:???? Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Quoted 9 lines

??? Remove build option LOAD_IMAGE_V2

??? The code of LOAD_IMAGE_V2=0 has been removed.

??? Change-Id: Iea03e5bebb90c66889bdb23f85c07d0c9717fffe ??? Co-authored-by: Antonio Nino Diaz <[email protected]> ??? Signed-off-by: Antonio Nino Diaz <[email protected]>

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 7 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous
one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

The last non-nxp commit there was from around March 2018..

Quoted 3 lines

And these patches are not breaking boot on zynqmp that's why not big
deal for me.

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Please get this reviewed by people who are using current blX code.

What do you mean by blX code? Nobody is using this flow for now, i.e. ? spl -> bl31 -> u-boot

As I said I am not quite sure about it. I see that rockchip guys are using ATF and they also call that code in ATF. They should know which version the use.

NXP imx8 also uses u-boot -> bl31 as far as I know.

Quoted 1 line

Definitely check with them to ack your patches.

I've put Kever (who did the initial patches for rockchip) on CC for this.
But again they are using the old method. So lets assume they will ignore this series (for whatever reason), won't it be accepted then? I mean this series doesn't touch the old behavior, just adding a new one.

-michael

#26 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Quoted 73 lines · Michael Walle

Am 2020-11-20 14:16, schrieb Michal Simek:

Quoted 63 lines · Michael Walle
Quoted 62 lines

Am 2020-11-20 12:15, schrieb Michal Simek:

Quoted 61 lines · Michael Walle
Quoted 59 lines

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 24 lines

Hi,

Quoted 10 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31
directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f Author:???? Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100 Commit:???? Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Quoted 9 lines

??? Remove build option LOAD_IMAGE_V2

??? The code of LOAD_IMAGE_V2=0 has been removed.

??? Change-Id: Iea03e5bebb90c66889bdb23f85c07d0c9717fffe ??? Co-authored-by: Antonio Nino Diaz <[email protected]> ??? Signed-off-by: Antonio Nino Diaz <[email protected]>

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 6 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous
one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

The last non-nxp commit there was from around March 2018..

Quoted 2 lines

And these patches are not breaking boot on zynqmp that's why not big deal for me.

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Please get this reviewed by people who are using current blX code.

What do you mean by blX code? Nobody is using this flow for now, i.e. ? spl -> bl31 -> u-boot

As I said I am not quite sure about it. I see that rockchip guys are using ATF and they also call that code in ATF. They should know which version the use.

Quoted 8 lines

NXP imx8 also uses u-boot -> bl31 as far as I know.

Quoted 1 line

Definitely check with them to ack your patches.

I've put Kever (who did the initial patches for rockchip) on CC for this. But again they are using the old method. So lets assume they will ignore this series (for whatever reason), won't it be accepted then? I mean this series doesn't touch the old behavior, just adding a new one.

up to Priyanka or Tom.
I have no problem with your patches because we are not using this method and your patches doesn't break our SPL boot flow.

Thanks,
Michal

#27 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

Am 2020-11-20 14:35, schrieb Michal Simek:

Quoted 4 lines · Michael Walle
Quoted 3 lines

Am 2020-11-20 14:16, schrieb Michal Simek:

Quoted 2 lines · Michael Walle
Quoted 1 line

Am 2020-11-20 12:15, schrieb Michal Simek:

[..]

Quoted 21 lines
Quoted 12 lines
Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Please get this reviewed by people who are using current blX code.

What do you mean by blX code? Nobody is using this flow for now, i.e.
? spl -> bl31 -> u-boot

As I said I am not quite sure about it. I see that rockchip guys are using ATF and they also call that code in ATF. They should know which version the use.

NXP imx8 also uses u-boot -> bl31 as far as I know.

Quoted 8 lines
Quoted 1 line

Definitely check with them to ack your patches.

I've put Kever (who did the initial patches for rockchip) on CC for this.
But again they are using the old method. So lets assume they will ignore
this series (for whatever reason), won't it be accepted then? I mean this series doesn't touch the old behavior, just adding a new one.

Quoted 4 lines

up to Priyanka or Tom.
I have no problem with your patches because we are not using this method
and your patches doesn't break our SPL boot flow.

I haven't said this: I really appreciated your review and I was surprised
how fast it was. Thanks and maybe Kever will also have a look. We'll see ;)

-michael

#28 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

In reply to Michal Simek
Quoted 80 lines · Michal Simek
Quoted 77 lines · Michael Walle

Am 2020-11-20 14:16, schrieb Michal Simek:

Quoted 63 lines · Michael Walle
Quoted 62 lines

Am 2020-11-20 12:15, schrieb Michal Simek:

Quoted 61 lines · Michael Walle
Quoted 59 lines

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 24 lines

Hi,

Quoted 10 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31
directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f Author:???? Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100 Commit:???? Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Quoted 9 lines

??? Remove build option LOAD_IMAGE_V2

??? The code of LOAD_IMAGE_V2=0 has been removed.

??? Change-Id: Iea03e5bebb90c66889bdb23f85c07d0c9717fffe ??? Co-authored-by: Antonio Nino Diaz <[email protected]> ??? Signed-off-by: Antonio Nino Diaz <[email protected]>

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Quoted 6 lines

On Xilinx ZynqMP I use SPL->bl31 loading but not using that TFA structure because xilinx is using own format.

But I am curious if V2 was removed in 2018 who is really using previous
one and also if current implemenation is origin or also not full v2.

NXP,
https://source.codeaurora.org/external/qoriq/qoriq-components/atf/tree/plat/nxp/common/common.mk#n55

The last non-nxp commit there was from around March 2018..

Quoted 2 lines

And these patches are not breaking boot on zynqmp that's why not big deal for me.

I was looking at porting TFA to upstream for this board but there is such a huge gap. Therefore, it seemed to be easier to just use the vendor version for now.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Please get this reviewed by people who are using current blX code.

What do you mean by blX code? Nobody is using this flow for now, i.e. ? spl -> bl31 -> u-boot

As I said I am not quite sure about it. I see that rockchip guys are using ATF and they also call that code in ATF. They should know which version the use.

NXP imx8 also uses u-boot -> bl31 as far as I know.

Quoted 1 line

Definitely check with them to ack your patches.

Quoted 8 lines
Quoted 4 lines

I've put Kever (who did the initial patches for rockchip) on CC for this. But again they are using the old method. So lets assume they will ignore this series (for whatever reason), won't it be accepted then? I mean this series doesn't touch the old behavior, just adding a new one.

up to Priyanka or Tom.
I have no problem with your patches because we are not using this method and your patches doesn't break our SPL boot flow.

FWIW, I've currently assigned this to myself in patchwork with the notion that baring further changes, I'll pick this up and put it in -next, when it's around that time.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201120/981dfce9/attachment.sig>
#29 lore raw

v2 cover spl: atf: add support for LOAD_IMAGE_V2

In reply to Michael Walle

Am 2020-11-20 11:48, schrieb Michael Walle:

Quoted 29 lines

Am 2020-11-20 11:14, schrieb Michal Simek:

Quoted 28 lines

Hi,

Quoted 10 lines · Michael Walle

Newer TF-A versions provide a new image loading protocol. This is used on
(newer?) NXP's SoCs. Normally, the bootflow is bl1 -> bl2 -> bl31 -> u-boot. With this series it is possible that U-Boot SPL loads the bl31
directly and thus replacing bl1 and bl2 from the TF-A.

This was tested on the Kontron sl28 board using NXPs bl31 and the upstream
version of the OP-TEE Trusted OS.

I still have some questions about this.

As I see from TFA previous image format has been removed in 2018 by

commit ed51b51f7a9163a7fc48289c5ed97a3fe4fe504f

Author:     Roberto Vargas <[email protected]>
AuthorDate: Mon Sep 24 17:20:48 2018 +0100
Commit:     Antonio Nino Diaz <[email protected]>
CommitDate: Fri Sep 28 15:31:52 2018 +0100

Remove build option LOAD_IMAGE_V2

The code of LOAD_IMAGE_V2=0 has been removed.

Quoted 8 lines
Quoted 5 lines
Change-Id Iea03e5bebb90c66889bdb23f85c07d0c9717fffe

DOH! Lol, I'm using just one non-upstream part for the whole board and of course it is doing something miserable. I wasn't aware of this.

Ah, this commit wasn't about removing LOAD_IMAGE_V2 but making it the only
supported one. Thus it basically removes the old "LOAD_IMAGE_V2=0". That is
the former boot protocol which is the only one u-boot supports until this
patch series.

It seems that zynqmp doesn't check for the v2 header version. This is the common function:
https://elixir.bootlin.com/arm-trusted-firmware/v2.4/source/common/desc_image_load.c#L341

-michael