From 75533a65b5cf39fbe9f28e6080696b30e99ba2b6 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:31:43 +0800 Subject: [PATCH] rimage: manifest: add 1.5 manifest define add 1.5 manifest structure define, macro define, KBL and SKL 1.5 manifest defines Signed-off-by: Zhu Yingjiang --- rimage/css.h | 3 +++ rimage/man_kbl.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.h | 8 +++++-- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 rimage/man_kbl.c diff --git a/rimage/css.h b/rimage/css.h index 77597d127..13135c55e 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -18,6 +18,7 @@ struct image; +#define MAN_CSS_LT_MODULE_TYPE 0x00000006 #define MAN_CSS_MOD_TYPE 4 #define MAN_CSS_HDR_SIZE 161 /* in words */ #define MAN_CSS_HDR_VERSION 0x10000 @@ -29,6 +30,8 @@ struct image; #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) +#define MAN_CSS_MAN_SIZE_V1_5 \ + (sizeof(struct fw_image_manifest_v1_5) >> 2) /* * RSA Key and Crypto diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c new file mode 100644 index 000000000..5e614f551 --- /dev/null +++ b/rimage/man_kbl.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include +#include + +#define KBL_HARDWARE_BUFFER_BASE 0xBE500000 +#define KBL_HARDWARE_BUFFER_LEN 0x4A000 + +/* manifest template */ +struct fw_image_manifest_v1_5 kbl_manifest = { + .css_header = { + .module_type = MAN_CSS_LT_MODULE_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 0x800, + .key_size = MAN_CSS_KEY_SIZE, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + /* size in pages from $CPD */ + .preload_page_count = 0, + .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 = 0, + .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, + .hw_buf_length = KBL_HARDWARE_BUFFER_LEN + }, + }, +}; diff --git a/rimage/manifest.h b/rimage/manifest.h index 29f598fcc..4c53a69a0 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -91,10 +91,14 @@ struct fw_image_manifest_v1_8 { extern struct fw_image_manifest_v1_8 apl_manifest; extern struct fw_image_manifest_v1_8 cnl_manifest; +/* + * Firmware manifest header V1.5 used on SKL and KBL + */ struct fw_image_manifest_v1_5 { - struct css_header_v1_5 header; - struct sof_man_fw_desc adsp_fw_bin_desc; + struct css_header_v1_5 css_header; + struct sof_man_fw_desc desc; } __attribute__((packed)); extern struct fw_image_manifest_v1_5 skl_manifest; +extern struct fw_image_manifest_v1_5 kbl_manifest; #endif