public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta-isar: u-boot: Update to 2021.10
@ 2021-11-03 10:49 Vijai Kumar K
  2021-11-03 11:01 ` Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Vijai Kumar K @ 2021-11-03 10:49 UTC (permalink / raw)
  To: isar-users; +Cc: Vijai Kumar K

Update to the latest u-boot.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
Boot tested on de0-nano-soc.

I donot have a stm32 board. Only build tested for it.

Thanks,
Vijai Kumar K

 ...y-add-property-no-map-to-created-res.patch | 151 ------------------
 ...rty-no-map-to-secure-reserved-memory.patch |  33 ----
 ...{u-boot-2020.10.inc => u-boot-2021.10.inc} |   4 +-
 ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} |   0
 .../u-boot/u-boot-stm32mp15x_2020.10.bb       |  10 --
 .../u-boot/u-boot-stm32mp15x_2021.10.bb       |   6 +
 6 files changed, 9 insertions(+), 195 deletions(-)
 delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
 delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
 rename meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc => u-boot-2021.10.inc} (64%)
 rename meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb => u-boot-de0-nano-soc_2021.10.bb} (100%)
 delete mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
 create mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb

diff --git a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
deleted file mode 100644
index 8a32fc1..0000000
--- a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00 2001
-From: Etienne Carriere <etienne.carriere@st.com>
-Date: Thu, 10 Sep 2020 10:49:59 +0200
-Subject: [PATCH] fdtdec: optionally add property no-map to created reserved
- memory node
-
-Add boolean input argument @no_map to helper function
-fdtdec_add_reserved_memory() to add or not "no-map" property
-for an added reserved memory node.
-
-Property no-map is used by the Linux kernel to not not map memory
-in its static memory mapping. It is needed for example for the|
-consistency of system non-cached memory and to prevent speculative
-accesses to some firewalled memory.
-
-No functional change. A later change will update to OPTEE library to
-add no-map property to OP-TEE reserved memory nodes.
-
-Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
-Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
-Reviewed-by: Simon Glass <sjg@chromium.org>
----
- arch/riscv/lib/fdt_fixup.c |  2 +-
- include/fdtdec.h           |  5 +++--
- lib/fdtdec.c               | 10 ++++++++--
- lib/optee/optee.c          |  2 +-
- test/dm/fdtdec.c           |  6 +++---
- 5 files changed, 16 insertions(+), 9 deletions(-)
-
-diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
-index 5b2420243f..d02062fd5b 100644
---- a/arch/riscv/lib/fdt_fixup.c
-+++ b/arch/riscv/lib/fdt_fixup.c
-@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
- 		pmp_mem.start = addr;
- 		pmp_mem.end = addr + size - 1;
- 		err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem,
--						 &phandle);
-+						 &phandle, false);
- 		if (err < 0 && err != -FDT_ERR_EXISTS) {
- 			log_err("failed to add reserved memory: %d\n", err);
- 			return err;
-diff --git a/include/fdtdec.h b/include/fdtdec.h
-index 152eb07b9e..62d1660973 100644
---- a/include/fdtdec.h
-+++ b/include/fdtdec.h
-@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-  *     };
-  *     uint32_t phandle;
-  *
-- *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle);
-+ *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle, false);
-  *
-  * This results in the following subnode being added to the top-level
-  * /reserved-memory node:
-@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-  * @param carveout	information about the carveout region
-  * @param phandlep	return location for the phandle of the carveout region
-  *			can be NULL if no phandle should be added
-+ * @param no_map	add "no-map" property if true
-  * @return 0 on success or a negative error code on failure
-  */
- int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 			       const struct fdt_memory *carveout,
--			       uint32_t *phandlep);
-+			       uint32_t *phandlep, bool no_map);
- 
- /**
-  * fdtdec_get_carveout() - reads a carveout from an FDT
-diff --git a/lib/fdtdec.c b/lib/fdtdec.c
-index 56bf9fcc79..b8fc5e2bff 100644
---- a/lib/fdtdec.c
-+++ b/lib/fdtdec.c
-@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void *blob)
- 
- int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 			       const struct fdt_memory *carveout,
--			       uint32_t *phandlep)
-+			       uint32_t *phandlep, bool no_map)
- {
- 	fdt32_t cells[4] = {}, *ptr = cells;
- 	uint32_t upper, lower, phandle;
-@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 	if (err < 0)
- 		return err;
- 
-+	if (no_map) {
-+		err = fdt_setprop(blob, node, "no-map", NULL, 0);
-+		if (err < 0)
-+			return err;
-+	}
-+
- 	/* return the phandle for the new node for the caller to use */
- 	if (phandlep)
- 		*phandlep = phandle;
-@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name,
- 	fdt32_t value;
- 	void *prop;
- 
--	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle);
-+	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle, false);
- 	if (err < 0) {
- 		debug("failed to add reserved memory: %d\n", err);
- 		return err;
-diff --git a/lib/optee/optee.c b/lib/optee/optee.c
-index 457d4cca8a..963c2ff430 100644
---- a/lib/optee/optee.c
-+++ b/lib/optee/optee.c
-@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
- 				ret = fdtdec_add_reserved_memory(new_blob,
- 								 nodename,
- 								 &carveout,
--								 NULL);
-+								 NULL, false);
- 				free(oldname);
- 
- 				if (ret < 0)
-diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c
-index 716993f706..4119003041 100644
---- a/test/dm/fdtdec.c
-+++ b/test/dm/fdtdec.c
-@@ -80,7 +80,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x1000;
- 	resv.end = 0x1fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region",
--					       &resv, &phandle));
-+					       &resv, &phandle, false));
- 
- 	/* Test /reserve-memory and its subnode should exist */
- 	parent = fdt_path_offset(blob, "/reserved-memory");
-@@ -101,7 +101,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x2000;
- 	resv.end = 0x2fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
--					       &resv, &phandle1));
-+					       &resv, &phandle1, false));
- 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1");
- 	ut_assert(subnode > 0);
- 
-@@ -115,7 +115,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x1000;
- 	resv.end = 0x1fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2",
--					       &resv, &phandle1));
-+					       &resv, &phandle1, false));
- 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region2");
- 	ut_assert(subnode < 0);
- 
--- 
-2.26.2
-
diff --git a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
deleted file mode 100644
index 6a39968..0000000
--- a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00 2001
-From: Etienne Carriere <etienne.carriere@st.com>
-Date: Thu, 10 Sep 2020 10:50:01 +0200
-Subject: [PATCH] optee: add property no-map to secure reserved memory
-
-OP-TEE reserved memory node must set property "no-map" to prevent
-Linux kernel from mapping secure memory unless what non-secure world
-speculative accesses of the CPU can violate the memory firmware
-configuration.
-
-Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree")
-Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
-Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
----
- lib/optee/optee.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/optee/optee.c b/lib/optee/optee.c
-index 963c2ff430..9e6606568f 100644
---- a/lib/optee/optee.c
-+++ b/lib/optee/optee.c
-@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
- 				ret = fdtdec_add_reserved_memory(new_blob,
- 								 nodename,
- 								 &carveout,
--								 NULL, false);
-+								 NULL, true);
- 				free(oldname);
- 
- 				if (ret < 0)
--- 
-2.26.2
-
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
similarity index 64%
rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
index 604776a..964ae6d 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
@@ -5,9 +5,11 @@
 
 require recipes-bsp/u-boot/u-boot-custom.inc
 
+DEBIAN_BUILD_DEPENDS += ", libssl-dev"
+
 SRC_URI += " \
     https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
     "
-SRC_URI[sha256sum] = "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622"
+SRC_URI[sha256sum] = "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4"
 
 S = "${WORKDIR}/u-boot-${PV}"
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
similarity index 100%
rename from meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb
rename to meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
deleted file mode 100644
index 39fceb2..0000000
--- a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-require u-boot-${PV}.inc
-
-SRC_URI += " \
-    file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch \
-    file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch"
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
new file mode 100644
index 0000000..6d95643
--- /dev/null
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
@@ -0,0 +1,6 @@
+#
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+require u-boot-${PV}.inc
-- 
2.25.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] meta-isar: u-boot: Update to 2021.10
  2021-11-03 10:49 [PATCH] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
@ 2021-11-03 11:01 ` Jan Kiszka
  2021-11-05  5:55   ` Kanagarajan, Vijaikumar
  2021-11-03 18:25 ` Henning Schild
  2021-11-05  6:15 ` [PATCH v2 1/2] " Vijai Kumar K
  2 siblings, 1 reply; 18+ messages in thread
From: Jan Kiszka @ 2021-11-03 11:01 UTC (permalink / raw)
  To: Vijai Kumar K, isar-users

On 03.11.21 11:49, Vijai Kumar K wrote:
> Update to the latest u-boot.
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> Boot tested on de0-nano-soc.
> 
> I donot have a stm32 board. Only build tested for it.

I do have a board... somewhere... but I will likely not be able to test
soon.

> 
> Thanks,
> Vijai Kumar K
> 

[...]

> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> similarity index 64%
> rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 604776a..964ae6d 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,9 +5,11 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> +DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> +

I wonder if we shouldn't make that a first-class dependency and move it
to u-boot-custom.inc. That's now standard for recent releases, and if
users of older releases really want to avoid it, they could still do a
DEBIAN_BUILD_DEPENDS_remove.

That change should be a separate patch then.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] meta-isar: u-boot: Update to 2021.10
  2021-11-03 10:49 [PATCH] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
  2021-11-03 11:01 ` Jan Kiszka
