mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
spl: imx: Add support for new PQC container
To support PQC container format which is used for post quantum authentication on new i.MX parts like i.MX94 The major changes compared to legacy container format is in signature block, new container tag and version, and new alignment of container header. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Jacky Bai <ping.bai@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
@@ -66,7 +66,7 @@ static bool is_v2x_fw_container(ulong addr)
|
||||
struct boot_img_t *img_entry;
|
||||
|
||||
phdr = (struct container_hdr *)addr;
|
||||
if (phdr->tag != 0x87 || phdr->version != 0x0) {
|
||||
if ((phdr->tag != 0x87 && phdr->tag != 0x82) || phdr->version != 0x0) {
|
||||
debug("Wrong container header\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -371,6 +371,13 @@ config SPL_IMX_CONTAINER_USE_TRAMPOLINE
|
||||
help
|
||||
Enable SPL load reader to load data to a trampoline buffer.
|
||||
|
||||
config IMX_PQC_SUPPORT
|
||||
bool "Enable to support i.MX ROM PQC Container"
|
||||
depends on SPL && SPL_LOAD_IMX_CONTAINER
|
||||
help
|
||||
Support i.MX ROM new PQC container format. If your chip does not use
|
||||
PQC container, say 'n'.
|
||||
|
||||
config IMX_CONTAINER_CFG
|
||||
string "i.MX8 Container config file"
|
||||
depends on SPL && SPL_LOAD_IMX_CONTAINER
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
#define IV_MAX_LEN 32
|
||||
#define HASH_MAX_LEN 64
|
||||
|
||||
#if IS_ENABLED(CONFIG_IMX_PQC_SUPPORT)
|
||||
#define CONTAINER_HDR_ALIGNMENT 0x4000
|
||||
#else
|
||||
#define CONTAINER_HDR_ALIGNMENT 0x400
|
||||
#endif
|
||||
#define CONTAINER_HDR_EMMC_OFFSET 0
|
||||
#define CONTAINER_HDR_MMCSD_OFFSET SZ_32K
|
||||
#define CONTAINER_HDR_QSPI_OFFSET SZ_4K
|
||||
@@ -72,7 +76,14 @@ int get_container_size(ulong addr, u16 *header_length);
|
||||
|
||||
static inline bool valid_container_hdr(struct container_hdr *container)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_IMX_PQC_SUPPORT)
|
||||
return (container->tag == CONTAINER_HDR_TAG ||
|
||||
container->tag == 0x82) &&
|
||||
(container->version == CONTAINER_HDR_VERSION ||
|
||||
container->version == 0x2);
|
||||
#else
|
||||
return container->tag == CONTAINER_HDR_TAG &&
|
||||
container->version == CONTAINER_HDR_VERSION;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user