summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYe Li <[email protected]>2025-07-08 04:42:55 +0800
committerFabio Estevam <[email protected]>2025-07-17 09:56:33 -0300
commit42337445b55c79d8a820b4eec9536a7844839372 (patch)
tree2b4d3e53b6077fe1d7e5f8ee290fdd614d7ed0f6 /include
parentcb06e1082a8b29f565034f8a33f91339c768b265 (diff)
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 <[email protected]> Signed-off-by: Jacky Bai <[email protected]> Signed-off-by: Alice Guo <[email protected]> Acked-by: Peng Fan <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/imx_container.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/imx_container.h b/include/imx_container.h
index 691c764b3e5..684fc3bc988 100644
--- a/include/imx_container.h
+++ b/include/imx_container.h
@@ -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