From dd77445f018c173f0e811092d23b50cfe2d1baa1 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 20:13:59 +0200 Subject: [PATCH] rimage: update tgl Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 1 + rimage/man_tgl.c | 126 ++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.c | 4 +- rimage/manifest.h | 2 + 4 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 rimage/man_tgl.c diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt index bdb01d45f..dc5d3ac79 100644 --- a/rimage/CMakeLists.txt +++ b/rimage/CMakeLists.txt @@ -25,6 +25,7 @@ add_executable(rimage man_cnl.c man_kbl.c man_sue.c + man_tgl.c cse.c css.c plat_auth.c diff --git a/rimage/man_tgl.c b/rimage/man_tgl.c new file mode 100644 index 000000000..83877e198 --- /dev/null +++ b/rimage/man_tgl.c @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2019 Intel Corporation. All rights reserved. + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include + +/* manifest template */ +struct fw_image_manifest_v2_5 tgl_manifest = { + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header_v1_8) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET_V1_8, + .length = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET_V2_5, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET_V1_8, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0x30000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c index e9f819516..b4db79b02 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1302,9 +1302,9 @@ const struct adsp machine_tgl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_TIGERLAKE, - .write_firmware = man_write_fw_v1_8, + .write_firmware = NULL, /* not yet implemented */ .write_firmware_meu = man_write_fw_meu_v2_5, - .man_v1_8 = &cnl_manifest, // use the same as CNL + .man_v2_5 = &tgl_manifest, }; const struct adsp machine_sue = { diff --git a/rimage/manifest.h b/rimage/manifest.h index 1f3789b8a..32e0574e8 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -108,6 +108,8 @@ struct fw_image_manifest_v2_5 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); +extern struct fw_image_manifest_v2_5 tgl_manifest; + /* * Firmware manifest header V1.8 used on APL onwards */