All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spl: fit: Also record architecture in /fit-images
@ 2021-05-31  8:57 Michal Simek
  2021-06-22 13:31 ` Simon Glass
  2021-07-23 12:34 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2021-05-31  8:57 UTC (permalink / raw)
  To: u-boot, git, Simon Glass; +Cc: Alexandru Gagniuc, Marek Vasut, Philippe Reynes

On ARM64 secure OS can run as 64bit or 32bit that's why it is necessary to
record information about architecture that other code can read it and
properly pass it to TF-A and start in 64bit or 32bit mode.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 common/fdt_support.c  | 4 +++-
 common/spl/spl_fit.c  | 3 ++-
 include/fdt_support.h | 3 ++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index a9a32df1e78f..240f1e57d135 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -594,7 +594,7 @@ void fdt_fixup_ethernet(void *fdt)
 
 int fdt_record_loadable(void *blob, u32 index, const char *name,
 			uintptr_t load_addr, u32 size, uintptr_t entry_point,
-			const char *type, const char *os)
+			const char *type, const char *os, const char *arch)
 {
 	int err, node;
 
@@ -622,6 +622,8 @@ int fdt_record_loadable(void *blob, u32 index, const char *name,
 		fdt_setprop_string(blob, node, "type", type);
 	if (os)
 		fdt_setprop_string(blob, node, "os", os);
+	if (arch)
+		fdt_setprop_string(blob, node, "arch", arch);
 
 	return node;
 }
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index caddf5119679..f6c475315ed6 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -480,7 +480,8 @@ static int spl_fit_record_loadable(const struct spl_fit_info *ctx, int index,
 	ret = fdt_record_loadable(blob, index, name, image->load_addr,
 				  image->size, image->entry_point,
 				  fdt_getprop(ctx->fit, node, "type", NULL),
-				  fdt_getprop(ctx->fit, node, "os", NULL));
+				  fdt_getprop(ctx->fit, node, "os", NULL),
+				  fdt_getprop(ctx->fit, node, "arch", NULL));
 	return ret;
 }
 
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 1e4dbc0a8f65..f6f46bb8e9ce 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -160,11 +160,12 @@ static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {}
  * @param entry_point   entry point (if specified, otherwise pass -1)
  * @param type          type (if specified, otherwise pass NULL)
  * @param os            os-type (if specified, otherwise pass NULL)
+ * @param arch		architecture (if specified, otherwise pass NULL)
  * @return 0 if ok, or -1 or -FDT_ERR_... on error
  */
 int fdt_record_loadable(void *blob, u32 index, const char *name,
 			uintptr_t load_addr, u32 size, uintptr_t entry_point,
-			const char *type, const char *os);
+			const char *type, const char *os, const char *arch);
 
 #ifdef CONFIG_PCI
 #include <pci.h>
-- 
2.31.1


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

* Re: [PATCH] spl: fit: Also record architecture in /fit-images
  2021-05-31  8:57 [PATCH] spl: fit: Also record architecture in /fit-images Michal Simek
@ 2021-06-22 13:31 ` Simon Glass
  2021-07-23 12:34 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-06-22 13:31 UTC (permalink / raw)
  To: Michal Simek
  Cc: U-Boot Mailing List, git, Alexandru Gagniuc, Marek Vasut,
	Philippe Reynes

On Mon, 31 May 2021 at 02:57, Michal Simek <michal.simek@xilinx.com> wrote:
>
> On ARM64 secure OS can run as 64bit or 32bit that's why it is necessary to
> record information about architecture that other code can read it and
> properly pass it to TF-A and start in 64bit or 32bit mode.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  common/fdt_support.c  | 4 +++-
>  common/spl/spl_fit.c  | 3 ++-
>  include/fdt_support.h | 3 ++-
>  3 files changed, 7 insertions(+), 3 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* Re: [PATCH] spl: fit: Also record architecture in /fit-images
  2021-05-31  8:57 [PATCH] spl: fit: Also record architecture in /fit-images Michal Simek
  2021-06-22 13:31 ` Simon Glass
@ 2021-07-23 12:34 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-07-23 12:34 UTC (permalink / raw)
  To: Michal Simek
  Cc: u-boot, git, Simon Glass, Alexandru Gagniuc, Marek Vasut,
	Philippe Reynes

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

On Mon, May 31, 2021 at 10:57:07AM +0200, Michal Simek wrote:

> On ARM64 secure OS can run as 64bit or 32bit that's why it is necessary to
> record information about architecture that other code can read it and
> properly pass it to TF-A and start in 64bit or 32bit mode.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2021-07-23 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31  8:57 [PATCH] spl: fit: Also record architecture in /fit-images Michal Simek
2021-06-22 13:31 ` Simon Glass
2021-07-23 12:34 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.