@ 2021-11-03 18:25 ` Henning Schild
  2021-11-05  6:05   ` Kanagarajan, Vijaikumar
  2021-11-05  6:15 ` [PATCH v2 1/2] " Vijai Kumar K
  2 siblings, 1 reply; 18+ messages in thread
From: Henning Schild @ 2021-11-03 18:25 UTC (permalink / raw)
  To: Vijai Kumar K; +Cc: isar-users

Am Wed, 3 Nov 2021 16:19:50 +0530
schrieb Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>:

> Update to the latest u-boot.
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> Boot tested on de0-nano-soc.
> 
> I donot have a stm32 board. Only build tested for it.
> 
> Thanks,
> Vijai Kumar K
> 
>  ...y-add-property-no-map-to-created-res.patch | 151
> ------------------ ...rty-no-map-to-secure-reserved-memory.patch |
> 33 ---- ...{u-boot-2020.10.inc => u-boot-2021.10.inc} |   4 +-
>  ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} |   0
>  .../u-boot/u-boot-stm32mp15x_2020.10.bb       |  10 --
>  .../u-boot/u-boot-stm32mp15x_2021.10.bb       |   6 +
>  6 files changed, 9 insertions(+), 195 deletions(-)
>  delete mode 100644
> meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> delete mode 100644
> meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
> rename meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc =>
> u-boot-2021.10.inc} (64%) rename
> meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb =>
> u-boot-de0-nano-soc_2021.10.bb} (100%) delete mode 100644
> meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb create mode
> 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> 
> diff --git
> a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> deleted file mode 100644 index 8a32fc1..0000000 ---
> a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> +++ /dev/null @@ -1,151 +0,0 @@
> -From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00
> 2001 -From: Etienne Carriere <etienne.carriere@st.com>
> -Date: Thu, 10 Sep 2020 10:49:59 +0200
> -Subject: [PATCH] fdtdec: optionally add property no-map to created
> reserved
> - memory node
> -
> -Add boolean input argument @no_map to helper function
> -fdtdec_add_reserved_memory() to add or not "no-map" property
> -for an added reserved memory node.
> -
> -Property no-map is used by the Linux kernel to not not map memory
> -in its static memory mapping. It is needed for example for the|
> -consistency of system non-cached memory and to prevent speculative
> -accesses to some firewalled memory.
> -
> -No functional change. A later change will update to OPTEE library to
> -add no-map property to OP-TEE reserved memory nodes.
> -
> -Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> -Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> -Reviewed-by: Simon Glass <sjg@chromium.org>
> ----
> - arch/riscv/lib/fdt_fixup.c |  2 +-
> - include/fdtdec.h           |  5 +++--
> - lib/fdtdec.c               | 10 ++++++++--
> - lib/optee/optee.c          |  2 +-
> - test/dm/fdtdec.c           |  6 +++---
> - 5 files changed, 16 insertions(+), 9 deletions(-)
> -
> -diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
> -index 5b2420243f..d02062fd5b 100644
> ---- a/arch/riscv/lib/fdt_fixup.c
> -+++ b/arch/riscv/lib/fdt_fixup.c
> -@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src,
> void *dst)
> - 		pmp_mem.start = addr;
> - 		pmp_mem.end = addr + size - 1;
> - 		err = fdtdec_add_reserved_memory(dst, basename,
> &pmp_mem, --
> &phandle); -+
> &phandle, false);
> - 		if (err < 0 && err != -FDT_ERR_EXISTS) {
> - 			log_err("failed to add reserved memory:
> %d\n", err);
> - 			return err;
> -diff --git a/include/fdtdec.h b/include/fdtdec.h
> -index 152eb07b9e..62d1660973 100644
> ---- a/include/fdtdec.h
> -+++ b/include/fdtdec.h
> -@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void
> *blob, int node, uint32_t phandle)
> -  *     };
> -  *     uint32_t phandle;
> -  *
> -- *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb,
> &phandle); -+ *     fdtdec_add_reserved_memory(fdt, "framebuffer",
> &fb, &phandle, false);
> -  *
> -  * This results in the following subnode being added to the
> top-level
> -  * /reserved-memory node:
> -@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void
> *blob, int node, uint32_t phandle)
> -  * @param carveout	information about the carveout region
> -  * @param phandlep	return location for the phandle of the
> carveout region
> -  *			can be NULL if no phandle should be added
> -+ * @param no_map	add "no-map" property if true
> -  * @return 0 on success or a negative error code on failure
> -  */
> - int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 			       const struct fdt_memory *carveout,
> --			       uint32_t *phandlep);
> -+			       uint32_t *phandlep, bool no_map);
> - 
> - /**
> -  * fdtdec_get_carveout() - reads a carveout from an FDT
> -diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> -index 56bf9fcc79..b8fc5e2bff 100644
> ---- a/lib/fdtdec.c
> -+++ b/lib/fdtdec.c
> -@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void
> *blob)
> - 
> - int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 			       const struct fdt_memory *carveout,
> --			       uint32_t *phandlep)
> -+			       uint32_t *phandlep, bool no_map)
> - {
> - 	fdt32_t cells[4] = {}, *ptr = cells;
> - 	uint32_t upper, lower, phandle;
> -@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob,
> const char *basename,
> - 	if (err < 0)
> - 		return err;
> - 
> -+	if (no_map) {
> -+		err = fdt_setprop(blob, node, "no-map", NULL, 0);
> -+		if (err < 0)
> -+			return err;
> -+	}
> -+
> - 	/* return the phandle for the new node for the caller to
> use */
> - 	if (phandlep)
> - 		*phandlep = phandle;
> -@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char
> *node, const char *prop_name,
> - 	fdt32_t value;
> - 	void *prop;
> - 
> --	err = fdtdec_add_reserved_memory(blob, name, carveout,
> &phandle); -+	err = fdtdec_add_reserved_memory(blob, name,
> carveout, &phandle, false);
> - 	if (err < 0) {
> - 		debug("failed to add reserved memory: %d\n", err);
> - 		return err;
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c
> -index 457d4cca8a..963c2ff430 100644
> ---- a/lib/optee/optee.c
> -+++ b/lib/optee/optee.c
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob,
> void *new_blob)
> - 				ret =
> fdtdec_add_reserved_memory(new_blob,
> -
> nodename,
> -
> &carveout, --
> 	 NULL); -+
> 		 NULL, false);
> - 				free(oldname);
> - 
> - 				if (ret < 0)
> -diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c
> -index 716993f706..4119003041 100644
> ---- a/test/dm/fdtdec.c
> -+++ b/test/dm/fdtdec.c
> -@@ -80,7 +80,7 @@ static int
> dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x1000;
> - 	resv.end = 0x1fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region",
> --					       &resv, &phandle));
> -+					       &resv, &phandle,
> false));
> - 
> - 	/* Test /reserve-memory and its subnode should exist */
> - 	parent = fdt_path_offset(blob, "/reserved-memory");
> -@@ -101,7 +101,7 @@ static int
> dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x2000;
> - 	resv.end = 0x2fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
> --					       &resv, &phandle1));
> -+					       &resv, &phandle1,
> false));
> - 	subnode = fdt_path_offset(blob,
> "/reserved-memory/rsvd_region1");
> - 	ut_assert(subnode > 0);
> - 
> -@@ -115,7 +115,7 @@ static int
> dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x1000;
> - 	resv.end = 0x1fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2",
> --					       &resv, &phandle1));
> -+					       &resv, &phandle1,
> false));
> - 	subnode = fdt_path_offset(blob,
> "/reserved-memory/rsvd_region2");
> - 	ut_assert(subnode < 0);
> - 
> --- 
> -2.26.2
> -
> diff --git
> a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
> b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
> deleted file mode 100644 index 6a39968..0000000 ---
> a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
> +++ /dev/null @@ -1,33 +0,0 @@
> -From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00
> 2001 -From: Etienne Carriere <etienne.carriere@st.com>
> -Date: Thu, 10 Sep 2020 10:50:01 +0200
> -Subject: [PATCH] optee: add property no-map to secure reserved memory
> -
> -OP-TEE reserved memory node must set property "no-map" to prevent
> -Linux kernel from mapping secure memory unless what non-secure world
> -speculative accesses of the CPU can violate the memory firmware
> -configuration.
> -
> -Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a
> loaded devicetree") -Signed-off-by: Etienne Carriere
> <etienne.carriere@st.com> -Signed-off-by: Patrice Chotard
> <patrice.chotard@st.com> ----
> - lib/optee/optee.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c
> -index 963c2ff430..9e6606568f 100644
> ---- a/lib/optee/optee.c
> -+++ b/lib/optee/optee.c
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob,
> void *new_blob)
> - 				ret =
> fdtdec_add_reserved_memory(new_blob,
> -
> nodename,
> -
> &carveout, --
> 	 NULL, false); -+
> 			 NULL, true);
> - 				free(oldname);
> - 
> - 				if (ret < 0)
> --- 
> -2.26.2
> -
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc similarity index 64%
> rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 604776a..964ae6d 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,9 +5,11 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> +DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> +

I guess that should go into the inc and not the recipe. If that inc
should still support older u-boots it should be somehow done
conditionally depending on $PV[0] > 2020

My guess is that you have another board for which you can test, and you
might have that very line in another recipe.

Henning

>  SRC_URI += " \
>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
>      "
> -SRC_URI[sha256sum] =
> "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622"
> +SRC_URI[sha256sum] =
> "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4" S
> = "${WORKDIR}/u-boot-${PV}" diff --git
> a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb
> b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
> similarity index 100% rename from
> meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb rename to
> meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb diff
> --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb deleted
> file mode 100644 index 39fceb2..0000000 ---
> a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb +++
> /dev/null @@ -1,10 +0,0 @@ -#
> -# Copyright (c) Siemens AG, 2020
> -#
> -# SPDX-License-Identifier: MIT
> -
> -require u-boot-${PV}.inc
> -
> -SRC_URI += " \
> -
> file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> \
> -
> file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch"
> diff --git
> a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb new file
> mode 100644 index 0000000..6d95643 --- /dev/null +++
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb @@ -0,0
> +1,6 @@ +#
> +# Copyright (c) Siemens AG, 2020
> +#
> +# SPDX-License-Identifier: MIT
> +
> +require u-boot-${PV}.inc


^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] meta-isar: u-boot: Update to 2021.10
  2021-11-03 11:01 ` Jan Kiszka
@ 2021-11-05  5:55   ` Kanagarajan, Vijaikumar
  0 siblings, 0 replies; 18+ messages in thread
From: Kanagarajan, Vijaikumar @ 2021-11-05  5:55 UTC (permalink / raw)
  To: Jan Kiszka, isar-users



-----Original Message-----
From: Jan Kiszka <jan.kiszka@siemens.com> 
Sent: 03 November 2021 16:32
To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>; isar-users@googlegroups.com
Subject: Re: [PATCH] meta-isar: u-boot: Update to 2021.10

On 03.11.21 11:49, Vijai Kumar K wrote:
> Update to the latest u-boot.
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> Boot tested on de0-nano-soc.
> 
> I donot have a stm32 board. Only build tested for it.

I do have a board... somewhere... but I will likely not be able to test soon.

> 
> Thanks,
> Vijai Kumar K
> 

[...]

> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc 
> b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> similarity index 64%
> rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 604776a..964ae6d 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,9 +5,11 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> +DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> +

I wonder if we shouldn't make that a first-class dependency and move it to u-boot-custom.inc. That's now standard for recent releases, and if users of older releases really want to avoid it, they could still do a DEBIAN_BUILD_DEPENDS_remove.

That change should be a separate patch then.


Yes we can. Will send a v2.

Jan

--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [PATCH] meta-isar: u-boot: Update to 2021.10
  2021-11-03 18:25 ` Henning Schild
