spl: fit: Also record architecture in /fit-images

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>
This commit is contained in:
Michal Simek 2021-05-27 11:40:09 +02:00
parent 3972ae65e4
commit be2d1a87c7
3 changed files with 7 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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>