Definitions of the Metadata in the Device Firmware binary files. Signed-off-by: Gokul Sivakumar --- .../net/wireless/infineon/inffmac/trxhdr.h | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 drivers/net/wireless/infineon/inffmac/trxhdr.h diff --git a/drivers/net/wireless/infineon/inffmac/trxhdr.h b/drivers/net/wireless/infineon/inffmac/trxhdr.h new file mode 100644 index 000000000000..fe724406442d --- /dev/null +++ b/drivers/net/wireless/infineon/inffmac/trxhdr.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: ISC */ +/* + * Copyright (c) 2020-2025, Infineon Technologies AG, or an affiliate of Infineon Technologies AG. + * All rights reserved. + */ + +#ifndef INFF_TRXHDR_H +#define INFF_TRXHDR_H + +/* Bootloader makes special use of trx header "offsets" array */ +enum { + TRX_OFFSET_SIGN_INFO_IDX = 0, + TRX_OFFSET_DATA_FOR_SIGN1_IDX = 1, + TRX_OFFSET_DATA_FOR_SIGN2_IDX = 2, + TRX_OFFSET_ROOT_MODULUS_IDX = 3, + TRX_OFFSET_ROOT_EXPONENT_IDX = 67, + TRX_OFFSET_CONT_MODULUS_IDX = 68, + TRX_OFFSET_CONT_EXPONENT_IDX = 132, + TRX_OFFSET_HASH_FW_IDX = 133, + TRX_OFFSET_FW_LEN_IDX = 149, + TRX_OFFSET_TR_RST_IDX = 150, + TRX_OFFSET_FW_VER_FOR_ANTIROOLBACK_IDX = 151, + TRX_OFFSET_IV_IDX = 152, + TRX_OFFSET_NONCE_IDX = 160, + TRX_OFFSET_SIGN_INFO2_IDX = 168, + TRX_OFFSET_MAX_IDX +}; + +#define TRX_MAGIC 0x30524448 /* "HDR0" */ +#define TRX_VERSION 4 /* Version 4 */ +#define TRX_MAX_OFFSET TRX_OFFSET_MAX_IDX /* Max number of file offsets */ + +struct trx_header_le { + __le32 magic; /* "HDR0" */ + __le32 len; /* Length of file including header */ + __le32 crc32; /* CRC from flag_version to end of file */ + __le32 flag_version; /* 0:15 flags, 16:31 version */ + __le32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions */ +}; + +#define TRX_VERSION5 5 /* Version 5 */ + +struct trxv5_header_le { + __le32 magic; /* "HDR0" */ + __le32 len; /* Length of file including header */ + __le32 crc32; /* 32-bit CRC from flag_version to end of file */ + __le32 flag_version; /* 0:15 flags, 16:31 version */ + __le32 root_cert_start_offset; /* Start Offset IDX for Root Certificate */ + __le32 content_cert_start_offset; /* Start Offset IDX for Content Certificate */ + __le32 fw_entry; /* Firmware Entry Point for CM mode */ + __le32 reserved; +}; + +#endif /* INFF_TRXHDR_H */ -- 2.25.1