@ 2021-11-05  6:05   ` Kanagarajan, Vijaikumar
  0 siblings, 0 replies; 18+ messages in thread
From: Kanagarajan, Vijaikumar @ 2021-11-05  6:05 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users



-----Original Message-----
From: Henning Schild <henning.schild@siemens.com> 
Sent: 03 November 2021 23:55
To: Kanagarajan, Vijaikumar <Vijaikumar_Kanagarajan@mentor.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH] meta-isar: u-boot: Update to 2021.10

Am Wed, 3 Nov 2021 16:19:50 +0530
schrieb Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>:

> Update to the latest u-boot.
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> Boot tested on de0-nano-soc.
> 
> I donot have a stm32 board. Only build tested for it.
> 
> Thanks,
> Vijai Kumar K
> 
>  ...y-add-property-no-map-to-created-res.patch | 151
> ------------------ ...rty-no-map-to-secure-reserved-memory.patch |
> 33 ---- ...{u-boot-2020.10.inc => u-boot-2021.10.inc} |   4 +-
>  ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} |   0
>  .../u-boot/u-boot-stm32mp15x_2020.10.bb       |  10 --
>  .../u-boot/u-boot-stm32mp15x_2021.10.bb       |   6 +
>  6 files changed, 9 insertions(+), 195 deletions(-)  delete mode 
> 100644 
> meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property
> -no-map-to-created-res.patch
> delete mode 100644
> meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-s
> ecure-reserved-memory.patch rename 
> meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc => 
> u-boot-2021.10.inc} (64%) rename 
> meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb => 
> u-boot-de0-nano-soc_2021.10.bb} (100%) delete mode 100644 
> meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb create mode
> 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> 
> diff --git
> a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-proper
> ty-no-map-to-created-res.patch 
> b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-proper
> ty-no-map-to-created-res.patch deleted file mode 100644 index 
> 8a32fc1..0000000 --- 
> a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-proper
> ty-no-map-to-created-res.patch
> +++ /dev/null @@ -1,151 +0,0 @@
> -From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00
> 2001 -From: Etienne Carriere <etienne.carriere@st.com>
> -Date: Thu, 10 Sep 2020 10:49:59 +0200
> -Subject: [PATCH] fdtdec: optionally add property no-map to created 
> reserved
> - memory node
> -
> -Add boolean input argument @no_map to helper function
> -fdtdec_add_reserved_memory() to add or not "no-map" property -for an 
> added reserved memory node.
> -
> -Property no-map is used by the Linux kernel to not not map memory -in 
> its static memory mapping. It is needed for example for the| 
> -consistency of system non-cached memory and to prevent speculative 
> -accesses to some firewalled memory.
> -
> -No functional change. A later change will update to OPTEE library to 
> -add no-map property to OP-TEE reserved memory nodes.
> -
> -Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> -Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> -Reviewed-by: Simon Glass <sjg@chromium.org>
> ----
> - arch/riscv/lib/fdt_fixup.c |  2 +-
> - include/fdtdec.h           |  5 +++--
> - lib/fdtdec.c               | 10 ++++++++--
> - lib/optee/optee.c          |  2 +-
> - test/dm/fdtdec.c           |  6 +++---
> - 5 files changed, 16 insertions(+), 9 deletions(-)
> -
> -diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c 
> -index 5b2420243f..d02062fd5b 100644
> ---- a/arch/riscv/lib/fdt_fixup.c
> -+++ b/arch/riscv/lib/fdt_fixup.c
> -@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, 
> void *dst)
> - 		pmp_mem.start = addr;
> - 		pmp_mem.end = addr + size - 1;
> - 		err = fdtdec_add_reserved_memory(dst, basename,
> &pmp_mem, --
> &phandle); -+
> &phandle, false);
> - 		if (err < 0 && err != -FDT_ERR_EXISTS) {
> - 			log_err("failed to add reserved memory:
> %d\n", err);
> - 			return err;
> -diff --git a/include/fdtdec.h b/include/fdtdec.h -index 
> 152eb07b9e..62d1660973 100644
> ---- a/include/fdtdec.h
> -+++ b/include/fdtdec.h
> -@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void 
> *blob, int node, uint32_t phandle)
> -  *     };
> -  *     uint32_t phandle;
> -  *
> -- *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb,
> &phandle); -+ *     fdtdec_add_reserved_memory(fdt, "framebuffer",
> &fb, &phandle, false);
> -  *
> -  * This results in the following subnode being added to the 
> top-level
> -  * /reserved-memory node:
> -@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void 
> *blob, int node, uint32_t phandle)
> -  * @param carveout	information about the carveout region
> -  * @param phandlep	return location for the phandle of the
> carveout region
> -  *			can be NULL if no phandle should be added
> -+ * @param no_map	add "no-map" property if true
> -  * @return 0 on success or a negative error code on failure
> -  */
> - int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 			       const struct fdt_memory *carveout,
> --			       uint32_t *phandlep);
> -+			       uint32_t *phandlep, bool no_map);
> -
> - /**
> -  * fdtdec_get_carveout() - reads a carveout from an FDT -diff --git 
> a/lib/fdtdec.c b/lib/fdtdec.c -index 56bf9fcc79..b8fc5e2bff 100644
> ---- a/lib/fdtdec.c
> -+++ b/lib/fdtdec.c
> -@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void
> *blob)
> -
> - int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 			       const struct fdt_memory *carveout,
> --			       uint32_t *phandlep)
> -+			       uint32_t *phandlep, bool no_map)
> - {
> - 	fdt32_t cells[4] = {}, *ptr = cells;
> - 	uint32_t upper, lower, phandle;
> -@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob, 
> const char *basename,
> - 	if (err < 0)
> - 		return err;
> -
> -+	if (no_map) {
> -+		err = fdt_setprop(blob, node, "no-map", NULL, 0);
> -+		if (err < 0)
> -+			return err;
> -+	}
> -+
> - 	/* return the phandle for the new node for the caller to
> use */
> - 	if (phandlep)
> - 		*phandlep = phandle;
> -@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char 
> *node, const char *prop_name,
> - 	fdt32_t value;
> - 	void *prop;
> - 
> --	err = fdtdec_add_reserved_memory(blob, name, carveout,
> &phandle); -+	err = fdtdec_add_reserved_memory(blob, name,
> carveout, &phandle, false);
> - 	if (err < 0) {
> - 		debug("failed to add reserved memory: %d\n", err);
> - 		return err;
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c -index 
> 457d4cca8a..963c2ff430 100644
> ---- a/lib/optee/optee.c
> -+++ b/lib/optee/optee.c
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, 
> void *new_blob)
> - 				ret =
> fdtdec_add_reserved_memory(new_blob,
> -
> nodename,
> -
> &carveout, --
> 	 NULL); -+
> 		 NULL, false);
> - 				free(oldname);
> - 
> - 				if (ret < 0)
> -diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c -index 
> 716993f706..4119003041 100644
> ---- a/test/dm/fdtdec.c
> -+++ b/test/dm/fdtdec.c
> -@@ -80,7 +80,7 @@ static int
> dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x1000;
> - 	resv.end = 0x1fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region",
> --					       &resv, &phandle));
> -+					       &resv, &phandle,
> false));
> - 
> - 	/* Test /reserve-memory and its subnode should exist */
> - 	parent = fdt_path_offset(blob, "/reserved-memory");
> -@@ -101,7 +101,7 @@ static int
> dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x2000;
> - 	resv.end = 0x2fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
> --					       &resv, &phandle1));
> -+					       &resv, &phandle1,
> false));
> - 	subnode = fdt_path_offset(blob,
> "/reserved-memory/rsvd_region1");
> - 	ut_assert(subnode > 0);
> -
> -@@ -115,7 +115,7 @@ static int
> dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x1000;
> - 	resv.end = 0x1fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2",
> --					       &resv, &phandle1));
> -+					       &resv, &phandle1,
> false));
> - 	subnode = fdt_path_offset(blob,
> "/reserved-memory/rsvd_region2");
> - 	ut_assert(subnode < 0);
> -
> ---
> -2.26.2
> -
> diff --git
> a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to
> -secure-reserved-memory.patch 
> b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to
> -secure-reserved-memory.patch deleted file mode 100644 index 
> 6a39968..0000000 --- 
> a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to
> -secure-reserved-memory.patch
> +++ /dev/null @@ -1,33 +0,0 @@
> -From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00
> 2001 -From: Etienne Carriere <etienne.carriere@st.com>
> -Date: Thu, 10 Sep 2020 10:50:01 +0200
> -Subject: [PATCH] optee: add property no-map to secure reserved memory
> -
> -OP-TEE reserved memory node must set property "no-map" to prevent 
> -Linux kernel from mapping secure memory unless what non-secure world 
> -speculative accesses of the CPU can violate the memory firmware 
> -configuration.
> -
> -Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a 
> loaded devicetree") -Signed-off-by: Etienne Carriere 
> <etienne.carriere@st.com> -Signed-off-by: Patrice Chotard 
> <patrice.chotard@st.com> ----
> - lib/optee/optee.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c -index 
> 963c2ff430..9e6606568f 100644
> ---- a/lib/optee/optee.c
> -+++ b/lib/optee/optee.c
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, 
> void *new_blob)
> - 				ret =
> fdtdec_add_reserved_memory(new_blob,
> -
> nodename,
> -
> &carveout, --
> 	 NULL, false); -+
> 			 NULL, true);
> - 				free(oldname);
> - 
> - 				if (ret < 0)
> ---
> -2.26.2
> -
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc similarity index 64% 
> rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 604776a..964ae6d 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,9 +5,11 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> +DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> +

I guess that should go into the inc and not the recipe. If that inc should still support older u-boots it should be somehow done conditionally depending on $PV[0] > 2020

My guess is that you have another board for which you can test, and you might have that very line in another recipe.


Yes. Will move to the inc in meta layer. 
I am not sure if making it conditionally dependent is worth the effort. We could just add it. I see no harm in having an extra dependency for the older u-boots.
Maybe downstream users with frozen base-apts might have an issue, but they could always remove it in their layer.

Thanks,
Vijai Kumar K

Henning

>  SRC_URI += " \
>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
>      "
> -SRC_URI[sha256sum] =
> "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622"
> +SRC_URI[sha256sum] =
> "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4" S = 
> "${WORKDIR}/u-boot-${PV}" diff --git 
> a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb
> b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
> similarity index 100% rename from
> meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb rename to 
> meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb diff --git 
> a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb deleted 
> file mode 100644 index 39fceb2..0000000 --- 
> a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb +++ 
> /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) Siemens AG, 2020 -# -# 
> SPDX-License-Identifier: MIT
> -
> -require u-boot-${PV}.inc
> -
> -SRC_URI += " \
> -
> file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> \
> -
> file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch"
> diff --git
> a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb new file 
> mode 100644 index 0000000..6d95643 --- /dev/null +++ 
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb @@ -0,0
> +1,6 @@ +#
> +# Copyright (c) Siemens AG, 2020
> +#
> +# SPDX-License-Identifier: MIT
> +
> +require u-boot-${PV}.inc


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 1/2] meta-isar: u-boot: Update to 2021.10
  2021-11-03 10:49 [PATCH] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
  2021-11-03 11:01 ` Jan Kiszka
  2021-11-03 18:25 ` Henning Schild
@ 2021-11-05  6:15 ` Vijai Kumar K
  2021-11-05  6:15   ` [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
  2 siblings, 1 reply; 18+ messages in thread
From: Vijai Kumar K @ 2021-11-05  6:15 UTC (permalink / raw)
  To: isar-users; +Cc: Vijai Kumar K

Update to the latest u-boot.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 ...y-add-property-no-map-to-created-res.patch | 151 ------------------
 ...rty-no-map-to-secure-reserved-memory.patch |  33 ----
 ...{u-boot-2020.10.inc => u-boot-2021.10.inc} |   4 +-
 ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} |   0
 .../u-boot/u-boot-stm32mp15x_2020.10.bb       |  10 --
 .../u-boot/u-boot-stm32mp15x_2021.10.bb       |   6 +
 6 files changed, 9 insertions(+), 195 deletions(-)
 delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
 delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
 rename meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc => u-boot-2021.10.inc} (64%)
 rename meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb => u-boot-de0-nano-soc_2021.10.bb} (100%)
 delete mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
 create mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb

diff --git a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
deleted file mode 100644
index 8a32fc1..0000000
--- a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00 2001
-From: Etienne Carriere <etienne.carriere@st.com>
-Date: Thu, 10 Sep 2020 10:49:59 +0200
-Subject: [PATCH] fdtdec: optionally add property no-map to created reserved
- memory node
-
-Add boolean input argument @no_map to helper function
-fdtdec_add_reserved_memory() to add or not "no-map" property
-for an added reserved memory node.
-
-Property no-map is used by the Linux kernel to not not map memory
-in its static memory mapping. It is needed for example for the|
-consistency of system non-cached memory and to prevent speculative
-accesses to some firewalled memory.
-
-No functional change. A later change will update to OPTEE library to
-add no-map property to OP-TEE reserved memory nodes.
-
-Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
-Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
-Reviewed-by: Simon Glass <sjg@chromium.org>
----
- arch/riscv/lib/fdt_fixup.c |  2 +-
- include/fdtdec.h           |  5 +++--
- lib/fdtdec.c               | 10 ++++++++--
- lib/optee/optee.c          |  2 +-
- test/dm/fdtdec.c           |  6 +++---
- 5 files changed, 16 insertions(+), 9 deletions(-)
-
-diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
-index 5b2420243f..d02062fd5b 100644
---- a/arch/riscv/lib/fdt_fixup.c
-+++ b/arch/riscv/lib/fdt_fixup.c
-@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
- 		pmp_mem.start = addr;
- 		pmp_mem.end = addr + size - 1;
- 		err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem,
--						 &phandle);
-+						 &phandle, false);
- 		if (err < 0 && err != -FDT_ERR_EXISTS) {
- 			log_err("failed to add reserved memory: %d\n", err);
- 			return err;
-diff --git a/include/fdtdec.h b/include/fdtdec.h
-index 152eb07b9e..62d1660973 100644
---- a/include/fdtdec.h
-+++ b/include/fdtdec.h
-@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-  *     };
-  *     uint32_t phandle;
-  *
-- *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle);
-+ *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle, false);
-  *
-  * This results in the following subnode being added to the top-level
-  * /reserved-memory node:
-@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-  * @param carveout	information about the carveout region
-  * @param phandlep	return location for the phandle of the carveout region
-  *			can be NULL if no phandle should be added
-+ * @param no_map	add "no-map" property if true
-  * @return 0 on success or a negative error code on failure
-  */
- int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 			       const struct fdt_memory *carveout,
--			       uint32_t *phandlep);
-+			       uint32_t *phandlep, bool no_map);
- 
- /**
-  * fdtdec_get_carveout() - reads a carveout from an FDT
-diff --git a/lib/fdtdec.c b/lib/fdtdec.c
-index 56bf9fcc79..b8fc5e2bff 100644
---- a/lib/fdtdec.c
-+++ b/lib/fdtdec.c
-@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void *blob)
- 
- int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 			       const struct fdt_memory *carveout,
--			       uint32_t *phandlep)
-+			       uint32_t *phandlep, bool no_map)
- {
- 	fdt32_t cells[4] = {}, *ptr = cells;
- 	uint32_t upper, lower, phandle;
-@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 	if (err < 0)
- 		return err;
- 
-+	if (no_map) {
-+		err = fdt_setprop(blob, node, "no-map", NULL, 0);
-+		if (err < 0)
-+			return err;
-+	}
-+
- 	/* return the phandle for the new node for the caller to use */
- 	if (phandlep)
- 		*phandlep = phandle;
-@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name,
- 	fdt32_t value;
- 	void *prop;
- 
--	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle);
-+	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle, false);
- 	if (err < 0) {
- 		debug("failed to add reserved memory: %d\n", err);
- 		return err;
-diff --git a/lib/optee/optee.c b/lib/optee/optee.c
-index 457d4cca8a..963c2ff430 100644
---- a/lib/optee/optee.c
-+++ b/lib/optee/optee.c
-@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
- 				ret = fdtdec_add_reserved_memory(new_blob,
- 								 nodename,
- 								 &carveout,
--								 NULL);
-+								 NULL, false);
- 				free(oldname);
- 
- 				if (ret < 0)
-diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c
-index 716993f706..4119003041 100644
---- a/test/dm/fdtdec.c
-+++ b/test/dm/fdtdec.c
-@@ -80,7 +80,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x1000;
- 	resv.end = 0x1fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region",
--					       &resv, &phandle));
-+					       &resv, &phandle, false));
- 
- 	/* Test /reserve-memory and its subnode should exist */
- 	parent = fdt_path_offset(blob, "/reserved-memory");
-@@ -101,7 +101,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x2000;
- 	resv.end = 0x2fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
--					       &resv, &phandle1));
-+					       &resv, &phandle1, false));
- 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1");
- 	ut_assert(subnode > 0);
- 
-@@ -115,7 +115,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x1000;
- 	resv.end = 0x1fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2",
--					       &resv, &phandle1));
-+					       &resv, &phandle1, false));
- 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region2");
- 	ut_assert(subnode < 0);
- 
--- 
-2.26.2
-
diff --git a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
deleted file mode 100644
index 6a39968..0000000
--- a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00 2001
-From: Etienne Carriere <etienne.carriere@st.com>
-Date: Thu, 10 Sep 2020 10:50:01 +0200
-Subject: [PATCH] optee: add property no-map to secure reserved memory
-
-OP-TEE reserved memory node must set property "no-map" to prevent
-Linux kernel from mapping secure memory unless what non-secure world
-speculative accesses of the CPU can violate the memory firmware
-configuration.
-
-Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree")
-Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
-Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
----
- lib/optee/optee.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/optee/optee.c b/lib/optee/optee.c
-index 963c2ff430..9e6606568f 100644
---- a/lib/optee/optee.c
-+++ b/lib/optee/optee.c
-@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
- 				ret = fdtdec_add_reserved_memory(new_blob,
- 								 nodename,
- 								 &carveout,
--								 NULL, false);
-+								 NULL, true);
- 				free(oldname);
- 
- 				if (ret < 0)
--- 
-2.26.2
-
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
similarity index 64%
rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
index 604776a..964ae6d 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
@@ -5,9 +5,11 @@
 
 require recipes-bsp/u-boot/u-boot-custom.inc
 
+DEBIAN_BUILD_DEPENDS += ", libssl-dev"
+
 SRC_URI += " \
     https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
     "
-SRC_URI[sha256sum] = "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622"
+SRC_URI[sha256sum] = "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4"
 
 S = "${WORKDIR}/u-boot-${PV}"
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
similarity index 100%
rename from meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb
rename to meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
deleted file mode 100644
index 39fceb2..0000000
--- a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-require u-boot-${PV}.inc
-
-SRC_URI += " \
-    file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch \
-    file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch"
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
new file mode 100644
index 0000000..6d95643
--- /dev/null
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
@@ -0,0 +1,6 @@
+#
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+require u-boot-${PV}.inc
-- 
2.25.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-05  6:15 ` [PATCH v2 1/2] " Vijai Kumar K
@ 2021-11-05  6:15   ` Vijai Kumar K
  2021-11-05  6:28     ` Jan Kiszka
  2021-11-06 12:12     ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
  0 siblings, 2 replies; 18+ messages in thread
