blob: 8d1d3d2cae019a63dea33e68a8d8777a48b7aee7 [file] [log] [blame]
Liam Girdwood05ef4342018-02-13 20:29:40 +00001/*
2 * Copyright (c) 2017, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef __MANIFEST_H__
15#define __MANIFEST_H__
16
17#include <stdint.h>
18#include "uapi/manifest.h"
19#include "css.h"
20#include "cse.h"
21#include "plat_auth.h"
22
23#define MAN_PAGE_SIZE 4096
24
Liam Girdwood08f85702018-03-30 14:44:17 +010025/* start offset for modules built using xcc */
26#define XCC_MOD_OFFSET 0x8
27
Liam Girdwood05ef4342018-02-13 20:29:40 +000028/* start offset for base FW module */
29#define FILE_TEXT_OFFSET 0x8000
30
31/*
32 * CSE values for CNL
33 */
34#define MAN_CSE_PARTS 3
35
36
37#define MAN_CSE_HDR_OFFSET 0
38#define MAN_CSE_PADDING_SIZE 0x30
39#define MAN_EXT_PADDING 0x20
40#define MAN_DESC_OFFSET 0x2000
41
42#define MAN_CSS_HDR_OFFSET \
43 (MAN_CSE_HDR_OFFSET + \
44 sizeof(struct CsePartitionDirHeader) + \
45 MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry))
46
47#define MAN_SIG_PKG_OFFSET \
48 (MAN_CSS_HDR_OFFSET + \
49 sizeof(struct css_header))
50
51#define MAN_PART_INFO_OFFSET \
52 (MAN_SIG_PKG_OFFSET + \
53 sizeof(struct signed_pkg_info_ext))
54
55#define MAN_META_EXT_OFFSET \
56 (MAN_SIG_PKG_OFFSET + \
57 sizeof(struct signed_pkg_info_ext) + \
58 sizeof(struct partition_info_ext) + \
59 MAN_CSE_PADDING_SIZE)
60
61#define MAN_FW_DESC_OFFSET \
62 (MAN_META_EXT_OFFSET + \
63 sizeof(struct sof_man_adsp_meta_file_ext) + \
64 MAN_EXT_PADDING)
65
66#define MAN_DESC_PADDING_SIZE \
67 (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET)
68
69/*
70 * Firmware manifest header.
71 */
72struct fw_image_manifest {
73 /* MEU tool needs these sections to be 0s */
74 struct CsePartitionDirHeader cse_partition_dir_header;
75 struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS];
76 struct css_header css;
77 struct signed_pkg_info_ext signed_pkg;
78 struct partition_info_ext partition_info;
79 uint8_t cse_padding[MAN_CSE_PADDING_SIZE];
80 struct sof_man_adsp_meta_file_ext adsp_file_ext;
81
82 /* reserved / pading at end of ext data - all 0s*/
83 uint8_t reserved[MAN_EXT_PADDING];
84
85 /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */
86 uint8_t padding[MAN_DESC_PADDING_SIZE];
87
88 struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */
89} __attribute__((packed));
90
91extern struct fw_image_manifest apl_manifest;
92extern struct fw_image_manifest cnl_manifest;
93#endif