2019-06-02 02:01:02 +08:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2018-02-14 04:29:40 +08:00
|
|
|
*
|
2019-06-02 02:01:02 +08:00
|
|
|
* Copyright(c) 2017 Intel Corporation. All rights reserved.
|
2018-02-14 04:29:40 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MANIFEST_H__
|
|
|
|
#define __MANIFEST_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2019-05-31 21:04:48 +08:00
|
|
|
#include <user/manifest.h>
|
2018-02-14 04:29:40 +08:00
|
|
|
#include "css.h"
|
|
|
|
#include "cse.h"
|
|
|
|
#include "plat_auth.h"
|
|
|
|
|
|
|
|
#define MAN_PAGE_SIZE 4096
|
|
|
|
|
2018-03-30 21:44:17 +08:00
|
|
|
/* start offset for modules built using xcc */
|
|
|
|
#define XCC_MOD_OFFSET 0x8
|
|
|
|
|
2018-02-14 04:29:40 +08:00
|
|
|
/* start offset for base FW module */
|
2018-11-24 23:33:59 +08:00
|
|
|
#define FILE_TEXT_OFFSET_V1_8 0x8000
|
|
|
|
#define FILE_TEXT_OFFSET_V1_5 0x2000
|
2018-12-01 00:06:30 +08:00
|
|
|
#define FILE_TEXT_OFFSET_V1_5_SUE 0xA000
|
2018-02-14 04:29:40 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* CSE values for CNL
|
|
|
|
*/
|
|
|
|
#define MAN_CSE_PARTS 3
|
|
|
|
|
|
|
|
|
|
|
|
#define MAN_CSE_HDR_OFFSET 0
|
|
|
|
#define MAN_CSE_PADDING_SIZE 0x30
|
|
|
|
#define MAN_EXT_PADDING 0x20
|
2018-11-24 23:33:59 +08:00
|
|
|
#define MAN_DESC_OFFSET_V1_8 0x2000
|
|
|
|
#define MAN_DESC_OFFSET_V1_5 0x284
|
2019-01-07 20:44:44 +08:00
|
|
|
#define MAN_DESC_OFFSET_V1_5_SUE 0x2000
|
2019-04-11 20:09:02 +08:00
|
|
|
#define MAN_DEFAULT_IMR_TYPE 3
|
2018-02-14 04:29:40 +08:00
|
|
|
|
2018-11-08 18:30:03 +08:00
|
|
|
#define MAN_CSS_HDR_OFFSET \
|
2018-02-14 04:29:40 +08:00
|
|
|
(MAN_CSE_HDR_OFFSET + \
|
|
|
|
sizeof(struct CsePartitionDirHeader) + \
|
|
|
|
MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry))
|
|
|
|
|
2018-10-18 14:21:04 +08:00
|
|
|
#define MAN_SIG_PKG_OFFSET_V1_8 \
|
2018-11-08 18:30:03 +08:00
|
|
|
(MAN_CSS_HDR_OFFSET + \
|
2018-10-15 13:47:08 +08:00
|
|
|
sizeof(struct css_header_v1_8))
|
2018-02-14 04:29:40 +08:00
|
|
|
|
2018-10-18 14:21:04 +08:00
|
|
|
#define MAN_PART_INFO_OFFSET_V1_8 \
|
|
|
|
(MAN_SIG_PKG_OFFSET_V1_8 + \
|
2018-02-14 04:29:40 +08:00
|
|
|
sizeof(struct signed_pkg_info_ext))
|
|
|
|
|
2018-10-18 14:21:04 +08:00
|
|
|
#define MAN_META_EXT_OFFSET_V1_8 \
|
|
|
|
(MAN_SIG_PKG_OFFSET_V1_8 + \
|
2018-02-14 04:29:40 +08:00
|
|
|
sizeof(struct signed_pkg_info_ext) + \
|
|
|
|
sizeof(struct partition_info_ext) + \
|
|
|
|
MAN_CSE_PADDING_SIZE)
|
|
|
|
|
2018-10-18 14:21:04 +08:00
|
|
|
#define MAN_FW_DESC_OFFSET_V1_8 \
|
|
|
|
(MAN_META_EXT_OFFSET_V1_8 + \
|
2018-02-14 04:29:40 +08:00
|
|
|
sizeof(struct sof_man_adsp_meta_file_ext) + \
|
|
|
|
MAN_EXT_PADDING)
|
|
|
|
|
2018-10-18 14:21:04 +08:00
|
|
|
#define MAN_DESC_PADDING_SIZE_V1_8 \
|
2018-11-24 23:33:59 +08:00
|
|
|
(MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V1_8)
|
2018-02-14 04:29:40 +08:00
|
|
|
|
2018-11-08 18:30:03 +08:00
|
|
|
#define MAN_SIG_PKG_OFFSET_V1_5 \
|
|
|
|
(MAN_CSS_HDR_OFFSET + \
|
|
|
|
sizeof(struct css_header_v1_5))
|
|
|
|
|
|
|
|
#define MAN_META_EXT_OFFSET_V1_5 \
|
|
|
|
(MAN_SIG_PKG_OFFSET_V1_5 + \
|
|
|
|
sizeof(struct signed_pkg_info_ext) + \
|
|
|
|
sizeof(struct partition_info_ext) + \
|
|
|
|
MAN_CSE_PADDING_SIZE)
|
|
|
|
|
|
|
|
#define MAN_FW_DESC_OFFSET_V1_5 \
|
|
|
|
(MAN_META_EXT_OFFSET_V1_5 + \
|
|
|
|
sizeof(struct sof_man_adsp_meta_file_ext) + \
|
|
|
|
MAN_EXT_PADDING)
|
|
|
|
|
2018-02-14 04:29:40 +08:00
|
|
|
/*
|
2018-11-05 16:19:49 +08:00
|
|
|
* Firmware manifest header V1.8 used on APL onwards
|
2018-02-14 04:29:40 +08:00
|
|
|
*/
|
2018-10-15 13:47:08 +08:00
|
|
|
struct fw_image_manifest_v1_8 {
|
2018-02-14 04:29:40 +08:00
|
|
|
/* MEU tool needs these sections to be 0s */
|
|
|
|
struct CsePartitionDirHeader cse_partition_dir_header;
|
|
|
|
struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS];
|
2018-10-15 13:47:08 +08:00
|
|
|
struct css_header_v1_8 css;
|
2018-02-14 04:29:40 +08:00
|
|
|
struct signed_pkg_info_ext signed_pkg;
|
|
|
|
struct partition_info_ext partition_info;
|
|
|
|
uint8_t cse_padding[MAN_CSE_PADDING_SIZE];
|
|
|
|
struct sof_man_adsp_meta_file_ext adsp_file_ext;
|
|
|
|
|
|
|
|
/* reserved / pading at end of ext data - all 0s*/
|
|
|
|
uint8_t reserved[MAN_EXT_PADDING];
|
|
|
|
|
|
|
|
/* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */
|
2018-10-18 14:21:04 +08:00
|
|
|
uint8_t padding[MAN_DESC_PADDING_SIZE_V1_8];
|
2018-02-14 04:29:40 +08:00
|
|
|
|
|
|
|
struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
2018-10-15 13:47:08 +08:00
|
|
|
extern struct fw_image_manifest_v1_8 apl_manifest;
|
|
|
|
extern struct fw_image_manifest_v1_8 cnl_manifest;
|
2018-10-15 14:21:38 +08:00
|
|
|
|
2018-11-05 16:31:43 +08:00
|
|
|
/*
|
|
|
|
* Firmware manifest header V1.5 used on SKL and KBL
|
|
|
|
*/
|
2018-10-15 14:21:38 +08:00
|
|
|
struct fw_image_manifest_v1_5 {
|
2018-11-05 16:31:43 +08:00
|
|
|
struct css_header_v1_5 css_header;
|
|
|
|
struct sof_man_fw_desc desc;
|
2018-10-15 14:21:38 +08:00
|
|
|
} __attribute__((packed));
|
|
|
|
|
2018-12-01 00:06:30 +08:00
|
|
|
struct fw_image_manifest_v1_5_sue {
|
|
|
|
struct sof_man_fw_desc desc;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
2018-11-08 18:30:03 +08:00
|
|
|
/*
|
|
|
|
* TODO: verify if we need platform specific manifest, or just
|
|
|
|
* define manifest_v1_5 and manifest_v1_8.
|
|
|
|
*/
|
2018-10-15 14:21:38 +08:00
|
|
|
extern struct fw_image_manifest_v1_5 skl_manifest;
|
2018-11-05 16:31:43 +08:00
|
|
|
extern struct fw_image_manifest_v1_5 kbl_manifest;
|
2018-12-01 00:06:30 +08:00
|
|
|
extern struct fw_image_manifest_v1_5_sue sue_manifest;
|
2018-02-14 04:29:40 +08:00
|
|
|
#endif
|