From: Vijai Kumar K @ 2021-11-05  6:15 UTC (permalink / raw)
  To: isar-users; +Cc: Vijai Kumar K

Move the libssl-dependency to u-boot-custom.inc.

u-boot 2021.10 or later needs libssl-dev to compile.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 2 --
 meta/recipes-bsp/u-boot/u-boot-custom.inc       | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
index 964ae6d..f3f822a 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
@@ -5,8 +5,6 @@
 
 require recipes-bsp/u-boot/u-boot-custom.inc
 
-DEBIAN_BUILD_DEPENDS += ", libssl-dev"
-
 SRC_URI += " \
     https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
     "
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 9984d8c..d51a296 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -24,7 +24,7 @@ python() {
         d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
 }
 
-DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
+DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev"
 
 TEMPLATE_FILES = "debian/control.tmpl"
 TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-05  6:15   ` [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
@ 2021-11-05  6:28     ` Jan Kiszka
  2021-11-05  7:40       ` vijai kumar
  2021-11-06 12:12     ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
  1 sibling, 1 reply; 18+ messages in thread
From: Jan Kiszka @ 2021-11-05  6:28 UTC (permalink / raw)
  To: Vijai Kumar K, isar-users

On 05.11.21 07:15, Vijai Kumar K wrote:
> Move the libssl-dependency to u-boot-custom.inc.
> 
> u-boot 2021.10 or later needs libssl-dev to compile.
> 

I think this started even earlier. In meta-iot2050, e.g., we have this
for 2021.04 as well. But it would require some research to identify the
exact version.

> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
>  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 2 --
>  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 2 +-
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 964ae6d..f3f822a 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,8 +5,6 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> -DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> -
>  SRC_URI += " \
>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
>      "
> diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> index 9984d8c..d51a296 100644
> --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> @@ -24,7 +24,7 @@ python() {
>          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
>  }
>  
> -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
> +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev"
>  
Just realizing: Is this a host or target dependency, i.e. is it (only)
needed for building packaged tools, or does U-Boot need that for host
tools? In the latter case, libssl-dev:native would be needed to ensure
the right package is installed in case of cross-builds.

Please check so that we are not leaving this issue half-done behind.

Jan

>  TEMPLATE_FILES = "debian/control.tmpl"
>  TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
> 

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-05  6:28     ` Jan Kiszka
@ 2021-11-05  7:40       ` vijai kumar
  2021-11-05 12:16         ` vijai kumar
  0 siblings, 1 reply; 18+ messages in thread
From: vijai kumar @ 2021-11-05  7:40 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Vijai Kumar K, isar-users

On Fri, Nov 5, 2021 at 11:58 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 05.11.21 07:15, Vijai Kumar K wrote:
> > Move the libssl-dependency to u-boot-custom.inc.
> >
> > u-boot 2021.10 or later needs libssl-dev to compile.
> >
>
> I think this started even earlier. In meta-iot2050, e.g., we have this
> for 2021.04 as well. But it would require some research to identify the
> exact version.
>
> > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > ---
> >  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 2 --
> >  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 2 +-
> >  2 files changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > index 964ae6d..f3f822a 100644
> > --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > @@ -5,8 +5,6 @@
> >
> >  require recipes-bsp/u-boot/u-boot-custom.inc
> >
> > -DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> > -
> >  SRC_URI += " \
> >      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
> >      "
> > diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > index 9984d8c..d51a296 100644
> > --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > @@ -24,7 +24,7 @@ python() {
> >          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
> >  }
> >
> > -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
> > +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev"
> >
> Just realizing: Is this a host or target dependency, i.e. is it (only)
> needed for building packaged tools, or does U-Boot need that for host
> tools? In the latter case, libssl-dev:native would be needed to ensure
> the right package is installed in case of cross-builds.
>
> Please check so that we are not leaving this issue half-done behind.

Yes. Onto both of them.

Thanks,
Vijai Kumar K

>
> Jan
>
> >  TEMPLATE_FILES = "debian/control.tmpl"
> >  TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
> >
>
> --
> Siemens AG, T RDA IOT
> Corporate Competence Center Embedded Linux
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/7da7eb13-2b2b-cd59-14f9-e43d1808dd5d%40siemens.com.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-05  7:40       ` vijai kumar
@ 2021-11-05 12:16         ` vijai kumar
  0 siblings, 0 replies; 18+ messages in thread
From: vijai kumar @ 2021-11-05 12:16 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Vijai Kumar K, isar-users

