2019-06-02 02:01:02 +08:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//
|
|
|
|
// Copyright(c) 2017 Intel Corporation. All rights reserved.
|
|
|
|
//
|
|
|
|
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
|
|
|
|
// Keyon Jie <yang.jie@linux.intel.com>
|
2018-02-14 04:29:40 +08:00
|
|
|
|
|
|
|
#include "rimage.h"
|
|
|
|
#include "manifest.h"
|
|
|
|
#include "plat_auth.h"
|
|
|
|
|
2018-06-04 19:03:42 +08:00
|
|
|
void ri_adsp_meta_data_create(struct image *image, int meta_start_offset,
|
2019-03-06 18:52:50 +08:00
|
|
|
int meta_end_offset)
|
2018-02-14 04:29:40 +08:00
|
|
|
{
|
|
|
|
struct sof_man_adsp_meta_file_ext *meta =
|
2018-06-04 19:03:42 +08:00
|
|
|
image->fw_image + meta_start_offset;
|
2018-02-14 04:29:40 +08:00
|
|
|
|
|
|
|
fprintf(stdout, " meta: completing ADSP manifest\n");
|
|
|
|
|
2018-11-24 23:33:59 +08:00
|
|
|
meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET_V1_8 +
|
|
|
|
image->image_end - meta_end_offset;
|
2018-02-14 04:29:40 +08:00
|
|
|
|
|
|
|
fprintf(stdout, " meta: limit is 0x%x\n",
|
|
|
|
meta->comp_desc[0].limit_offset);
|
|
|
|
/* now hash the AdspFwBinaryDesc -> EOF */
|
|
|
|
}
|
|
|
|
|
|
|
|
void ri_plat_ext_data_create(struct image *image)
|
|
|
|
{
|
2018-10-18 14:21:04 +08:00
|
|
|
struct partition_info_ext *part = image->fw_image
|
|
|
|
+ MAN_PART_INFO_OFFSET_V1_8;
|
2018-02-14 04:29:40 +08:00
|
|
|
struct sof_man_adsp_meta_file_ext *meta =
|
2018-10-18 14:21:04 +08:00
|
|
|
image->fw_image + MAN_META_EXT_OFFSET_V1_8;
|
2018-11-24 23:33:59 +08:00
|
|
|
struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8;
|
2018-02-14 04:29:40 +08:00
|
|
|
|
|
|
|
fprintf(stdout, " auth: completing authentication manifest\n");
|
|
|
|
|
2018-11-24 23:33:59 +08:00
|
|
|
part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8;
|
2018-02-14 04:29:40 +08:00
|
|
|
part->length += MAN_PAGE_SIZE - (part->length % MAN_PAGE_SIZE);
|
|
|
|
|
|
|
|
/* do this here atm */
|
|
|
|
desc->header.preload_page_count = part->length / MAN_PAGE_SIZE;
|
|
|
|
}
|