mirror of https://github.com/thesofproject/sof.git
rimage: rename the old css_header and fw_image_manifest
rename css_header to css_header_v1_8 rename fw_image_manifest to fw_image_manifest_v1_8 Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
This commit is contained in:
parent
15d5a9545b
commit
4582729422
|
@ -22,7 +22,7 @@
|
|||
|
||||
void ri_css_hdr_create(struct image *image)
|
||||
{
|
||||
struct css_header *css = image->fw_image + MAN_CSS_HDR_OFFSET;
|
||||
struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET;
|
||||
struct tm *date;
|
||||
struct timeval tv;
|
||||
int val;
|
||||
|
|
|
@ -28,7 +28,7 @@ struct image;
|
|||
#define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2)
|
||||
#define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2)
|
||||
#define MAN_CSS_MAN_SIZE \
|
||||
(sizeof(struct fw_image_manifest) >> 2)
|
||||
(sizeof(struct fw_image_manifest_v1_8) >> 2)
|
||||
|
||||
/*
|
||||
* RSA Key and Crypto
|
||||
|
@ -44,7 +44,7 @@ struct fw_version {
|
|||
uint16_t build_version;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct css_header {
|
||||
struct css_header_v1_8 {
|
||||
uint32_t header_type;
|
||||
uint32_t header_len;
|
||||
uint32_t header_version;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <version.h>
|
||||
|
||||
/* manifest template */
|
||||
struct fw_image_manifest apl_manifest = {
|
||||
struct fw_image_manifest_v1_8 apl_manifest = {
|
||||
|
||||
.cse_partition_dir_header = {
|
||||
.header_marker = CSE_HEADER_MAKER,
|
||||
|
@ -36,7 +36,7 @@ struct fw_image_manifest apl_manifest = {
|
|||
/* CssHeader + platformFirmwareAuthenticationExtension - padding */
|
||||
.entry_name = "ADSP.man",
|
||||
.offset = MAN_CSS_HDR_OFFSET,
|
||||
.length = sizeof(struct css_header) +
|
||||
.length = sizeof(struct css_header_v1_8) +
|
||||
PLAT_AUTH_SIZE,
|
||||
},
|
||||
{ /* ADSPMetadataFileExtension */
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <version.h>
|
||||
|
||||
/* manifest template */
|
||||
struct fw_image_manifest cnl_manifest = {
|
||||
struct fw_image_manifest_v1_8 cnl_manifest = {
|
||||
|
||||
.cse_partition_dir_header = {
|
||||
.header_marker = CSE_HEADER_MAKER,
|
||||
|
@ -35,7 +35,7 @@ struct fw_image_manifest cnl_manifest = {
|
|||
/* CssHeader + platformFirmwareAuthenticationExtension - padding */
|
||||
.entry_name = "ADSP.man",
|
||||
.offset = MAN_CSS_HDR_OFFSET,
|
||||
.length = sizeof(struct css_header) +
|
||||
.length = sizeof(struct css_header_v1_8) +
|
||||
PLAT_AUTH_SIZE,
|
||||
},
|
||||
{ /* ADSPMetadataFileExtension */
|
||||
|
|
|
@ -90,7 +90,7 @@ static int man_init_image(struct image *image)
|
|||
return -ENOMEM;
|
||||
|
||||
memcpy(image->fw_image, image->adsp->man,
|
||||
sizeof(struct fw_image_manifest));
|
||||
sizeof(struct fw_image_manifest_v1_8));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc)
|
|||
static int man_write_fw(struct image *image)
|
||||
{
|
||||
struct sof_man_fw_desc *desc;
|
||||
struct fw_image_manifest *m;
|
||||
struct fw_image_manifest_v1_8 *m;
|
||||
uint8_t hash[SOF_MAN_MOD_SHA256_LEN];
|
||||
int ret, i;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
#define MAN_SIG_PKG_OFFSET \
|
||||
(MAN_CSS_HDR_OFFSET + \
|
||||
sizeof(struct css_header))
|
||||
sizeof(struct css_header_v1_8))
|
||||
|
||||
#define MAN_PART_INFO_OFFSET \
|
||||
(MAN_SIG_PKG_OFFSET + \
|
||||
|
@ -69,11 +69,11 @@
|
|||
/*
|
||||
* Firmware manifest header.
|
||||
*/
|
||||
struct fw_image_manifest {
|
||||
struct fw_image_manifest_v1_8 {
|
||||
/* MEU tool needs these sections to be 0s */
|
||||
struct CsePartitionDirHeader cse_partition_dir_header;
|
||||
struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS];
|
||||
struct css_header css;
|
||||
struct css_header_v1_8 css;
|
||||
struct signed_pkg_info_ext signed_pkg;
|
||||
struct partition_info_ext partition_info;
|
||||
uint8_t cse_padding[MAN_CSE_PADDING_SIZE];
|
||||
|
@ -88,6 +88,6 @@ struct fw_image_manifest {
|
|||
struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */
|
||||
} __attribute__((packed));
|
||||
|
||||
extern struct fw_image_manifest apl_manifest;
|
||||
extern struct fw_image_manifest cnl_manifest;
|
||||
extern struct fw_image_manifest_v1_8 apl_manifest;
|
||||
extern struct fw_image_manifest_v1_8 cnl_manifest;
|
||||
#endif
|
||||
|
|
|
@ -68,8 +68,8 @@ static void bytes_swap(uint8_t *ptr, uint32_t size)
|
|||
* manifest header (Public Key, Exponent and Signature).
|
||||
*/
|
||||
|
||||
int pkcs_sign(struct image *image, struct fw_image_manifest *man,
|
||||
void *ptr1, unsigned int size1, void *ptr2, unsigned int size2)
|
||||
int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man,
|
||||
void *ptr1, unsigned int size1, void *ptr2, unsigned int size2)
|
||||
{
|
||||
RSA *priv_rsa = NULL;
|
||||
EVP_PKEY *privkey;
|
||||
|
@ -151,10 +151,10 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man,
|
|||
|
||||
int ri_manifest_sign(struct image *image)
|
||||
{
|
||||
struct fw_image_manifest *man = image->fw_image;
|
||||
struct fw_image_manifest_v1_8 *man = image->fw_image;
|
||||
|
||||
pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET,
|
||||
sizeof(struct css_header) -
|
||||
sizeof(struct css_header_v1_8) -
|
||||
(MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN +
|
||||
MAN_RSA_SIGNATURE_LEN),
|
||||
(void *)man + MAN_SIG_PKG_OFFSET,
|
||||
|
|
|
@ -146,7 +146,7 @@ struct adsp {
|
|||
enum machine_id machine_id;
|
||||
int (*write_firmware)(struct image *image);
|
||||
int (*write_firmware_meu)(struct image *image);
|
||||
struct fw_image_manifest *man;
|
||||
struct fw_image_manifest_v1_8 *man;
|
||||
};
|
||||
|
||||
int write_logs_dictionary(struct image *image);
|
||||
|
@ -157,8 +157,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash);
|
|||
int ri_manifest_sign(struct image *image);
|
||||
void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash);
|
||||
|
||||
int pkcs_sign(struct image *image, struct fw_image_manifest *man,
|
||||
void *ptr1, unsigned size1, void *ptr2, unsigned size2);
|
||||
int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man,
|
||||
void *ptr1, unsigned int size1, void *ptr2, unsigned int size2);
|
||||
|
||||
int elf_parse_module(struct image *image, int module_index, const char *name);
|
||||
void elf_free_module(struct image *image, int module_index);
|
||||
|
|
Loading…
Reference in New Issue