On Fri, Nov 5, 2021 at 1:10 PM vijai kumar
<vijaikumar.kanagarajan@gmail.com> wrote:
>
> On Fri, Nov 5, 2021 at 11:58 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
> >
> > On 05.11.21 07:15, Vijai Kumar K wrote:
> > > Move the libssl-dependency to u-boot-custom.inc.
> > >
> > > u-boot 2021.10 or later needs libssl-dev to compile.
> > >
> >
> > I think this started even earlier. In meta-iot2050, e.g., we have this
> > for 2021.04 as well. But it would require some research to identify the
> > exact version.
> >
> > > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > > ---
> > >  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 2 --
> > >  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 2 +-
> > >  2 files changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > > index 964ae6d..f3f822a 100644
> > > --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > > +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > > @@ -5,8 +5,6 @@
> > >
> > >  require recipes-bsp/u-boot/u-boot-custom.inc
> > >
> > > -DEBIAN_BUILD_DEPENDS += ", libssl-dev"
> > > -
> > >  SRC_URI += " \
> > >      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
> > >      "
> > > diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > > index 9984d8c..d51a296 100644
> > > --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > > +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > > @@ -24,7 +24,7 @@ python() {
> > >          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
> > >  }
> > >
> > > -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
> > > +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev"
> > >
> > Just realizing: Is this a host or target dependency, i.e. is it (only)
> > needed for building packaged tools, or does U-Boot need that for host
> > tools? In the latter case, libssl-dev:native would be needed to ensure
> > the right package is installed in case of cross-builds.
> >
> > Please check so that we are not leaving this issue half-done behind.
>
> Yes. Onto both of them.

Looks like we need both libssl-dev and libssl-dev:native afterall.
Will send a v3.

Thanks,
Vijai Kumar K

>
> Thanks,
> Vijai Kumar K
>
> >
> > Jan
> >
> > >  TEMPLATE_FILES = "debian/control.tmpl"
> > >  TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
> > >
> >
> > --
> > Siemens AG, T RDA IOT
> > Corporate Competence Center Embedded Linux
> >
> > --
> > You received this message because you are subscribed to the Google Groups "isar-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/7da7eb13-2b2b-cd59-14f9-e43d1808dd5d%40siemens.com.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10
  2021-11-05  6:15   ` [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
  2021-11-05  6:28     ` Jan Kiszka
@ 2021-11-06 12:12     ` Vijai Kumar K
  2021-11-06 12:12       ` [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
                         ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: Vijai Kumar K @ 2021-11-06 12:12 UTC (permalink / raw)
  To: isar-users, jan.kiszka; +Cc: Vijai Kumar K

Update to the latest u-boot.

Newer versions of u-boot require libssl-dev:native for compilation.
It also needs libssl-dev of the host architecture for cross compilation
of tools.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---

Hi,

I am not sure why we are not conditionally compiling u-boot tools based
on U_BOOT_TOOLS_PACKAGE. We build tools every time but only package them
once the above variable is set.

I have left it untouched. When we finally do, we should check if
U_BOOT_TOOLS_PACKAGE is set along with ISAR_CROSS_COMPILE.

I could send a patch if we agree that the tools should only be compiled
when U_BOOT_TOOLS_PACKAGE is set.

Thanks,
Vijai Kumar K


 ...y-add-property-no-map-to-created-res.patch | 151 ------------------
 ...rty-no-map-to-secure-reserved-memory.patch |  33 ----
 ...{u-boot-2020.10.inc => u-boot-2021.10.inc} |   5 +-
 ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} |   0
 .../u-boot/u-boot-stm32mp15x_2020.10.bb       |  10 --
 .../u-boot/u-boot-stm32mp15x_2021.10.bb       |   6 +
 6 files changed, 10 insertions(+), 195 deletions(-)
 delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
 delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
 rename meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc => u-boot-2021.10.inc} (50%)
 rename meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb => u-boot-de0-nano-soc_2021.10.bb} (100%)
 delete mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
 create mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb

diff --git a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
deleted file mode 100644
index 8a32fc1..0000000
--- a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00 2001
-From: Etienne Carriere <etienne.carriere@st.com>
-Date: Thu, 10 Sep 2020 10:49:59 +0200
-Subject: [PATCH] fdtdec: optionally add property no-map to created reserved
- memory node
-
-Add boolean input argument @no_map to helper function
-fdtdec_add_reserved_memory() to add or not "no-map" property
-for an added reserved memory node.
-
-Property no-map is used by the Linux kernel to not not map memory
-in its static memory mapping. It is needed for example for the|
-consistency of system non-cached memory and to prevent speculative
-accesses to some firewalled memory.
-
-No functional change. A later change will update to OPTEE library to
-add no-map property to OP-TEE reserved memory nodes.
-
-Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
-Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
-Reviewed-by: Simon Glass <sjg@chromium.org>
----
- arch/riscv/lib/fdt_fixup.c |  2 +-
- include/fdtdec.h           |  5 +++--
- lib/fdtdec.c               | 10 ++++++++--
- lib/optee/optee.c          |  2 +-
- test/dm/fdtdec.c           |  6 +++---
- 5 files changed, 16 insertions(+), 9 deletions(-)
-
-diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
-index 5b2420243f..d02062fd5b 100644
---- a/arch/riscv/lib/fdt_fixup.c
-+++ b/arch/riscv/lib/fdt_fixup.c
-@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
- 		pmp_mem.start = addr;
- 		pmp_mem.end = addr + size - 1;
- 		err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem,
--						 &phandle);
-+						 &phandle, false);
- 		if (err < 0 && err != -FDT_ERR_EXISTS) {
- 			log_err("failed to add reserved memory: %d\n", err);
- 			return err;
-diff --git a/include/fdtdec.h b/include/fdtdec.h
-index 152eb07b9e..62d1660973 100644
---- a/include/fdtdec.h
-+++ b/include/fdtdec.h
-@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-  *     };
-  *     uint32_t phandle;
-  *
-- *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle);
-+ *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle, false);
-  *
-  * This results in the following subnode being added to the top-level
-  * /reserved-memory node:
-@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-  * @param carveout	information about the carveout region
-  * @param phandlep	return location for the phandle of the carveout region
-  *			can be NULL if no phandle should be added
-+ * @param no_map	add "no-map" property if true
-  * @return 0 on success or a negative error code on failure
-  */
- int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 			       const struct fdt_memory *carveout,
--			       uint32_t *phandlep);
-+			       uint32_t *phandlep, bool no_map);
- 
- /**
-  * fdtdec_get_carveout() - reads a carveout from an FDT
-diff --git a/lib/fdtdec.c b/lib/fdtdec.c
-index 56bf9fcc79..b8fc5e2bff 100644
---- a/lib/fdtdec.c
-+++ b/lib/fdtdec.c
-@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void *blob)
- 
- int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 			       const struct fdt_memory *carveout,
--			       uint32_t *phandlep)
-+			       uint32_t *phandlep, bool no_map)
- {
- 	fdt32_t cells[4] = {}, *ptr = cells;
- 	uint32_t upper, lower, phandle;
-@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
- 	if (err < 0)
- 		return err;
- 
-+	if (no_map) {
-+		err = fdt_setprop(blob, node, "no-map", NULL, 0);
-+		if (err < 0)
-+			return err;
-+	}
-+
- 	/* return the phandle for the new node for the caller to use */
- 	if (phandlep)
- 		*phandlep = phandle;
-@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name,
- 	fdt32_t value;
- 	void *prop;
- 
--	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle);
-+	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle, false);
- 	if (err < 0) {
- 		debug("failed to add reserved memory: %d\n", err);
- 		return err;
-diff --git a/lib/optee/optee.c b/lib/optee/optee.c
-index 457d4cca8a..963c2ff430 100644
---- a/lib/optee/optee.c
-+++ b/lib/optee/optee.c
-@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
- 				ret = fdtdec_add_reserved_memory(new_blob,
- 								 nodename,
- 								 &carveout,
--								 NULL);
-+								 NULL, false);
- 				free(oldname);
- 
- 				if (ret < 0)
-diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c
-index 716993f706..4119003041 100644
---- a/test/dm/fdtdec.c
-+++ b/test/dm/fdtdec.c
-@@ -80,7 +80,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x1000;
- 	resv.end = 0x1fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region",
--					       &resv, &phandle));
-+					       &resv, &phandle, false));
- 
- 	/* Test /reserve-memory and its subnode should exist */
- 	parent = fdt_path_offset(blob, "/reserved-memory");
-@@ -101,7 +101,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x2000;
- 	resv.end = 0x2fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
--					       &resv, &phandle1));
-+					       &resv, &phandle1, false));
- 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1");
- 	ut_assert(subnode > 0);
- 
-@@ -115,7 +115,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
- 	resv.start = 0x1000;
- 	resv.end = 0x1fff;
- 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2",
--					       &resv, &phandle1));
-+					       &resv, &phandle1, false));
- 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region2");
- 	ut_assert(subnode < 0);
- 
--- 
-2.26.2
-
diff --git a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
deleted file mode 100644
index 6a39968..0000000
--- a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00 2001
-From: Etienne Carriere <etienne.carriere@st.com>
-Date: Thu, 10 Sep 2020 10:50:01 +0200
-Subject: [PATCH] optee: add property no-map to secure reserved memory
-
-OP-TEE reserved memory node must set property "no-map" to prevent
-Linux kernel from mapping secure memory unless what non-secure world
-speculative accesses of the CPU can violate the memory firmware
-configuration.
-
-Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree")
-Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
-Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
----
- lib/optee/optee.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/optee/optee.c b/lib/optee/optee.c
-index 963c2ff430..9e6606568f 100644
---- a/lib/optee/optee.c
-+++ b/lib/optee/optee.c
-@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
- 				ret = fdtdec_add_reserved_memory(new_blob,
- 								 nodename,
- 								 &carveout,
--								 NULL, false);
-+								 NULL, true);
- 				free(oldname);
- 
- 				if (ret < 0)
--- 
-2.26.2
-
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
similarity index 50%
rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
index 604776a..158c297 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
@@ -5,9 +5,12 @@
 
 require recipes-bsp/u-boot/u-boot-custom.inc
 
+DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
+DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
+
 SRC_URI += " \
     https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
     "
