board: xilinx: update guid based on metadata

The generated GUID applies to all Xilinx platforms but is not
specific to any individual board. For FWU multi bank update,
use the image UUID (GUID) from the FWU metadata structure
rather than embedding a generated GUID into the U-Boot build.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250912100539.4127378-3-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
Padmarao Begari
2025-09-12 15:35:39 +05:30
committed by Michal Simek
parent aa4e7f7083
commit 68dc66d7e0

View File

@@ -9,6 +9,7 @@
#include <efi.h>
#include <efi_loader.h>
#include <env.h>
#include <fwu.h>
#include <image.h>
#include <init.h>
#include <jffs2/load_kernel.h>
@@ -743,3 +744,29 @@ __weak int board_rng_seed(struct abuf *buf)
return 0;
}
#endif
#if defined(CONFIG_FWU_MULTI_BANK_UPDATE)
int fwu_platform_hook(struct udevice *dev, struct fwu_data *data)
{
/* Note: The FWU metadata is an unsecure piece of data, as
* highlighted by the spec, and there is no way to ascertain
* that it has not been tampered with in a malicious manner.
* U-Boot OTOH can be part of a trusted boot chain, where the
* U-Boot image has been verified before being booted. So,
* although this does remove issues that might crop up with
* manual mismatches, still need to consider the fact that
* the FWU mdata is not a secure piece of data.
* And this is a not real problem with Xilinx platforms because
* actually it is only providing reference stack.
*/
struct fwu_image_entry *img_entry = &data->fwu_images[0];
/* Copy image type GUID */
memcpy(&fw_images[0].image_type_id, &img_entry->image_type_guid, 16);
return 0;
}
#endif