Skip to content

Commit 11f27ac

Browse files
authored
Merge pull request #540 from zhuyingjiang/topic/add-manifest-1.5
[RFC]Topic/add 1.5 manifest and rimage
2 parents 868feb6 + 5912e40 commit 11f27ac

13 files changed

Lines changed: 505 additions & 33 deletions

File tree

configure.ac

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,47 @@ case "$with_platform" in
239239
XTENSA_CORE="hifi3_std"
240240
AC_SUBST(XTENSA_CORE)
241241

242-
AC_DEFINE([CONFIG_APOLLOLAKE], [1], [Configure for Apololake])
242+
AC_DEFINE([CONFIG_APOLLOLAKE], [1], [Configure for Apollolake])
243+
AC_DEFINE([CONFIG_BOOT_LOADER], [1], [Configure Boot Loader])
244+
AC_DEFINE([CONFIG_IRQ_MAP], [1], [Configure IRQ maps])
245+
AC_DEFINE([CONFIG_DMA_GW], [1], [Configure DMA Gateway])
246+
AC_DEFINE([CONFIG_MEM_WND], [1], [Configure Memory Windows])
247+
;;
248+
kabylake*)
249+
250+
PLATFORM_LDSCRIPT="apollolake.x"
251+
AC_SUBST(PLATFORM_LDSCRIPT)
252+
253+
PLATFORM="apollolake"
254+
AC_SUBST(PLATFORM)
255+
256+
FW_NAME="kbl"
257+
AC_SUBST(FW_NAME)
258+
259+
XTENSA_CORE="hifi3_std"
260+
AC_SUBST(XTENSA_CORE)
261+
262+
AC_DEFINE([CONFIG_APOLLOLAKE], [1], [Configure for Apollolake])
263+
AC_DEFINE([CONFIG_BOOT_LOADER], [1], [Configure Boot Loader])
264+
AC_DEFINE([CONFIG_IRQ_MAP], [1], [Configure IRQ maps])
265+
AC_DEFINE([CONFIG_DMA_GW], [1], [Configure DMA Gateway])
266+
AC_DEFINE([CONFIG_MEM_WND], [1], [Configure Memory Windows])
267+
;;
268+
skylake*)
269+
270+
PLATFORM_LDSCRIPT="apollolake.x"
271+
AC_SUBST(PLATFORM_LDSCRIPT)
272+
273+
PLATFORM="apollolake"
274+
AC_SUBST(PLATFORM)
275+
276+
FW_NAME="skl"
277+
AC_SUBST(FW_NAME)
278+
279+
XTENSA_CORE="hifi3_std"
280+
AC_SUBST(XTENSA_CORE)
281+
282+
AC_DEFINE([CONFIG_APOLLOLAKE], [1], [Configure for Apollolake])
243283
AC_DEFINE([CONFIG_BOOT_LOADER], [1], [Configure Boot Loader])
244284
AC_DEFINE([CONFIG_IRQ_MAP], [1], [Configure IRQ maps])
245285
AC_DEFINE([CONFIG_DMA_GW], [1], [Configure DMA Gateway])
@@ -353,14 +393,14 @@ AM_CONDITIONAL(BUILD_BAYTRAIL, test "$FW_NAME" = "byt")
353393
AM_CONDITIONAL(BUILD_CHERRYTRAIL, test "$FW_NAME" = "cht")
354394
AM_CONDITIONAL(BUILD_HASWELL, test "$FW_NAME" = "hsw")
355395
AM_CONDITIONAL(BUILD_BROADWELL, test "$FW_NAME" = "bdw")
356-
AM_CONDITIONAL(BUILD_APOLLOLAKE, test "$FW_NAME" = "apl")
396+
AM_CONDITIONAL(BUILD_APOLLOLAKE, test "$FW_NAME" = "apl" -o "$FW_NAME" = "skl" -o "$FW_NAME" = "kbl")
357397
AM_CONDITIONAL(BUILD_CANNONLAKE, test "$FW_NAME" = "cnl")
358398
AM_CONDITIONAL(BUILD_SUECREEK, test "$FW_NAME" = "sue")
359399
AM_CONDITIONAL(BUILD_ICELAKE, test "$FW_NAME" = "icl")
360-
AM_CONDITIONAL(BUILD_BOOTLOADER, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue")
361-
AM_CONDITIONAL(BUILD_CAVS, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue")
362-
AM_CONDITIONAL(BUILD_MODULE, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue")
363-
AM_CONDITIONAL(BUILD_APL_SSP, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue")
400+
AM_CONDITIONAL(BUILD_BOOTLOADER, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue" -o "$FW_NAME" = "skl" -o "$FW_NAME" = "kbl")
401+
AM_CONDITIONAL(BUILD_CAVS, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue" -o "$FW_NAME" = "skl" -o "$FW_NAME" = "kbl")
402+
AM_CONDITIONAL(BUILD_MODULE, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue" -o "$FW_NAME" = "skl" -o "$FW_NAME" = "kbl")
403+
AM_CONDITIONAL(BUILD_APL_SSP, test "$FW_NAME" = "apl" -o "$FW_NAME" = "cnl" -o "$FW_NAME" = "icl" -o "$FW_NAME" = "sue" -o "$FW_NAME" = "skl" -o "$FW_NAME" = "kbl")
364404

365405
# DSP core support (Optional)
366406
AC_ARG_WITH([dsp-core],

rimage/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ rimage_SOURCES = \
1414
file_simple.c \
1515
man_apl.c \
1616
man_cnl.c \
17+
man_kbl.c \
1718
cse.c \
1819
css.c \
1920
plat_auth.c \

rimage/css.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#include "css.h"
2121
#include "manifest.h"
2222

23-
void ri_css_hdr_create_v1_8(struct image *image)
23+
void ri_css_hdr_create(struct image *image)
2424
{
25-
struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET_V1_8;
25+
struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET;
2626
struct tm *date;
2727
struct timeval tv;
2828
int val;

rimage/css.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
struct image;
2020

21+
#define MAN_CSS_LT_MODULE_TYPE 0x00000006
2122
#define MAN_CSS_MOD_TYPE 4
2223
#define MAN_CSS_HDR_SIZE 161 /* in words */
2324
#define MAN_CSS_HDR_VERSION 0x10000
@@ -29,6 +30,8 @@ struct image;
2930
#define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2)
3031
#define MAN_CSS_MAN_SIZE_V1_8 \
3132
(sizeof(struct fw_image_manifest_v1_8) >> 2)
33+
#define MAN_CSS_MAN_SIZE_V1_5 \
34+
(sizeof(struct fw_image_manifest_v1_5) >> 2)
3235

3336
/*
3437
* RSA Key and Crypto
@@ -81,6 +84,6 @@ struct css_header_v1_5 {
8184
uint8_t signature[MAN_RSA_SIGNATURE_LEN];
8285
} __attribute__((packed));
8386

84-
void ri_css_hdr_create_v1_8(struct image *image);
87+
void ri_css_hdr_create(struct image *image);
8588

8689
#endif

rimage/man_apl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct fw_image_manifest_v1_8 apl_manifest = {
3535
{
3636
/* CssHeader + platformFirmwareAuthenticationExtension - padding */
3737
.entry_name = "ADSP.man",
38-
.offset = MAN_CSS_HDR_OFFSET_V1_8,
38+
.offset = MAN_CSS_HDR_OFFSET,
3939
.length = sizeof(struct css_header_v1_8) +
4040
PLAT_AUTH_SIZE,
4141
},

rimage/man_cnl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = {
3434
{
3535
/* CssHeader + platformFirmwareAuthenticationExtension - padding */
3636
.entry_name = "ADSP.man",
37-
.offset = MAN_CSS_HDR_OFFSET_V1_8,
37+
.offset = MAN_CSS_HDR_OFFSET,
3838
.length = sizeof(struct css_header_v1_8) +
3939
PLAT_AUTH_SIZE,
4040
},

rimage/man_kbl.c

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2018, 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+
#include "css.h"
15+
#include "cse.h"
16+
#include "plat_auth.h"
17+
#include "manifest.h"
18+
#include <config.h>
19+
#include <version.h>
20+
21+
/*
22+
* TODO: check if all platform for 1.5 are the same base and length.
23+
* if yes, define it as HARDWARE_BUFFER_BASE_V1_5, HARDWARE_BUFFER_LEN_v1_5
24+
* if not, define a platform specific base and length.
25+
*/
26+
#define KBL_HARDWARE_BUFFER_BASE 0xBE500000
27+
#define KBL_HARDWARE_BUFFER_LEN 0x4A000
28+
29+
/* manifest template */
30+
struct fw_image_manifest_v1_5 kbl_manifest = {
31+
.css_header = {
32+
.module_type = MAN_CSS_LT_MODULE_TYPE,
33+
.header_len = MAN_CSS_HDR_SIZE,
34+
.header_version = MAN_CSS_HDR_VERSION,
35+
.module_vendor = MAN_CSS_MOD_VENDOR,
36+
.size = 0x800,
37+
.key_size = MAN_CSS_KEY_SIZE,
38+
.modulus_size = MAN_CSS_MOD_SIZE,
39+
.exponent_size = MAN_CSS_EXP_SIZE,
40+
},
41+
42+
.desc = {
43+
.header = {
44+
.header_id = SOF_MAN_FW_HDR_ID,
45+
.header_len = sizeof(struct sof_man_fw_header),
46+
.name = SOF_MAN_FW_HDR_NAME,
47+
/* size in pages from $CPD */
48+
.preload_page_count = 0,
49+
.fw_image_flags = SOF_MAN_FW_HDR_FLAGS,
50+
.feature_mask = SOF_MAN_FW_HDR_FEATURES,
51+
.major_version = SOF_MAJOR,
52+
.minor_version = SOF_MINOR,
53+
.hotfix_version = 0,
54+
.build_version = SOF_BUILD,
55+
.load_offset = 0,
56+
.hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE,
57+
.hw_buf_length = KBL_HARDWARE_BUFFER_LEN
58+
},
59+
},
60+
};

0 commit comments

Comments
 (0)