-SRC_URI[sha256sum] = "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622"
+SRC_URI[sha256sum] = "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4"
 
 S = "${WORKDIR}/u-boot-${PV}"
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
similarity index 100%
rename from meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb
rename to meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
deleted file mode 100644
index 39fceb2..0000000
--- a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-require u-boot-${PV}.inc
-
-SRC_URI += " \
-    file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch \
-    file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch"
diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
new file mode 100644
index 0000000..6d95643
--- /dev/null
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
@@ -0,0 +1,6 @@
+#
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+require u-boot-${PV}.inc
-- 
2.25.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-06 12:12     ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
@ 2021-11-06 12:12       ` Vijai Kumar K
  2021-11-09  6:01         ` Jan Kiszka
  2021-11-09  6:06       ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Jan Kiszka
  2021-11-19 17:54       ` vijaikumar....@gmail.com
  2 siblings, 1 reply; 18+ messages in thread
From: Vijai Kumar K @ 2021-11-06 12:12 UTC (permalink / raw)
  To: isar-users, jan.kiszka; +Cc: Vijai Kumar K

Move the libssl-dependency to u-boot-custom.inc.

Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
 meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 3 ---
 meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
index 158c297..f3f822a 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
@@ -5,9 +5,6 @@
 
 require recipes-bsp/u-boot/u-boot-custom.inc
 
-DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
-DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
-
 SRC_URI += " \
     https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
     "
diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
index 9984d8c..57d4f36 100644
--- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
@@ -24,7 +24,9 @@ python() {
         d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
 }
 
-DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
+DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev:native"
+DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
+
 
 TEMPLATE_FILES = "debian/control.tmpl"
 TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-06 12:12       ` [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
@ 2021-11-09  6:01         ` Jan Kiszka
  2021-11-19 16:54           ` vijai kumar
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Kiszka @ 2021-11-09  6:01 UTC (permalink / raw)
  To: Vijai Kumar K, isar-users

On 06.11.21 13:12, Vijai Kumar K wrote:
> Move the libssl-dependency to u-boot-custom.inc.
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
>  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 3 ---
>  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 158c297..f3f822a 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,9 +5,6 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> -DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
> -DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> -
>  SRC_URI += " \
>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
>      "
> diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> index 9984d8c..57d4f36 100644
> --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> @@ -24,7 +24,9 @@ python() {
>          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
>  }
>  
> -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
> +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev:native"
> +DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> +

It would feel more logical to me to put the :native part under the
cross-compile condition. The outcome will be the same, but :native is a
redundant statement in the native build case.

Jan

>  
>  TEMPLATE_FILES = "debian/control.tmpl"
>  TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
> 

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10
  2021-11-06 12:12     ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
  2021-11-06 12:12       ` [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
@ 2021-11-09  6:06       ` Jan Kiszka
  2021-11-19 17:54       ` vijaikumar....@gmail.com
  2 siblings, 0 replies; 18+ messages in thread
From: Jan Kiszka @ 2021-11-09  6:06 UTC (permalink / raw)
  To: Vijai Kumar K, isar-users

On 06.11.21 13:12, Vijai Kumar K wrote:
> Update to the latest u-boot.
> 
> Newer versions of u-boot require libssl-dev:native for compilation.
> It also needs libssl-dev of the host architecture for cross compilation
> of tools.
> 
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> 
> Hi,
> 
> I am not sure why we are not conditionally compiling u-boot tools based
> on U_BOOT_TOOLS_PACKAGE. We build tools every time but only package them
> once the above variable is set.
> 
> I have left it untouched. When we finally do, we should check if
> U_BOOT_TOOLS_PACKAGE is set along with ISAR_CROSS_COMPILE.
> 
> I could send a patch if we agree that the tools should only be compiled
> when U_BOOT_TOOLS_PACKAGE is set.

I agree that we can safe those few cycles. I suppose I was just too lazy
to propaget that variable to the rules file and make things conditional
there as well.


> 
> Thanks,
> Vijai Kumar K
> 
> 
>  ...y-add-property-no-map-to-created-res.patch | 151 ------------------
>  ...rty-no-map-to-secure-reserved-memory.patch |  33 ----
>  ...{u-boot-2020.10.inc => u-boot-2021.10.inc} |   5 +-
>  ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} |   0
>  .../u-boot/u-boot-stm32mp15x_2020.10.bb       |  10 --
>  .../u-boot/u-boot-stm32mp15x_2021.10.bb       |   6 +
>  6 files changed, 10 insertions(+), 195 deletions(-)
>  delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
>  delete mode 100644 meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
>  rename meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc => u-boot-2021.10.inc} (50%)
>  rename meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb => u-boot-de0-nano-soc_2021.10.bb} (100%)
>  delete mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
>  create mode 100644 meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> 
> diff --git a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> deleted file mode 100644
> index 8a32fc1..0000000
> --- a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch
> +++ /dev/null
> @@ -1,151 +0,0 @@
> -From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00 2001
> -From: Etienne Carriere <etienne.carriere@st.com>
> -Date: Thu, 10 Sep 2020 10:49:59 +0200
> -Subject: [PATCH] fdtdec: optionally add property no-map to created reserved
> - memory node
> -
> -Add boolean input argument @no_map to helper function
> -fdtdec_add_reserved_memory() to add or not "no-map" property
> -for an added reserved memory node.
> -
> -Property no-map is used by the Linux kernel to not not map memory
> -in its static memory mapping. It is needed for example for the|
> -consistency of system non-cached memory and to prevent speculative
> -accesses to some firewalled memory.
> -
> -No functional change. A later change will update to OPTEE library to
> -add no-map property to OP-TEE reserved memory nodes.
> -
> -Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> -Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> -Reviewed-by: Simon Glass <sjg@chromium.org>
> ----
> - arch/riscv/lib/fdt_fixup.c |  2 +-
> - include/fdtdec.h           |  5 +++--
> - lib/fdtdec.c               | 10 ++++++++--
> - lib/optee/optee.c          |  2 +-
> - test/dm/fdtdec.c           |  6 +++---
> - 5 files changed, 16 insertions(+), 9 deletions(-)
> -
> -diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
> -index 5b2420243f..d02062fd5b 100644
> ---- a/arch/riscv/lib/fdt_fixup.c
> -+++ b/arch/riscv/lib/fdt_fixup.c
> -@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
> - 		pmp_mem.start = addr;
> - 		pmp_mem.end = addr + size - 1;
> - 		err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem,
> --						 &phandle);
> -+						 &phandle, false);
> - 		if (err < 0 && err != -FDT_ERR_EXISTS) {
> - 			log_err("failed to add reserved memory: %d\n", err);
> - 			return err;
> -diff --git a/include/fdtdec.h b/include/fdtdec.h
> -index 152eb07b9e..62d1660973 100644
> ---- a/include/fdtdec.h
> -+++ b/include/fdtdec.h
> -@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
> -  *     };
> -  *     uint32_t phandle;
> -  *
> -- *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle);
> -+ *     fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle, false);
> -  *
> -  * This results in the following subnode being added to the top-level
> -  * /reserved-memory node:
> -@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
> -  * @param carveout	information about the carveout region
> -  * @param phandlep	return location for the phandle of the carveout region
> -  *			can be NULL if no phandle should be added
> -+ * @param no_map	add "no-map" property if true
> -  * @return 0 on success or a negative error code on failure
> -  */
> - int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 			       const struct fdt_memory *carveout,
> --			       uint32_t *phandlep);
> -+			       uint32_t *phandlep, bool no_map);
> - 
> - /**
> -  * fdtdec_get_carveout() - reads a carveout from an FDT
> -diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> -index 56bf9fcc79..b8fc5e2bff 100644
> ---- a/lib/fdtdec.c
> -+++ b/lib/fdtdec.c
> -@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void *blob)
> - 
> - int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 			       const struct fdt_memory *carveout,
> --			       uint32_t *phandlep)
> -+			       uint32_t *phandlep, bool no_map)
> - {
> - 	fdt32_t cells[4] = {}, *ptr = cells;
> - 	uint32_t upper, lower, phandle;
> -@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename,
> - 	if (err < 0)
> - 		return err;
> - 
> -+	if (no_map) {
> -+		err = fdt_setprop(blob, node, "no-map", NULL, 0);
> -+		if (err < 0)
> -+			return err;
> -+	}
> -+
> - 	/* return the phandle for the new node for the caller to use */
> - 	if (phandlep)
> - 		*phandlep = phandle;
> -@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name,
> - 	fdt32_t value;
> - 	void *prop;
> - 
> --	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle);
> -+	err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle, false);
> - 	if (err < 0) {
> - 		debug("failed to add reserved memory: %d\n", err);
> - 		return err;
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c
> -index 457d4cca8a..963c2ff430 100644
> ---- a/lib/optee/optee.c
> -+++ b/lib/optee/optee.c
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
> - 				ret = fdtdec_add_reserved_memory(new_blob,
> - 								 nodename,
> - 								 &carveout,
> --								 NULL);
> -+								 NULL, false);
> - 				free(oldname);
> - 
> - 				if (ret < 0)
> -diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c
> -index 716993f706..4119003041 100644
> ---- a/test/dm/fdtdec.c
> -+++ b/test/dm/fdtdec.c
> -@@ -80,7 +80,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x1000;
> - 	resv.end = 0x1fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region",
> --					       &resv, &phandle));
> -+					       &resv, &phandle, false));
> - 
> - 	/* Test /reserve-memory and its subnode should exist */
> - 	parent = fdt_path_offset(blob, "/reserved-memory");
> -@@ -101,7 +101,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x2000;
> - 	resv.end = 0x2fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1",
> --					       &resv, &phandle1));
> -+					       &resv, &phandle1, false));
> - 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1");
> - 	ut_assert(subnode > 0);
> - 
> -@@ -115,7 +115,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts)
> - 	resv.start = 0x1000;
> - 	resv.end = 0x1fff;
> - 	ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2",
> --					       &resv, &phandle1));
> -+					       &resv, &phandle1, false));
> - 	subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region2");
> - 	ut_assert(subnode < 0);
> - 
> --- 
> -2.26.2
> -
> diff --git a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
> deleted file mode 100644
> index 6a39968..0000000
> --- a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00 2001
> -From: Etienne Carriere <etienne.carriere@st.com>
> -Date: Thu, 10 Sep 2020 10:50:01 +0200
> -Subject: [PATCH] optee: add property no-map to secure reserved memory
> -
> -OP-TEE reserved memory node must set property "no-map" to prevent
> -Linux kernel from mapping secure memory unless what non-secure world
> -speculative accesses of the CPU can violate the memory firmware
> -configuration.
> -
> -Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree")
> -Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> -Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ----
> - lib/optee/optee.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c
> -index 963c2ff430..9e6606568f 100644
> ---- a/lib/optee/optee.c
> -+++ b/lib/optee/optee.c
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void *new_blob)
> - 				ret = fdtdec_add_reserved_memory(new_blob,
> - 								 nodename,
> - 								 &carveout,
> --								 NULL, false);
> -+								 NULL, true);
> - 				free(oldname);
> - 
> - 				if (ret < 0)
> --- 
> -2.26.2
> -
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> similarity index 50%
> rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> index 604776a..158c297 100644
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> @@ -5,9 +5,12 @@
>  
>  require recipes-bsp/u-boot/u-boot-custom.inc
>  
> +DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
> +DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> +
>  SRC_URI += " \
>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
>      "
> -SRC_URI[sha256sum] = "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622"
> +SRC_URI[sha256sum] = "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4"
>  
>  S = "${WORKDIR}/u-boot-${PV}"
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
> similarity index 100%
> rename from meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb
> rename to meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
> deleted file mode 100644
> index 39fceb2..0000000
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -#
> -# Copyright (c) Siemens AG, 2020
> -#
> -# SPDX-License-Identifier: MIT
> -
> -require u-boot-${PV}.inc
> -
> -SRC_URI += " \
> -    file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch \
> -    file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch"
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> new file mode 100644
> index 0000000..6d95643
> --- /dev/null
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb
> @@ -0,0 +1,6 @@
> +#
> +# Copyright (c) Siemens AG, 2020
> +#
> +# SPDX-License-Identifier: MIT
> +
> +require u-boot-${PV}.inc
> 

Looks goot to me.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-09  6:01         ` Jan Kiszka
@ 2021-11-19 16:54           ` vijai kumar
  2021-11-22  6:20             ` Jan Kiszka
  0 siblings, 1 reply; 18+ messages in thread
From: vijai kumar @ 2021-11-19 16:54 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Vijai Kumar K, isar-users

On Tue, Nov 9, 2021 at 11:31 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 06.11.21 13:12, Vijai Kumar K wrote:
> > Move the libssl-dependency to u-boot-custom.inc.
> >
> > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > ---
> >  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 3 ---
> >  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
> >  2 files changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > index 158c297..f3f822a 100644
> > --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> > @@ -5,9 +5,6 @@
> >
> >  require recipes-bsp/u-boot/u-boot-custom.inc
> >
> > -DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
> > -DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> > -
> >  SRC_URI += " \
> >      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
> >      "
> > diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > index 9984d8c..57d4f36 100644
> > --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> > @@ -24,7 +24,9 @@ python() {
> >          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
> >  }
> >
> > -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
> > +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev:native"
> > +DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> > +
>
> It would feel more logical to me to put the :native part under the
> cross-compile condition. The outcome will be the same, but :native is a
> redundant statement in the native build case.

Hi Jan,

Sorry I thought I had replied to this. But it looks like not.

>From my testing,
1. libssl-dev:native is needed to build the u-boot image(bin).
2. libssl-dev of host(Debian) is needed only when we cross compile u-boot-tools.

Even though the :native looks redundant, from the perspective of
u-boot, it makes sense.
Also, we now make it depend on cross-compile because tools are always built.

If you see my patches on u-boot refactor[1], the libssl-dev inclusion
will only take place in case we cross
compile tools. (ISAR_CROSS_COMPILE == 1 && U_BOOT_TOOLS_PACKAGE = 1)

[1]: https://groups.google.com/g/isar-users/c/RvvuZ5BRI0U/m/-m8u_mZMAQAJ

Thanks,
Vijai Kumar K



>
> Jan
>
> >
> >  TEMPLATE_FILES = "debian/control.tmpl"
> >  TEMPLATE_VARS += "MACHINE DEBIAN_BUILD_DEPENDS"
> >
>
> --
> Siemens AG, T RDA IOT
> Corporate Competence Center Embedded Linux
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/07718b5f-1186-d912-419e-9dac134f9367%40siemens.com.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10
  2021-11-06 12:12     ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
  2021-11-06 12:12       ` [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
  2021-11-09  6:06       ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Jan Kiszka
@ 2021-11-19 17:54       ` vijaikumar....@gmail.com
  2 siblings, 0 replies; 18+ messages in thread
From: vijaikumar....@gmail.com @ 2021-11-19 17:54 UTC (permalink / raw)
  To: isar-users


[-- Attachment #1.1: Type: text/plain, Size: 12307 bytes --]



On Saturday, November 6, 2021 at 5:42:25 PM UTC+5:30 Vijai Kumar K wrote:

> Update to the latest u-boot. 
>
> Newer versions of u-boot require libssl-dev:native for compilation. 
> It also needs libssl-dev of the host architecture for cross compilation 
> of tools. 
>
> Signed-off-by: Vijai Kumar K <Vijaikumar_...@mentor.com> 


> --- 
>
> Hi, 
>
> I am not sure why we are not conditionally compiling u-boot tools based 
> on U_BOOT_TOOLS_PACKAGE. We build tools every time but only package them 
> once the above variable is set. 
>
> I have left it untouched. When we finally do, we should check if 
> U_BOOT_TOOLS_PACKAGE is set along with ISAR_CROSS_COMPILE. 
>
> I could send a patch if we agree that the tools should only be compiled 
> when U_BOOT_TOOLS_PACKAGE is set. 
>
> Thanks, 
> Vijai Kumar K


V4 of the patch is available 
at https://groups.google.com/g/isar-users/c/j0D4yTlIyH0
Since this has become more cluttered.

Thanks,
Vijai Kumar K
 

>
>
>
> ...y-add-property-no-map-to-created-res.patch | 151 ------------------ 
> ...rty-no-map-to-secure-reserved-memory.patch | 33 ---- 
> ...{u-boot-2020.10.inc => u-boot-2021.10.inc} | 5 +- 
> ...0.10.bb => u-boot-de0-nano-soc_2021.10.bb} | 0 
> .../u-boot/u-boot-stm32mp15x_2020.10.bb | 10 -- 
> .../u-boot/u-boot-stm32mp15x_2021.10.bb | 6 + 
> 6 files changed, 10 insertions(+), 195 deletions(-) 
> delete mode 100644 
> meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch 
>
> delete mode 100644 
> meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch 
>
> rename meta-isar/recipes-bsp/u-boot/{u-boot-2020.10.inc => 
> u-boot-2021.10.inc} (50%) 
> rename meta-isar/recipes-bsp/u-boot/{u-boot-de0-nano-soc_2020.10.bb => 
> u-boot-de0-nano-soc_2021.10.bb} (100%) 
> delete mode 100644 meta-isar/recipes-bsp/u-boot/
> u-boot-stm32mp15x_2020.10.bb 
> create mode 100644 meta-isar/recipes-bsp/u-boot/
> u-boot-stm32mp15x_2021.10.bb 
>
> diff --git 
> a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch 
> b/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch 
>
> deleted file mode 100644 
> index 8a32fc1..0000000 
> --- 
> a/meta-isar/recipes-bsp/u-boot/files/0001-fdtdec-optionally-add-property-no-map-to-created-res.patch 
>
> +++ /dev/null 
> @@ -1,151 +0,0 @@ 
> -From ccaa5747bdeae4261199dd7e80771e4de1c550ca Mon Sep 17 00:00:00 2001 
> -From: Etienne Carriere <etienne....@st.com> 
> -Date: Thu, 10 Sep 2020 10:49:59 +0200 
> -Subject: [PATCH] fdtdec: optionally add property no-map to created 
> reserved 
> - memory node 
> - 
> -Add boolean input argument @no_map to helper function 
> -fdtdec_add_reserved_memory() to add or not "no-map" property 
> -for an added reserved memory node. 
> - 
> -Property no-map is used by the Linux kernel to not not map memory 
> -in its static memory mapping. It is needed for example for the| 
> -consistency of system non-cached memory and to prevent speculative 
> -accesses to some firewalled memory. 
> - 
> -No functional change. A later change will update to OPTEE library to 
> -add no-map property to OP-TEE reserved memory nodes. 
> - 
> -Signed-off-by: Etienne Carriere <etienne....@st.com> 
> -Signed-off-by: Patrice Chotard <patrice...@st.com> 
> -Reviewed-by: Simon Glass <s...@chromium.org> 
> ---- 
> - arch/riscv/lib/fdt_fixup.c | 2 +- 
> - include/fdtdec.h | 5 +++-- 
> - lib/fdtdec.c | 10 ++++++++-- 
> - lib/optee/optee.c | 2 +- 
> - test/dm/fdtdec.c | 6 +++--- 
> - 5 files changed, 16 insertions(+), 9 deletions(-) 
> - 
> -diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c 
> -index 5b2420243f..d02062fd5b 100644 
> ---- a/arch/riscv/lib/fdt_fixup.c 
> -+++ b/arch/riscv/lib/fdt_fixup.c 
> -@@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void 
> *dst) 
> - pmp_mem.start = addr; 
> - pmp_mem.end = addr + size - 1; 
> - err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem, 
> -- &phandle); 
> -+ &phandle, false); 
> - if (err < 0 && err != -FDT_ERR_EXISTS) { 
> - log_err("failed to add reserved memory: %d\n", err); 
> - return err; 
> -diff --git a/include/fdtdec.h b/include/fdtdec.h 
> -index 152eb07b9e..62d1660973 100644 
> ---- a/include/fdtdec.h 
> -+++ b/include/fdtdec.h 
> -@@ -1029,7 +1029,7 @@ static inline int fdtdec_set_phandle(void *blob, 
> int node, uint32_t phandle) 
> - * }; 
> - * uint32_t phandle; 
> - * 
> -- * fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle); 
> -+ * fdtdec_add_reserved_memory(fdt, "framebuffer", &fb, &phandle, false); 
> - * 
> - * This results in the following subnode being added to the top-level 
> - * /reserved-memory node: 
> -@@ -1056,11 +1056,12 @@ static inline int fdtdec_set_phandle(void *blob, 
> int node, uint32_t phandle) 
> - * @param carveout information about the carveout region 
> - * @param phandlep return location for the phandle of the carveout region 
> - * can be NULL if no phandle should be added 
> -+ * @param no_map add "no-map" property if true 
> - * @return 0 on success or a negative error code on failure 
> - */ 
> - int fdtdec_add_reserved_memory(void *blob, const char *basename, 
> - const struct fdt_memory *carveout, 
> -- uint32_t *phandlep); 
> -+ uint32_t *phandlep, bool no_map); 
> - 
> - /** 
> - * fdtdec_get_carveout() - reads a carveout from an FDT 
> -diff --git a/lib/fdtdec.c b/lib/fdtdec.c 
> -index 56bf9fcc79..b8fc5e2bff 100644 
> ---- a/lib/fdtdec.c 
> -+++ b/lib/fdtdec.c 
> -@@ -1316,7 +1316,7 @@ static int fdtdec_init_reserved_memory(void *blob) 
> - 
> - int fdtdec_add_reserved_memory(void *blob, const char *basename, 
> - const struct fdt_memory *carveout, 
> -- uint32_t *phandlep) 
> -+ uint32_t *phandlep, bool no_map) 
> - { 
> - fdt32_t cells[4] = {}, *ptr = cells; 
> - uint32_t upper, lower, phandle; 
> -@@ -1416,6 +1416,12 @@ int fdtdec_add_reserved_memory(void *blob, const 
> char *basename, 
> - if (err < 0) 
> - return err; 
> - 
> -+ if (no_map) { 
> -+ err = fdt_setprop(blob, node, "no-map", NULL, 0); 
> -+ if (err < 0) 
> -+ return err; 
> -+ } 
> -+ 
> - /* return the phandle for the new node for the caller to use */ 
> - if (phandlep) 
> - *phandlep = phandle; 
> -@@ -1481,7 +1487,7 @@ int fdtdec_set_carveout(void *blob, const char 
> *node, const char *prop_name, 
> - fdt32_t value; 
> - void *prop; 
> - 
> -- err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle); 
> -+ err = fdtdec_add_reserved_memory(blob, name, carveout, &phandle, 
> false); 
> - if (err < 0) { 
> - debug("failed to add reserved memory: %d\n", err); 
> - return err; 
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c 
> -index 457d4cca8a..963c2ff430 100644 
> ---- a/lib/optee/optee.c 
> -+++ b/lib/optee/optee.c 
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void 
> *new_blob) 
> - ret = fdtdec_add_reserved_memory(new_blob, 
> - nodename, 
> - &carveout, 
> -- NULL); 
> -+ NULL, false); 
> - free(oldname); 
> - 
> - if (ret < 0) 
> -diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c 
> -index 716993f706..4119003041 100644 
> ---- a/test/dm/fdtdec.c 
> -+++ b/test/dm/fdtdec.c 
> -@@ -80,7 +80,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct 
> unit_test_state *uts) 
> - resv.start = 0x1000; 
> - resv.end = 0x1fff; 
> - ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region", 
> -- &resv, &phandle)); 
> -+ &resv, &phandle, false)); 
> - 
> - /* Test /reserve-memory and its subnode should exist */ 
> - parent = fdt_path_offset(blob, "/reserved-memory"); 
> -@@ -101,7 +101,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct 
> unit_test_state *uts) 
> - resv.start = 0x2000; 
> - resv.end = 0x2fff; 
> - ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1", 
> -- &resv, &phandle1)); 
> -+ &resv, &phandle1, false)); 
> - subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1"); 
> - ut_assert(subnode > 0); 
> - 
> -@@ -115,7 +115,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct 
> unit_test_state *uts) 
> - resv.start = 0x1000; 
> - resv.end = 0x1fff; 
> - ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2", 
> -- &resv, &phandle1)); 
> -+ &resv, &phandle1, false)); 
> - subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region2"); 
> - ut_assert(subnode < 0); 
> - 
> --- 
> -2.26.2 
> - 
> diff --git 
> a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch 
> b/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch 
>
> deleted file mode 100644 
> index 6a39968..0000000 
> --- 
> a/meta-isar/recipes-bsp/u-boot/files/0002-optee-add-property-no-map-to-secure-reserved-memory.patch 
>
> +++ /dev/null 
> @@ -1,33 +0,0 @@ 
> -From 3e15c315f97401f394ae83ed17fbef72b765222a Mon Sep 17 00:00:00 2001 
> -From: Etienne Carriere <etienne....@st.com> 
> -Date: Thu, 10 Sep 2020 10:50:01 +0200 
> -Subject: [PATCH] optee: add property no-map to secure reserved memory 
> - 
> -OP-TEE reserved memory node must set property "no-map" to prevent 
> -Linux kernel from mapping secure memory unless what non-secure world 
> -speculative accesses of the CPU can violate the memory firmware 
> -configuration. 
> - 
> -Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded 
> devicetree") 
> -Signed-off-by: Etienne Carriere <etienne....@st.com> 
> -Signed-off-by: Patrice Chotard <patrice...@st.com> 
> ---- 
> - lib/optee/optee.c | 2 +- 
> - 1 file changed, 1 insertion(+), 1 deletion(-) 
> - 
> -diff --git a/lib/optee/optee.c b/lib/optee/optee.c 
> -index 963c2ff430..9e6606568f 100644 
> ---- a/lib/optee/optee.c 
> -+++ b/lib/optee/optee.c 
> -@@ -192,7 +192,7 @@ int optee_copy_fdt_nodes(const void *old_blob, void 
> *new_blob) 
> - ret = fdtdec_add_reserved_memory(new_blob, 
> - nodename, 
> - &carveout, 
> -- NULL, false); 
> -+ NULL, true); 
> - free(oldname); 
> - 
> - if (ret < 0) 
> --- 
> -2.26.2 
> - 
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc 
> b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc 
> similarity index 50% 
> rename from meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc 
> rename to meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc 
> index 604776a..158c297 100644 
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2020.10.inc 
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc 
> @@ -5,9 +5,12 @@ 
>
> require recipes-bsp/u-boot/u-boot-custom.inc 
>
> +DEBIAN_BUILD_DEPENDS += ", libssl-dev:native" 
> +DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if 
> d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}" 
> + 
> SRC_URI += " \ 
> https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \ 
> " 
> -SRC_URI[sha256sum] = 
> "0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622" 
> +SRC_URI[sha256sum] = 
> "cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4" 
>
> S = "${WORKDIR}/u-boot-${PV}" 
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb 
> b/meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb 
> similarity index 100% 
> rename from meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2020.10.bb 
> rename to meta-isar/recipes-bsp/u-boot/u-boot-de0-nano-soc_2021.10.bb 
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb 
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb 
> deleted file mode 100644 
> index 39fceb2..0000000 
> --- a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2020.10.bb 
> +++ /dev/null 
> @@ -1,10 +0,0 @@ 
> -# 
> -# Copyright (c) Siemens AG, 2020 
> -# 
> -# SPDX-License-Identifier: MIT 
> - 
> -require u-boot-${PV}.inc 
> - 
> -SRC_URI += " \ 
> - file://0001-fdtdec-optionally-add-property-no-map-to-created-res.patch \ 
> - file://0002-optee-add-property-no-map-to-secure-reserved-memory.patch" 
> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb 
> b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb 
> new file mode 100644 
> index 0000000..6d95643 
> --- /dev/null 
> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-stm32mp15x_2021.10.bb 
> @@ -0,0 +1,6 @@ 
> +# 
> +# Copyright (c) Siemens AG, 2020 
> +# 
> +# SPDX-License-Identifier: MIT 
> + 
> +require u-boot-${PV}.inc 
> -- 
> 2.25.1 
>
>

[-- Attachment #1.2: Type: text/html, Size: 19154 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-19 16:54           ` vijai kumar
@ 2021-11-22  6:20             ` Jan Kiszka
  2021-11-22  6:37               ` vijai kumar
  0 siblings, 1 reply; 18+ messages in thread
From: Jan Kiszka @ 2021-11-22  6:20 UTC (permalink / raw)
  To: vijai kumar; +Cc: Vijai Kumar K, isar-users

On 19.11.21 17:54, vijai kumar wrote:
> On Tue, Nov 9, 2021 at 11:31 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>
>> On 06.11.21 13:12, Vijai Kumar K wrote:
>>> Move the libssl-dependency to u-boot-custom.inc.
>>>
>>> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
>>> ---
>>>  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 3 ---
>>>  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
>>>  2 files changed, 3 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
>>> index 158c297..f3f822a 100644
>>> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
>>> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
>>> @@ -5,9 +5,6 @@
>>>
>>>  require recipes-bsp/u-boot/u-boot-custom.inc
>>>
>>> -DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
>>> -DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
>>> -
>>>  SRC_URI += " \
>>>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
>>>      "
>>> diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
>>> index 9984d8c..57d4f36 100644
>>> --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
>>> +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
>>> @@ -24,7 +24,9 @@ python() {
>>>          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
>>>  }
>>>
>>> -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
>>> +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev:native"
>>> +DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
>>> +
>>
>> It would feel more logical to me to put the :native part under the
>> cross-compile condition. The outcome will be the same, but :native is a
>> redundant statement in the native build case.
> 
> Hi Jan,
> 
> Sorry I thought I had replied to this. But it looks like not.
> 
> From my testing,
> 1. libssl-dev:native is needed to build the u-boot image(bin).
> 2. libssl-dev of host(Debian) is needed only when we cross compile u-boot-tools.
> 
> Even though the :native looks redundant, from the perspective of
> u-boot, it makes sense.
> Also, we now make it depend on cross-compile because tools are always built.
> 
> If you see my patches on u-boot refactor[1], the libssl-dev inclusion
> will only take place in case we cross
> compile tools. (ISAR_CROSS_COMPILE == 1 && U_BOOT_TOOLS_PACKAGE = 1)
> 
> [1]: https://groups.google.com/g/isar-users/c/RvvuZ5BRI0U/m/-m8u_mZMAQAJ
> 

Well, thinking about this again, the best way would be to only make this
dependent on whether we are building tools or not. The cross-compile
dependency is just unneeded, will not save any installation in practice
because non-cross means libssl-dev:native == libssl-dev.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom
  2021-11-22  6:20             ` Jan Kiszka
@ 2021-11-22  6:37               ` vijai kumar
  0 siblings, 0 replies; 18+ messages in thread
From: vijai kumar @ 2021-11-22  6:37 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Vijai Kumar K, isar-users

On Mon, Nov 22, 2021 at 11:50 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 19.11.21 17:54, vijai kumar wrote:
> > On Tue, Nov 9, 2021 at 11:31 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
> >>
> >> On 06.11.21 13:12, Vijai Kumar K wrote:
> >>> Move the libssl-dependency to u-boot-custom.inc.
> >>>
> >>> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> >>> ---
> >>>  meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc | 3 ---
> >>>  meta/recipes-bsp/u-boot/u-boot-custom.inc       | 4 +++-
> >>>  2 files changed, 3 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> >>> index 158c297..f3f822a 100644
> >>> --- a/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> >>> +++ b/meta-isar/recipes-bsp/u-boot/u-boot-2021.10.inc
> >>> @@ -5,9 +5,6 @@
> >>>
> >>>  require recipes-bsp/u-boot/u-boot-custom.inc
> >>>
> >>> -DEBIAN_BUILD_DEPENDS += ", libssl-dev:native"
> >>> -DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> >>> -
> >>>  SRC_URI += " \
> >>>      https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
> >>>      "
> >>> diff --git a/meta/recipes-bsp/u-boot/u-boot-custom.inc b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> >>> index 9984d8c..57d4f36 100644
> >>> --- a/meta/recipes-bsp/u-boot/u-boot-custom.inc
> >>> +++ b/meta/recipes-bsp/u-boot/u-boot-custom.inc
> >>> @@ -24,7 +24,9 @@ python() {
> >>>          d.setVar('DEBIAN_BUILD_DEPENDS', d.getVar('BUILD_DEPENDS'))
> >>>  }
> >>>
> >>> -DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git"
> >>> +DEBIAN_BUILD_DEPENDS ?= "bc, bison, flex, device-tree-compiler, git, libssl-dev:native"
> >>> +DEBIAN_BUILD_DEPENDS += "${@', libssl-dev' if d.getVar('ISAR_CROSS_COMPILE') == '1' else ''}"
> >>> +
> >>
> >> It would feel more logical to me to put the :native part under the
> >> cross-compile condition. The outcome will be the same, but :native is a
> >> redundant statement in the native build case.
> >
> > Hi Jan,
> >
> > Sorry I thought I had replied to this. But it looks like not.
> >
> > From my testing,
> > 1. libssl-dev:native is needed to build the u-boot image(bin).
> > 2. libssl-dev of host(Debian) is needed only when we cross compile u-boot-tools.
> >
> > Even though the :native looks redundant, from the perspective of
> > u-boot, it makes sense.
> > Also, we now make it depend on cross-compile because tools are always built.
> >
> > If you see my patches on u-boot refactor[1], the libssl-dev inclusion
> > will only take place in case we cross
> > compile tools. (ISAR_CROSS_COMPILE == 1 && U_BOOT_TOOLS_PACKAGE = 1)
> >
> > [1]: https://groups.google.com/g/isar-users/c/RvvuZ5BRI0U/m/-m8u_mZMAQAJ
> >
>
> Well, thinking about this again, the best way would be to only make this
> dependent on whether we are building tools or not. The cross-compile
> dependency is just unneeded, will not save any installation in practice
> because non-cross means libssl-dev:native == libssl-dev.

I will club the series with DEB_BUILD_PROFILES series and make sure we
bring the latter
first so that we can drop this cross compile dependency smoothly.

Thanks,
Vijai Kumar K

>
> Jan
>
> --
> Siemens AG, T RDA IOT
> Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-11-22  6:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 10:49 [PATCH] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
2021-11-03 11:01 ` Jan Kiszka
2021-11-05  5:55   ` Kanagarajan, Vijaikumar
2021-11-03 18:25 ` Henning Schild
2021-11-05  6:05   ` Kanagarajan, Vijaikumar
2021-11-05  6:15 ` [PATCH v2 1/2] " Vijai Kumar K
2021-11-05  6:15   ` [PATCH v2 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
2021-11-05  6:28     ` Jan Kiszka
2021-11-05  7:40       ` vijai kumar
2021-11-05 12:16         ` vijai kumar
2021-11-06 12:12     ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Vijai Kumar K
2021-11-06 12:12       ` [PATCH v3 2/2] u-boot: Move libssl-dev dependency to u-boot-custom Vijai Kumar K
2021-11-09  6:01         ` Jan Kiszka
2021-11-19 16:54           ` vijai kumar
2021-11-22  6:20             ` Jan Kiszka
2021-11-22  6:37               ` vijai kumar
2021-11-09  6:06       ` [PATCH v3 1/2] meta-isar: u-boot: Update to 2021.10 Jan Kiszka
2021-11-19 17:54       ` vijaikumar....@gmail.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox